OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 AppliedTextDecoration_h | 5 #ifndef AppliedTextDecoration_h |
6 #define AppliedTextDecoration_h | 6 #define AppliedTextDecoration_h |
7 | 7 |
8 #include "core/css/StyleColor.h" | 8 #include "core/css/StyleColor.h" |
9 #include "core/layout/style/LayoutStyleConstants.h" | 9 #include "core/layout/style/ComputedStyleConstants.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 class AppliedTextDecoration { | 13 class AppliedTextDecoration { |
14 public: | 14 public: |
15 AppliedTextDecoration(TextDecoration, TextDecorationStyle, StyleColor); | 15 AppliedTextDecoration(TextDecoration, TextDecorationStyle, StyleColor); |
16 explicit AppliedTextDecoration(TextDecoration); | 16 explicit AppliedTextDecoration(TextDecoration); |
17 | 17 |
18 TextDecoration line() const { return static_cast<TextDecoration>(m_line); } | 18 TextDecoration line() const { return static_cast<TextDecoration>(m_line); } |
19 TextDecorationStyle style() const { return static_cast<TextDecorationStyle>(
m_style); } | 19 TextDecorationStyle style() const { return static_cast<TextDecorationStyle>(
m_style); } |
20 | 20 |
21 bool isSimpleUnderline() const { return m_line == TextDecorationUnderline &&
m_style == TextDecorationStyleSolid && m_color.isCurrentColor(); } | 21 bool isSimpleUnderline() const { return m_line == TextDecorationUnderline &&
m_style == TextDecorationStyleSolid && m_color.isCurrentColor(); } |
22 bool operator==(const AppliedTextDecoration&) const; | 22 bool operator==(const AppliedTextDecoration&) const; |
23 bool operator!=(const AppliedTextDecoration& o) const { return !(*this == o)
; } | 23 bool operator!=(const AppliedTextDecoration& o) const { return !(*this == o)
; } |
24 | 24 |
25 private: | 25 private: |
26 unsigned m_line : TextDecorationBits; | 26 unsigned m_line : TextDecorationBits; |
27 unsigned m_style : 3; // TextDecorationStyle | 27 unsigned m_style : 3; // TextDecorationStyle |
28 StyleColor m_color; | 28 StyleColor m_color; |
29 }; | 29 }; |
30 | 30 |
31 } // namespace blink | 31 } // namespace blink |
32 | 32 |
33 #endif // AppliedTextDecoration_h | 33 #endif // AppliedTextDecoration_h |
OLD | NEW |