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 NGLineBuilder_h | 5 #ifndef NGLineBuilder_h |
6 #define NGLineBuilder_h | 6 #define NGLineBuilder_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "core/layout/ng/geometry/ng_logical_offset.h" | 9 #include "core/layout/ng/geometry/ng_logical_offset.h" |
| 10 #include "core/layout/ng/ng_fragment_builder.h" |
10 #include "core/layout/ng/ng_layout_opportunity_iterator.h" | 11 #include "core/layout/ng/ng_layout_opportunity_iterator.h" |
11 #include "core/layout/ng/ng_physical_fragment.h" | 12 #include "core/layout/ng/ng_physical_fragment.h" |
12 #include "platform/fonts/FontBaseline.h" | 13 #include "platform/fonts/FontBaseline.h" |
13 #include "platform/heap/Handle.h" | 14 #include "platform/heap/Handle.h" |
14 #include "wtf/Vector.h" | 15 #include "wtf/Vector.h" |
15 | 16 |
16 namespace blink { | 17 namespace blink { |
17 | 18 |
18 class ComputedStyle; | 19 class ComputedStyle; |
19 class FontMetrics; | 20 class FontMetrics; |
20 class NGConstraintSpace; | 21 class NGConstraintSpace; |
21 class NGFragmentBuilder; | |
22 class NGInlineNode; | 22 class NGInlineNode; |
23 class NGLayoutInlineItem; | 23 class NGLayoutInlineItem; |
24 | 24 |
25 // NGLineBuilder creates the fragment tree for a line. | 25 // NGLineBuilder creates the fragment tree for a line. |
26 // NGLineBuilder manages the current line as a range, |start| and |end|. | 26 // NGLineBuilder manages the current line as a range, |start| and |end|. |
27 // |end| can be extended multiple times before creating a line, usually until | 27 // |end| can be extended multiple times before creating a line, usually until |
28 // |!CanFitOnLine()|. | 28 // |!CanFitOnLine()|. |
29 // |SetBreakOpportunity| can mark the last confirmed offset that can fit. | 29 // |SetBreakOpportunity| can mark the last confirmed offset that can fit. |
30 class CORE_EXPORT NGLineBuilder final { | 30 class CORE_EXPORT NGLineBuilder final { |
31 STACK_ALLOCATED(); | 31 STACK_ALLOCATED(); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 void AccumulateUsedFonts(const NGLayoutInlineItem&, | 136 void AccumulateUsedFonts(const NGLayoutInlineItem&, |
137 const LineItemChunk&, | 137 const LineItemChunk&, |
138 LineBoxData*); | 138 LineBoxData*); |
139 | 139 |
140 // Finds the next layout opportunity for the next text fragment. | 140 // Finds the next layout opportunity for the next text fragment. |
141 void FindNextLayoutOpportunity(); | 141 void FindNextLayoutOpportunity(); |
142 | 142 |
143 Persistent<NGInlineNode> inline_box_; | 143 Persistent<NGInlineNode> inline_box_; |
144 NGConstraintSpace* constraint_space_; // Not owned as STACK_ALLOCATED. | 144 NGConstraintSpace* constraint_space_; // Not owned as STACK_ALLOCATED. |
145 NGFragmentBuilder* containing_block_builder_; | 145 NGFragmentBuilder* containing_block_builder_; |
146 Vector<RefPtr<NGPhysicalFragment>, 32> fragments_; | |
147 Vector<NGLogicalOffset, 32> offsets_; | |
148 Vector<LineBoxData, 32> line_box_data_list_; | 146 Vector<LineBoxData, 32> line_box_data_list_; |
149 unsigned start_index_ = 0; | 147 unsigned start_index_ = 0; |
150 unsigned start_offset_ = 0; | 148 unsigned start_offset_ = 0; |
151 unsigned last_index_ = 0; | 149 unsigned last_index_ = 0; |
152 unsigned end_offset_ = 0; | 150 unsigned end_offset_ = 0; |
153 unsigned last_break_opportunity_index_ = 0; | 151 unsigned last_break_opportunity_index_ = 0; |
154 unsigned last_break_opportunity_offset_ = 0; | 152 unsigned last_break_opportunity_offset_ = 0; |
155 LayoutUnit end_position_; | 153 LayoutUnit end_position_; |
156 LayoutUnit last_break_opportunity_position_; | 154 LayoutUnit last_break_opportunity_position_; |
157 LayoutUnit content_size_; | 155 LayoutUnit content_size_; |
158 LayoutUnit max_inline_size_; | 156 LayoutUnit max_inline_size_; |
159 FontBaseline baseline_type_; | 157 FontBaseline baseline_type_; |
| 158 NGFragmentBuilder container_builder_; |
| 159 RefPtr<NGLayoutResult> container_layout_result_; |
160 | 160 |
161 NGLogicalOffset bfc_offset_; | 161 NGLogicalOffset bfc_offset_; |
162 NGLogicalRect current_opportunity_; | 162 NGLogicalRect current_opportunity_; |
163 | 163 |
164 #if DCHECK_IS_ON() | 164 #if DCHECK_IS_ON() |
165 unsigned is_bidi_reordered_ : 1; | 165 unsigned is_bidi_reordered_ : 1; |
166 #endif | 166 #endif |
167 }; | 167 }; |
168 | 168 |
169 } // namespace blink | 169 } // namespace blink |
170 | 170 |
171 #endif // NGLineBuilder_h | 171 #endif // NGLineBuilder_h |
OLD | NEW |