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

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

Issue 1268253002: Rename mainAxisIsIndefinite to mainAxisIsDefinite for easier readability (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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 | « Source/core/layout/LayoutFlexibleBox.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutFlexibleBox.cpp
diff --git a/Source/core/layout/LayoutFlexibleBox.cpp b/Source/core/layout/LayoutFlexibleBox.cpp
index 04978014df78e11f96be8b7dc8a8cda4df07dc56..8bb2badf816c1f1f4cf845946db3cf09beed9238 100644
--- a/Source/core/layout/LayoutFlexibleBox.cpp
+++ b/Source/core/layout/LayoutFlexibleBox.cpp
@@ -591,22 +591,22 @@ LayoutUnit LayoutFlexibleBox::mainAxisBorderAndPaddingExtentForChild(LayoutBox&
return isHorizontalFlow() ? child.borderAndPaddingWidth() : child.borderAndPaddingHeight();
}
-bool LayoutFlexibleBox::mainAxisLengthIsIndefinite(LayoutBox& child, const Length& flexBasis) const
+bool LayoutFlexibleBox::mainAxisLengthIsDefinite(LayoutBox& child, const Length& flexBasis) const
{
if (flexBasis.isAuto())
- return true;
+ return false;
if (flexBasis.hasPercent()) {
return isColumnFlow() ?
- child.computePercentageLogicalHeight(flexBasis) == -1 :
- !hasDefiniteLogicalWidth();
+ child.computePercentageLogicalHeight(flexBasis) != -1 :
+ hasDefiniteLogicalWidth();
}
// FIXME(cbiesinger): Is this correct?
- return false;
+ return true;
}
bool LayoutFlexibleBox::childFlexBaseSizeRequiresLayout(LayoutBox& child) const
{
- return mainAxisLengthIsIndefinite(child, flexBasisForChild(child)) && hasOrthogonalFlow(child);
+ return !mainAxisLengthIsDefinite(child, flexBasisForChild(child)) && hasOrthogonalFlow(child);
}
LayoutUnit LayoutFlexibleBox::computeInnerFlexBaseSizeForChild(LayoutBox& child, ChildLayoutType childLayoutType)
@@ -617,7 +617,7 @@ LayoutUnit LayoutFlexibleBox::computeInnerFlexBaseSizeForChild(LayoutBox& child,
UseCounter::count(document(), UseCounter::AspectRatioFlexItem);
Length flexBasis = flexBasisForChild(child);
- if (mainAxisLengthIsIndefinite(child, flexBasis)) {
+ if (!mainAxisLengthIsDefinite(child, flexBasis)) {
LayoutUnit mainAxisExtent;
if (hasOrthogonalFlow(child)) {
if (childLayoutType == NeverLayout)
@@ -864,7 +864,7 @@ LayoutUnit LayoutFlexibleBox::adjustChildSizeForMinAndMax(LayoutBox& child, Layo
contentSize = maxExtent;
Length mainSize = isHorizontalFlow() ? child.styleRef().width() : child.styleRef().height();
- if (!mainAxisLengthIsIndefinite(child, mainSize)) {
+ if (mainAxisLengthIsDefinite(child, mainSize)) {
LayoutUnit resolvedMainSize = computeMainAxisExtentForChild(child, MainOrPreferredSize, mainSize);
ASSERT(resolvedMainSize >= 0);
LayoutUnit specifiedSize = maxExtent != -1 ? std::min(resolvedMainSize, maxExtent) : resolvedMainSize;
« no previous file with comments | « Source/core/layout/LayoutFlexibleBox.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698