| 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 cdbda4f8f9b31aa7af56a8caea097b953d76ea57..43833329da81e92f5875af82d786cfc168944485 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,28 @@ void NGOutOfFlowLayoutPart::Run() {
|
| container_builder_->GetAndClearOutOfFlowDescendantCandidates(
|
| &out_of_flow_candidates, &out_of_flow_candidate_positions);
|
|
|
| - size_t position_index = 0;
|
| -
|
| - 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;
|
| - NGFragment* fragment =
|
| - LayoutDescendant(*descendant, static_position, &offset);
|
| - // TODO(atotic) Need to adjust size of overflow rect per spec.
|
| - container_builder_->AddChild(fragment, offset);
|
| - } else {
|
| - container_builder_->AddOutOfFlowDescendant(descendant, static_position);
|
| + 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++];
|
| + if (IsContainingBlockForAbsoluteDescendant(container_style_,
|
| + *descendant->Style())) {
|
| + NGLogicalOffset offset;
|
| + NGFragment* fragment =
|
| + LayoutDescendant(*descendant, static_position, &offset);
|
| + // TODO(atotic) Need to adjust size of overflow rect per spec.
|
| + container_builder_->AddChild(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);
|
| }
|
| }
|
|
|
|
|