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, |