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..0d4e4ab9d64f7098d9dbc2d06e7bdda32daff2e7 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,12 @@ NGLogicalOffset NGBlockLayoutAlgorithm::PrepareChildLayout( |
curr_margin_strut_.Append(curr_child_margins_.block_start); |
} |
- // Should collapse margins if inline. |
- if (child->IsInline()) { |
+ // TODO(glebl): Handle the case when a legacy block has border/padding. |
ikilpatrick
2017/04/24 20:27:50
This should be fine right? As these should always
Gleb Lanbin
2017/04/24 21:15:33
yes, on a second thought, I think this TODO is not
|
+ 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_); |