Changeset 252866 in webkit


Ignore:
Timestamp:
Nov 25, 2019 11:06:25 AM (4 years ago)
Author:
Alan Bujtas
Message:

[LFC] Do not run layout when setNeedsLayout is disabled
https://bugs.webkit.org/show_bug.cgi?id=204586
<rdar://problem/57475333>

Reviewed by Antti Koivisto.

setNeedsLayout is disabled while the content size is set on the ScrollView. It triggers a forced layout in WebkitLegacy.

  • layout/LayoutContext.cpp:

(WebCore::Layout::LayoutContext::layout):

  • page/FrameViewLayoutContext.cpp:

(WebCore::FrameViewLayoutContext::layoutUsingFormattingContext):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r252865 r252866  
     12019-11-25  Zalan Bujtas  <zalan@apple.com>
     2
     3        [LFC] Do not run layout when setNeedsLayout is disabled
     4        https://bugs.webkit.org/show_bug.cgi?id=204586
     5        <rdar://problem/57475333>
     6
     7        Reviewed by Antti Koivisto.
     8
     9        setNeedsLayout is disabled while the content size is set on the ScrollView. It triggers a forced layout in WebkitLegacy.
     10
     11        * layout/LayoutContext.cpp:
     12        (WebCore::Layout::LayoutContext::layout):
     13        * page/FrameViewLayoutContext.cpp:
     14        (WebCore::FrameViewLayoutContext::layoutUsingFormattingContext):
     15
    1162019-11-25  Zalan Bujtas  <zalan@apple.com>
    217
  • trunk/Source/WebCore/layout/LayoutContext.cpp

    r252534 r252866  
    6060{
    6161    PhaseScope scope(Phase::Type::Layout);
     62
     63    auto& formattingContextRootsForLayout = invalidationState.formattingContextRoots();
     64    if (formattingContextRootsForLayout.computesEmpty())
     65        return;
     66
    6267    // Set the geometry on the root.
    6368    // Note that we never layout the root box. It has to have an already computed geometry (in case of ICB, it's the view geometry).
     
    7378    displayBox.setContentBoxHeight(rootContentBoxSize.height());
    7479    displayBox.setContentBoxWidth(rootContentBoxSize.width());
    75 
    76     auto& formattingContextRootsForLayout = invalidationState.formattingContextRoots();
    77     ASSERT(!formattingContextRootsForLayout.computesEmpty());
    7880    for (auto& formattingContextRoot : formattingContextRootsForLayout)
    7981        layoutFormattingContextSubtree(formattingContextRoot, invalidationState);
  • trunk/Source/WebCore/page/FrameViewLayoutContext.cpp

    r252735 r252866  
    7474    auto invalidationState = Layout::InvalidationState { };
    7575    auto invalidationContext = Layout::InvalidationContext { invalidationState };
    76     invalidationContext.styleChanged(*m_layoutState->root().firstChild(), StyleDifference::Layout);
     76
     77    // FrameView::setContentsSize temporary disables layout.
     78    if (!m_disableSetNeedsLayoutCount)
     79        invalidationContext.styleChanged(*m_layoutState->root().firstChild(), StyleDifference::Layout);
    7780
    7881    auto layoutContext = Layout::LayoutContext { *m_layoutState };
Note: See TracChangeset for help on using the changeset viewer.