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

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

Issue 2546353002: Move oof-descendants to NGPhysicalFragmentBase (Closed)
Patch Set: fix win build problem Created 4 years 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/ng/ng_physical_fragment.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.cc b/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.cc
index 2f5125638cd192326641de8ccacab12dc9d5d5cc..4875abf2d657e8c3ea17283b05958934660cf3f0 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.cc
@@ -50,22 +50,15 @@ NGFragmentBuilder& NGFragmentBuilder::AddChild(NGFragmentBase* child,
children_.append(child->PhysicalFragment());
offsets_.append(child_offset);
// Collect child's out of flow descendants.
- // TODO(atotic) All fragments can carry oof descendants.
- // Therefore, oof descendants should move from NGPhysicalFragment to
- // NGPhysicalFragmentBase
- if (child->PhysicalFragment()->Type() ==
- NGPhysicalFragmentBase::kFragmentBox) {
- const NGPhysicalFragment* physical_child =
- static_cast<const NGPhysicalFragment*>(&*child->PhysicalFragment());
- const Vector<NGStaticPosition>& oof_positions =
- physical_child->OutOfFlowPositions();
- size_t oof_index = 0;
- for (auto& oof_node : physical_child->OutOfFlowDescendants()) {
- NGStaticPosition oof_position = oof_positions[oof_index++];
- out_of_flow_descendant_candidates_.add(oof_node);
- out_of_flow_candidate_placements_.append(
- OutOfFlowPlacement{child_offset, oof_position});
- }
+ const NGPhysicalFragmentBase* physical_fragment = child->PhysicalFragment();
+ const Vector<NGStaticPosition>& oof_positions =
+ physical_fragment->OutOfFlowPositions();
+ size_t oof_index = 0;
+ for (auto& oof_node : physical_fragment->OutOfFlowDescendants()) {
+ NGStaticPosition oof_position = oof_positions[oof_index++];
+ out_of_flow_descendant_candidates_.add(oof_node);
+ out_of_flow_candidate_placements_.append(
+ OutOfFlowPlacement{child_offset, oof_position});
}
return *this;
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/ng/ng_physical_fragment.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698