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

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

Issue 2949453002: Make EFlexDirection an enum class. (Closed)
Patch Set: Fix 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 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 5e7869019ee142256f9237c78ff23dd471de1372..0a9fda174500722d5ca751638c56dd094ab96100 100644
--- a/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
@@ -275,7 +275,7 @@ IntSize LayoutFlexibleBox::OriginAdjustmentForScrollbars() const {
TextDirection text_direction = Style()->Direction();
WritingMode writing_mode = Style()->GetWritingMode();
- if (flex_direction == kFlowRow) {
+ if (flex_direction == EFlexDirection::kRow) {
if (text_direction == TextDirection::kRtl) {
if (blink::IsHorizontalWritingMode(writing_mode))
size.Expand(adjustment_width, 0);
@@ -284,7 +284,7 @@ IntSize LayoutFlexibleBox::OriginAdjustmentForScrollbars() const {
}
if (IsFlippedBlocksWritingMode(writing_mode))
size.Expand(adjustment_width, 0);
- } else if (flex_direction == kFlowRowReverse) {
+ } else if (flex_direction == EFlexDirection::kRowReverse) {
if (text_direction == TextDirection::kLtr) {
if (blink::IsHorizontalWritingMode(writing_mode))
size.Expand(adjustment_width, 0);
@@ -293,7 +293,7 @@ IntSize LayoutFlexibleBox::OriginAdjustmentForScrollbars() const {
}
if (IsFlippedBlocksWritingMode(writing_mode))
size.Expand(adjustment_width, 0);
- } else if (flex_direction == kFlowColumn) {
+ } else if (flex_direction == EFlexDirection::kColumn) {
if (IsFlippedBlocksWritingMode(writing_mode))
size.Expand(adjustment_width, 0);
} else {
@@ -308,17 +308,20 @@ IntSize LayoutFlexibleBox::OriginAdjustmentForScrollbars() const {
bool LayoutFlexibleBox::HasTopOverflow() const {
EFlexDirection flex_direction = Style()->FlexDirection();
if (IsHorizontalWritingMode())
- return flex_direction == kFlowColumnReverse;
- return flex_direction ==
- (Style()->IsLeftToRightDirection() ? kFlowRowReverse : kFlowRow);
+ return flex_direction == EFlexDirection::kColumnReverse;
+ return flex_direction == (Style()->IsLeftToRightDirection()
+ ? EFlexDirection::kRowReverse
+ : EFlexDirection::kRow);
}
bool LayoutFlexibleBox::HasLeftOverflow() const {
EFlexDirection flex_direction = Style()->FlexDirection();
- if (IsHorizontalWritingMode())
- return flex_direction ==
- (Style()->IsLeftToRightDirection() ? kFlowRowReverse : kFlowRow);
- return flex_direction == kFlowColumnReverse;
+ if (IsHorizontalWritingMode()) {
+ return flex_direction == (Style()->IsLeftToRightDirection()
+ ? EFlexDirection::kRowReverse
+ : EFlexDirection::kRow);
+ }
+ return flex_direction == EFlexDirection::kColumnReverse;
}
void LayoutFlexibleBox::RemoveChild(LayoutObject* child) {
@@ -470,7 +473,7 @@ bool LayoutFlexibleBox::IsLeftToRightFlow() const {
IsFlippedLinesWritingMode(Style()->GetWritingMode());
}
return Style()->IsLeftToRightDirection() ^
- (Style()->FlexDirection() == kFlowRowReverse);
+ (Style()->FlexDirection() == EFlexDirection::kRowReverse);
}
bool LayoutFlexibleBox::IsMultiline() const {
@@ -1628,8 +1631,8 @@ LayoutUnit LayoutFlexibleBox::StaticMainAxisPositionForPositionedChild(
LayoutUnit offset = InitialContentPositionOffset(available_space,
ResolvedJustifyContent(), 1);
- if (StyleRef().FlexDirection() == kFlowRowReverse ||
- StyleRef().FlexDirection() == kFlowColumnReverse)
+ if (StyleRef().FlexDirection() == EFlexDirection::kRowReverse ||
+ StyleRef().FlexDirection() == EFlexDirection::kColumnReverse)
offset = available_space - offset;
return offset;
}
@@ -1806,7 +1809,7 @@ void LayoutFlexibleBox::LayoutAndPlaceChildren(
FlowAwareBorderStart() + FlowAwarePaddingStart();
main_axis_offset += InitialContentPositionOffset(
available_free_space, justify_content, children.size());
- if (Style()->FlexDirection() == kFlowRowReverse &&
+ if (Style()->FlexDirection() == EFlexDirection::kRowReverse &&
ShouldPlaceBlockDirectionScrollbarOnLogicalLeft())
main_axis_offset += IsHorizontalFlow() ? VerticalScrollbarWidth()
: HorizontalScrollbarHeight();
@@ -1915,7 +1918,7 @@ void LayoutFlexibleBox::LayoutAndPlaceChildren(
LogicalHeight(), main_axis_offset + FlowAwareBorderEnd() +
FlowAwarePaddingEnd() + ScrollbarLogicalHeight()));
- if (Style()->FlexDirection() == kFlowColumnReverse) {
+ if (Style()->FlexDirection() == EFlexDirection::kColumnReverse) {
// We have to do an extra pass for column-reverse to reposition the flex
// items since the start depends on the height of the flexbox, which we
// only know after we've positioned all the flex items.
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSProperties.json5 ('k') | third_party/WebKit/Source/core/layout/LayoutFullScreen.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698