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

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

Issue 2286543002: Add Length::isPercent and use it in tables. (Closed)
Patch Set: rebase Created 4 years, 3 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 f22261a38592dade1450d471678a91c23223bef5..6450699940452f79224dd97822049649e6683fac 100644
--- a/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
@@ -769,7 +769,7 @@ LayoutUnit LayoutFlexibleBox::computeMainSizeFromAspectRatioUsing(const LayoutBo
if (crossSizeLength.isFixed()) {
crossSize = LayoutUnit(crossSizeLength.value());
} else {
- DCHECK(crossSizeLength.hasPercent());
+ DCHECK(crossSizeLength.isPercentOrCalc());
crossSize = hasOrthogonalFlow(child) ?
adjustBorderBoxLogicalWidthForBoxSizing(valueForLength(crossSizeLength, contentWidth())) :
child.computePercentageLogicalHeight(crossSizeLength);
@@ -794,7 +794,7 @@ bool LayoutFlexibleBox::mainAxisLengthIsDefinite(const LayoutBox& child, const L
{
if (flexBasis.isAuto())
return false;
- if (flexBasis.hasPercent()) {
+ if (flexBasis.isPercentOrCalc()) {
if (!isColumnFlow() || m_hasDefiniteHeight == SizeDefiniteness::Definite)
return true;
if (m_hasDefiniteHeight == SizeDefiniteness::Indefinite)
@@ -810,7 +810,7 @@ bool LayoutFlexibleBox::crossAxisLengthIsDefinite(const LayoutBox& child, const
{
if (length.isAuto())
return false;
- if (length.hasPercent()) {
+ if (length.isPercentOrCalc()) {
if (hasOrthogonalFlow(child) || m_hasDefiniteHeight == SizeDefiniteness::Definite)
return true;
if (m_hasDefiniteHeight == SizeDefiniteness::Indefinite)
@@ -1186,7 +1186,7 @@ LayoutUnit LayoutFlexibleBox::mainSizeForPercentageResolution(const LayoutBox& c
const Length& flexBasis = flexBasisForChild(child);
if (!mainAxisLengthIsDefinite(child, flexBasis))
return LayoutUnit(-1);
- if (!flexBasis.hasPercent()) {
+ if (!flexBasis.isPercentOrCalc()) {
// If flex basis had a percentage, our size is guaranteed to be definite or the flex item's
// size could not be definite.
// Otherwise, we make up a percentage to check whether we have a definite size.

Powered by Google App Engine
This is Rietveld 408576698