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 NGFragmentBase_h | 5 #ifndef NGFragmentBase_h |
6 #define NGFragmentBase_h | 6 #define NGFragmentBase_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/layout/ng/ng_constraint_space.h" |
9 #include "platform/LayoutUnit.h" | 10 #include "platform/LayoutUnit.h" |
10 #include "platform/heap/Handle.h" | 11 #include "platform/heap/Handle.h" |
11 #include "wtf/Vector.h" | 12 #include "wtf/Vector.h" |
12 | 13 |
13 namespace blink { | 14 namespace blink { |
14 | 15 |
15 class CORE_EXPORT NGFragmentBase : public GarbageCollected<NGFragmentBase> { | 16 class CORE_EXPORT NGFragmentBase : public GarbageCollected<NGFragmentBase> { |
16 public: | 17 public: |
17 enum NGFragmentType { FragmentBox = 0, FragmentText = 1 }; | 18 enum NGFragmentType { FragmentBox = 0, FragmentText = 1 }; |
18 | 19 |
19 // TODO(eae): We might want to re-use WritingMode and Direction from style. | |
20 enum NGWritingMode { | |
21 HorizontalTopBottom = 0, | |
22 VerticalRightLeft = 1, | |
23 VerticalLeftRight = 2, | |
24 SidewaysRightLeft = 3, | |
25 SidewaysLeftRight = 4 | |
26 }; | |
27 enum NGDirection { LeftToRight = 0, RightToLeft = 1 }; | |
28 | |
29 NGFragmentType type() const { return static_cast<NGFragmentType>(m_type); } | 20 NGFragmentType type() const { return static_cast<NGFragmentType>(m_type); } |
30 NGWritingMode writingMode() const { | 21 NGWritingMode writingMode() const { |
31 return static_cast<NGWritingMode>(m_writingMode); | 22 return static_cast<NGWritingMode>(m_writingMode); |
32 } | 23 } |
33 NGDirection direction() const { | 24 NGDirection direction() const { |
34 return static_cast<NGDirection>(m_direction); | 25 return static_cast<NGDirection>(m_direction); |
35 } | 26 } |
36 | 27 |
37 // Returns the border-box size. | 28 // Returns the border-box size. |
38 LayoutUnit inlineSize() const { return m_inlineSize; } | 29 LayoutUnit inlineSize() const { return m_inlineSize; } |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 61 |
71 unsigned m_type : 1; | 62 unsigned m_type : 1; |
72 unsigned m_writingMode : 3; | 63 unsigned m_writingMode : 3; |
73 unsigned m_direction : 1; | 64 unsigned m_direction : 1; |
74 unsigned m_hasBeenPlaced : 1; | 65 unsigned m_hasBeenPlaced : 1; |
75 }; | 66 }; |
76 | 67 |
77 } // namespace blink | 68 } // namespace blink |
78 | 69 |
79 #endif // NGFragmentBase_h | 70 #endif // NGFragmentBase_h |
OLD | NEW |