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

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

Issue 2954953002: [LayoutNG] Abort a layout once the BFC offset is resolved. (Closed)
Patch Set: rebase. Created 3 years, 5 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/inline/ng_inline_node.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.cc b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.cc
index 765e45770d2f0e978a5814a50d4a54050f161f79..ff37b1366728acbe1f301ac1383d425065e56654 100644
--- a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.cc
+++ b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.cc
@@ -354,7 +354,11 @@ RefPtr<NGLayoutResult> NGInlineNode::Layout(NGConstraintSpace* constraint_space,
NGInlineLayoutAlgorithm algorithm(*this, constraint_space,
ToNGInlineBreakToken(break_token));
RefPtr<NGLayoutResult> result = algorithm.Layout();
- CopyFragmentDataToLayoutBox(*constraint_space, result.Get());
+
+ if (result->Status() == NGLayoutResult::kSuccess &&
+ result->UnpositionedFloats().IsEmpty())
+ CopyFragmentDataToLayoutBox(*constraint_space, result.Get());
+
return result;
}
@@ -373,7 +377,10 @@ static LayoutUnit ComputeContentSize(NGInlineNode node,
NGPhysicalFragment::NGFragmentType::kFragmentBox, node);
container_builder.SetBfcOffset(NGLogicalOffset{LayoutUnit(), LayoutUnit()});
- NGLineBreaker line_breaker(node, space.Get(), &container_builder);
+ Vector<RefPtr<NGUnpositionedFloat>> unpositioned_floats;
+ NGLineBreaker line_breaker(node, space.Get(), &container_builder,
+ &unpositioned_floats);
+
NGLineInfo line_info;
LayoutUnit result;
while (line_breaker.NextLine(&line_info, NGLogicalOffset())) {

Powered by Google App Engine
This is Rietveld 408576698