[LFC][Integration] Update style of contained layout boxes
https://bugs.webkit.org/show_bug.cgi?id=218017

Reviewed by Zalan Bujtas.

Update layout box style on style change as needed. This fixes at least fast/replaced/max-width-percent.html with
image support enabled.

The patch also contains refactoring to make BoxTree non-const and moves the style update code there.

* layout/integration/LayoutIntegrationBoxTree.cpp:
(WebCore::LayoutIntegration::BoxTree::BoxTree):
(WebCore::LayoutIntegration::BoxTree::buildTree):
(WebCore::LayoutIntegration::BoxTree::updateStyle):
(WebCore::LayoutIntegration::BoxTree::layoutBoxForRenderer):
(WebCore::LayoutIntegration::BoxTree::layoutBoxForRenderer const):
(WebCore::LayoutIntegration::BoxTree::rendererForLayoutBox):
(WebCore::LayoutIntegration::BoxTree::rendererForLayoutBox const):
* layout/integration/LayoutIntegrationBoxTree.h:
(WebCore::LayoutIntegration::BoxTree::flow const):
(WebCore::LayoutIntegration::BoxTree::flow):
* layout/integration/LayoutIntegrationInlineContent.cpp:
(WebCore::LayoutIntegration::InlineContent::rendererForLayoutBox const):
* layout/integration/LayoutIntegrationInlineContent.h:
* layout/integration/LayoutIntegrationLineIteratorModernPath.h:
(WebCore::LayoutIntegration::LineIteratorModernPath::logicalStartRunWithNode const):
(WebCore::LayoutIntegration::LineIteratorModernPath::logicalEndRunWithNode const):
* layout/integration/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::LineLayout):
(WebCore::LayoutIntegration::LineLayout::containing):
(WebCore::LayoutIntegration::LineLayout::updateReplacedDimensions):
(WebCore::LayoutIntegration::LineLayout::updateStyle):
(WebCore::LayoutIntegration::LineLayout::constructContent):
(WebCore::LayoutIntegration::LineLayout::textRunsFor const):
(WebCore::LayoutIntegration::LineLayout::runFor const):
(WebCore::LayoutIntegration::LineLayout::rendererForLayoutBox const):
(WebCore::LayoutIntegration::LineLayout::paint):
(WebCore::LayoutIntegration::LineLayout::hitTest):
* layout/integration/LayoutIntegrationLineLayout.h:
* layout/integration/LayoutIntegrationRunIteratorModernPath.h:
(WebCore::LayoutIntegration::RunIteratorModernPath::renderer const):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::styleDidChange):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::styleDidChange):

Update the line layout style.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@268798 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/rendering/RenderBlockFlow.cpp b/Source/WebCore/rendering/RenderBlockFlow.cpp
index 8375485..dc068f3 100644
--- a/Source/WebCore/rendering/RenderBlockFlow.cpp
+++ b/Source/WebCore/rendering/RenderBlockFlow.cpp
@@ -2103,15 +2103,15 @@
         };
         if (shouldInvalidateLineLayoutPath())
             invalidateLineLayoutPath();
+
+#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
+        if (auto* lineLayout = layoutFormattingContextLineLayout())
+            lineLayout->updateStyle(*this);
+#endif
     }
 
     if (multiColumnFlow())
         updateStylesForColumnChildren();
-
-#if ENABLE(LAYOUT_FORMATTING_CONTEXT)
-    if (layoutFormattingContextLineLayout())
-        layoutFormattingContextLineLayout()->updateStyle();
-#endif
 }
 
 void RenderBlockFlow::updateStylesForColumnChildren()
@@ -2988,7 +2988,7 @@
 {
 #if ENABLE(LAYOUT_FORMATTING_CONTEXT)
     if (layoutFormattingContextLineLayout()) {
-        layoutFormattingContextLineLayout()->collectOverflow(*this);
+        layoutFormattingContextLineLayout()->collectOverflow();
         return;
     }
 #endif
@@ -3676,7 +3676,7 @@
     layoutFormattingContextLineLayout.layout();
 
     if (view().frameView().layoutContext().layoutState()->isPaginated())
-        layoutFormattingContextLineLayout.adjustForPagination(*this);
+        layoutFormattingContextLineLayout.adjustForPagination();
 
     auto contentHeight = layoutFormattingContextLineLayout.contentLogicalHeight();
     auto contentBoxTop = borderAndPaddingBefore();