| 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 NGInlineLayoutAlgorithm_h | 5 #ifndef NGInlineLayoutAlgorithm_h |
| 6 #define NGInlineLayoutAlgorithm_h | 6 #define NGInlineLayoutAlgorithm_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/inline/ng_inline_box_state.h" |
| 10 #include "core/layout/ng/inline/ng_inline_break_token.h" | 11 #include "core/layout/ng/inline/ng_inline_break_token.h" |
| 11 #include "core/layout/ng/inline/ng_line_height_metrics.h" | 12 #include "core/layout/ng/inline/ng_line_height_metrics.h" |
| 12 #include "core/layout/ng/ng_constraint_space_builder.h" | 13 #include "core/layout/ng/ng_constraint_space_builder.h" |
| 13 #include "core/layout/ng/ng_fragment_builder.h" | 14 #include "core/layout/ng/ng_fragment_builder.h" |
| 14 #include "core/layout/ng/ng_layout_algorithm.h" | 15 #include "core/layout/ng/ng_layout_algorithm.h" |
| 15 #include "platform/fonts/FontBaseline.h" | 16 #include "platform/fonts/FontBaseline.h" |
| 16 #include "platform/heap/Handle.h" | 17 #include "platform/heap/Handle.h" |
| 17 #include "platform/wtf/Vector.h" | 18 #include "platform/wtf/Vector.h" |
| 18 | 19 |
| 19 namespace blink { | 20 namespace blink { |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 // - if it's too wide then we add the float to the unpositioned list so it can | 129 // - if it's too wide then we add the float to the unpositioned list so it can |
| 129 // be positioned after we're done with the current line. | 130 // be positioned after we're done with the current line. |
| 130 void LayoutAndPositionFloat(LayoutUnit end_position, LayoutObject*); | 131 void LayoutAndPositionFloat(LayoutUnit end_position, LayoutObject*); |
| 131 | 132 |
| 132 bool PlaceItems(const Vector<LineItemChunk, 32>&); | 133 bool PlaceItems(const Vector<LineItemChunk, 32>&); |
| 133 void AccumulateUsedFonts(const NGLayoutInlineItem&, | 134 void AccumulateUsedFonts(const NGLayoutInlineItem&, |
| 134 const LineItemChunk&, | 135 const LineItemChunk&, |
| 135 NGLineBoxFragmentBuilder*); | 136 NGLineBoxFragmentBuilder*); |
| 136 LayoutUnit PlaceAtomicInline(const NGLayoutInlineItem&, | 137 LayoutUnit PlaceAtomicInline(const NGLayoutInlineItem&, |
| 137 NGLineBoxFragmentBuilder*, | 138 NGLineBoxFragmentBuilder*, |
| 139 NGInlineBoxState*, |
| 138 NGTextFragmentBuilder*); | 140 NGTextFragmentBuilder*); |
| 139 | 141 |
| 140 // Finds the next layout opportunity for the next text fragment. | 142 // Finds the next layout opportunity for the next text fragment. |
| 141 void FindNextLayoutOpportunity(); | 143 void FindNextLayoutOpportunity(); |
| 142 | 144 |
| 143 Vector<RefPtr<NGLayoutResult>, 32> layout_results_; | 145 Vector<RefPtr<NGLayoutResult>, 32> layout_results_; |
| 146 NGInlineLayoutStateStack box_states_; |
| 144 unsigned start_index_ = 0; | 147 unsigned start_index_ = 0; |
| 145 unsigned start_offset_ = 0; | 148 unsigned start_offset_ = 0; |
| 146 unsigned last_index_ = 0; | 149 unsigned last_index_ = 0; |
| 147 unsigned end_offset_ = 0; | 150 unsigned end_offset_ = 0; |
| 148 unsigned last_break_opportunity_index_ = 0; | 151 unsigned last_break_opportunity_index_ = 0; |
| 149 unsigned last_break_opportunity_offset_ = 0; | 152 unsigned last_break_opportunity_offset_ = 0; |
| 150 LayoutUnit end_position_; | 153 LayoutUnit end_position_; |
| 151 LayoutUnit last_break_opportunity_position_; | 154 LayoutUnit last_break_opportunity_position_; |
| 152 LayoutUnit content_size_; | 155 LayoutUnit content_size_; |
| 153 LayoutUnit max_inline_size_; | 156 LayoutUnit max_inline_size_; |
| 154 FontBaseline baseline_type_ = FontBaseline::kAlphabeticBaseline; | 157 FontBaseline baseline_type_ = FontBaseline::kAlphabeticBaseline; |
| 155 | 158 |
| 156 NGLogicalOffset bfc_offset_; | 159 NGLogicalOffset bfc_offset_; |
| 157 NGLogicalRect current_opportunity_; | 160 NGLogicalRect current_opportunity_; |
| 158 | 161 |
| 159 unsigned is_horizontal_writing_mode_ : 1; | 162 unsigned is_horizontal_writing_mode_ : 1; |
| 160 unsigned disallow_first_line_rules_ : 1; | 163 unsigned disallow_first_line_rules_ : 1; |
| 161 | 164 |
| 162 NGConstraintSpaceBuilder space_builder_; | 165 NGConstraintSpaceBuilder space_builder_; |
| 163 #if DCHECK_IS_ON() | 166 #if DCHECK_IS_ON() |
| 164 unsigned is_bidi_reordered_ : 1; | 167 unsigned is_bidi_reordered_ : 1; |
| 165 #endif | 168 #endif |
| 166 }; | 169 }; |
| 167 | 170 |
| 168 } // namespace blink | 171 } // namespace blink |
| 169 | 172 |
| 170 #endif // NGInlineLayoutAlgorithm_h | 173 #endif // NGInlineLayoutAlgorithm_h |
| OLD | NEW |