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

Unified Diff: sky/engine/platform/geometry/LayoutBoxExtent.cpp

Issue 688213002: First pass at removing dead vertical writing mode code. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 2 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 | « sky/engine/platform/geometry/LayoutBoxExtent.h ('k') | sky/engine/platform/text/WritingMode.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/platform/geometry/LayoutBoxExtent.cpp
diff --git a/sky/engine/platform/geometry/LayoutBoxExtent.cpp b/sky/engine/platform/geometry/LayoutBoxExtent.cpp
index cfeb01728d4fc37f2285ec2d2e32168f78ee8dfe..3e07aee49ab058e17a3169ba74d4404dd1d48ec8 100644
--- a/sky/engine/platform/geometry/LayoutBoxExtent.cpp
+++ b/sky/engine/platform/geometry/LayoutBoxExtent.cpp
@@ -37,22 +37,22 @@ namespace blink {
LayoutUnit LayoutBoxExtent::logicalTop() const
{
- return isHorizontalWritingMode() ? m_top : m_left;
+ return m_top;
}
LayoutUnit LayoutBoxExtent::logicalBottom() const
{
- return isHorizontalWritingMode() ? m_bottom : m_right;
+ return m_bottom;
}
LayoutUnit LayoutBoxExtent::logicalLeft() const
{
- return isHorizontalWritingMode() ? m_left : m_top;
+ return m_left;
}
LayoutUnit LayoutBoxExtent::logicalRight() const
{
- return isHorizontalWritingMode() ? m_right : m_bottom;
+ return m_right;
}
LayoutUnit LayoutBoxExtent::before() const
@@ -69,16 +69,12 @@ LayoutUnit LayoutBoxExtent::after() const
LayoutUnit LayoutBoxExtent::start(TextDirection direction) const
{
- if (isHorizontalWritingMode())
- return isLeftToRightDirection(direction) ? m_left : m_right;
- return isLeftToRightDirection(direction) ? m_top : m_bottom;
+ return isLeftToRightDirection(direction) ? m_left : m_right;
}
LayoutUnit LayoutBoxExtent::end(TextDirection direction) const
{
- if (isHorizontalWritingMode())
- return isLeftToRightDirection(direction) ? m_right : m_left;
- return isLeftToRightDirection(direction) ? m_bottom : m_top;
+ return isLeftToRightDirection(direction) ? m_right : m_left;
}
void LayoutBoxExtent::setBefore(LayoutUnit value)
@@ -95,56 +91,38 @@ void LayoutBoxExtent::setAfter(LayoutUnit value)
void LayoutBoxExtent::setStart(TextDirection direction, LayoutUnit value)
{
- if (isHorizontalWritingMode()) {
- if (isLeftToRightDirection(direction))
- m_left = value;
- else
- m_right = value;
- } else {
- if (isLeftToRightDirection(direction))
- m_top = value;
- else
- m_bottom = value;
- }
+ if (isLeftToRightDirection(direction))
+ m_left = value;
+ else
+ m_right = value;
}
void LayoutBoxExtent::setEnd(TextDirection direction, LayoutUnit value)
{
- if (isHorizontalWritingMode()) {
- if (isLeftToRightDirection(direction))
- m_right = value;
- else
- m_left = value;
- } else {
- if (isLeftToRightDirection(direction))
- m_bottom = value;
- else
- m_top = value;
- }
+ if (isLeftToRightDirection(direction))
+ m_right = value;
+ else
+ m_left = value;
}
LayoutUnit& LayoutBoxExtent::mutableLogicalLeft()
{
- return isHorizontalWritingMode() ? m_left : m_top;
+ return m_left;
}
LayoutUnit& LayoutBoxExtent::mutableLogicalRight()
{
- return isHorizontalWritingMode() ? m_right : m_bottom;
+ return m_right;
}
LayoutUnit& LayoutBoxExtent::mutableBefore()
{
- return isHorizontalWritingMode() ?
- (isFlippedBlocksWritingMode() ? m_bottom : m_top) :
- (isFlippedBlocksWritingMode() ? m_right: m_left);
+ return m_top;
}
LayoutUnit& LayoutBoxExtent::mutableAfter()
{
- return isHorizontalWritingMode() ?
- (isFlippedBlocksWritingMode() ? m_top : m_bottom) :
- (isFlippedBlocksWritingMode() ? m_left: m_right);
+ return m_bottom;
}
} // namespace blink
« no previous file with comments | « sky/engine/platform/geometry/LayoutBoxExtent.h ('k') | sky/engine/platform/text/WritingMode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698