OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 NGInlineItem_h | 5 #ifndef NGInlineItem_h |
6 #define NGInlineItem_h | 6 #define NGInlineItem_h |
7 | 7 |
8 #include "platform/LayoutUnit.h" | 8 #include "platform/LayoutUnit.h" |
9 #include "platform/fonts/FontFallbackPriority.h" | 9 #include "platform/fonts/FontFallbackPriority.h" |
10 #include "platform/fonts/SimpleFontData.h" | 10 #include "platform/fonts/SimpleFontData.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 const char* NGInlineItemTypeToString(int val) const; | 68 const char* NGInlineItemTypeToString(int val) const; |
69 | 69 |
70 const ShapeResult* TextShapeResult() const { return shape_result_.Get(); } | 70 const ShapeResult* TextShapeResult() const { return shape_result_.Get(); } |
71 NGLayoutInlineShapeOptions ShapeOptions() const { | 71 NGLayoutInlineShapeOptions ShapeOptions() const { |
72 return static_cast<NGLayoutInlineShapeOptions>(shape_options_); | 72 return static_cast<NGLayoutInlineShapeOptions>(shape_options_); |
73 } | 73 } |
74 | 74 |
75 unsigned StartOffset() const { return start_offset_; } | 75 unsigned StartOffset() const { return start_offset_; } |
76 unsigned EndOffset() const { return end_offset_; } | 76 unsigned EndOffset() const { return end_offset_; } |
77 unsigned Length() const { return end_offset_ - start_offset_; } | 77 unsigned Length() const { return end_offset_ - start_offset_; } |
78 TextDirection Direction() const { | 78 TextDirection Direction() const { return DirectionFromLevel(BidiLevel()); } |
79 return BidiLevel() & 1 ? TextDirection::kRtl : TextDirection::kLtr; | |
80 } | |
81 UBiDiLevel BidiLevel() const { return static_cast<UBiDiLevel>(bidi_level_); } | 79 UBiDiLevel BidiLevel() const { return static_cast<UBiDiLevel>(bidi_level_); } |
82 UScriptCode GetScript() const { return script_; } | 80 UScriptCode GetScript() const { return script_; } |
83 const ComputedStyle* Style() const { return style_.Get(); } | 81 const ComputedStyle* Style() const { return style_.Get(); } |
84 LayoutObject* GetLayoutObject() const { return layout_object_; } | 82 LayoutObject* GetLayoutObject() const { return layout_object_; } |
85 | 83 |
86 void SetOffset(unsigned start, unsigned end); | 84 void SetOffset(unsigned start, unsigned end); |
87 void SetEndOffset(unsigned); | 85 void SetEndOffset(unsigned); |
88 | 86 |
89 LayoutUnit InlineSize() const; | 87 LayoutUnit InlineSize() const; |
90 LayoutUnit InlineSize(unsigned start, unsigned end) const; | 88 LayoutUnit InlineSize(unsigned start, unsigned end) const; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 | 168 |
171 private: | 169 private: |
172 NGInlineItem* start_item_; | 170 NGInlineItem* start_item_; |
173 unsigned size_; | 171 unsigned size_; |
174 unsigned start_index_; | 172 unsigned start_index_; |
175 }; | 173 }; |
176 | 174 |
177 } // namespace blink | 175 } // namespace blink |
178 | 176 |
179 #endif // NGInlineItem_h | 177 #endif // NGInlineItem_h |
OLD | NEW |