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

Unified Diff: third_party/WebKit/Source/core/layout/ng/ng_block_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/ng_block_node.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc b/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc
index 6fea69c3ae0a74529b769acaa15cab460fc5ea97..b93e93720121e6e847b214fe8bb0e92ba77b38c2 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc
@@ -132,7 +132,10 @@ RefPtr<NGLayoutResult> NGBlockNode::Layout(NGConstraintSpace* constraint_space,
RefPtr<NGLayoutResult> layout_result =
LayoutWithAlgorithm(Style(), *this, constraint_space, break_token);
- CopyFragmentDataToLayoutBox(*constraint_space, layout_result.Get());
+ if (layout_result->Status() == NGLayoutResult::kSuccess &&
+ layout_result->UnpositionedFloats().IsEmpty())
+ CopyFragmentDataToLayoutBox(*constraint_space, layout_result.Get());
+
return layout_result;
}
@@ -280,10 +283,16 @@ void NGBlockNode::CopyFragmentDataToLayoutBox(
if (child_fragment->IsPlaced())
FragmentPositionUpdated(ToNGPhysicalBoxFragment(*child_fragment));
- for (const NGPositionedFloat& positioned_float :
- ToNGPhysicalBoxFragment(child_fragment.Get())->PositionedFloats()) {
- FloatingObjectPositionedUpdated(
- positioned_float, ToLayoutBox(child_fragment->GetLayoutObject()));
+ if (child_fragment->GetLayoutObject()->IsLayoutBlockFlow())
+ ToLayoutBlockFlow(child_fragment->GetLayoutObject())
+ ->AddOverflowFromFloats();
+
+ if (child_fragment->GetLayoutObject() == box_) {
+ for (const NGPositionedFloat& positioned_float :
+ ToNGPhysicalBoxFragment(child_fragment.Get())->PositionedFloats()) {
+ FloatingObjectPositionedUpdated(
+ positioned_float, ToLayoutBox(child_fragment->GetLayoutObject()));
+ }
}
}
@@ -300,7 +309,11 @@ void NGBlockNode::CopyFragmentDataToLayoutBox(
box_->ClearNeedsLayout();
if (box_->IsLayoutBlockFlow()) {
- ToLayoutBlockFlow(box_)->UpdateIsSelfCollapsing();
+ LayoutBlockFlow* block_flow = ToLayoutBlockFlow(box_);
+ block_flow->UpdateIsSelfCollapsing();
+
+ if (block_flow->CreatesNewFormattingContext())
+ block_flow->AddOverflowFromFloats();
}
}

Powered by Google App Engine
This is Rietveld 408576698