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

Side by Side Diff: third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.h

Issue 2816933003: Use Layout Opportunity Iterator to position new FC blocks. (Closed)
Patch Set: fix block-formatting-contexts-{005|007} Created 3 years, 8 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 unified diff | Download patch
OLDNEW
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/inline/ng_physical_text_fragment.h" 8 #include "core/layout/ng/inline/ng_physical_text_fragment.h"
9 #include "core/layout/ng/ng_break_token.h" 9 #include "core/layout/ng/ng_break_token.h"
10 #include "core/layout/ng/ng_constraint_space.h" 10 #include "core/layout/ng/ng_constraint_space.h"
(...skipping 20 matching lines...) Expand all
31 NGFragmentBuilder& SetBlockSize(LayoutUnit); 31 NGFragmentBuilder& SetBlockSize(LayoutUnit);
32 NGLogicalSize Size() const { return size_; } 32 NGLogicalSize Size() const { return size_; }
33 33
34 NGFragmentBuilder& SetOverflowSize(const NGLogicalSize&); 34 NGFragmentBuilder& SetOverflowSize(const NGLogicalSize&);
35 NGFragmentBuilder& SetBlockOverflow(LayoutUnit); 35 NGFragmentBuilder& SetBlockOverflow(LayoutUnit);
36 36
37 NGFragmentBuilder& AddChild(RefPtr<NGLayoutResult>, const NGLogicalOffset&); 37 NGFragmentBuilder& AddChild(RefPtr<NGLayoutResult>, const NGLogicalOffset&);
38 NGFragmentBuilder& AddChild(RefPtr<NGPhysicalFragment>, 38 NGFragmentBuilder& AddChild(RefPtr<NGPhysicalFragment>,
39 const NGLogicalOffset&); 39 const NGLogicalOffset&);
40 40
41 NGFragmentBuilder& AddFloatingObject(RefPtr<NGFloatingObject>,
42 const NGLogicalOffset&);
43
44 NGFragmentBuilder& SetBfcOffset(const NGLogicalOffset& offset); 41 NGFragmentBuilder& SetBfcOffset(const NGLogicalOffset& offset);
45 42
46 NGFragmentBuilder& AddUnpositionedFloat( 43 NGFragmentBuilder& AddUnpositionedFloat(
47 RefPtr<NGFloatingObject> floating_object); 44 RefPtr<NGFloatingObject> floating_object);
48 45
49 // Builder has non-trivial out-of-flow descendant methods. 46 // Builder has non-trivial out-of-flow descendant methods.
50 // These methods are building blocks for implementation of 47 // These methods are building blocks for implementation of
51 // out-of-flow descendants by layout algorithms. 48 // out-of-flow descendants by layout algorithms.
52 // 49 //
53 // They are intended to be used by layout algorithm like this: 50 // They are intended to be used by layout algorithm like this:
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 // Mutable list of floats that need to be positioned. 104 // Mutable list of floats that need to be positioned.
108 Vector<RefPtr<NGFloatingObject>>& MutableUnpositionedFloats() { 105 Vector<RefPtr<NGFloatingObject>>& MutableUnpositionedFloats() {
109 return unpositioned_floats_; 106 return unpositioned_floats_;
110 } 107 }
111 108
112 // List of floats that need to be positioned. 109 // List of floats that need to be positioned.
113 const Vector<RefPtr<NGFloatingObject>>& UnpositionedFloats() const { 110 const Vector<RefPtr<NGFloatingObject>>& UnpositionedFloats() const {
114 return unpositioned_floats_; 111 return unpositioned_floats_;
115 } 112 }
116 113
114 // Mutable list of positioned floats, i.e. floats with logical_offset set.
115 Vector<RefPtr<NGFloatingObject>>& MutablePositionedFloats() {
116 return positioned_floats_;
117 }
118
117 const WTF::Optional<NGLogicalOffset>& BfcOffset() const { 119 const WTF::Optional<NGLogicalOffset>& BfcOffset() const {
118 return bfc_offset_; 120 return bfc_offset_;
119 } 121 }
120 122
121 const Vector<RefPtr<NGPhysicalFragment>>& Children() const { 123 const Vector<RefPtr<NGPhysicalFragment>>& Children() const {
122 return children_; 124 return children_;
123 } 125 }
124 126
125 bool DidBreak() const { return did_break_; } 127 bool DidBreak() const { return did_break_; }
126 128
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 WeakBoxList out_of_flow_descendant_candidates_; 166 WeakBoxList out_of_flow_descendant_candidates_;
165 Vector<OutOfFlowPlacement> out_of_flow_candidate_placements_; 167 Vector<OutOfFlowPlacement> out_of_flow_candidate_placements_;
166 168
167 WeakBoxList out_of_flow_descendants_; 169 WeakBoxList out_of_flow_descendants_;
168 Vector<NGStaticPosition> out_of_flow_positions_; 170 Vector<NGStaticPosition> out_of_flow_positions_;
169 171
170 // Floats that need to be positioned by the next in-flow fragment that can 172 // Floats that need to be positioned by the next in-flow fragment that can
171 // determine its block position in space. 173 // determine its block position in space.
172 Vector<RefPtr<NGFloatingObject>> unpositioned_floats_; 174 Vector<RefPtr<NGFloatingObject>> unpositioned_floats_;
173 175
174 Vector<NGLogicalOffset> floating_object_offsets_;
175 Vector<RefPtr<NGFloatingObject>> positioned_floats_; 176 Vector<RefPtr<NGFloatingObject>> positioned_floats_;
176 177
177 WTF::Optional<NGLogicalOffset> bfc_offset_; 178 WTF::Optional<NGLogicalOffset> bfc_offset_;
178 NGMarginStrut end_margin_strut_; 179 NGMarginStrut end_margin_strut_;
179 }; 180 };
180 181
181 } // namespace blink 182 } // namespace blink
182 183
183 #endif // NGFragmentBuilder 184 #endif // NGFragmentBuilder
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698