Title: [234553] trunk/Source/WebCore
Revision
234553
Author
[email protected]
Date
2018-08-03 10:57:35 -0700 (Fri, 03 Aug 2018)

Log Message

[LFC][BFC] Layout out-of-flow descendants only on the formatting context root.
https://bugs.webkit.org/show_bug.cgi?id=188312

Reviewed by Antti Koivisto.

Collect out-of-flow descendants on the formatting root container instead of the containing block and run layout on them on the root level. It's more efficient this way.

* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::TreeBuilder::createSubTree):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (234552 => 234553)


--- trunk/Source/WebCore/ChangeLog	2018-08-03 17:56:29 UTC (rev 234552)
+++ trunk/Source/WebCore/ChangeLog	2018-08-03 17:57:35 UTC (rev 234553)
@@ -1,3 +1,17 @@
+2018-08-03  Zalan Bujtas  <[email protected]>
+
+        [LFC][BFC] Layout out-of-flow descendants only on the formatting context root.
+        https://bugs.webkit.org/show_bug.cgi?id=188312
+
+        Reviewed by Antti Koivisto.
+
+        Collect out-of-flow descendants on the formatting root container instead of the containing block and run layout on them on the root level. It's more efficient this way.
+
+        * layout/blockformatting/BlockFormattingContext.cpp:
+        (WebCore::Layout::BlockFormattingContext::layout const):
+        * layout/layouttree/LayoutTreeBuilder.cpp:
+        (WebCore::Layout::TreeBuilder::createSubTree):
+
 2018-08-03  Andy Estes  <[email protected]>
 
         ContentFilterUnblockHandler's constructors access moved-from variables

Modified: trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp (234552 => 234553)


--- trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp	2018-08-03 17:56:29 UTC (rev 234552)
+++ trunk/Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp	2018-08-03 17:57:35 UTC (rev 234553)
@@ -117,7 +117,6 @@
             auto& container = downcast<Container>(layoutBox);
             // Move in-flow positioned children to their final position.
             placeInFlowPositionedChildren(layoutContext, container);
-            layoutOutOfFlowDescendants(layoutContext, container);
             if (auto* nextSibling = container.nextInFlowOrFloatingSibling()) {
                 layoutQueue.append(std::make_unique<LayoutPair>(LayoutPair {*nextSibling, layoutContext.createDisplayBox(*nextSibling)}));
                 break;

Modified: trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp (234552 => 234553)


--- trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp	2018-08-03 17:56:29 UTC (rev 234552)
+++ trunk/Source/WebCore/layout/layouttree/LayoutTreeBuilder.cpp	2018-08-03 17:57:35 UTC (rev 234553)
@@ -110,7 +110,8 @@
         if (box->isOutOfFlowPositioned()) {
             // Not efficient, but this is temporary anyway.
             // Collect the out-of-flow descendants at the formatting root lever (as opposed to at the containing block level, though they might be the same).
-            const_cast<Container&>(box->formattingContextRoot()).addOutOfFlowDescendant(*box);
+            auto& containingBlockFormattingContextRoot = box->containingBlock()->formattingContextRoot();
+            const_cast<Container&>(containingBlockFormattingContextRoot).addOutOfFlowDescendant(*box);
         }
         if (is<RenderElement>(child))
             createSubTree(downcast<RenderElement>(child), downcast<Container>(*box));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to