OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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 StyleSelfAlignmentData_h | 5 #ifndef StyleSelfAlignmentData_h |
6 #define StyleSelfAlignmentData_h | 6 #define StyleSelfAlignmentData_h |
7 | 7 |
8 #include "core/style/ComputedStyleConstants.h" | 8 #include "core/style/ComputedStyleConstants.h" |
9 #include "wtf/Allocator.h" | 9 #include "wtf/Allocator.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 class StyleSelfAlignmentData { | 13 class StyleSelfAlignmentData { |
14 DISALLOW_NEW(); | 14 DISALLOW_NEW(); |
15 | 15 |
16 public: | 16 public: |
17 // Style data for Self-Aligment and Default-Alignment properties: align-{self,
items}, justify-{self, items}. | 17 // Style data for Self-Aligment and Default-Alignment properties: align-{self, |
18 // [ <self-position> && <overflow-position>? ] | [ legacy && [ left | right |
center ] ] | 18 // items}, justify-{self, items}. |
| 19 // [ <self-position> && <overflow-position>? ] | [ legacy && [ left | right | |
| 20 // center ] ] |
19 StyleSelfAlignmentData(ItemPosition position, | 21 StyleSelfAlignmentData(ItemPosition position, |
20 OverflowAlignment overflow, | 22 OverflowAlignment overflow, |
21 ItemPositionType positionType = NonLegacyPosition) | 23 ItemPositionType positionType = NonLegacyPosition) |
22 : m_position(position), | 24 : m_position(position), |
23 m_positionType(positionType), | 25 m_positionType(positionType), |
24 m_overflow(overflow) {} | 26 m_overflow(overflow) {} |
25 | 27 |
26 void setPosition(ItemPosition position) { m_position = position; } | 28 void setPosition(ItemPosition position) { m_position = position; } |
27 void setPositionType(ItemPositionType positionType) { | 29 void setPositionType(ItemPositionType positionType) { |
28 m_positionType = positionType; | 30 m_positionType = positionType; |
(...skipping 13 matching lines...) Expand all Loading... |
42 bool operator==(const StyleSelfAlignmentData& o) const { | 44 bool operator==(const StyleSelfAlignmentData& o) const { |
43 return m_position == o.m_position && m_positionType == o.m_positionType && | 45 return m_position == o.m_position && m_positionType == o.m_positionType && |
44 m_overflow == o.m_overflow; | 46 m_overflow == o.m_overflow; |
45 } | 47 } |
46 | 48 |
47 bool operator!=(const StyleSelfAlignmentData& o) const { | 49 bool operator!=(const StyleSelfAlignmentData& o) const { |
48 return !(*this == o); | 50 return !(*this == o); |
49 } | 51 } |
50 | 52 |
51 private: | 53 private: |
52 unsigned m_position : 4; // ItemPosition | 54 unsigned m_position : 4; // ItemPosition |
53 unsigned | 55 unsigned m_positionType : 1; // Whether or not alignment uses the 'legacy' |
54 m_positionType : 1; // Whether or not alignment uses the 'legacy' keyword
. | 56 // keyword. |
55 unsigned m_overflow : 2; // OverflowAlignment | 57 unsigned m_overflow : 2; // OverflowAlignment |
56 }; | 58 }; |
57 | 59 |
58 } // namespace blink | 60 } // namespace blink |
59 | 61 |
60 #endif // StyleSelfAlignmentData_h | 62 #endif // StyleSelfAlignmentData_h |
OLD | NEW |