| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NGFragmentBuilder_h | 5 #ifndef NGFragmentBuilder_h |
| 6 #define NGFragmentBuilder_h | 6 #define NGFragmentBuilder_h |
| 7 | 7 |
| 8 #include "core/layout/ng/ng_constraint_space.h" | 8 #include "core/layout/ng/ng_constraint_space.h" |
| 9 #include "core/layout/ng/ng_floating_object.h" | 9 #include "core/layout/ng/ng_floating_object.h" |
| 10 #include "core/layout/ng/ng_physical_fragment.h" | 10 #include "core/layout/ng/ng_physical_fragment.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 // are stored inside builder. | 49 // are stored inside builder. |
| 50 // | 50 // |
| 51 // for (child : children) | 51 // for (child : children) |
| 52 // if (child->position == (Absolute or Fixed)) | 52 // if (child->position == (Absolute or Fixed)) |
| 53 // builder->AddOutOfFlowChildCandidate(child); | 53 // builder->AddOutOfFlowChildCandidate(child); |
| 54 // else | 54 // else |
| 55 // fragment = child->Layout() | 55 // fragment = child->Layout() |
| 56 // builder->AddChild(fragment) | 56 // builder->AddChild(fragment) |
| 57 // end | 57 // end |
| 58 // | 58 // |
| 59 // Part 2: layout algorithm positions out-of-flow descendants. | 59 // builder->SetInlineSize/SetBlockSize |
| 60 // | 60 // |
| 61 // builder->SetInlineSize/SetBlockSize | 61 // Part 2: Out-of-flow layout part positions out-of-flow descendants. |
| 62 // builder->GetAndClearOutOfFlowDescendantCandidates(oof_candidates); | 62 // |
| 63 // NGOutOfFlowLayoutPart out_of_flow_layout(container_style, | 63 // NGOutOfFlowLayoutPart(container_style, builder).Run(); |
| 64 // builder->Size()); | 64 // |
| 65 // while (oof_candidates.size() > 0) | 65 // See layout part for builder interaction. |
| 66 // { | |
| 67 // candidate = oof_candidates.shift(); | |
| 68 // if (IsContainingBlockForAbsoluteChild(style, candidate_style)) { | |
| 69 // NGFragmentBase* fragment; | |
| 70 // NGLogicalOffset* fragment_offset; | |
| 71 // out_of_flow_layout.Layout(candidate, &fragment, &offset); | |
| 72 // builder->AddChild(fragment); | |
| 73 // builder->GetAndClearOutOfFlowDescendantCandidates(child_oof_candidates)
; | |
| 74 // oof_candidates.prepend(child_oof_candidates); | |
| 75 // } else { | |
| 76 // builder->AddOutOfFlowDescendant(); | |
| 77 // } | |
| 78 // } | |
| 79 NGFragmentBuilder& AddOutOfFlowChildCandidate(NGBlockNode*, NGLogicalOffset); | 66 NGFragmentBuilder& AddOutOfFlowChildCandidate(NGBlockNode*, NGLogicalOffset); |
| 80 | 67 |
| 81 void GetAndClearOutOfFlowDescendantCandidates(WeakBoxList*, | 68 void GetAndClearOutOfFlowDescendantCandidates(WeakBoxList*, |
| 82 Vector<NGStaticPosition>*); | 69 Vector<NGStaticPosition>*); |
| 83 | 70 |
| 84 NGFragmentBuilder& AddOutOfFlowDescendant(NGBlockNode*, | 71 NGFragmentBuilder& AddOutOfFlowDescendant(NGBlockNode*, |
| 85 const NGStaticPosition&); | 72 const NGStaticPosition&); |
| 86 | 73 |
| 87 NGFragmentBuilder& AddUnpositionedFloat(NGFloatingObject* floating_object); | 74 NGFragmentBuilder& AddUnpositionedFloat(NGFloatingObject* floating_object); |
| 88 | 75 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 | 146 |
| 160 Vector<NGLogicalOffset> floating_object_offsets_; | 147 Vector<NGLogicalOffset> floating_object_offsets_; |
| 161 HeapVector<Member<NGFloatingObject>> positioned_floats_; | 148 HeapVector<Member<NGFloatingObject>> positioned_floats_; |
| 162 | 149 |
| 163 Member<NGBreakToken> break_token_; | 150 Member<NGBreakToken> break_token_; |
| 164 }; | 151 }; |
| 165 | 152 |
| 166 } // namespace blink | 153 } // namespace blink |
| 167 | 154 |
| 168 #endif // NGFragmentBuilder | 155 #endif // NGFragmentBuilder |
| OLD | NEW |