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

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: ./ 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 771d4b449c00ae8661b59847ac5bb3008f25436e..0727c5582c6310755cce40607085a59eeb20fe01 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
@@ -135,7 +135,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;
}
@@ -283,10 +286,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_) {
eae 2017/07/10 23:27:49 When would this be false?
ikilpatrick 2017/07/11 17:20:41 So this is actually for the _child_, i.e. NGBoxFr
+ for (const NGPositionedFloat& positioned_float :
+ ToNGPhysicalBoxFragment(child_fragment.Get())->PositionedFloats()) {
+ FloatingObjectPositionedUpdated(
+ positioned_float, ToLayoutBox(child_fragment->GetLayoutObject()));
+ }
}
}
@@ -303,7 +312,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