Changeset 140638 in webkit


Ignore:
Timestamp:
Jan 23, 2013 8:06:22 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Don't allocate rare data on every Element on removal
https://bugs.webkit.org/show_bug.cgi?id=107756

Patch by Elliott Sprehn <Elliott Sprehn> on 2013-01-23
Reviewed by Eric Seidel.

We should not allocate an ElementRareData for every element
in Element::removedFrom. Previously calls to setIsInTopLayer
would unconditionally call ensureElementRareData(), and this was
called from Element::removedFrom meaning removing an element
made the entire subtree suddenly balloon to huge in size as each
one got an ElementRareData.

This is a regression from my patch on Bug 103912 where I removed a check
that avoided this allocation.

No new tests needed, covered by existing tests.

  • dom/Element.cpp:

(WebCore::Element::setIsInTopLayer):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r140635 r140638  
     12013-01-23  Elliott Sprehn  <esprehn@gmail.com>
     2
     3        Don't allocate rare data on every Element on removal
     4        https://bugs.webkit.org/show_bug.cgi?id=107756
     5
     6        Reviewed by Eric Seidel.
     7
     8        We should not allocate an ElementRareData for every element
     9        in Element::removedFrom. Previously calls to setIsInTopLayer
     10        would unconditionally call ensureElementRareData(), and this was
     11        called from Element::removedFrom meaning removing an element
     12        made the entire subtree suddenly balloon to huge in size as each
     13        one got an ElementRareData.
     14
     15        This is a regression from my patch on Bug 103912 where I removed a check
     16        that avoided this allocation.
     17
     18        No new tests needed, covered by existing tests.
     19
     20        * dom/Element.cpp:
     21        (WebCore::Element::setIsInTopLayer):
     22
    1232013-01-23  Adam Barth  <abarth@webkit.org>
    224
  • trunk/Source/WebCore/dom/Element.cpp

    r140546 r140638  
    24022402void Element::setIsInTopLayer(bool inTopLayer)
    24032403{
     2404    if (isInTopLayer() == inTopLayer)
     2405        return;
    24042406    ensureElementRareData()->setIsInTopLayer(inTopLayer);
    24052407    setNeedsStyleRecalc(SyntheticStyleChange);
Note: See TracChangeset for help on using the changeset viewer.