Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(373)

Unified Diff: third_party/WebKit/Source/core/layout/ng/ng_block_node.cc

Issue 2700683002: [LayoutNG] Fix incorrectly positioned empty blocks inside of new BFC (Closed)
Patch Set: Fix comments and some crashes in FloatingObjects Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/ng/ng_block_node.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc b/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc
index 7e8127a48780df6ce49966c3c011861e117d73f2..73fc8570d4ce7472ba1b3e2ff1af3b8200649881 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc
@@ -246,6 +246,13 @@ void NGBlockNode::CopyFragmentDataToLayoutBox(
intrinsic_logical_height -= border_and_padding.BlockSum();
layout_box_->setIntrinsicContentLogicalHeight(intrinsic_logical_height);
+ // We may still have unpositioned floats when we reach the root box.
+ if (!layout_box_->parent()) {
+ for (const auto& floating_object : fragment_->PositionedFloats()) {
+ FloatingObjectPositionedUpdated(floating_object, layout_box_);
+ }
+ }
+
// TODO(layout-dev): Currently we are not actually performing layout on
// inline children. For now just clear the needsLayout bit so that we can
// run unittests.

Powered by Google App Engine
This is Rietveld 408576698