Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(288)

Side by Side Diff: third_party/WebKit/Source/core/style/AppliedTextDecoration.h

Issue 2497963002: Add support for multiple text decorations with same line positioning (Closed)
Patch Set: Update slimming paint expectations Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
9 #include "core/style/ComputedStyleConstants.h" 8 #include "core/style/ComputedStyleConstants.h"
9 #include "platform/graphics/Color.h"
10 #include "wtf/Allocator.h" 10 #include "wtf/Allocator.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 class AppliedTextDecoration { 14 class AppliedTextDecoration {
15 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); 15 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
16 16
17 public: 17 public:
18 AppliedTextDecoration(TextDecoration, TextDecorationStyle, StyleColor); 18 AppliedTextDecoration(TextDecoration, TextDecorationStyle, Color);
19 explicit AppliedTextDecoration(TextDecoration);
20 19
21 TextDecoration line() const { return static_cast<TextDecoration>(m_line); } 20 TextDecoration lines() const { return static_cast<TextDecoration>(m_lines); }
22 TextDecorationStyle style() const { 21 TextDecorationStyle style() const {
23 return static_cast<TextDecorationStyle>(m_style); 22 return static_cast<TextDecorationStyle>(m_style);
24 } 23 }
24 Color color() const { return m_color; }
25 void setColor(Color color) { m_color = color; }
25 26
26 bool isSimpleUnderline() const {
27 return m_line == TextDecorationUnderline &&
28 m_style == TextDecorationStyleSolid && m_color.isCurrentColor();
29 }
30 bool operator==(const AppliedTextDecoration&) const; 27 bool operator==(const AppliedTextDecoration&) const;
31 bool operator!=(const AppliedTextDecoration& o) const { 28 bool operator!=(const AppliedTextDecoration& o) const {
32 return !(*this == o); 29 return !(*this == o);
33 } 30 }
34 31
35 private: 32 private:
36 unsigned m_line : TextDecorationBits; 33 unsigned m_lines : TextDecorationBits;
37 unsigned m_style : 3; // TextDecorationStyle 34 unsigned m_style : 3; // TextDecorationStyle
38 StyleColor m_color; 35 Color m_color;
39 }; 36 };
40 37
41 } // namespace blink 38 } // namespace blink
42 39
43 #endif // AppliedTextDecoration_h 40 #endif // AppliedTextDecoration_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698