Index: third_party/WebKit/Source/core/style/ComputedStyleConstants.h |
diff --git a/third_party/WebKit/Source/core/style/ComputedStyleConstants.h b/third_party/WebKit/Source/core/style/ComputedStyleConstants.h |
index 1b89f9e062e028c1ec1ca9a73c5dcefb91041479..460ece1bc25403ca388f5253cc91d0736b28850c 100644 |
--- a/third_party/WebKit/Source/core/style/ComputedStyleConstants.h |
+++ b/third_party/WebKit/Source/core/style/ComputedStyleConstants.h |
@@ -251,18 +251,29 @@ enum QuoteType { OPEN_QUOTE, CLOSE_QUOTE, NO_OPEN_QUOTE, NO_CLOSE_QUOTE }; |
enum EAnimPlayState { kAnimPlayStatePlaying, kAnimPlayStatePaused }; |
static const size_t kTextDecorationBits = 4; |
-enum TextDecoration { |
- kTextDecorationNone = 0x0, |
- kTextDecorationUnderline = 0x1, |
- kTextDecorationOverline = 0x2, |
- kTextDecorationLineThrough = 0x4, |
- kTextDecorationBlink = 0x8 |
+enum class TextDecoration : unsigned { |
+ kNone = 0x0, |
+ kUnderline = 0x1, |
+ kOverline = 0x2, |
+ kLineThrough = 0x4, |
+ kBlink = 0x8 |
}; |
inline TextDecoration operator|(TextDecoration a, TextDecoration b) { |
- return TextDecoration(int(a) | int(b)); |
+ return static_cast<TextDecoration>(static_cast<unsigned>(a) | |
+ static_cast<unsigned>(b)); |
} |
inline TextDecoration& operator|=(TextDecoration& a, TextDecoration b) { |
- return a = a | b; |
+ return a = static_cast<TextDecoration>(static_cast<unsigned>(a) | |
+ static_cast<unsigned>(b)); |
+} |
+inline TextDecoration& operator^=(TextDecoration& a, TextDecoration b) { |
+ return a = static_cast<TextDecoration>(static_cast<unsigned>(a) ^ |
+ static_cast<unsigned>(b)); |
+} |
+inline bool EnumHasFlags(TextDecoration v, TextDecoration mask) { |
Bugs Nash
2017/04/27 00:02:23
If this function is only going to be used for Text
shend
2017/04/27 00:27:33
Certain other enums will need this as well. I will
|
+ return static_cast<TextDecoration>(static_cast<unsigned>(v) & |
+ static_cast<unsigned>(mask)) != |
+ TextDecoration::kNone; |
Bugs Nash
2017/04/27 00:02:23
I don't think TextDecoration::kNone is exactly wha
shend
2017/04/27 00:27:33
Done.
|
} |
enum TextDecorationStyle { |