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

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

Issue 2181953004: Changed ComputedStyle's EVisibility to be an enum class and fixed naming (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@_move_computedstyle_around
Patch Set: Rebase Created 4 years, 4 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/ComputedStyleConstants.h
diff --git a/third_party/WebKit/Source/core/style/ComputedStyleConstants.h b/third_party/WebKit/Source/core/style/ComputedStyleConstants.h
index f9b57ee99066caf889ba7235ec1d5ffe5917b305..57a6689f7b3b1b5c61f96e982493218bdd35458e 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyleConstants.h
+++ b/third_party/WebKit/Source/core/style/ComputedStyleConstants.h
@@ -30,6 +30,11 @@
namespace blink {
+// TODO(sashab): Change these enums to enum classes with an unsigned underlying
+// type. Enum classes provide better type safety, and forcing an unsigned
+// underlying type prevents msvc from interpreting enums as negative numbers.
+// See: crbug.com/628043
+
// Sides used when drawing borders and outlines. The values should run clockwise from top.
enum BoxSide {
BSTop,
@@ -386,7 +391,9 @@ enum ECaptionSide {
enum EListStylePosition { ListStylePositionOutside, ListStylePositionInside };
-enum EVisibility { VISIBLE, HIDDEN, COLLAPSE };
+// TODO(sashab): Add a static_assert when this is used in bitfields to ensure it
+// uses unsigned as the underlying type.
+enum class EVisibility : unsigned { Visible, Hidden, Collapse };
tkent 2016/08/10 01:11:33 Can you drop 'E' prefix from enum type names in yo
sashab 2016/08/10 01:14:51 Sure, so just to clarify: enum class Visibility :
tkent 2016/08/10 01:18:43 Exactly!
enum ECursor {
// The following must match the order in CSSValueKeywords.in.
« no previous file with comments | « third_party/WebKit/Source/core/style/ComputedStyle.cpp ('k') | third_party/WebKit/Source/core/svg/SVGUseElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698