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 3 // found in the LICENSE file. 4 5 #ifndef AppliedTextDecoration_h 6 #define AppliedTextDecoration_h 7 8 #include "core/css/StyleColor.h" 9 #include "core/rendering/style/RenderStyleConstants.h" 10 11 namespace blink { 12 13 class AppliedTextDecoration { 14 public: 15 AppliedTextDecoration(TextDecoration, TextDecorationStyle, StyleColor); 16 explicit AppliedTextDecoration(TextDecoration); 17 AppliedTextDecoration(); 18 line()19 TextDecoration line() const { return static_cast<TextDecoration>(m_line); } style()20 TextDecorationStyle style() const { return static_cast<TextDecorationStyle>(m_style); } 21 isSimpleUnderline()22 bool isSimpleUnderline() const { return m_line == TextDecorationUnderline && m_style == TextDecorationStyleSolid && m_color.isCurrentColor(); } 23 bool operator==(const AppliedTextDecoration&) const; 24 bool operator!=(const AppliedTextDecoration& o) const { return !(*this == o); } 25 26 private: 27 unsigned m_line : TextDecorationBits; 28 unsigned m_style : 3; // TextDecorationStyle 29 StyleColor m_color; 30 }; 31 32 } // namespace blink 33 34 #endif // AppliedTextDecoration_h 35