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

Unified Diff: third_party/WebKit/Source/core/style/BorderStyle.h

Issue 2890733002: Make EBorderStyle an enum class. (Closed)
Patch Set: Build for Mac Created 3 years, 7 months 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/style/BorderStyle.h
diff --git a/third_party/WebKit/Source/core/style/BorderStyle.h b/third_party/WebKit/Source/core/style/BorderStyle.h
index b243bca03615b4eb68983d57addb6ee5a88d4cff..184ef450ea547a55e7ac22c88267be44776f1eac 100644
--- a/third_party/WebKit/Source/core/style/BorderStyle.h
+++ b/third_party/WebKit/Source/core/style/BorderStyle.h
@@ -37,18 +37,24 @@ class BorderStyle {
friend class ComputedStyle;
public:
- BorderStyle() : style_(kBorderStyleNone), is_auto_(kOutlineIsAutoOff) {}
+ BorderStyle()
+ : style_(static_cast<unsigned>(EBorderStyle::kNone)),
+ is_auto_(kOutlineIsAutoOff) {}
- bool NonZero() const { return (style_ != kBorderStyleNone); }
+ bool NonZero() const {
+ return (style_ != static_cast<unsigned>(EBorderStyle::kNone));
+ }
bool operator==(const BorderStyle& o) const { return style_ == o.style_; }
// The default width is 3px, but if the style is none we compute a value of 0
// (in ComputedStyle itself)
bool VisuallyEqual(const BorderStyle& o) const {
- if (style_ == kBorderStyleNone && o.style_ == kBorderStyleNone)
+ if (style_ == static_cast<unsigned>(EBorderStyle::kNone) &&
+ o.style_ == static_cast<unsigned>(EBorderStyle::kNone))
return true;
- if (style_ == kBorderStyleHidden && o.style_ == kBorderStyleHidden)
+ if (style_ == static_cast<unsigned>(EBorderStyle::kHidden) &&
+ o.style_ == static_cast<unsigned>(EBorderStyle::kHidden))
return true;
return *this == o;
}
@@ -56,7 +62,7 @@ class BorderStyle {
bool operator!=(const BorderStyle& o) const { return !(*this == o); }
EBorderStyle Style() const { return static_cast<EBorderStyle>(style_); }
- void SetStyle(EBorderStyle style) { style_ = style; }
+ void SetStyle(EBorderStyle style) { style_ = static_cast<unsigned>(style); }
OutlineIsAuto IsAuto() const { return static_cast<OutlineIsAuto>(is_auto_); }
void SetIsAuto(OutlineIsAuto is_auto) { is_auto_ = is_auto; }
« no previous file with comments | « third_party/WebKit/Source/core/style/BorderEdge.cpp ('k') | third_party/WebKit/Source/core/style/BorderValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698