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

Unified Diff: third_party/WebKit/Source/core/style/BorderEdge.cpp

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/BorderEdge.cpp
diff --git a/third_party/WebKit/Source/core/style/BorderEdge.cpp b/third_party/WebKit/Source/core/style/BorderEdge.cpp
index 24de02b939f72d5508e7f7b030c0e4848be81138..4914453d2857c7a095a2e91186dd5a50c7b9e419 100644
--- a/third_party/WebKit/Source/core/style/BorderEdge.cpp
+++ b/third_party/WebKit/Source/core/style/BorderEdge.cpp
@@ -12,16 +12,18 @@ BorderEdge::BorderEdge(float edge_width,
bool edge_is_present)
: color(edge_color),
is_present(edge_is_present),
- style(edge_style),
+ style(static_cast<unsigned>(edge_style)),
width_(edge_width) {
- if (style == kBorderStyleDouble && edge_width < 3)
- style = kBorderStyleSolid;
+ if (style == static_cast<unsigned>(EBorderStyle::kDouble) && edge_width < 3)
+ style = static_cast<unsigned>(EBorderStyle::kSolid);
}
-BorderEdge::BorderEdge() : is_present(false), style(kBorderStyleHidden) {}
+BorderEdge::BorderEdge()
+ : is_present(false), style(static_cast<unsigned>(EBorderStyle::kHidden)) {}
bool BorderEdge::HasVisibleColorAndStyle() const {
- return style > kBorderStyleHidden && color.Alpha() > 0;
+ return style > static_cast<unsigned>(EBorderStyle::kHidden) &&
+ color.Alpha() > 0;
}
bool BorderEdge::ShouldRender() const {
@@ -33,21 +35,25 @@ bool BorderEdge::PresentButInvisible() const {
}
bool BorderEdge::ObscuresBackgroundEdge() const {
- if (!is_present || color.HasAlpha() || style == kBorderStyleHidden)
+ if (!is_present || color.HasAlpha() ||
+ style == static_cast<unsigned>(EBorderStyle::kHidden))
return false;
- if (style == kBorderStyleDotted || style == kBorderStyleDashed)
+ if (style == static_cast<unsigned>(EBorderStyle::kDotted) ||
+ style == static_cast<unsigned>(EBorderStyle::kDashed))
return false;
return true;
}
bool BorderEdge::ObscuresBackground() const {
- if (!is_present || color.HasAlpha() || style == kBorderStyleHidden)
+ if (!is_present || color.HasAlpha() ||
+ style == static_cast<unsigned>(EBorderStyle::kHidden))
return false;
- if (style == kBorderStyleDotted || style == kBorderStyleDashed ||
- style == kBorderStyleDouble)
+ if (style == static_cast<unsigned>(EBorderStyle::kDotted) ||
+ style == static_cast<unsigned>(EBorderStyle::kDashed) ||
+ style == static_cast<unsigned>(EBorderStyle::kDouble))
return false;
return true;
« no previous file with comments | « third_party/WebKit/Source/core/paint/TableCellPainter.cpp ('k') | third_party/WebKit/Source/core/style/BorderStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698