Changeset 124580 in webkit


Ignore:
Timestamp:
Aug 3, 2012 1:15:35 AM (12 years ago)
Author:
inferno@chromium.org
Message:

Regression(r124564): Wrong inlineChildrenBlock->hasLayer() computed in RenderBlock::removeChild.
https://bugs.webkit.org/show_bug.cgi?id=90800

Reviewed by Eric Seidel.

r124564 reversed the sequence of setStyle and removeChildNode calls, but failed to cache the value
of inlineChildrenBlock->hasLayer(). So, it will be null when the layer is removed from parent in setStyle.
Fixed by the caching the bool value.

Covered by existing test fast/block/layer-not-removed-from-parent-crash.html.

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::removeChild):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r124578 r124580  
     12012-08-03  Abhishek Arya  <inferno@chromium.org>
     2
     3        Regression(r124564): Wrong inlineChildrenBlock->hasLayer() computed in RenderBlock::removeChild.
     4        https://bugs.webkit.org/show_bug.cgi?id=90800
     5
     6        Reviewed by Eric Seidel.
     7
     8        r124564 reversed the sequence of setStyle and removeChildNode calls, but failed to cache the value
     9        of inlineChildrenBlock->hasLayer(). So, it will be null when the layer is removed from parent in setStyle.
     10        Fixed by the caching the bool value.
     11
     12        Covered by existing test fast/block/layer-not-removed-from-parent-crash.html.
     13
     14        * rendering/RenderBlock.cpp:
     15        (WebCore::RenderBlock::removeChild):
     16
    1172012-08-03  Mario Sanchez Prada  <msanchez@igalia.com>
    218
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r124564 r124580  
    11701170            ASSERT(!inlineChildrenBlock->continuation());
    11711171            RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay(style(), BLOCK);
     1172            // Cache this value as it might get changed in setStyle() call.
     1173            bool inlineChildrenBlockHasLayer = inlineChildrenBlock->hasLayer();
    11721174            inlineChildrenBlock->setStyle(newStyle);
    1173             children()->removeChildNode(this, inlineChildrenBlock, inlineChildrenBlock->hasLayer());
     1175            children()->removeChildNode(this, inlineChildrenBlock, inlineChildrenBlockHasLayer);
    11741176           
    11751177            // Now just put the inlineChildrenBlock inside the blockChildrenBlock.
    11761178            blockChildrenBlock->children()->insertChildNode(blockChildrenBlock, inlineChildrenBlock, prev == inlineChildrenBlock ? blockChildrenBlock->firstChild() : 0,
    1177                                                             inlineChildrenBlock->hasLayer() || blockChildrenBlock->hasLayer());
     1179                                                            inlineChildrenBlockHasLayer || blockChildrenBlock->hasLayer());
    11781180            next->setNeedsLayoutAndPrefWidthsRecalc();
    11791181           
Note: See TracChangeset for help on using the changeset viewer.