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

Side by Side 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 3 years, 12 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/geometry/LayoutRectOutsetsTest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012, Google Inc. All rights reserved. 2 * Copyright (c) 2012, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 15 matching lines...) Expand all
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef WritingMode_h 31 #ifndef WritingMode_h
32 #define WritingMode_h 32 #define WritingMode_h
33 33
34 namespace blink { 34 namespace blink {
35 35
36 enum WritingMode { 36 // These values are named to match the CSS keywords they correspond to: namely
37 TopToBottomWritingMode, 37 // horizontal-tb, vertical-rl and vertical-lr.
38 RightToLeftWritingMode, 38 // Since these names aren't very self-explanatory, where possible use the
39 LeftToRightWritingMode 39 // inline utility functions below.
40 }; 40 enum class WritingMode : unsigned { HorizontalTb, VerticalRl, VerticalLr };
41 41
42 // Lines have horizontal orientation; modes horizontal-tb. 42 // Lines have horizontal orientation; modes horizontal-tb.
43 inline bool isHorizontalWritingMode(WritingMode writingMode) { 43 inline bool isHorizontalWritingMode(WritingMode writingMode) {
44 return writingMode == TopToBottomWritingMode; 44 return writingMode == WritingMode::HorizontalTb;
45 } 45 }
46 46
47 // Bottom of the line occurs earlier in the block; modes vertical-lr. 47 // Bottom of the line occurs earlier in the block; modes vertical-lr.
48 inline bool isFlippedLinesWritingMode(WritingMode writingMode) { 48 inline bool isFlippedLinesWritingMode(WritingMode writingMode) {
49 return writingMode == LeftToRightWritingMode; 49 return writingMode == WritingMode::VerticalLr;
50 } 50 }
51 51
52 // Block progression increases in the opposite direction to normal; modes 52 // Block progression increases in the opposite direction to normal; modes
53 // vertical-rl. 53 // vertical-rl.
54 inline bool isFlippedBlocksWritingMode(WritingMode writingMode) { 54 inline bool isFlippedBlocksWritingMode(WritingMode writingMode) {
55 return writingMode == RightToLeftWritingMode; 55 return writingMode == WritingMode::VerticalRl;
56 } 56 }
57 57
58 } // namespace blink 58 } // namespace blink
59 59
60 #endif // WritingMode_h 60 #endif // WritingMode_h
OLDNEW
« 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