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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp

Issue 2595833002: Replaced usages of WritingMode to use inline utility functions instead (Closed)
Patch Set: Rebase and fixed ::blink with just blink:: Created 4 years 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
Index: third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp b/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
index fc8c89517280fc5c81ddaaee5f9a44dc2956ecb8..07b85d06d2497e256ce2d09379774135f17190d9 100644
--- a/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
@@ -270,29 +270,29 @@ IntSize LayoutFlexibleBox::originAdjustmentForScrollbars() const {
if (flexDirection == FlowRow) {
if (textDirection == TextDirection::Rtl) {
- if (writingMode == TopToBottomWritingMode)
+ if (blink::isHorizontalWritingMode(writingMode))
size.expand(adjustmentWidth, 0);
else
size.expand(0, adjustmentHeight);
}
- if (writingMode == RightToLeftWritingMode)
+ if (isFlippedBlocksWritingMode(writingMode))
size.expand(adjustmentWidth, 0);
} else if (flexDirection == FlowRowReverse) {
if (textDirection == TextDirection::Ltr) {
- if (writingMode == TopToBottomWritingMode)
+ if (blink::isHorizontalWritingMode(writingMode))
size.expand(adjustmentWidth, 0);
else
size.expand(0, adjustmentHeight);
}
- if (writingMode == RightToLeftWritingMode)
+ if (isFlippedBlocksWritingMode(writingMode))
size.expand(adjustmentWidth, 0);
} else if (flexDirection == FlowColumn) {
- if (writingMode == RightToLeftWritingMode)
+ if (isFlippedBlocksWritingMode(writingMode))
size.expand(adjustmentWidth, 0);
} else {
- if (writingMode == TopToBottomWritingMode)
+ if (blink::isHorizontalWritingMode(writingMode))
size.expand(0, adjustmentHeight);
- else if (writingMode == LeftToRightWritingMode)
+ else if (isFlippedLinesWritingMode(writingMode))
size.expand(adjustmentWidth, 0);
}
return size;
@@ -459,9 +459,10 @@ bool LayoutFlexibleBox::isHorizontalFlow() const {
}
bool LayoutFlexibleBox::isLeftToRightFlow() const {
- if (isColumnFlow())
- return style()->getWritingMode() == TopToBottomWritingMode ||
- style()->getWritingMode() == LeftToRightWritingMode;
+ if (isColumnFlow()) {
+ return blink::isHorizontalWritingMode(style()->getWritingMode()) ||
+ isFlippedLinesWritingMode(style()->getWritingMode());
+ }
return style()->isLeftToRightDirection() ^
(style()->flexDirection() == FlowRowReverse);
}
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutTableCell.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698