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_box_state.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 class NGTextFragmentBuilder; | 28 class NGTextFragmentBuilder; |
29 | 29 |
30 // A class for inline layout (e.g. a <span> with no special style). | 30 // A class for inline layout (e.g. a <span> with no special style). |
31 // | 31 // |
32 // This class determines the position of NGInlineItem and build line boxes. | 32 // This class determines the position of NGInlineItem and build line boxes. |
33 // | 33 // |
34 // Uses NGLineBreaker to find NGInlineItems to form a line. | 34 // Uses NGLineBreaker to find NGInlineItems to form a line. |
35 class CORE_EXPORT NGInlineLayoutAlgorithm final | 35 class CORE_EXPORT NGInlineLayoutAlgorithm final |
36 : public NGLayoutAlgorithm<NGInlineNode, NGInlineBreakToken> { | 36 : public NGLayoutAlgorithm<NGInlineNode, NGInlineBreakToken> { |
37 public: | 37 public: |
38 NGInlineLayoutAlgorithm(NGInlineNode*, | 38 NGInlineLayoutAlgorithm(NGInlineNode, |
39 NGConstraintSpace*, | 39 NGConstraintSpace*, |
40 NGInlineBreakToken* = nullptr); | 40 NGInlineBreakToken* = nullptr); |
41 | 41 |
42 // The available width for the current line. | 42 // The available width for the current line. |
43 LayoutUnit AvailableWidth() const; | 43 LayoutUnit AvailableWidth() const; |
44 | 44 |
45 // Create a line. | 45 // Create a line. |
46 // @return false if the line does not fit in the constraint space in block | 46 // @return false if the line does not fit in the constraint space in block |
47 // direction. | 47 // direction. |
48 bool CreateLine(NGInlineItemResults*, RefPtr<NGInlineBreakToken> = nullptr); | 48 bool CreateLine(NGInlineItemResults*, RefPtr<NGInlineBreakToken> = nullptr); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 unsigned is_horizontal_writing_mode_ : 1; | 93 unsigned is_horizontal_writing_mode_ : 1; |
94 unsigned disallow_first_line_rules_ : 1; | 94 unsigned disallow_first_line_rules_ : 1; |
95 | 95 |
96 NGConstraintSpaceBuilder space_builder_; | 96 NGConstraintSpaceBuilder space_builder_; |
97 NGBoxStrut border_and_padding_; | 97 NGBoxStrut border_and_padding_; |
98 }; | 98 }; |
99 | 99 |
100 } // namespace blink | 100 } // namespace blink |
101 | 101 |
102 #endif // NGInlineLayoutAlgorithm_h | 102 #endif // NGInlineLayoutAlgorithm_h |
OLD | NEW |