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 NGInlineNodeData_h | 5 #ifndef NGInlineNodeData_h |
6 #define NGInlineNodeData_h | 6 #define NGInlineNodeData_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "core/layout/ng/inline/ng_inline_item.h" | 9 #include "core/layout/ng/inline/ng_inline_item.h" |
10 #include "platform/wtf/Vector.h" | 10 #include "platform/wtf/Vector.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 class LayoutBox; | 14 class LayoutBox; |
15 | 15 |
16 // Data which is required for inline nodes. | 16 // Data which is required for inline nodes. |
17 struct CORE_EXPORT NGInlineNodeData { | 17 struct CORE_EXPORT NGInlineNodeData { |
18 private: | 18 private: |
| 19 TextDirection BaseDirection() const { |
| 20 return static_cast<TextDirection>(base_direction_); |
| 21 } |
| 22 void SetBaseDirection(TextDirection direction) { |
| 23 base_direction_ = static_cast<unsigned>(direction); |
| 24 } |
| 25 |
19 friend class NGInlineNode; | 26 friend class NGInlineNode; |
20 friend class NGInlineNodeForTest; | 27 friend class NGInlineNodeForTest; |
21 | 28 |
22 // Text content for all inline items represented by a single NGInlineNode. | 29 // Text content for all inline items represented by a single NGInlineNode. |
23 // Encoded either as UTF-16 or latin-1 depending on the content. | 30 // Encoded either as UTF-16 or latin-1 depending on the content. |
24 String text_content_; | 31 String text_content_; |
25 Vector<NGInlineItem> items_; | 32 Vector<NGInlineItem> items_; |
26 | 33 |
27 // next_sibling_ is only valid after NGInlineNode::PrepareLayout is called. | 34 // next_sibling_ is only valid after NGInlineNode::PrepareLayout is called. |
28 // Calling NGInlineNode::NextSibling will trigger this. | 35 // Calling NGInlineNode::NextSibling will trigger this. |
29 LayoutBox* next_sibling_; | 36 LayoutBox* next_sibling_; |
30 | 37 |
31 // start_inline_ must always be reset within the constructor of NGInlineNode. | 38 // start_inline_ must always be reset within the constructor of NGInlineNode. |
32 LayoutObject* start_inline_; | 39 LayoutObject* start_inline_; |
33 | 40 |
34 // TODO(kojii): This should move to somewhere else when we move PrepareLayout | 41 unsigned is_bidi_enabled_ : 1; |
35 // to the correct place. | 42 unsigned base_direction_ : 1; // TextDirection |
36 bool is_bidi_enabled_ = false; | |
37 }; | 43 }; |
38 | 44 |
39 } // namespace blink | 45 } // namespace blink |
40 | 46 |
41 #endif // NGInlineNode_h | 47 #endif // NGInlineNode_h |
OLD | NEW |