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):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234553
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2018-08-03 Zalan Bujtas <zalan@apple.com>
+
+ [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 <aestes@apple.com>
ContentFilterUnblockHandler's constructors access moved-from variables
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;
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));