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

Unified Diff: third_party/WebKit/Source/platform/LengthBox.cpp

Issue 2705143002: Split StyleSurroundData::offset into separate members. (Closed)
Patch Set: Fix typo Created 3 years, 9 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
« no previous file with comments | « third_party/WebKit/Source/platform/LengthBox.h ('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/LengthBox.cpp
diff --git a/third_party/WebKit/Source/platform/LengthBox.cpp b/third_party/WebKit/Source/platform/LengthBox.cpp
index b7dd0e4431daddb63652bbe32502df315cb0b503..2f1f590ba459b3cb4d18d606e54d07a6a2272cf2 100644
--- a/third_party/WebKit/Source/platform/LengthBox.cpp
+++ b/third_party/WebKit/Source/platform/LengthBox.cpp
@@ -32,38 +32,64 @@
namespace blink {
-const Length& LengthBox::logicalLeft(WritingMode writingMode) const {
- return isHorizontalWritingMode(writingMode) ? m_left : m_top;
+const Length& LengthBox::logicalLeft(WritingMode writingMode,
+ const Length& left,
+ const Length& top) {
+ return isHorizontalWritingMode(writingMode) ? left : top;
}
-const Length& LengthBox::logicalRight(WritingMode writingMode) const {
- return isHorizontalWritingMode(writingMode) ? m_right : m_bottom;
+const Length& LengthBox::logicalRight(WritingMode writingMode,
+ const Length& right,
+ const Length& bottom) {
+ return isHorizontalWritingMode(writingMode) ? right : bottom;
}
-const Length& LengthBox::before(WritingMode writingMode) const {
+const Length& LengthBox::before(WritingMode writingMode,
+ const Length& top,
+ const Length& left,
+ const Length& right) {
switch (writingMode) {
case WritingMode::kHorizontalTb:
- return m_top;
+ return top;
case WritingMode::kVerticalLr:
- return m_left;
+ return left;
case WritingMode::kVerticalRl:
- return m_right;
+ return right;
}
- ASSERT_NOT_REACHED();
- return m_top;
+ NOTREACHED();
+ return top;
}
-const Length& LengthBox::after(WritingMode writingMode) const {
+const Length& LengthBox::after(WritingMode writingMode,
+ const Length& bottom,
+ const Length& left,
+ const Length& right) {
switch (writingMode) {
case WritingMode::kHorizontalTb:
- return m_bottom;
+ return bottom;
case WritingMode::kVerticalLr:
- return m_right;
+ return right;
case WritingMode::kVerticalRl:
- return m_left;
+ return left;
}
- ASSERT_NOT_REACHED();
- return m_bottom;
+ NOTREACHED();
+ return bottom;
+}
+
+const Length& LengthBox::logicalLeft(WritingMode writingMode) const {
+ return LengthBox::logicalLeft(writingMode, m_left, m_top);
+}
+
+const Length& LengthBox::logicalRight(WritingMode writingMode) const {
+ return LengthBox::logicalRight(writingMode, m_right, m_bottom);
+}
+
+const Length& LengthBox::before(WritingMode writingMode) const {
+ return LengthBox::before(writingMode, m_top, m_left, m_right);
+}
+
+const Length& LengthBox::after(WritingMode writingMode) const {
+ return LengthBox::after(writingMode, m_bottom, m_left, m_right);
}
const Length& LengthBox::start(WritingMode writingMode,
« no previous file with comments | « third_party/WebKit/Source/platform/LengthBox.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698