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

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

Issue 2835233004: Collapse margins before child that uses legacy layout. (Closed)
Patch Set: margin-collapse/100.html is still broken on Windows because of LayoutInline Created 3 years, 8 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_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 e4f148ad47b744dc0ff123f04fbb55dd2f2b188d..9dae0ce353e93100f5433eb0e85a0df1ea1b7238 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
@@ -344,8 +344,11 @@ NGLogicalOffset NGBlockLayoutAlgorithm::PrepareChildLayout(
curr_margin_strut_.Append(curr_child_margins_.block_start);
}
- // Should collapse margins if inline.
- if (child->IsInline()) {
+ bool is_legacy_block =
+ child->IsBlock() && !ToNGBlockNode(child)->CanUseNewLayout();
+
+ // Should collapse margins if inline or legacy block
+ if (child->IsInline() || is_legacy_block) {
curr_bfc_offset_.block_offset += curr_margin_strut_.Sum();
MaybeUpdateFragmentBfcOffset(ConstraintSpace(), curr_bfc_offset_,
&container_builder_);
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | third_party/WebKit/Source/core/layout/ng/ng_block_node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698