⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 118654 in webkit


Ignore:
Timestamp:
May 28, 2012, 1:40:02 AM (14 years ago)
Author:
morrita@google.com
Message:

[Refactoring][ShadowDOM] Some ElementShadow methods can be inlined.
https://bugs.webkit.org/show_bug.cgi?id=87617

Reviewed by Kentaro Hara.

Inlined ElementShadow::attachHost(), ElementShadow::detachHost() and
ElementShadow::reattach()

No new tests. No behavior change.

  • dom/Element.cpp:

(WebCore::Element::attach):
(WebCore::Element::detach):

  • dom/ElementShadow.cpp:

(WebCore::ElememtnShadow::reattachHostChildrenAndShadow):

  • dom/ElementShadow.h:

(ElementShadow):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r118652 r118654  
     12012-05-27  MORITA Hajime  <morrita@google.com>
     2
     3        [Refactoring][ShadowDOM] Some ElementShadow methods can be inlined.
     4        https://bugs.webkit.org/show_bug.cgi?id=87617
     5
     6        Reviewed by Kentaro Hara.
     7
     8        Inlined ElementShadow::attachHost(), ElementShadow::detachHost() and
     9        ElementShadow::reattach()
     10
     11        No new tests. No behavior change.
     12
     13        * dom/Element.cpp:
     14        (WebCore::Element::attach):
     15        (WebCore::Element::detach):
     16        * dom/ElementShadow.cpp:
     17        (WebCore::ElememtnShadow::reattachHostChildrenAndShadow):
     18        * dom/ElementShadow.h:
     19        (ElementShadow):
     20
    1212012-05-28  Peter Rybin  <peter.rybin@gmail.com>
    222
  • trunk/Source/WebCore/dom/Element.cpp

    r118553 r118654  
    948948    if (ElementShadow* shadow = this->shadow()) {
    949949        parentPusher.push();
    950         shadow->attachHost(this);
     950        shadow->attach();
     951        attachChildrenIfNeeded();
     952        attachAsNode();
    951953    } else {
    952954        if (firstChild())
     
    984986        rareData()->resetComputedStyle();
    985987
    986     if (ElementShadow* shadow = this->shadow())
    987         shadow->detachHost(this);
    988     else
     988    if (ElementShadow* shadow = this->shadow()) {
     989        detachChildrenIfNeeded();
     990        shadow->detach();
     991        detachAsNode();
     992    } else
    989993        ContainerNode::detach();
    990994
  • trunk/Source/WebCore/dom/ElementShadow.cpp

    r118131 r118654  
    124124}
    125125
    126 void ElementShadow::attachHost(Element* host)
    127 {
    128     attach();
    129     host->attachChildrenIfNeeded();
    130     host->attachAsNode();
    131 }
    132 
    133126void ElementShadow::detach()
    134127{
     
    139132}
    140133
    141 void ElementShadow::detachHost(Element* host)
    142 {
    143     host->detachChildrenIfNeeded();
    144     detach();
    145     host->detachAsNode();
    146 }
    147 
    148134InsertionPoint* ElementShadow::insertionPointFor(const Node* node) const
    149135{
     
    158144
    159145    return distributor().findInsertionPointFor(node);
    160 }
    161 
    162 void ElementShadow::reattach()
    163 {
    164     detach();
    165     attach();
    166146}
    167147
     
    242222    Element* hostNode = youngestShadowRoot()->host();
    243223    hostNode->detachChildrenIfNeeded();
    244     reattach();
     224    detach();
     225    attach();
    245226    hostNode->attachChildrenIfNeeded();
    246227}
  • trunk/Source/WebCore/dom/ElementShadow.h

    r118131 r118654  
    5757    void attach();
    5858    void detach();
    59     void reattach();
    60     void attachHost(Element*);
    61     void detachHost(Element*);
    6259
    6360    bool childNeedsStyleRecalc();
Note: See TracChangeset for help on using the changeset viewer.