Changeset 206765 in webkit


Ignore:
Timestamp:
Oct 3, 2016 8:33:57 PM (8 years ago)
Author:
Alan Bujtas
Message:

[ListItems] Render tree should be all clean by the end of FrameView::layout().
https://bugs.webkit.org/show_bug.cgi?id=162832

Reviewed by Simon Fraser.

List item markers are inserted into the tree during layout, right before laying out
the list item (that's a big FIXME). At this point we already know what part of the tree
needs to be laid out. Inserting a list item marker does not expand this dirty area.
However whenever we insert a new renderer into the tree, we call setNeedsLayout on the contining block chain.
In certain cases (floating renderers), it could potentially trigger some unintentional markings
and we return from FrameView::layout() with a dirty subtree.

This patch preemptively marks the list item and its marker dirty so that
when the marker is getting inserted into the tree, we stop the marking at the parent.

Not testable.

  • rendering/RenderListItem.cpp:

(WebCore::RenderListItem::insertOrMoveMarkerRendererIfNeeded):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r206761 r206765  
     12016-10-03  Zalan Bujtas  <zalan@apple.com>
     2
     3        [ListItems] Render tree should be all clean by the end of FrameView::layout().
     4        https://bugs.webkit.org/show_bug.cgi?id=162832
     5
     6        Reviewed by Simon Fraser.
     7
     8        List item markers are inserted into the tree during layout, right before laying out
     9        the list item (that's a big FIXME). At this point we already know what part of the tree
     10        needs to be laid out. Inserting a list item marker does not expand this dirty area.
     11        However whenever we insert a new renderer into the tree, we call setNeedsLayout on the contining block chain.
     12        In certain cases (floating renderers), it could potentially trigger some unintentional markings
     13        and we return from FrameView::layout() with a dirty subtree.
     14
     15        This patch preemptively marks the list item and its marker dirty so that
     16        when the marker is getting inserted into the tree, we stop the marking at the parent.
     17
     18        Not testable.
     19
     20        * rendering/RenderListItem.cpp:
     21        (WebCore::RenderListItem::insertOrMoveMarkerRendererIfNeeded):
     22
    1232016-10-03  Myles C. Maxfield  <mmaxfield@apple.com>
    224
  • trunk/Source/WebCore/rendering/RenderListItem.cpp

    r204466 r206765  
    288288        // containers other than ourselves, so we need to disable LayoutState.
    289289        LayoutStateDisabler layoutStateDisabler(view());
     290        // Mark the parent dirty so that when the marker gets inserted into the tree
     291        // and dirties ancestors, it stops at the parent.
     292        newParent->setChildNeedsLayout(MarkOnlyThis);
     293        m_marker->setNeedsLayout(MarkOnlyThis);
     294
    290295        m_marker->removeFromParent();
    291296        newParent->addChild(m_marker, firstNonMarkerChild(*newParent));
Note: See TracChangeset for help on using the changeset viewer.