| 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_physical_fragment.h" | 8 #include "core/layout/ng/ng_physical_fragment.h" |
| 9 #include "core/layout/ng/ng_units.h" | 9 #include "core/layout/ng/ng_units.h" |
| 10 | 10 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 // if (child->position == (Absolute or Fixed)) | 48 // if (child->position == (Absolute or Fixed)) |
| 49 // builder->AddOutOfFlowChildCandidate(child); | 49 // builder->AddOutOfFlowChildCandidate(child); |
| 50 // else | 50 // else |
| 51 // fragment = child->Layout() | 51 // fragment = child->Layout() |
| 52 // builder->AddChild(fragment) | 52 // builder->AddChild(fragment) |
| 53 // end | 53 // end |
| 54 // | 54 // |
| 55 // Part 2: layout algorithm positions out-of-flow descendants. | 55 // Part 2: layout algorithm positions out-of-flow descendants. |
| 56 // | 56 // |
| 57 // builder->SetInlineSize/SetBlockSize | 57 // builder->SetInlineSize/SetBlockSize |
| 58 // builder->GetAndClearOutOfFlowDescendantCandidates(oof_candidates) | 58 // builder->GetAndClearOutOfFlowDescendantCandidates(oof_candidates); |
| 59 // NGOutOfFlowLayoutPart out_of_flow_layout(container_style, | 59 // NGOutOfFlowLayoutPart out_of_flow_layout(container_style, |
| 60 // builder->Size()); | 60 // builder->Size()); |
| 61 // while (oof_candidates.size() > 0) | 61 // while (oof_candidates.size() > 0) |
| 62 // { | 62 // { |
| 63 // candidate = oof_candidates.shift() | 63 // candidate = oof_candidates.shift(); |
| 64 // if (out_of_flow_layout.StartLayout(candidate)) | 64 // if (IsContainingBlockForAbsoluteChild(style, candidate_style)) { |
| 65 // NGFragmentBase* fragment; | 65 // NGFragmentBase* fragment; |
| 66 // NGLogicalOffset* fragment_offset; | 66 // NGLogicalOffset* fragment_offset; |
| 67 // while (out_of_flow_layout.Layout(&fragment, &fragment_offset) == | 67 // out_of_flow_layout.Layout(candidate, &fragment, &offset); |
| 68 // kNotFinished) | |
| 69 // ; | |
| 70 // builder->AddChild(fragment); | 68 // builder->AddChild(fragment); |
| 71 // builder->GetAndClearOutOfFlowDescendantCandidates(child_oof_candidates) | 69 // builder->GetAndClearOutOfFlowDescendantCandidates(child_oof_candidates)
; |
| 72 // oof_candidates.prepend(child_oof_candidates) | 70 // oof_candidates.prepend(child_oof_candidates); |
| 73 // else | 71 // } else { |
| 74 // builder->AddOutOfFlowDescendant(); | 72 // builder->AddOutOfFlowDescendant(); |
| 73 // } |
| 75 // } | 74 // } |
| 76 NGFragmentBuilder& AddOutOfFlowChildCandidate(NGBlockNode*, NGLogicalOffset); | 75 NGFragmentBuilder& AddOutOfFlowChildCandidate(NGBlockNode*, NGLogicalOffset); |
| 77 | 76 |
| 78 void GetAndClearOutOfFlowDescendantCandidates(WeakBoxList*, | 77 void GetAndClearOutOfFlowDescendantCandidates(WeakBoxList*, |
| 79 Vector<NGStaticPosition>*); | 78 Vector<NGStaticPosition>*); |
| 80 | 79 |
| 81 NGFragmentBuilder& AddOutOfFlowDescendant(NGBlockNode*, | 80 NGFragmentBuilder& AddOutOfFlowDescendant(NGBlockNode*, |
| 82 const NGStaticPosition&); | 81 const NGStaticPosition&); |
| 83 | 82 |
| 84 void SetBreakToken(NGBreakToken* token) { | 83 void SetBreakToken(NGBreakToken* token) { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 137 |
| 139 WeakBoxList out_of_flow_descendants_; | 138 WeakBoxList out_of_flow_descendants_; |
| 140 Vector<NGStaticPosition> out_of_flow_positions_; | 139 Vector<NGStaticPosition> out_of_flow_positions_; |
| 141 | 140 |
| 142 Member<NGBreakToken> break_token_; | 141 Member<NGBreakToken> break_token_; |
| 143 }; | 142 }; |
| 144 | 143 |
| 145 } // namespace blink | 144 } // namespace blink |
| 146 | 145 |
| 147 #endif // NGFragmentBuilder | 146 #endif // NGFragmentBuilder |
| OLD | NEW |