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

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

Issue 2710213007: [NGLayout] Collapse margins before processing LayoutInline. (Closed)
Patch Set: git rebase-update 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc » ('j') | 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 edc7d660a96802fdae0b49e41322fe4dbf32f3fd..a4df599b4260b20826bd670faf5e8cba83ee4b94 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
@@ -784,6 +784,14 @@ NGBlockLayoutAlgorithm::CreateConstraintSpaceForCurrentChild() {
DCHECK(current_child_);
if (current_child_->Type() == NGLayoutInputNode::kLegacyInline) {
// TODO(kojii): Setup space_builder_ appropriately for inline child.
+
+ // Margins collapsing: Inline block.
+ curr_bfc_offset_.block_offset += curr_margin_strut_.Sum();
+ UpdateFragmentBfcOffset(curr_bfc_offset_);
+ PositionPendingFloats(curr_bfc_offset_.block_offset, ConstraintSpace(),
+ builder_.get());
+ curr_margin_strut_ = {};
+
return space_builder_->ToConstraintSpace(
FromPlatformWritingMode(Style().getWritingMode()));
// Calculate margins in parent's writing mode.
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698