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

Unified Diff: third_party/WebKit/Source/platform/text/WritingMode.h

Issue 2591373003: Changed WritingMode to an enum class and renamed its members (Closed)
Patch Set: Added comment Created 4 years 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
« no previous file with comments | « third_party/WebKit/Source/platform/geometry/LayoutRectOutsetsTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/text/WritingMode.h
diff --git a/third_party/WebKit/Source/platform/text/WritingMode.h b/third_party/WebKit/Source/platform/text/WritingMode.h
index e59527d50d53e7a7523ba98016b5004443469481..b18c46028738a00130d16a654800e58053e0e838 100644
--- a/third_party/WebKit/Source/platform/text/WritingMode.h
+++ b/third_party/WebKit/Source/platform/text/WritingMode.h
@@ -33,26 +33,26 @@
namespace blink {
-enum WritingMode {
- TopToBottomWritingMode,
- RightToLeftWritingMode,
- LeftToRightWritingMode
-};
+// These values are named to match the CSS keywords they correspond to: namely
+// horizontal-tb, vertical-rl and vertical-lr.
+// Since these names aren't very self-explanatory, where possible use the
+// inline utility functions below.
+enum class WritingMode : unsigned { HorizontalTb, VerticalRl, VerticalLr };
// Lines have horizontal orientation; modes horizontal-tb.
inline bool isHorizontalWritingMode(WritingMode writingMode) {
- return writingMode == TopToBottomWritingMode;
+ return writingMode == WritingMode::HorizontalTb;
}
// Bottom of the line occurs earlier in the block; modes vertical-lr.
inline bool isFlippedLinesWritingMode(WritingMode writingMode) {
- return writingMode == LeftToRightWritingMode;
+ return writingMode == WritingMode::VerticalLr;
}
// Block progression increases in the opposite direction to normal; modes
// vertical-rl.
inline bool isFlippedBlocksWritingMode(WritingMode writingMode) {
- return writingMode == RightToLeftWritingMode;
+ return writingMode == WritingMode::VerticalRl;
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/platform/geometry/LayoutRectOutsetsTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698