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

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

Issue 2646853006: [LayoutNG] Pull out of flow candidate loop into out of flow layout part. (Closed)
Patch Set: rebase Created 3 years, 11 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 bd107013392b4316412488ea3648a0372bcb5893..aadb712141713604efc3afe663f15fa8be4ff074 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
@@ -308,7 +308,8 @@ NGPhysicalFragment* NGBlockLayoutAlgorithm::Layout() {
ComputeBlockSizeForFragment(ConstraintSpace(), Style(), content_size_);
builder_->SetBlockSize(block_size);
- LayoutOutOfFlowChildren();
+ // Layout our absolute and fixed positioned children.
+ NGOutOfFlowLayoutPart(Style(), builder_).Run();
builder_->SetInlineOverflow(max_inline_size_).SetBlockOverflow(content_size_);
@@ -339,32 +340,6 @@ void NGBlockLayoutAlgorithm::FinishCurrentChildLayout(NGFragment* fragment) {
builder_->AddChild(fragment, fragment_offset);
}
-void NGBlockLayoutAlgorithm::LayoutOutOfFlowChildren() {
- HeapLinkedHashSet<WeakMember<NGBlockNode>> out_of_flow_candidates;
- Vector<NGStaticPosition> out_of_flow_candidate_positions;
- builder_->GetAndClearOutOfFlowDescendantCandidates(
- &out_of_flow_candidates, &out_of_flow_candidate_positions);
-
- Member<NGOutOfFlowLayoutPart> out_of_flow_layout =
- new NGOutOfFlowLayoutPart(&Style(), builder_->Size());
- size_t candidate_positions_index = 0;
-
- for (auto& child : out_of_flow_candidates) {
- NGStaticPosition static_position =
- out_of_flow_candidate_positions[candidate_positions_index++];
-
- if (IsContainingBlockForAbsoluteChild(Style(), *child->Style())) {
- NGFragment* fragment;
- NGLogicalOffset offset;
- out_of_flow_layout->Layout(*child, static_position, &fragment, &offset);
- // TODO(atotic) Need to adjust size of overflow rect per spec.
- builder_->AddChild(fragment, offset);
- } else {
- builder_->AddOutOfFlowDescendant(child, static_position);
- }
- }
-}
-
bool NGBlockLayoutAlgorithm::ProceedToNextUnfinishedSibling(
NGPhysicalFragment* child_fragment) {
DCHECK(current_child_);

Powered by Google App Engine
This is Rietveld 408576698