Changeset 87227 in webkit
- Timestamp:
- May 24, 2011 4:19:55 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r87215 r87227 1 2011-05-24 Kent Tamura <tkent@chromium.org> 2 3 Reviewed by Dimitri Glazkov. 4 5 Node::shadowAncestorNode() and shadowTreeRootNode() should be const. 6 https://bugs.webkit.org/show_bug.cgi?id=61398 7 8 shadowAncestorNode() and shadowTreeRootNode() should be const 9 though they can return 'this' pointer. 10 11 No new tests. This doesn't change any visible behavior. 12 13 * dom/Node.cpp: 14 (WebCore::Node::shadowAncestorNode): Make this const. 15 (WebCore::Node::shadowTreeRootNode): ditto. 16 * dom/Node.h: Update declarations. 17 * html/shadow/TextControlInnerElements.h: 18 (WebCore::SpinButtonElement::isEnabledFormControl): Need no const_cast<>. 19 (WebCore::SpinButtonElement::isReadOnlyFormControl): ditto. 20 1 21 2011-05-24 James Simonsen <simonjam@chromium.org> 2 22 -
trunk/Source/WebCore/dom/Node.cpp
r87147 r87227 1539 1539 #endif 1540 1540 1541 Node* Node::shadowAncestorNode() 1541 Node* Node::shadowAncestorNode() const 1542 1542 { 1543 1543 #if ENABLE(SVG) … … 1547 1547 // shadow tree concept. (This function _could_ be made virtual - opinions?) 1548 1548 if (isSVGElement()) 1549 return this;1549 return const_cast<Node*>(this); 1550 1550 #endif 1551 1551 … … 1553 1553 if (root) 1554 1554 return root->shadowHost(); 1555 return this;1556 } 1557 1558 Node* Node::shadowTreeRootNode() 1559 { 1560 Node* root = this;1555 return const_cast<Node*>(this); 1556 } 1557 1558 Node* Node::shadowTreeRootNode() const 1559 { 1560 Node* root = const_cast<Node*>(this); 1561 1561 while (root) { 1562 1562 if (root->isShadowRoot() || root->isSVGShadowRoot()) -
trunk/Source/WebCore/dom/Node.h
r87147 r87227 215 215 virtual bool canHaveLightChildRendererWithShadow() const { return false; } 216 216 217 Node* shadowAncestorNode() ;217 Node* shadowAncestorNode() const; 218 218 // Returns 0, a ShadowRoot, or a legacy shadow root. 219 Node* shadowTreeRootNode() ;219 Node* shadowTreeRootNode() const; 220 220 // Returns 0, a child of ShadowRoot, or a legacy shadow root. 221 221 Node* nonBoundaryShadowTreeRootNode(); -
trunk/Source/WebCore/html/shadow/TextControlInnerElements.h
r87067 r87227 107 107 virtual void detach(); 108 108 virtual bool isSpinButtonElement() const { return true; } 109 // FIXME: shadowAncestorNode() should be const. 110 virtual bool isEnabledFormControl() const { return static_cast<Element*>(const_cast<SpinButtonElement*>(this)->shadowAncestorNode())->isEnabledFormControl(); } 111 virtual bool isReadOnlyFormControl() const { return static_cast<Element*>(const_cast<SpinButtonElement*>(this)->shadowAncestorNode())->isReadOnlyFormControl(); } 109 virtual bool isEnabledFormControl() const { return static_cast<Element*>(shadowAncestorNode())->isEnabledFormControl(); } 110 virtual bool isReadOnlyFormControl() const { return static_cast<Element*>(shadowAncestorNode())->isReadOnlyFormControl(); } 112 111 virtual void defaultEventHandler(Event*); 113 112 void startRepeatingTimer();
Note: See TracChangeset
for help on using the changeset viewer.