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

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

Issue 2651393003: [layoutng] Propagate fixed descendants of abs. (Closed)
Patch Set: fixed1 is a reserved keyword on a mac Created 3 years, 10 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_out_of_flow_layout_part.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_out_of_flow_layout_part.cc b/third_party/WebKit/Source/core/layout/ng/ng_out_of_flow_layout_part.cc
index bb83650d9f2a3ffb2ee9232b62ddea208d08c7bb..85d2fe9f999dd0361d568190207eb9824e284c0c 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_out_of_flow_layout_part.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_out_of_flow_layout_part.cc
@@ -68,22 +68,30 @@ void NGOutOfFlowLayoutPart::Run() {
container_builder_->GetAndClearOutOfFlowDescendantCandidates(
&out_of_flow_candidates, &out_of_flow_candidate_positions);
- size_t position_index = 0;
+ while (out_of_flow_candidates.size() > 0) {
+ size_t position_index = 0;
- for (auto& descendant : out_of_flow_candidates) {
- NGStaticPosition static_position =
- out_of_flow_candidate_positions[position_index++];
+ for (auto& descendant : out_of_flow_candidates) {
+ NGStaticPosition static_position =
+ out_of_flow_candidate_positions[position_index++];
- if (IsContainingBlockForAbsoluteDescendant(container_style_,
- descendant->Style())) {
- NGLogicalOffset offset;
- RefPtr<NGPhysicalFragment> physical_fragment =
- LayoutDescendant(*descendant, static_position, &offset);
- // TODO(atotic) Need to adjust size of overflow rect per spec.
- container_builder_->AddChild(std::move(physical_fragment), offset);
- } else {
- container_builder_->AddOutOfFlowDescendant(descendant, static_position);
+ if (IsContainingBlockForAbsoluteDescendant(container_style_,
+ descendant->Style())) {
+ NGLogicalOffset offset;
+ RefPtr<NGPhysicalFragment> physical_fragment =
+ LayoutDescendant(*descendant, static_position, &offset);
+ // TODO(atotic) Need to adjust size of overflow rect per spec.
+ container_builder_->AddChild(std::move(physical_fragment), offset);
+ } else {
+ container_builder_->AddOutOfFlowDescendant(descendant, static_position);
+ }
}
+ // Sweep any descendants that might have been added.
+ // This happens when an absolute container has a fixed child.
+ out_of_flow_candidates.clear();
+ out_of_flow_candidate_positions.clear();
+ container_builder_->GetAndClearOutOfFlowDescendantCandidates(
+ &out_of_flow_candidates, &out_of_flow_candidate_positions);
}
}
« no previous file with comments | « third_party/WebKit/Source/core/BUILD.gn ('k') | third_party/WebKit/Source/core/layout/ng/ng_out_of_flow_layout_part_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698