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

Unified Diff: third_party/WebKit/Source/core/style/ComputedStyle.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/ComputedStyle.h
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.h b/third_party/WebKit/Source/core/style/ComputedStyle.h
index 2d3e107e091833e5fc70b53a95b1843792a871e0..b8b62a40a8b94788f4ec90b192d7e3c2be4d8d1a 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.h
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.h
@@ -516,8 +516,8 @@ class CORE_EXPORT ComputedStyle : public ComputedStyleBase<ComputedStyle>,
// TODO(nainar): Move all fixed point logic to a separate class.
// border-top-width
float BorderTopWidth() const {
- if (surround_data_->border_.top_.Style() == kBorderStyleNone ||
- surround_data_->border_.top_.Style() == kBorderStyleHidden)
+ if (surround_data_->border_.top_.Style() == EBorderStyle::kNone ||
+ surround_data_->border_.top_.Style() == EBorderStyle::kHidden)
return 0;
return static_cast<float>(BorderTopWidthInternal()) /
kBorderWidthDenominator;
@@ -528,8 +528,8 @@ class CORE_EXPORT ComputedStyle : public ComputedStyleBase<ComputedStyle>,
// border-bottom-width
float BorderBottomWidth() const {
- if (surround_data_->border_.bottom_.Style() == kBorderStyleNone ||
- surround_data_->border_.bottom_.Style() == kBorderStyleHidden)
+ if (surround_data_->border_.bottom_.Style() == EBorderStyle::kNone ||
+ surround_data_->border_.bottom_.Style() == EBorderStyle::kHidden)
return 0;
return static_cast<float>(BorderBottomWidthInternal()) /
kBorderWidthDenominator;
@@ -540,8 +540,8 @@ class CORE_EXPORT ComputedStyle : public ComputedStyleBase<ComputedStyle>,
// border-left-width
float BorderLeftWidth() const {
- if (surround_data_->border_.left_.Style() == kBorderStyleNone ||
- surround_data_->border_.left_.Style() == kBorderStyleHidden)
+ if (surround_data_->border_.left_.Style() == EBorderStyle::kNone ||
+ surround_data_->border_.left_.Style() == EBorderStyle::kHidden)
return 0;
return static_cast<float>(BorderLeftWidthInternal()) /
kBorderWidthDenominator;
@@ -552,8 +552,8 @@ class CORE_EXPORT ComputedStyle : public ComputedStyleBase<ComputedStyle>,
// border-right-width
float BorderRightWidth() const {
- if (surround_data_->border_.right_.Style() == kBorderStyleNone ||
- surround_data_->border_.right_.Style() == kBorderStyleHidden)
+ if (surround_data_->border_.right_.Style() == EBorderStyle::kNone ||
+ surround_data_->border_.right_.Style() == EBorderStyle::kHidden)
return 0;
return static_cast<float>(BorderRightWidthInternal()) /
kBorderWidthDenominator;
@@ -563,14 +563,14 @@ class CORE_EXPORT ComputedStyle : public ComputedStyleBase<ComputedStyle>,
}
// Border style properties.
- static EBorderStyle InitialBorderStyle() { return kBorderStyleNone; }
+ static EBorderStyle InitialBorderStyle() { return EBorderStyle::kNone; }
// border-top-style
EBorderStyle BorderTopStyle() const {
return surround_data_->border_.Top().Style();
}
void SetBorderTopStyle(EBorderStyle v) {
- SET_VAR(surround_data_, border_.top_.style_, v);
+ SET_VAR(surround_data_, border_.top_.style_, static_cast<unsigned>(v));
}
// border-right-style
@@ -578,7 +578,7 @@ class CORE_EXPORT ComputedStyle : public ComputedStyleBase<ComputedStyle>,
return surround_data_->border_.Right().Style();
}
void SetBorderRightStyle(EBorderStyle v) {
- SET_VAR(surround_data_, border_.right_.style_, v);
+ SET_VAR(surround_data_, border_.right_.style_, static_cast<unsigned>(v));
}
// border-left-style
@@ -586,7 +586,7 @@ class CORE_EXPORT ComputedStyle : public ComputedStyleBase<ComputedStyle>,
return surround_data_->border_.Left().Style();
}
void SetBorderLeftStyle(EBorderStyle v) {
- SET_VAR(surround_data_, border_.left_.style_, v);
+ SET_VAR(surround_data_, border_.left_.style_, static_cast<unsigned>(v));
}
// border-bottom-style
@@ -594,7 +594,7 @@ class CORE_EXPORT ComputedStyle : public ComputedStyleBase<ComputedStyle>,
return surround_data_->border_.Bottom().Style();
}
void SetBorderBottomStyle(EBorderStyle v) {
- SET_VAR(surround_data_, border_.bottom_.style_, v);
+ SET_VAR(surround_data_, border_.bottom_.style_, static_cast<unsigned>(v));
}
// Border color properties.
@@ -703,7 +703,8 @@ class CORE_EXPORT ComputedStyle : public ComputedStyleBase<ComputedStyle>,
return rare_non_inherited_data_->multi_col_->rule_.Style();
}
void SetColumnRuleStyle(EBorderStyle b) {
- SET_NESTED_VAR(rare_non_inherited_data_, multi_col_, rule_.style_, b);
+ SET_NESTED_VAR(rare_non_inherited_data_, multi_col_, rule_.style_,
+ static_cast<unsigned>(b));
}
// column-rule-width (aka -webkit-column-rule-width)
@@ -1193,7 +1194,8 @@ class CORE_EXPORT ComputedStyle : public ComputedStyleBase<ComputedStyle>,
return rare_non_inherited_data_->outline_.Style();
}
void SetOutlineStyle(EBorderStyle v) {
- SET_VAR(rare_non_inherited_data_, outline_.style_, v);
+ SET_VAR(rare_non_inherited_data_, outline_.style_,
+ static_cast<unsigned>(v));
}
static OutlineIsAuto InitialOutlineStyleIsAuto() { return kOutlineIsAutoOff; }
OutlineIsAuto OutlineStyleIsAuto() const {
@@ -1207,7 +1209,7 @@ class CORE_EXPORT ComputedStyle : public ComputedStyleBase<ComputedStyle>,
// outline-width
static unsigned short InitialOutlineWidth() { return 3; }
unsigned short OutlineWidth() const {
- if (rare_non_inherited_data_->outline_.Style() == kBorderStyleNone)
+ if (rare_non_inherited_data_->outline_.Style() == EBorderStyle::kNone)
return 0;
return rare_non_inherited_data_->outline_.Width();
}
@@ -1218,7 +1220,7 @@ class CORE_EXPORT ComputedStyle : public ComputedStyleBase<ComputedStyle>,
// outline-offset
static int InitialOutlineOffset() { return 0; }
int OutlineOffset() const {
- if (rare_non_inherited_data_->outline_.Style() == kBorderStyleNone)
+ if (rare_non_inherited_data_->outline_.Style() == EBorderStyle::kNone)
return 0;
return rare_non_inherited_data_->outline_.Offset();
}
@@ -2937,23 +2939,23 @@ class CORE_EXPORT ComputedStyle : public ComputedStyleBase<ComputedStyle>,
}
bool BorderColorVisuallyEquals(const ComputedStyle& o) const {
- if ((BorderLeftStyle() == kBorderStyleNone &&
- o.BorderLeftStyle() == kBorderStyleNone) &&
- (BorderRightStyle() == kBorderStyleNone &&
- o.BorderRightStyle() == kBorderStyleNone) &&
- (BorderTopStyle() == kBorderStyleNone &&
- o.BorderTopStyle() == kBorderStyleNone) &&
- (BorderBottomStyle() == kBorderStyleNone &&
- o.BorderBottomStyle() == kBorderStyleNone))
+ if ((BorderLeftStyle() == EBorderStyle::kNone &&
+ o.BorderLeftStyle() == EBorderStyle::kNone) &&
+ (BorderRightStyle() == EBorderStyle::kNone &&
+ o.BorderRightStyle() == EBorderStyle::kNone) &&
+ (BorderTopStyle() == EBorderStyle::kNone &&
+ o.BorderTopStyle() == EBorderStyle::kNone) &&
+ (BorderBottomStyle() == EBorderStyle::kNone &&
+ o.BorderBottomStyle() == EBorderStyle::kNone))
return true;
- if ((BorderLeftStyle() == kBorderStyleHidden &&
- o.BorderLeftStyle() == kBorderStyleHidden) &&
- (BorderRightStyle() == kBorderStyleHidden &&
- o.BorderRightStyle() == kBorderStyleHidden) &&
- (BorderTopStyle() == kBorderStyleHidden &&
- o.BorderTopStyle() == kBorderStyleHidden) &&
- (BorderBottomStyle() == kBorderStyleHidden &&
- o.BorderBottomStyle() == kBorderStyleHidden))
+ if ((BorderLeftStyle() == EBorderStyle::kHidden &&
+ o.BorderLeftStyle() == EBorderStyle::kHidden) &&
+ (BorderRightStyle() == EBorderStyle::kHidden &&
+ o.BorderRightStyle() == EBorderStyle::kHidden) &&
+ (BorderTopStyle() == EBorderStyle::kHidden &&
+ o.BorderTopStyle() == EBorderStyle::kHidden) &&
+ (BorderBottomStyle() == EBorderStyle::kHidden &&
+ o.BorderBottomStyle() == EBorderStyle::kHidden))
return true;
return BorderColorEquals(o);
}
@@ -3051,7 +3053,7 @@ class CORE_EXPORT ComputedStyle : public ComputedStyleBase<ComputedStyle>,
// Outline utility functions.
bool HasOutline() const {
- return OutlineWidth() > 0 && OutlineStyle() > kBorderStyleHidden;
+ return OutlineWidth() > 0 && OutlineStyle() > EBorderStyle::kHidden;
}
int OutlineOutsetExtent() const;
float GetOutlineStrokeWidthForFocusRing() const;
« no previous file with comments | « third_party/WebKit/Source/core/style/BorderValue.h ('k') | third_party/WebKit/Source/core/style/ComputedStyle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698