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

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

Issue 2336353002: Collapse bottom margins of a last child and its parent if parent's height=auto (Closed)
Patch Set: Created 4 years, 3 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 1da0c530ef4f5112401a89a38d93b2fedd1c54b9..8b03c1f7307841c84d3130d178ef800dbdf7b004 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
@@ -112,7 +112,13 @@ LayoutUnit NGBlockLayoutAlgorithm::CollapseMargins(
// Calculate margin strut for the current child.
NGMarginStrut curr_margin_strut = children_margin_strut;
curr_margin_strut.AppendMarginBlockStart(margins.block_start);
- curr_margin_strut.AppendMarginBlockEnd(margins.block_end);
+ if (current_child_->Style()->height().isAuto()) {
ikilpatrick 2016/09/13 19:08:39 not logicalHeight here?
Gleb Lanbin 2016/09/13 19:33:44 Done.
+ // bottom margin of a last in-flow child is only collapsed if
+ // the parent has 'auto' computed height
+ curr_margin_strut.AppendMarginBlockEnd(margins.block_end);
+ } else {
+ curr_margin_strut.SetMarginBlockEnd(margins.block_end);
+ }
// Set the margin strut for the resultant fragment if this is the first or
// last child fragment.

Powered by Google App Engine
This is Rietveld 408576698