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

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

Issue 2047743002: [css-flexbox] logical widths are always definite. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 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
« no previous file with comments | « third_party/WebKit/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: 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 e8134f47117114199ad7eba49d503d2795bde7cc..074460c044204223227c1dab928cebcce55e3b81 100644
--- a/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
@@ -761,7 +761,7 @@ bool LayoutFlexibleBox::mainAxisLengthIsDefinite(const LayoutBox& child, const L
if (flexBasis.hasPercent()) {
return isColumnFlow() ?
child.computePercentageLogicalHeight(flexBasis) != -1 :
- hasDefiniteLogicalWidth();
+ true;
}
return true;
}
@@ -772,7 +772,7 @@ bool LayoutFlexibleBox::crossAxisLengthIsDefinite(const LayoutBox& child, const
return false;
if (length.hasPercent()) {
return hasOrthogonalFlow(child) ?
- hasDefiniteLogicalWidth() :
+ true :
child.computePercentageLogicalHeight(length) != -1;
}
// TODO(cbiesinger): Eventually we should support other types of sizes here. Requires updating
@@ -1107,40 +1107,6 @@ LayoutUnit LayoutFlexibleBox::adjustChildSizeForMinAndMax(const LayoutBox& child
return std::max(childSize, minExtent);
}
-LayoutUnit LayoutFlexibleBox::computeDefiniteLogicalWidth()
-{
- const Length& widthLength = styleRef().logicalWidth();
- if (widthLength.hasPercent() && !hasDefiniteLogicalWidth())
- return LayoutUnit(-1);
-
- if (widthLength.isAuto()) {
- // We can still have a definite width even with width: auto if we're a flex item ourselves
- if (!isFlexItem())
- return LayoutUnit(-1);
- return toLayoutFlexibleBox(parent())->childLogicalWidthForPercentageResolution(*this);
- }
- LogicalExtentComputedValues computedValues;
- computeLogicalWidth(computedValues);
- return computedValues.m_extent;
-}
-
-LayoutUnit LayoutFlexibleBox::computeDefiniteLogicalHeight()
-{
- const Length& heightLength = styleRef().logicalHeight();
- if (heightLength.hasPercent()) {
- return computePercentageLogicalHeight(heightLength);
- }
- if (heightLength.isAuto()) {
- // We can still have a definite height even with height: auto if we're a flex item ourselves
- if (!isFlexItem())
- return LayoutUnit(-1);
- return toLayoutFlexibleBox(parent())->childLogicalHeightForPercentageResolution(*this);
- }
- LogicalExtentComputedValues computedValues;
- computeLogicalHeight(LayoutUnit(-1), LayoutUnit(), computedValues);
- return computedValues.m_extent;
-}
-
LayoutUnit LayoutFlexibleBox::crossSizeForPercentageResolution(const LayoutBox& child)
{
if (alignmentForChild(child) != ItemPositionStretch)
@@ -1189,13 +1155,6 @@ LayoutUnit LayoutFlexibleBox::childLogicalHeightForPercentageResolution(const La
return mainSizeForPercentageResolution(child);
}
-LayoutUnit LayoutFlexibleBox::childLogicalWidthForPercentageResolution(const LayoutBox& child)
-{
- if (hasOrthogonalFlow(child))
- return crossSizeForPercentageResolution(child);
- return mainSizeForPercentageResolution(child);
-}
-
LayoutUnit LayoutFlexibleBox::adjustChildSizeForAspectRatioCrossAxisMinAndMax(const LayoutBox& child, LayoutUnit childSize)
{
Length crossMin = isHorizontalFlow() ? child.style()->minHeight() : child.style()->minWidth();
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutFlexibleBox.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698