Chromium Code Reviews| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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*, |
| 138 NGTextFragmentBuilder*); | 139 NGTextFragmentBuilder*); |
| 139 | 140 |
| 141 NGInlineBoxState* OnBeginPlaceItems(); | |
|
ikilpatrick
2017/04/18 01:04:37
Oh, sorry, does it make sense to move, OnBeginPlac
| |
| 142 NGInlineBoxState* OnOpenTag(const NGLayoutInlineItem&, | |
| 143 NGLineBoxFragmentBuilder*, | |
| 144 NGTextFragmentBuilder*); | |
| 145 NGInlineBoxState* OnCloseTag(const NGLayoutInlineItem&, | |
| 146 NGLineBoxFragmentBuilder*, | |
| 147 NGInlineBoxState*); | |
| 148 void OnEndPlaceItems(NGLineBoxFragmentBuilder*); | |
| 149 void EndBoxState(NGInlineBoxState*, NGLineBoxFragmentBuilder*); | |
| 150 void ApplyBaselineShift(NGInlineBoxState*, NGLineBoxFragmentBuilder*); | |
| 151 | |
| 140 // Finds the next layout opportunity for the next text fragment. | 152 // Finds the next layout opportunity for the next text fragment. |
| 141 void FindNextLayoutOpportunity(); | 153 void FindNextLayoutOpportunity(); |
| 142 | 154 |
| 143 Vector<RefPtr<NGLayoutResult>, 32> layout_results_; | 155 Vector<RefPtr<NGLayoutResult>, 32> layout_results_; |
| 156 NGInlineLayoutStateStack box_states_; | |
| 144 unsigned start_index_ = 0; | 157 unsigned start_index_ = 0; |
| 145 unsigned start_offset_ = 0; | 158 unsigned start_offset_ = 0; |
| 146 unsigned last_index_ = 0; | 159 unsigned last_index_ = 0; |
| 147 unsigned end_offset_ = 0; | 160 unsigned end_offset_ = 0; |
| 148 unsigned last_break_opportunity_index_ = 0; | 161 unsigned last_break_opportunity_index_ = 0; |
| 149 unsigned last_break_opportunity_offset_ = 0; | 162 unsigned last_break_opportunity_offset_ = 0; |
| 150 LayoutUnit end_position_; | 163 LayoutUnit end_position_; |
| 151 LayoutUnit last_break_opportunity_position_; | 164 LayoutUnit last_break_opportunity_position_; |
| 152 LayoutUnit content_size_; | 165 LayoutUnit content_size_; |
| 153 LayoutUnit max_inline_size_; | 166 LayoutUnit max_inline_size_; |
| 154 FontBaseline baseline_type_ = FontBaseline::kAlphabeticBaseline; | 167 FontBaseline baseline_type_ = FontBaseline::kAlphabeticBaseline; |
| 155 | 168 |
| 156 NGLogicalOffset bfc_offset_; | 169 NGLogicalOffset bfc_offset_; |
| 157 NGLogicalRect current_opportunity_; | 170 NGLogicalRect current_opportunity_; |
| 158 | 171 |
| 159 unsigned is_horizontal_writing_mode_ : 1; | 172 unsigned is_horizontal_writing_mode_ : 1; |
| 160 unsigned disallow_first_line_rules_ : 1; | 173 unsigned disallow_first_line_rules_ : 1; |
| 161 | 174 |
| 162 NGConstraintSpaceBuilder space_builder_; | 175 NGConstraintSpaceBuilder space_builder_; |
| 163 #if DCHECK_IS_ON() | 176 #if DCHECK_IS_ON() |
| 164 unsigned is_bidi_reordered_ : 1; | 177 unsigned is_bidi_reordered_ : 1; |
| 165 #endif | 178 #endif |
| 166 }; | 179 }; |
| 167 | 180 |
| 168 } // namespace blink | 181 } // namespace blink |
| 169 | 182 |
| 170 #endif // NGInlineLayoutAlgorithm_h | 183 #endif // NGInlineLayoutAlgorithm_h |
| OLD | NEW |