Changeset 87227 in webkit


Ignore:
Timestamp:
May 24, 2011 4:19:55 PM (13 years ago)
Author:
tkent@chromium.org
Message:

2011-05-24 Kent Tamura <tkent@chromium.org>

Reviewed by Dimitri Glazkov.

Node::shadowAncestorNode() and shadowTreeRootNode() should be const.
https://bugs.webkit.org/show_bug.cgi?id=61398

shadowAncestorNode() and shadowTreeRootNode() should be const
though they can return 'this' pointer.

No new tests. This doesn't change any visible behavior.

  • dom/Node.cpp: (WebCore::Node::shadowAncestorNode): Make this const. (WebCore::Node::shadowTreeRootNode): ditto.
  • dom/Node.h: Update declarations.
  • html/shadow/TextControlInnerElements.h: (WebCore::SpinButtonElement::isEnabledFormControl): Need no const_cast<>. (WebCore::SpinButtonElement::isReadOnlyFormControl): ditto.
Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r87215 r87227  
     12011-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
    1212011-05-24  James Simonsen  <simonjam@chromium.org>
    222
  • trunk/Source/WebCore/dom/Node.cpp

    r87147 r87227  
    15391539#endif
    15401540
    1541 Node* Node::shadowAncestorNode()
     1541Node* Node::shadowAncestorNode() const
    15421542{
    15431543#if ENABLE(SVG)
     
    15471547    // shadow tree concept. (This function _could_ be made virtual - opinions?)
    15481548    if (isSVGElement())
    1549         return this;
     1549        return const_cast<Node*>(this);
    15501550#endif
    15511551
     
    15531553    if (root)
    15541554        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
     1558Node* Node::shadowTreeRootNode() const
     1559{
     1560    Node* root = const_cast<Node*>(this);
    15611561    while (root) {
    15621562        if (root->isShadowRoot() || root->isSVGShadowRoot())
  • trunk/Source/WebCore/dom/Node.h

    r87147 r87227  
    215215    virtual bool canHaveLightChildRendererWithShadow() const { return false; }
    216216
    217     Node* shadowAncestorNode();
     217    Node* shadowAncestorNode() const;
    218218    // Returns 0, a ShadowRoot, or a legacy shadow root.
    219     Node* shadowTreeRootNode();
     219    Node* shadowTreeRootNode() const;
    220220    // Returns 0, a child of ShadowRoot, or a legacy shadow root.
    221221    Node* nonBoundaryShadowTreeRootNode();
  • trunk/Source/WebCore/html/shadow/TextControlInnerElements.h

    r87067 r87227  
    107107    virtual void detach();
    108108    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(); }
    112111    virtual void defaultEventHandler(Event*);
    113112    void startRepeatingTimer();
Note: See TracChangeset for help on using the changeset viewer.