Changeset 206343 in webkit


Ignore:
Timestamp:
Sep 23, 2016 5:45:48 PM (8 years ago)
Author:
Alan Bujtas
Message:
ASSERTION FAILED: !newRelayoutRoot.container()
is<RenderView>(newRelayoutRoot.container()) !newRelayoutRoot.container()->needsLayout() while loading sohu.com

https://bugs.webkit.org/show_bug.cgi?id=162466

Reviewed by Simon Fraser.

Source/WebCore:

When we come across a out-of-flow positioned renderer during layout, we add it to a tracker map with
its containing block (calling RenderBlock::insertPositionedObject).
It ensures that a containing block can easily access to the out-of-flow positioned descendants during layout/painting/hittesting.
We do it even when the containing block - positioned renderer pair is already in this tracker map.
RenderBlock::insertPositionedObject() eagerly sets the positioned-child-needs-layout flag on the containing block
assuming it needs to layout this descendant later in the layout phase.
This patch ensure that we only flag the containing block dirty when the descendant needs layout.

Test: fast/block/positioning/subtree-assert-when-positioned-element-dirties-containing-block.html

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::insertPositionedObject):

LayoutTests:

  • fast/block/positioning/subtree-assert-when-positioned-element-dirties-containing-block-expected.txt: Added.
  • fast/block/positioning/subtree-assert-when-positioned-element-dirties-containing-block.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r206342 r206343  
     12016-09-23  Zalan Bujtas  <zalan@apple.com>
     2
     3        ASSERTION FAILED: !newRelayoutRoot.container() || is<RenderView>(newRelayoutRoot.container()) || !newRelayoutRoot.container()->needsLayout() while loading sohu.com
     4        https://bugs.webkit.org/show_bug.cgi?id=162466
     5
     6        Reviewed by Simon Fraser.
     7
     8        * fast/block/positioning/subtree-assert-when-positioned-element-dirties-containing-block-expected.txt: Added.
     9        * fast/block/positioning/subtree-assert-when-positioned-element-dirties-containing-block.html: Added.
     10
    1112016-09-23  Ryan Haddad  <ryanhaddad@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r206338 r206343  
     12016-09-23  Zalan Bujtas  <zalan@apple.com>
     2
     3        ASSERTION FAILED: !newRelayoutRoot.container() || is<RenderView>(newRelayoutRoot.container()) || !newRelayoutRoot.container()->needsLayout() while loading sohu.com
     4        https://bugs.webkit.org/show_bug.cgi?id=162466
     5
     6        Reviewed by Simon Fraser.
     7
     8        When we come across a out-of-flow positioned renderer during layout, we add it to a tracker map with
     9        its containing block (calling RenderBlock::insertPositionedObject).
     10        It ensures that a containing block can easily access to the out-of-flow positioned descendants during layout/painting/hittesting.
     11        We do it even when the containing block - positioned renderer pair is already in this tracker map.
     12        RenderBlock::insertPositionedObject() eagerly sets the positioned-child-needs-layout flag on the containing block
     13        assuming it needs to layout this descendant later in the layout phase.
     14        This patch ensure that we only flag the containing block dirty when the descendant needs layout.
     15
     16        Test: fast/block/positioning/subtree-assert-when-positioned-element-dirties-containing-block.html
     17
     18        * rendering/RenderBlock.cpp:
     19        (WebCore::RenderBlock::insertPositionedObject):
     20
    1212016-09-23  Yusuke Suzuki  <utatane.tea@gmail.com>
    222
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r205787 r206343  
    22512251{
    22522252    ASSERT(!isAnonymousBlock());
    2253 
    22542253    if (positioned.isRenderFlowThread())
    22552254        return;
    2256     // We should turn this bit on only while in layout.
    2257     ASSERT(posChildNeedsLayout() || view().frameView().isInLayout());
    2258     setPosChildNeedsLayoutBit(true);
     2255    // FIXME: Find out if we can do this as part of positioned.setChildNeedsLayout(MarkOnlyThis)
     2256    if (positioned.needsLayout()) {
     2257        // We should turn this bit on only while in layout.
     2258        ASSERT(posChildNeedsLayout() || view().frameView().isInLayout());
     2259        setPosChildNeedsLayoutBit(true);
     2260    }
    22592261    positionedDescendantsMap().addDescendant(*this, positioned, isRenderView() ? PositionedDescendantsMap::MoveDescendantToEnd::Yes
    22602262        : PositionedDescendantsMap::MoveDescendantToEnd::No);
Note: See TracChangeset for help on using the changeset viewer.