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

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

Issue 2752123002: [LayoutNG] Move NGFloatingObject off Oilpan (Closed)
Patch Set: fix comments Created 3 years, 9 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/ng_break_token.h" 8 #include "core/layout/ng/ng_break_token.h"
9 #include "core/layout/ng/ng_constraint_space.h" 9 #include "core/layout/ng/ng_constraint_space.h"
10 #include "core/layout/ng/ng_floating_object.h" 10 #include "core/layout/ng/ng_floating_object.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& SetInlineOverflow(LayoutUnit); 34 NGFragmentBuilder& SetInlineOverflow(LayoutUnit);
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(NGFloatingObject*, 41 NGFragmentBuilder& AddFloatingObject(RefPtr<NGFloatingObject>,
42 const NGLogicalOffset&); 42 const NGLogicalOffset&);
43 43
44 NGFragmentBuilder& SetBfcOffset(const NGLogicalOffset& offset); 44 NGFragmentBuilder& SetBfcOffset(const NGLogicalOffset& offset);
45 45
46 NGFragmentBuilder& AddUnpositionedFloat(NGFloatingObject* floating_object); 46 NGFragmentBuilder& AddUnpositionedFloat(NGFloatingObject* floating_object);
47 47
48 // Builder has non-trivial out-of-flow descendant methods. 48 // Builder has non-trivial out-of-flow descendant methods.
49 // These methods are building blocks for implementation of 49 // These methods are building blocks for implementation of
50 // out-of-flow descendants by layout algorithms. 50 // out-of-flow descendants by layout algorithms.
51 // 51 //
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 // Offsets are not supposed to be set during fragment construction, so we 96 // Offsets are not supposed to be set during fragment construction, so we
97 // do not provide a setter here. 97 // do not provide a setter here.
98 98
99 // Creates the fragment. Can only be called once. 99 // Creates the fragment. Can only be called once.
100 RefPtr<NGLayoutResult> ToBoxFragment(); 100 RefPtr<NGLayoutResult> ToBoxFragment();
101 RefPtr<NGPhysicalTextFragment> ToTextFragment(unsigned index, 101 RefPtr<NGPhysicalTextFragment> ToTextFragment(unsigned index,
102 unsigned start_offset, 102 unsigned start_offset,
103 unsigned end_offset); 103 unsigned end_offset);
104 104
105 // Mutable list of floats that need to be positioned. 105 // Mutable list of floats that need to be positioned.
106 Vector<Persistent<NGFloatingObject>>& MutableUnpositionedFloats() { 106 Vector<RefPtr<NGFloatingObject>>& MutableUnpositionedFloats() {
107 return unpositioned_floats_; 107 return unpositioned_floats_;
108 } 108 }
109 109
110 // List of floats that need to be positioned. 110 // List of floats that need to be positioned.
111 const Vector<Persistent<NGFloatingObject>>& UnpositionedFloats() const { 111 const Vector<RefPtr<NGFloatingObject>>& UnpositionedFloats() const {
112 return unpositioned_floats_; 112 return unpositioned_floats_;
113 } 113 }
114 114
115 const WTF::Optional<NGLogicalOffset>& BfcOffset() const { 115 const WTF::Optional<NGLogicalOffset>& BfcOffset() const {
116 return bfc_offset_; 116 return bfc_offset_;
117 } 117 }
118 118
119 bool DidBreak() const { return did_break_; } 119 bool DidBreak() const { return did_break_; }
120 120
121 private: 121 private:
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 Vector<RefPtr<NGBreakToken>> child_break_tokens_; 155 Vector<RefPtr<NGBreakToken>> child_break_tokens_;
156 156
157 WeakBoxList out_of_flow_descendant_candidates_; 157 WeakBoxList out_of_flow_descendant_candidates_;
158 Vector<OutOfFlowPlacement> out_of_flow_candidate_placements_; 158 Vector<OutOfFlowPlacement> out_of_flow_candidate_placements_;
159 159
160 WeakBoxList out_of_flow_descendants_; 160 WeakBoxList out_of_flow_descendants_;
161 Vector<NGStaticPosition> out_of_flow_positions_; 161 Vector<NGStaticPosition> out_of_flow_positions_;
162 162
163 // Floats that need to be positioned by the next in-flow fragment that can 163 // Floats that need to be positioned by the next in-flow fragment that can
164 // determine its block position in space. 164 // determine its block position in space.
165 Vector<Persistent<NGFloatingObject>> unpositioned_floats_; 165 Vector<RefPtr<NGFloatingObject>> unpositioned_floats_;
166 166
167 Vector<NGLogicalOffset> floating_object_offsets_; 167 Vector<NGLogicalOffset> floating_object_offsets_;
168 Vector<Persistent<NGFloatingObject>> positioned_floats_; 168 Vector<RefPtr<NGFloatingObject>> positioned_floats_;
169 169
170 WTF::Optional<NGLogicalOffset> bfc_offset_; 170 WTF::Optional<NGLogicalOffset> bfc_offset_;
171 NGMarginStrut end_margin_strut_; 171 NGMarginStrut end_margin_strut_;
172 }; 172 };
173 173
174 } // namespace blink 174 } // namespace blink
175 175
176 #endif // NGFragmentBuilder 176 #endif // NGFragmentBuilder
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698