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

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

Issue 2955613002: [LayoutNG] Stretch content size of BFCs to encapsulate floats. (Closed)
Patch Set: TestExpectations Created 3 years, 6 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
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc
index 846f71ddd145d63e0ad014cd8e8e983358163f8b..45e959ef1f60657a42347f4f22e36371dc2652d5 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc
@@ -297,6 +297,19 @@ RefPtr<NGLayoutResult> NGBlockLayoutAlgorithm::Layout() {
end_margin_strut.Sum());
end_margin_strut = NGMarginStrut();
}
+
+ // If the current layout is a new formatting context, we need to encapsulate
+ // all of our floats.
+ if (ConstraintSpace().IsNewFormattingContext()) {
+ // We can use the BFC coordinates, as we are a new formatting context.
+ DCHECK_EQ(container_builder_.BfcOffset().value(), NGLogicalOffset());
+
+ WTF::Optional<LayoutUnit> float_end_offset =
+ GetClearanceOffset(ConstraintSpace().Exclusions(), EClear::kBoth);
+ if (float_end_offset)
+ content_size_ = std::max(content_size_, float_end_offset.value());
+ }
+
content_size_ += border_scrollbar_padding_.block_end;
// Recompute the block-axis size now that we know our content size.
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698