Changeset 140512 in webkit


Ignore:
Timestamp:
Jan 22, 2013 11:31:30 PM (11 years ago)
Author:
falken@chromium.org
Message:

20% regression on dom_perf/DomDivWalk
https://bugs.webkit.org/show_bug.cgi?id=106726

Reviewed by Hajime Morita.

This patch moves the checks in Element::removedFrom for Fullscreen and top layer flags
into a slow path. The idea is for the two checks for Fullscreen and top layer
to be replaced by one faster check in the fast path.

The plan is to migrate the Fullscreen implementation to use top layer, so this is just a
short-term fix for the perf regression.

No new tests: no functionality change

  • dom/Element.cpp:

(WebCore::Element::removedFrom): Create a slow path to move the Fullscreen and top layer checks into.

  • dom/Node.cpp:

(WebCore::Node::setIsInTopLayer): To allow for cleaner code in Element::removedFrom, define
setIsInTopLayer and isInTopLayer even when the feature flag is off.

  • dom/Node.h:

(WebCore::Node::isInTopLayer): Ditto.
(Node):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r140509 r140512  
     12013-01-22  Matt Falkenhagen  <falken@chromium.org>
     2
     3        20% regression on dom_perf/DomDivWalk
     4        https://bugs.webkit.org/show_bug.cgi?id=106726
     5
     6        Reviewed by Hajime Morita.
     7
     8        This patch moves the checks in Element::removedFrom for Fullscreen and top layer flags
     9        into a slow path. The idea is for the two checks for Fullscreen and top layer
     10        to be replaced by one faster check in the fast path.
     11
     12        The plan is to migrate the Fullscreen implementation to use top layer, so this is just a
     13        short-term fix for the perf regression.
     14
     15        No new tests: no functionality change
     16
     17        * dom/Element.cpp:
     18        (WebCore::Element::removedFrom): Create a slow path to move the Fullscreen and top layer checks into.
     19        * dom/Node.cpp:
     20        (WebCore::Node::setIsInTopLayer): To allow for cleaner code in Element::removedFrom, define
     21        setIsInTopLayer and isInTopLayer even when the feature flag is off.
     22        * dom/Node.h:
     23        (WebCore::Node::isInTopLayer): Ditto.
     24        (Node):
     25
    1262013-01-22  Mark Lam  <mark.lam@apple.com>
    227
  • trunk/Source/WebCore/dom/Element.cpp

    r140452 r140512  
    11831183        after->removedFrom(insertionPoint);
    11841184
     1185    // FIXME: Fullscreen should be migrated to use the top layer (bug 107617). Then this can just be a single check.
     1186    // The purpose of the outer if statement is to quickly determine whether we must do the additional
     1187    // checks in a slow path.
     1188#if ENABLE(DIALOG_ELEMENT) || ENABLE(FULLSCREEN_API)
     1189    if (hasRareData() || isInTopLayer()) {
    11851190#if ENABLE(DIALOG_ELEMENT)
    1186     if (isInTopLayer())
    1187         document()->removeFromTopLayer(this);
     1191        if (isInTopLayer())
     1192            document()->removeFromTopLayer(this);
    11881193#endif
    11891194#if ENABLE(FULLSCREEN_API)
    1190     if (containsFullScreenElement())
    1191         setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(false);
    1192 #endif
     1195        if (containsFullScreenElement())
     1196            setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(false);
     1197#endif
     1198    }
     1199#endif
     1200
    11931201#if ENABLE(POINTER_LOCK)
    11941202    if (document()->page())
  • trunk/Source/WebCore/dom/Node.h

    r140411 r140512  
    686686    bool isInTopLayer() const { return getFlag(IsInTopLayer); }
    687687    void setIsInTopLayer(bool);
     688#else
     689    bool isInTopLayer() const { return false; }
     690    void setIsInTopLayer(bool) { }
    688691#endif
    689692
Note: See TracChangeset for help on using the changeset viewer.