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

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

Issue 2798203002: NGInlineLayoutAlgorithm should take margins of inline floats into account (Closed)
Patch Set: 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 1a584184b9bc5aaa389770efe39dd54ac84525d2..7b170a84ac515b065d6af18d6928a454f45b4d8e 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
@@ -277,9 +277,10 @@ void NGBlockLayoutAlgorithm::PrepareChildLayout(NGLayoutInputNode* child) {
DCHECK(child);
// Calculate margins in parent's writing mode.
- curr_child_margins_ = CalculateMargins(
- child, *space_builder_.ToConstraintSpace(
- FromPlatformWritingMode(Style().getWritingMode())));
+ curr_child_margins_ = ComputeMarginsForChild(
+ *space_builder_.ToConstraintSpace(
+ FromPlatformWritingMode(Style().getWritingMode())),
+ child);
// Set estimated BFC offset to the next child's constraint space.
curr_bfc_offset_ = builder_.BfcOffset() ? builder_.BfcOffset().value()
@@ -463,26 +464,6 @@ void NGBlockLayoutAlgorithm::FinalizeForFragmentation() {
builder_.SetBlockOverflow(content_size_);
}
-NGBoxStrut NGBlockLayoutAlgorithm::CalculateMargins(
- NGLayoutInputNode* child,
- const NGConstraintSpace& space) {
- DCHECK(child);
- const ComputedStyle& child_style = child->Style();
-
- WTF::Optional<MinMaxContentSize> sizes;
- if (NeedMinMaxContentSize(space, child_style))
- sizes = child->ComputeMinMaxContentSize();
-
- LayoutUnit child_inline_size =
- ComputeInlineSizeForFragment(space, child_style, sizes);
- NGBoxStrut margins = ComputeMargins(space, child_style, space.WritingMode(),
- space.Direction());
- if (!child_style.isFloating()) {
- ApplyAutoMargins(space, child_style, child_inline_size, &margins);
- }
- return margins;
-}
-
RefPtr<NGConstraintSpace> NGBlockLayoutAlgorithm::CreateConstraintSpaceForChild(
NGLayoutInputNode* child) {
DCHECK(child);

Powered by Google App Engine
This is Rietveld 408576698