Changeset 252912 in webkit
- Timestamp:
- Nov 27, 2019 1:41:57 PM (4 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r252911 r252912 1 2019-11-27 Zalan Bujtas <zalan@apple.com> 2 3 [LFC] Run layout on the root when InvalidationState is empty. 4 https://bugs.webkit.org/show_bug.cgi?id=204651 5 <rdar://problem/57509616> 6 7 Reviewed by Antti Koivisto. 8 9 InvalidationState captures style/tree mutation related changes. An empty InvalidationState indicates that the horizontal constraint changed 10 and we need to initiate a layout on the ICB (and the layout logic will propagate the damage down on the tree). 11 12 * layout/LayoutContext.cpp: 13 (WebCore::Layout::LayoutContext::layout): 14 * layout/RenderBlockFlowLineLayout.cpp: 15 (WebCore::Layout::RenderBlockFlowLineLayout::layout): 16 * layout/layouttree/LayoutTreeBuilder.cpp: 17 (WebCore::Layout::printLayoutTreeForLiveDocuments): 18 * page/FrameViewLayoutContext.cpp: 19 (WebCore::FrameViewLayoutContext::layoutUsingFormattingContext): 20 1 21 2019-11-27 Antoine Quint <graouts@apple.com> 2 22 -
trunk/Source/WebCore/layout/LayoutContext.cpp
r252866 r252912 60 60 { 61 61 PhaseScope scope(Phase::Type::Layout); 62 63 auto& formattingContextRootsForLayout = invalidationState.formattingContextRoots();64 if (formattingContextRootsForLayout.computesEmpty())65 return;66 67 62 // Set the geometry on the root. 68 63 // 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). … … 78 73 displayBox.setContentBoxHeight(rootContentBoxSize.height()); 79 74 displayBox.setContentBoxWidth(rootContentBoxSize.width()); 75 76 auto& formattingContextRootsForLayout = invalidationState.formattingContextRoots(); 77 // When invalidation is empty, we assume constraint mutation and start running layout on the context root. Layout logic should be able to figure out the damage. 78 if (formattingContextRootsForLayout.computesEmpty()) 79 return layoutFormattingContextSubtree(m_layoutState.root(), invalidationState); 80 80 81 for (auto& formattingContextRoot : formattingContextRootsForLayout) 81 82 layoutFormattingContextSubtree(formattingContextRoot, invalidationState); -
trunk/Source/WebCore/layout/RenderBlockFlowLineLayout.cpp
r252893 r252912 75 75 76 76 auto& rootContainer = m_layoutState->root(); 77 78 if (!rootContainer.firstChild()) 79 return; 80 81 InvalidationState invalidationState; 82 // FIXME: Find some better way to do this. 83 invalidationState.markNeedsUpdate(*rootContainer.firstChild()); 84 85 LayoutContext layoutContext(*m_layoutState); 77 auto layoutContext = LayoutContext { *m_layoutState }; 78 auto invalidationState = InvalidationState { }; 86 79 layoutContext.layout(m_flow.contentSize(), invalidationState); 87 80 -
trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp
r252893 r252912 451 451 auto& layoutRoot = layoutState.root(); 452 452 auto invalidationState = InvalidationState { }; 453 auto invalidationContext = InvalidationContext { invalidationState };454 invalidationContext.styleChanged(*layoutRoot.firstChild(), StyleDifference::Layout);455 456 453 LayoutContext(layoutState).layout(renderView.size(), invalidationState); 457 454 showLayoutTree(layoutRoot, &layoutState); -
trunk/Source/WebCore/page/FrameViewLayoutContext.cpp
r252866 r252912 62 62 return; 63 63 64 // FrameView::setContentsSize temporary disables layout. 65 if (m_disableSetNeedsLayoutCount) 66 return; 67 64 68 auto& renderView = *this->renderView(); 65 69 if (!m_layoutTreeContent) { … … 73 77 // FIXME: This is not the real invalidation yet. 74 78 auto invalidationState = Layout::InvalidationState { }; 75 auto invalidationContext = Layout::InvalidationContext { invalidationState };76 77 // FrameView::setContentsSize temporary disables layout.78 if (!m_disableSetNeedsLayoutCount)79 invalidationContext.styleChanged(*m_layoutState->root().firstChild(), StyleDifference::Layout);80 81 79 auto layoutContext = Layout::LayoutContext { *m_layoutState }; 82 80 layoutContext.layout(view().layoutSize(), invalidationState);
Note: See TracChangeset
for help on using the changeset viewer.