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

Side by Side Diff: third_party/WebKit/Source/platform/LengthBox.cpp

Issue 2925293003: Cleanup TextDirection (Closed)
Patch Set: unsigned to uint8_t Created 3 years, 6 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
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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 return bottom; 76 return bottom;
77 } 77 }
78 78
79 const Length& LengthBox::Start(WritingMode writing_mode, 79 const Length& LengthBox::Start(WritingMode writing_mode,
80 TextDirection direction, 80 TextDirection direction,
81 const Length& top, 81 const Length& top,
82 const Length& left, 82 const Length& left,
83 const Length& right, 83 const Length& right,
84 const Length& bottom) { 84 const Length& bottom) {
85 if (IsHorizontalWritingMode(writing_mode)) 85 if (IsHorizontalWritingMode(writing_mode))
86 return IsLeftToRightDirection(direction) ? left : right; 86 return IsLtr(direction) ? left : right;
87 return IsLeftToRightDirection(direction) ? top : bottom; 87 return IsLtr(direction) ? top : bottom;
88 } 88 }
89 89
90 const Length& LengthBox::End(WritingMode writing_mode, 90 const Length& LengthBox::End(WritingMode writing_mode,
91 TextDirection direction, 91 TextDirection direction,
92 const Length& top, 92 const Length& top,
93 const Length& left, 93 const Length& left,
94 const Length& right, 94 const Length& right,
95 const Length& bottom) { 95 const Length& bottom) {
96 if (IsHorizontalWritingMode(writing_mode)) 96 if (IsHorizontalWritingMode(writing_mode))
97 return IsLeftToRightDirection(direction) ? right : left; 97 return IsLtr(direction) ? right : left;
98 return IsLeftToRightDirection(direction) ? bottom : top; 98 return IsLtr(direction) ? bottom : top;
99 } 99 }
100 100
101 const Length& LengthBox::Over(WritingMode writing_mode, 101 const Length& LengthBox::Over(WritingMode writing_mode,
102 const Length& top, 102 const Length& top,
103 const Length& right) { 103 const Length& right) {
104 return IsHorizontalWritingMode(writing_mode) ? top : right; 104 return IsHorizontalWritingMode(writing_mode) ? top : right;
105 } 105 }
106 106
107 const Length& LengthBox::Under(WritingMode writing_mode, 107 const Length& LengthBox::Under(WritingMode writing_mode,
108 const Length& bottom, 108 const Length& bottom,
109 const Length& left) { 109 const Length& left) {
110 return IsHorizontalWritingMode(writing_mode) ? bottom : left; 110 return IsHorizontalWritingMode(writing_mode) ? bottom : left;
111 } 111 }
112 112
113 } // namespace blink 113 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698