Title: [184055] trunk/Source/WebCore
Revision
184055
Author
commit-qu...@webkit.org
Date
2015-05-10 14:43:26 -0700 (Sun, 10 May 2015)

Log Message

Rename Length::isPercent() and Length::isPercentNotCalculated().
https://bugs.webkit.org/show_bug.cgi?id=144791

Patch by Sungmann Cho <sungmann....@navercorp.com> on 2015-05-10
Reviewed by Darin Adler.

1. Rename these methods as below for consistency and clarity.

Length::isPercentNotCalculated() => Length::isPercent()
Length::isPercent() => Length::isPercentOrCalculated()

2. Simplify the condition check of length type in SVGLengthContext::valueForLength().

"length.isPercent() && !length.isCalculated()" => "length.isPercent()"

No new tests, no behavior change.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForImageSliceSide):
(WebCore::valueForReflection):
(WebCore::percentageOrZoomAdjustedValue):
(WebCore::lineHeightFromStyle):
(WebCore::ComputedStyleExtractor::propertyValue):
* html/HTMLPlugInImageElement.cpp:
(WebCore::is100Percent):
* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::computeTransformedExtentViaTransformList):
* platform/Length.h:
(WebCore::Length::percent):
(WebCore::Length::isPercent):
(WebCore::Length::isPercentOrCalculated):
(WebCore::Length::isSpecified):
(WebCore::Length::isPercentNotCalculated): Deleted.
* platform/graphics/transforms/TranslateTransformOperation.h:
* rendering/AutoTableLayout.cpp:
(WebCore::AutoTableLayout::recalcColumn):
(WebCore::AutoTableLayout::fullRecalc):
(WebCore::shouldScaleColumns):
(WebCore::AutoTableLayout::computeIntrinsicLogicalWidths):
(WebCore::AutoTableLayout::calcEffectiveLogicalWidth):
(WebCore::AutoTableLayout::layout):
* rendering/FixedTableLayout.cpp:
(WebCore::FixedTableLayout::calcWidthArray):
(WebCore::FixedTableLayout::applyPreferredLogicalWidthQuirks):
(WebCore::FixedTableLayout::layout):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::isSelfCollapsingBlock):
(WebCore::RenderBlock::textIndentOffset):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::needsPreferredWidthsRecalculation):
(WebCore::RenderBox::computeLogicalHeight):
(WebCore::RenderBox::computeContentAndScrollbarLogicalHeightUsing):
(WebCore::RenderBox::computePercentageLogicalHeight):
(WebCore::RenderBox::computeReplacedLogicalWidthRespectingMinMaxWidth):
(WebCore::RenderBox::computeReplacedLogicalWidthUsing):
(WebCore::RenderBox::computeReplacedLogicalHeightUsing):
(WebCore::RenderBox::availableLogicalHeightUsing):
(WebCore::logicalWidthIsResolvable):
(WebCore::RenderBox::percentageLogicalHeightIsResolvableFromBlock):
(WebCore::RenderBox::hasUnsplittableScrollingOverflow):
(WebCore::RenderBox::layoutOverflowRectForPropagation):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight):
(WebCore::RenderBoxModelObject::relativePositionOffset):
(WebCore::RenderBoxModelObject::computedCSSPadding):
(WebCore::RenderBoxModelObject::calculateImageIntrinsicDimensions):
(WebCore::RenderBoxModelObject::calculateFillTileSize):
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
(WebCore::RenderDeprecatedFlexibleBox::clearLineClamp):
* rendering/RenderElement.cpp:
(WebCore::mustRepaintFillLayers):
* rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::computeIntrinsicLogicalWidths):
* rendering/RenderFrameSet.cpp:
(WebCore::RenderFrameSet::layOutAxis):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::repaintOrMarkForLayout):
* rendering/RenderInline.cpp:
(WebCore::computeMargin):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::computeIntrinsicLogicalWidths):
* rendering/RenderMenuList.cpp:
(RenderMenuList::computeIntrinsicLogicalWidths):
* rendering/RenderObject.cpp:
(WebCore::objectIsRelayoutBoundary):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::computePreferredLogicalWidths):
* rendering/RenderSlider.cpp:
(WebCore::RenderSlider::computeIntrinsicLogicalWidths):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::layoutRows):
* rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::computeIntrinsicLogicalWidths):
* rendering/RenderView.cpp:
(WebCore::RenderView::layout):
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::verticalPositionForBox):
* rendering/style/GridLength.h:
(WebCore::GridLength::isPercentage):
* rendering/style/GridTrackSize.h:
(WebCore::GridTrackSize::isPercentage):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::computedLineHeight):
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::hasRelativeDimensions):
* svg/SVGLengthContext.cpp:
(WebCore::SVGLengthContext::valueForLength):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::hasRelativeWidth):
(WebCore::SVGImage::hasRelativeHeight):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (184054 => 184055)


--- trunk/Source/WebCore/ChangeLog	2015-05-10 21:26:51 UTC (rev 184054)
+++ trunk/Source/WebCore/ChangeLog	2015-05-10 21:43:26 UTC (rev 184055)
@@ -1,5 +1,120 @@
 2015-05-10  Sungmann Cho  <sungmann....@navercorp.com>
 
+        Rename Length::isPercent() and Length::isPercentNotCalculated().
+        https://bugs.webkit.org/show_bug.cgi?id=144791
+
+        Reviewed by Darin Adler.
+
+        1. Rename these methods as below for consistency and clarity.
+
+        Length::isPercentNotCalculated() => Length::isPercent()
+        Length::isPercent() => Length::isPercentOrCalculated()
+
+        2. Simplify the condition check of length type in SVGLengthContext::valueForLength().
+
+        "length.isPercent() && !length.isCalculated()" => "length.isPercent()"
+
+        No new tests, no behavior change.
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::valueForImageSliceSide):
+        (WebCore::valueForReflection):
+        (WebCore::percentageOrZoomAdjustedValue):
+        (WebCore::lineHeightFromStyle):
+        (WebCore::ComputedStyleExtractor::propertyValue):
+        * html/HTMLPlugInImageElement.cpp:
+        (WebCore::is100Percent):
+        * page/animation/AnimationBase.cpp:
+        (WebCore::AnimationBase::computeTransformedExtentViaTransformList):
+        * platform/Length.h:
+        (WebCore::Length::percent):
+        (WebCore::Length::isPercent):
+        (WebCore::Length::isPercentOrCalculated):
+        (WebCore::Length::isSpecified):
+        (WebCore::Length::isPercentNotCalculated): Deleted.
+        * platform/graphics/transforms/TranslateTransformOperation.h:
+        * rendering/AutoTableLayout.cpp:
+        (WebCore::AutoTableLayout::recalcColumn):
+        (WebCore::AutoTableLayout::fullRecalc):
+        (WebCore::shouldScaleColumns):
+        (WebCore::AutoTableLayout::computeIntrinsicLogicalWidths):
+        (WebCore::AutoTableLayout::calcEffectiveLogicalWidth):
+        (WebCore::AutoTableLayout::layout):
+        * rendering/FixedTableLayout.cpp:
+        (WebCore::FixedTableLayout::calcWidthArray):
+        (WebCore::FixedTableLayout::applyPreferredLogicalWidthQuirks):
+        (WebCore::FixedTableLayout::layout):
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::isSelfCollapsingBlock):
+        (WebCore::RenderBlock::textIndentOffset):
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::needsPreferredWidthsRecalculation):
+        (WebCore::RenderBox::computeLogicalHeight):
+        (WebCore::RenderBox::computeContentAndScrollbarLogicalHeightUsing):
+        (WebCore::RenderBox::computePercentageLogicalHeight):
+        (WebCore::RenderBox::computeReplacedLogicalWidthRespectingMinMaxWidth):
+        (WebCore::RenderBox::computeReplacedLogicalWidthUsing):
+        (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
+        (WebCore::RenderBox::availableLogicalHeightUsing):
+        (WebCore::logicalWidthIsResolvable):
+        (WebCore::RenderBox::percentageLogicalHeightIsResolvableFromBlock):
+        (WebCore::RenderBox::hasUnsplittableScrollingOverflow):
+        (WebCore::RenderBox::layoutOverflowRectForPropagation):
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight):
+        (WebCore::RenderBoxModelObject::relativePositionOffset):
+        (WebCore::RenderBoxModelObject::computedCSSPadding):
+        (WebCore::RenderBoxModelObject::calculateImageIntrinsicDimensions):
+        (WebCore::RenderBoxModelObject::calculateFillTileSize):
+        * rendering/RenderDeprecatedFlexibleBox.cpp:
+        (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
+        (WebCore::RenderDeprecatedFlexibleBox::clearLineClamp):
+        * rendering/RenderElement.cpp:
+        (WebCore::mustRepaintFillLayers):
+        * rendering/RenderFileUploadControl.cpp:
+        (WebCore::RenderFileUploadControl::computeIntrinsicLogicalWidths):
+        * rendering/RenderFrameSet.cpp:
+        (WebCore::RenderFrameSet::layOutAxis):
+        * rendering/RenderImage.cpp:
+        (WebCore::RenderImage::repaintOrMarkForLayout):
+        * rendering/RenderInline.cpp:
+        (WebCore::computeMargin):
+        * rendering/RenderListBox.cpp:
+        (WebCore::RenderListBox::computeIntrinsicLogicalWidths):
+        * rendering/RenderMenuList.cpp:
+        (RenderMenuList::computeIntrinsicLogicalWidths):
+        * rendering/RenderObject.cpp:
+        (WebCore::objectIsRelayoutBoundary):
+        * rendering/RenderReplaced.cpp:
+        (WebCore::RenderReplaced::computePreferredLogicalWidths):
+        * rendering/RenderSlider.cpp:
+        (WebCore::RenderSlider::computeIntrinsicLogicalWidths):
+        * rendering/RenderTable.cpp:
+        (WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight):
+        * rendering/RenderTableSection.cpp:
+        (WebCore::RenderTableSection::layoutRows):
+        * rendering/RenderTextControl.cpp:
+        (WebCore::RenderTextControl::computeIntrinsicLogicalWidths):
+        * rendering/RenderView.cpp:
+        (WebCore::RenderView::layout):
+        * rendering/RootInlineBox.cpp:
+        (WebCore::RootInlineBox::verticalPositionForBox):
+        * rendering/style/GridLength.h:
+        (WebCore::GridLength::isPercentage):
+        * rendering/style/GridTrackSize.h:
+        (WebCore::GridTrackSize::isPercentage):
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::RenderStyle::computedLineHeight):
+        * rendering/svg/RenderSVGRoot.cpp:
+        (WebCore::RenderSVGRoot::hasRelativeDimensions):
+        * svg/SVGLengthContext.cpp:
+        (WebCore::SVGLengthContext::valueForLength):
+        * svg/graphics/SVGImage.cpp:
+        (WebCore::SVGImage::hasRelativeWidth):
+        (WebCore::SVGImage::hasRelativeHeight):
+
+2015-05-10  Sungmann Cho  <sungmann....@navercorp.com>
+
         Remove unnecessary semicolons.
         https://bugs.webkit.org/show_bug.cgi?id=144844
 

Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (184054 => 184055)


--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2015-05-10 21:26:51 UTC (rev 184054)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2015-05-10 21:43:26 UTC (rev 184055)
@@ -483,7 +483,7 @@
 {
     // These values can be percentages, numbers, or while an animation of mixed types is in progress,
     // a calculation that combines a percentage and a number.
-    if (length.isPercentNotCalculated())
+    if (length.isPercent())
         return cssValuePool().createValue(length.percent(), CSSPrimitiveValue::CSS_PERCENTAGE);
     if (length.isFixed())
         return cssValuePool().createValue(length.value(), CSSPrimitiveValue::CSS_NUMBER);
@@ -646,7 +646,7 @@
         return cssValuePool().createIdentifierValue(CSSValueNone);
 
     RefPtr<CSSPrimitiveValue> offset;
-    if (reflection->offset().isPercent())
+    if (reflection->offset().isPercentOrCalculated())
         offset = cssValuePool().createValue(reflection->offset().percent(), CSSPrimitiveValue::CSS_PERCENTAGE);
     else
         offset = zoomAdjustedPixelValue(reflection->offset().value(), style);
@@ -736,7 +736,7 @@
 
 static Ref<CSSPrimitiveValue> percentageOrZoomAdjustedValue(Length length, const RenderStyle* style)
 {
-    if (length.isPercentNotCalculated())
+    if (length.isPercent())
         return cssValuePool().createValue(length.percent(), CSSPrimitiveValue::CSS_PERCENTAGE);
     
     return zoomAdjustedPixelValue(valueForLength(length, 0), style);
@@ -1559,7 +1559,7 @@
     Length length = style->lineHeight();
     if (length.isNegative()) // If true, line-height not set; use the font's line spacing.
         return zoomAdjustedPixelValue(style->fontMetrics().floatLineSpacing(), style);
-    if (length.isPercentNotCalculated()) {
+    if (length.isPercent()) {
         // This is imperfect, because it doesn't include the zoom factor and the real computation
         // for how high to be in pixels does include things like minimum font size and the zoom factor.
         // On the other hand, since font-size doesn't include the zoom factor, we really can't do
@@ -2429,7 +2429,7 @@
             if (marginRight.isFixed() || !is<RenderBox>(renderer))
                 return zoomAdjustedPixelValueForLength(marginRight, style.get());
             float value;
-            if (marginRight.isPercent()) {
+            if (marginRight.isPercentOrCalculated()) {
                 // RenderBox gives a marginRight() that is the distance between the right-edge of the child box
                 // and the right-edge of the containing box, when display == BLOCK. Let's calculate the absolute
                 // value of the specified margin-right % instead of relying on RenderBox's marginRight() value.

Modified: trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp (184054 => 184055)


--- trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp	2015-05-10 21:26:51 UTC (rev 184054)
+++ trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp	2015-05-10 21:43:26 UTC (rev 184055)
@@ -571,7 +571,7 @@
 
 static inline bool is100Percent(Length length)
 {
-    return length.isPercentNotCalculated() && length.percent() == 100;
+    return length.isPercent() && length.percent() == 100;
 }
     
 static inline bool isSmallerThanTinySizingThreshold(const RenderEmbeddedObject& renderer)

Modified: trunk/Source/WebCore/page/animation/AnimationBase.cpp (184054 => 184055)


--- trunk/Source/WebCore/page/animation/AnimationBase.cpp	2015-05-10 21:26:51 UTC (rev 184054)
+++ trunk/Source/WebCore/page/animation/AnimationBase.cpp	2015-05-10 21:43:26 UTC (rev 184055)
@@ -778,8 +778,8 @@
     
     bool applyTransformOrigin = containsRotation(style.transform().operations()) || style.transform().affectedByTransformOrigin();
     if (applyTransformOrigin) {
-        float offsetX = style.transformOriginX().isPercentNotCalculated() ? rendererBox.x() : 0;
-        float offsetY = style.transformOriginY().isPercentNotCalculated() ? rendererBox.y() : 0;
+        float offsetX = style.transformOriginX().isPercent() ? rendererBox.x() : 0;
+        float offsetY = style.transformOriginY().isPercent() ? rendererBox.y() : 0;
 
         transformOrigin.setX(floatValueForLength(style.transformOriginX(), rendererBox.width()) + offsetX);
         transformOrigin.setY(floatValueForLength(style.transformOriginY(), rendererBox.height()) + offsetY);

Modified: trunk/Source/WebCore/platform/Length.h (184054 => 184055)


--- trunk/Source/WebCore/platform/Length.h	2015-05-10 21:26:51 UTC (rev 184054)
+++ trunk/Source/WebCore/platform/Length.h	2015-05-10 21:43:26 UTC (rev 184055)
@@ -84,7 +84,7 @@
     bool isFixed() const;
     bool isMaxContent() const;
     bool isMinContent() const;
-    bool isPercentNotCalculated() const; // FIXME: Rename to isPercent.
+    bool isPercent() const;
     bool isRelative() const;
     bool isUndefined() const;
 
@@ -98,7 +98,7 @@
     bool isPositive() const;
     bool isNegative() const;
 
-    bool isPercent() const; // Returns true for both Percent and Calculated. FIXME: Find a better name for this.
+    bool isPercentOrCalculated() const; // Returns true for both Percent and Calculated.
 
     bool isIntrinsic() const;
     bool isIntrinsicOrAuto() const;
@@ -260,7 +260,7 @@
 
 inline float Length::percent() const
 {
-    ASSERT(isPercentNotCalculated());
+    ASSERT(isPercent());
     return value();
 }
 
@@ -333,7 +333,7 @@
     return m_isFloat ? (m_floatValue < 0) : (m_intValue < 0);
 }
 
-inline bool Length::isPercentNotCalculated() const
+inline bool Length::isPercent() const
 {
     return type() == Percent;
 }
@@ -348,9 +348,9 @@
     return type() == Undefined;
 }
 
-inline bool Length::isPercent() const
+inline bool Length::isPercentOrCalculated() const
 {
-    return isPercentNotCalculated() || isCalculated();
+    return isPercent() || isCalculated();
 }
 
 inline bool Length::isPositive() const
@@ -392,7 +392,7 @@
 
 inline bool Length::isSpecified() const
 {
-    return isFixed() || isPercent();
+    return isFixed() || isPercentOrCalculated();
 }
 
 inline bool Length::isSpecifiedOrIntrinsic() const

Modified: trunk/Source/WebCore/platform/graphics/transforms/TranslateTransformOperation.h (184054 => 184055)


--- trunk/Source/WebCore/platform/graphics/transforms/TranslateTransformOperation.h	2015-05-10 21:26:51 UTC (rev 184054)
+++ trunk/Source/WebCore/platform/graphics/transforms/TranslateTransformOperation.h	2015-05-10 21:43:26 UTC (rev 184055)
@@ -67,7 +67,7 @@
     virtual bool apply(TransformationMatrix& transform, const FloatSize& borderBoxSize) const override
     {
         transform.translate3d(x(borderBoxSize), y(borderBoxSize), z(borderBoxSize));
-        return m_x.isPercentNotCalculated() || m_y.isPercentNotCalculated();
+        return m_x.isPercent() || m_y.isPercent();
     }
 
     virtual PassRefPtr<TransformOperation> blend(const TransformOperation* from, double progress, bool blendToIdentity = false) override;

Modified: trunk/Source/WebCore/rendering/AutoTableLayout.cpp (184054 => 184055)


--- trunk/Source/WebCore/rendering/AutoTableLayout.cpp	2015-05-10 21:26:51 UTC (rev 184054)
+++ trunk/Source/WebCore/rendering/AutoTableLayout.cpp	2015-05-10 21:43:26 UTC (rev 184055)
@@ -92,7 +92,7 @@
                     switch (cellLogicalWidth.type()) {
                     case Fixed:
                         // ignore width=0
-                        if (cellLogicalWidth.isPositive() && !columnLayout.logicalWidth.isPercent()) {
+                        if (cellLogicalWidth.isPositive() && !columnLayout.logicalWidth.isPercentOrCalculated()) {
                             int logicalWidth = cell->adjustBorderBoxLogicalWidthForBoxSizing(cellLogicalWidth.value());
                             if (columnLayout.logicalWidth.isFixed()) {
                                 // Nav/IE weirdness
@@ -109,7 +109,7 @@
                         break;
                     case Percent:
                         m_hasPercent = true;
-                        if (cellLogicalWidth.isPositive() && (!columnLayout.logicalWidth.isPercentNotCalculated() || cellLogicalWidth.percent() > columnLayout.logicalWidth.percent()))
+                        if (cellLogicalWidth.isPositive() && (!columnLayout.logicalWidth.isPercent() || cellLogicalWidth.percent() > columnLayout.logicalWidth.percent()))
                             columnLayout.logicalWidth = cellLogicalWidth;
                         break;
                     case Relative:
@@ -159,7 +159,7 @@
             Length colLogicalWidth = column->style().logicalWidth();
             if (colLogicalWidth.isAuto())
                 colLogicalWidth = groupLogicalWidth;
-            if ((colLogicalWidth.isFixed() || colLogicalWidth.isPercent()) && colLogicalWidth.isZero())
+            if ((colLogicalWidth.isFixed() || colLogicalWidth.isPercentOrCalculated()) && colLogicalWidth.isZero())
                 colLogicalWidth = Length();
             unsigned effCol = m_table->colToEffCol(currentColumn);
             unsigned span = column->span();
@@ -188,7 +188,7 @@
     bool scale = true;
     while (table) {
         Length tableWidth = table->style().width();
-        if ((tableWidth.isAuto() || tableWidth.isPercent()) && !table->isOutOfFlowPositioned()) {
+        if ((tableWidth.isAuto() || tableWidth.isPercentOrCalculated()) && !table->isOutOfFlowPositioned()) {
             RenderBlock* containingBlock = table->containingBlock();
             while (containingBlock && !is<RenderView>(*containingBlock) && !is<RenderTableCell>(*containingBlock)
                 && containingBlock->style().width().isAuto() && !containingBlock->isOutOfFlowPositioned())
@@ -196,7 +196,7 @@
 
             table = nullptr;
             if (is<RenderTableCell>(containingBlock)
-                && (containingBlock->style().width().isAuto() || containingBlock->style().width().isPercent())) {
+                && (containingBlock->style().width().isAuto() || containingBlock->style().width().isPercentOrCalculated())) {
                 RenderTableCell& cell = downcast<RenderTableCell>(*containingBlock);
                 if (cell.colSpan() > 1 || cell.table()->style().width().isAuto())
                     scale = false;
@@ -230,7 +230,7 @@
         minWidth += m_layoutStruct[i].effectiveMinLogicalWidth;
         maxWidth += m_layoutStruct[i].effectiveMaxLogicalWidth;
         if (scaleColumns) {
-            if (m_layoutStruct[i].effectiveLogicalWidth.isPercentNotCalculated()) {
+            if (m_layoutStruct[i].effectiveLogicalWidth.isPercent()) {
                 float percent = std::min(m_layoutStruct[i].effectiveLogicalWidth.percent(), remainingPercent);
                 float logicalWidth = static_cast<float>(m_layoutStruct[i].effectiveMaxLogicalWidth) * 100 / std::max(percent, epsilon);
                 maxPercent = std::max(logicalWidth,  maxPercent);
@@ -323,7 +323,7 @@
                 //   <tr><td>1</td><td colspan=2>2-3</tr>
                 //   <tr><td>1</td><td colspan=2 width=100%>2-3</td></tr>
                 // </table>
-                if (!columnLayout.effectiveLogicalWidth.isPercentNotCalculated()) {
+                if (!columnLayout.effectiveLogicalWidth.isPercent()) {
                     columnLayout.effectiveLogicalWidth = Length();
                     allColsArePercent = false;
                 } else
@@ -341,7 +341,7 @@
         }
 
         // adjust table max width if needed
-        if (cellLogicalWidth.isPercentNotCalculated()) {
+        if (cellLogicalWidth.isPercent()) {
             if (totalPercent > cellLogicalWidth.percent() || allColsArePercent) {
                 // can't satify this condition, treat as variable
                 cellLogicalWidth = Length();
@@ -352,12 +352,12 @@
                 float percentMissing = cellLogicalWidth.percent() - totalPercent;
                 int totalWidth = 0;
                 for (unsigned pos = effCol; pos < lastCol; ++pos) {
-                    if (!m_layoutStruct[pos].effectiveLogicalWidth.isPercent())
+                    if (!m_layoutStruct[pos].effectiveLogicalWidth.isPercentOrCalculated())
                         totalWidth += m_layoutStruct[pos].effectiveMaxLogicalWidth;
                 }
 
                 for (unsigned pos = effCol; pos < lastCol && totalWidth > 0; ++pos) {
-                    if (!m_layoutStruct[pos].effectiveLogicalWidth.isPercent()) {
+                    if (!m_layoutStruct[pos].effectiveLogicalWidth.isPercentOrCalculated()) {
                         float percent = percentMissing * static_cast<float>(m_layoutStruct[pos].effectiveMaxLogicalWidth) / totalWidth;
                         totalWidth -= m_layoutStruct[pos].effectiveMaxLogicalWidth;
                         percentMissing -= percent;
@@ -384,9 +384,9 @@
                 int allocatedMinLogicalWidth = 0;
                 int allocatedMaxLogicalWidth = 0;
                 for (unsigned pos = effCol; pos < lastCol; ++pos) {
-                    ASSERT(m_layoutStruct[pos].logicalWidth.isPercentNotCalculated() || m_layoutStruct[pos].effectiveLogicalWidth.isPercentNotCalculated());
+                    ASSERT(m_layoutStruct[pos].logicalWidth.isPercent() || m_layoutStruct[pos].effectiveLogicalWidth.isPercent());
                     // |allColsArePercent| means that either the logicalWidth *or* the effectiveLogicalWidth are percents, handle both of them here.
-                    float percent = m_layoutStruct[pos].logicalWidth.isPercentNotCalculated() ? m_layoutStruct[pos].logicalWidth.percent() : m_layoutStruct[pos].effectiveLogicalWidth.percent();
+                    float percent = m_layoutStruct[pos].logicalWidth.isPercent() ? m_layoutStruct[pos].logicalWidth.percent() : m_layoutStruct[pos].effectiveLogicalWidth.percent();
                     int columnMinLogicalWidth = static_cast<int>(percent * cellMinLogicalWidth / totalPercent);
                     int columnMaxLogicalWidth = static_cast<int>(percent * cellMaxLogicalWidth / totalPercent);
                     m_layoutStruct[pos].effectiveMinLogicalWidth = std::max(m_layoutStruct[pos].effectiveMinLogicalWidth, columnMinLogicalWidth);
@@ -426,7 +426,7 @@
                 }
             }
         }
-        if (!cellLogicalWidth.isPercent()) {
+        if (!cellLogicalWidth.isPercentOrCalculated()) {
             if (cellMaxLogicalWidth > spanMaxLogicalWidth) {
                 for (unsigned pos = effCol; spanMaxLogicalWidth >= 0 && pos < lastCol; ++pos) {
                     int colMaxLogicalWidth = std::max(m_layoutStruct[pos].effectiveMaxLogicalWidth, static_cast<int>(spanMaxLogicalWidth ? cellMaxLogicalWidth * static_cast<float>(m_layoutStruct[pos].effectiveMaxLogicalWidth) / spanMaxLogicalWidth : cellMaxLogicalWidth));
@@ -541,7 +541,7 @@
     if (available > 0 && havePercent) {
         for (size_t i = 0; i < nEffCols; ++i) {
             Length& logicalWidth = m_layoutStruct[i].effectiveLogicalWidth;
-            if (logicalWidth.isPercent()) {
+            if (logicalWidth.isPercentOrCalculated()) {
                 int cellLogicalWidth = std::max<int>(m_layoutStruct[i].effectiveMinLogicalWidth, minimumValueForLength(logicalWidth, tableLogicalWidth));
                 available += m_layoutStruct[i].computedLogicalWidth - cellLogicalWidth;
                 m_layoutStruct[i].computedLogicalWidth = cellLogicalWidth;
@@ -552,7 +552,7 @@
             int excess = tableLogicalWidth * (totalPercent - 100) / 100;
             for (unsigned i = nEffCols; i; ) {
                 --i;
-                if (m_layoutStruct[i].effectiveLogicalWidth.isPercent()) {
+                if (m_layoutStruct[i].effectiveLogicalWidth.isPercentOrCalculated()) {
                     int cellLogicalWidth = m_layoutStruct[i].computedLogicalWidth;
                     int reduction = std::min(cellLogicalWidth,  excess);
                     // the lines below might look inconsistent, but that's the way it's handled in mozilla
@@ -620,7 +620,7 @@
     if (available > 0 && m_hasPercent && totalPercent < 100) {
         for (size_t i = 0; i < nEffCols; ++i) {
             Length& logicalWidth = m_layoutStruct[i].effectiveLogicalWidth;
-            if (logicalWidth.isPercentNotCalculated()) {
+            if (logicalWidth.isPercent()) {
                 int cellLogicalWidth = available * logicalWidth.percent() / totalPercent;
                 available -= cellLogicalWidth;
                 totalPercent -= logicalWidth.percent();
@@ -733,14 +733,14 @@
             for (unsigned i = nEffCols; i; ) {
                 --i;
                 Length& logicalWidth = m_layoutStruct[i].effectiveLogicalWidth;
-                if (logicalWidth.isPercent())
+                if (logicalWidth.isPercentOrCalculated())
                     logicalWidthBeyondMin += m_layoutStruct[i].computedLogicalWidth - m_layoutStruct[i].effectiveMinLogicalWidth;
             }
             
             for (unsigned i = nEffCols; i && logicalWidthBeyondMin > 0; ) {
                 --i;
                 Length& logicalWidth = m_layoutStruct[i].effectiveLogicalWidth;
-                if (logicalWidth.isPercent()) {
+                if (logicalWidth.isPercentOrCalculated()) {
                     int minMaxDiff = m_layoutStruct[i].computedLogicalWidth - m_layoutStruct[i].effectiveMinLogicalWidth;
                     int reduce = available * minMaxDiff / logicalWidthBeyondMin;
                     m_layoutStruct[i].computedLogicalWidth += reduce;

Modified: trunk/Source/WebCore/rendering/FixedTableLayout.cpp (184054 => 184055)


--- trunk/Source/WebCore/rendering/FixedTableLayout.cpp	2015-05-10 21:26:51 UTC (rev 184054)
+++ trunk/Source/WebCore/rendering/FixedTableLayout.cpp	2015-05-10 21:43:26 UTC (rev 184055)
@@ -117,7 +117,7 @@
                 }
                 spanInCurrentEffectiveColumn = m_table->spanOfEffCol(currentEffectiveColumn);
             }
-            if ((colStyleLogicalWidth.isFixed() || colStyleLogicalWidth.isPercent()) && colStyleLogicalWidth.isPositive()) {
+            if ((colStyleLogicalWidth.isFixed() || colStyleLogicalWidth.isPercentOrCalculated()) && colStyleLogicalWidth.isPositive()) {
                 m_width[currentEffectiveColumn] = colStyleLogicalWidth;
                 m_width[currentEffectiveColumn] *= spanInCurrentEffectiveColumn;
                 usedWidth += effectiveColWidth * spanInCurrentEffectiveColumn;
@@ -192,7 +192,7 @@
     // In this example, the two inner tables should be as large as the outer table. 
     // We can achieve this effect by making the maxwidth of fixed tables with percentage
     // widths be infinite.
-    if (m_table->style().logicalWidth().isPercent() && maxWidth < tableMaxWidth)
+    if (m_table->style().logicalWidth().isPercentOrCalculated() && maxWidth < tableMaxWidth)
         maxWidth = tableMaxWidth;
 }
 
@@ -225,7 +225,7 @@
         if (m_width[i].isFixed()) {
             calcWidth[i] = m_width[i].value();
             totalFixedWidth += calcWidth[i];
-        } else if (m_width[i].isPercentNotCalculated()) {
+        } else if (m_width[i].isPercent()) {
             calcWidth[i] = valueForLength(m_width[i], tableLogicalWidth);
             totalPercentWidth += calcWidth[i];
             totalPercent += m_width[i].percent();
@@ -254,7 +254,7 @@
             if (totalPercent) {
                 totalPercentWidth = 0;
                 for (unsigned i = 0; i < nEffCols; i++) {
-                    if (m_width[i].isPercentNotCalculated()) {
+                    if (m_width[i].isPercent()) {
                         calcWidth[i] = m_width[i].percent() * (tableLogicalWidth - totalFixedWidth) / totalPercent;
                         totalPercentWidth += calcWidth[i];
                     }

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (184054 => 184055)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2015-05-10 21:26:51 UTC (rev 184054)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2015-05-10 21:43:26 UTC (rev 184055)
@@ -811,7 +811,7 @@
 
     Length logicalHeightLength = style().logicalHeight();
     bool hasAutoHeight = logicalHeightLength.isAuto();
-    if (logicalHeightLength.isPercent() && !document().inQuirksMode()) {
+    if (logicalHeightLength.isPercentOrCalculated() && !document().inQuirksMode()) {
         hasAutoHeight = true;
         for (RenderBlock* cb = containingBlock(); !cb->isRenderView(); cb = cb->containingBlock()) {
             if (cb->style().logicalHeight().isFixed() || cb->isTableCell())
@@ -821,7 +821,7 @@
 
     // If the height is 0 or auto, then whether or not we are a self-collapsing block depends
     // on whether we have content that is all self-collapsing or not.
-    if (hasAutoHeight || ((logicalHeightLength.isFixed() || logicalHeightLength.isPercent()) && logicalHeightLength.isZero())) {
+    if (hasAutoHeight || ((logicalHeightLength.isFixed() || logicalHeightLength.isPercentOrCalculated()) && logicalHeightLength.isZero())) {
         // If the block has inline children, see if we generated any line boxes.  If we have any
         // line boxes, then we can't be self-collapsing, since we have content.
         if (childrenInline())
@@ -2256,7 +2256,7 @@
 LayoutUnit RenderBlock::textIndentOffset() const
 {
     LayoutUnit cw = 0;
-    if (style().textIndent().isPercent())
+    if (style().textIndent().isPercentOrCalculated())
         cw = containingBlock()->availableLogicalWidth();
     return minimumValueForLength(style().textIndent(), cw);
 }

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (184054 => 184055)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2015-05-10 21:26:51 UTC (rev 184054)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2015-05-10 21:43:26 UTC (rev 184055)
@@ -978,7 +978,7 @@
 
 bool RenderBox::needsPreferredWidthsRecalculation() const
 {
-    return style().paddingStart().isPercent() || style().paddingEnd().isPercent();
+    return style().paddingStart().isPercentOrCalculated() || style().paddingEnd().isPercentOrCalculated();
 }
 
 IntSize RenderBox::scrolledContentOffset() const
@@ -2782,8 +2782,8 @@
     // is specified. When we're printing, we also need this quirk if the body or root has a percentage 
     // height since we don't set a height in RenderView when we're printing. So without this quirk, the 
     // height has nothing to be a percentage of, and it ends up being 0. That is bad.
-    bool paginatedContentNeedsBaseHeight = document().printing() && h.isPercent()
-        && (isRoot() || (isBody() && document().documentElement()->renderer()->style().logicalHeight().isPercent())) && !isInline();
+    bool paginatedContentNeedsBaseHeight = document().printing() && h.isPercentOrCalculated()
+        && (isRoot() || (isBody() && document().documentElement()->renderer()->style().logicalHeight().isPercentOrCalculated())) && !isInline();
     if (stretchesToViewport() || paginatedContentNeedsBaseHeight) {
         LayoutUnit margins = collapsedMarginBefore() + collapsedMarginAfter();
         LayoutUnit visibleHeight = view().pageOrViewLogicalHeight();
@@ -2816,7 +2816,7 @@
 {
     if (height.isFixed())
         return height.value();
-    if (height.isPercent())
+    if (height.isPercentOrCalculated())
         return computePercentageLogicalHeight(height);
     return -1;
 }
@@ -2891,7 +2891,7 @@
     } else if (cbstyle.logicalHeight().isFixed()) {
         LayoutUnit contentBoxHeight = cb->adjustContentBoxLogicalHeightForBoxSizing(cbstyle.logicalHeight().value());
         availableHeight = std::max<LayoutUnit>(0, cb->constrainContentBoxLogicalHeightByMinMax(contentBoxHeight - cb->scrollbarLogicalHeight()));
-    } else if (cbstyle.logicalHeight().isPercent() && !isOutOfFlowPositionedWithSpecifiedHeight) {
+    } else if (cbstyle.logicalHeight().isPercentOrCalculated() && !isOutOfFlowPositionedWithSpecifiedHeight) {
         // We need to recur and compute the percentage height for our containing block.
         LayoutUnit heightWithScrollbar = cb->computePercentageLogicalHeight(cbstyle.logicalHeight());
         if (heightWithScrollbar != -1) {
@@ -2936,8 +2936,8 @@
 
 LayoutUnit RenderBox::computeReplacedLogicalWidthRespectingMinMaxWidth(LayoutUnit logicalWidth, ShouldComputePreferred shouldComputePreferred) const
 {
-    LayoutUnit minLogicalWidth = (shouldComputePreferred == ComputePreferred && style().logicalMinWidth().isPercent()) || style().logicalMinWidth().isUndefined() ? logicalWidth : computeReplacedLogicalWidthUsing(style().logicalMinWidth());
-    LayoutUnit maxLogicalWidth = (shouldComputePreferred == ComputePreferred && style().logicalMaxWidth().isPercent()) || style().logicalMaxWidth().isUndefined() ? logicalWidth : computeReplacedLogicalWidthUsing(style().logicalMaxWidth());
+    LayoutUnit minLogicalWidth = (shouldComputePreferred == ComputePreferred && style().logicalMinWidth().isPercentOrCalculated()) || style().logicalMinWidth().isUndefined() ? logicalWidth : computeReplacedLogicalWidthUsing(style().logicalMinWidth());
+    LayoutUnit maxLogicalWidth = (shouldComputePreferred == ComputePreferred && style().logicalMaxWidth().isPercentOrCalculated()) || style().logicalMaxWidth().isUndefined() ? logicalWidth : computeReplacedLogicalWidthUsing(style().logicalMaxWidth());
     return std::max(minLogicalWidth, std::min(logicalWidth, maxLogicalWidth));
 }
 
@@ -2965,7 +2965,7 @@
             // https://bugs.webkit.org/show_bug.cgi?id=91071
             if (logicalWidth.isIntrinsic())
                 return computeIntrinsicLogicalWidthUsing(logicalWidth, cw, borderAndPaddingLogicalWidth()) - borderAndPaddingLogicalWidth();
-            if (cw > 0 || (!cw && (containerLogicalWidth.isFixed() || containerLogicalWidth.isPercent())))
+            if (cw > 0 || (!cw && (containerLogicalWidth.isFixed() || containerLogicalWidth.isPercentOrCalculated())))
                 return adjustContentBoxLogicalWidthForBoxSizing(minimumValueForLength(logicalWidth, cw));
         }
         FALLTHROUGH;
@@ -3032,7 +3032,7 @@
                 // table cells using percentage heights.
                 // FIXME: This needs to be made block-flow-aware.  If the cell and image are perpendicular block-flows, this isn't right.
                 // https://bugs.webkit.org/show_bug.cgi?id=46997
-                while (cb && !cb->isRenderView() && (cb->style().logicalHeight().isAuto() || cb->style().logicalHeight().isPercent())) {
+                while (cb && !cb->isRenderView() && (cb->style().logicalHeight().isAuto() || cb->style().logicalHeight().isPercentOrCalculated())) {
                     if (cb->isTableCell()) {
                         // Don't let table cells squeeze percent-height replaced elements
                         // <http://bugs.webkit.org/show_bug.cgi?id=15359>
@@ -3060,13 +3060,13 @@
     // We need to stop here, since we don't want to increase the height of the table
     // artificially.  We're going to rely on this cell getting expanded to some new
     // height, and then when we lay out again we'll use the calculation below.
-    if (isTableCell() && (h.isAuto() || h.isPercent())) {
+    if (isTableCell() && (h.isAuto() || h.isPercentOrCalculated())) {
         if (hasOverrideLogicalContentHeight())
             return overrideLogicalContentHeight();
         return logicalHeight() - borderAndPaddingLogicalHeight();
     }
 
-    if (h.isPercent() && isOutOfFlowPositioned() && !isRenderFlowThread()) {
+    if (h.isPercentOrCalculated() && isOutOfFlowPositioned() && !isRenderFlowThread()) {
         // FIXME: This is wrong if the containingBlock has a perpendicular writing mode.
         LayoutUnit availableHeight = containingBlockLogicalHeightForPositioned(containingBlock());
         return adjustContentBoxLogicalHeightForBoxSizing(valueForLength(h, availableHeight));
@@ -4498,7 +4498,7 @@
     if (box->hasOverrideContainingBlockLogicalWidth())
         return box->overrideContainingBlockContentLogicalWidth() != -1;
 #endif
-    if (box->style().logicalWidth().isPercent())
+    if (box->style().logicalWidth().isPercentOrCalculated())
         return logicalWidthIsResolvable(*box->containingBlock());
 
     return false;
@@ -4550,7 +4550,7 @@
     // height.
     if (cb->style().logicalHeight().isFixed())
         return true;
-    if (cb->style().logicalHeight().isPercent() && !isOutOfFlowPositionedWithSpecifiedHeight)
+    if (cb->style().logicalHeight().isPercentOrCalculated() && !isOutOfFlowPositionedWithSpecifiedHeight)
         return percentageLogicalHeightIsResolvableFromBlock(cb->containingBlock(), cb->isOutOfFlowPositioned());
     if (cb->isRenderView() || inQuirksMode || isOutOfFlowPositionedWithSpecifiedHeight)
         return true;
@@ -4595,8 +4595,8 @@
     // conditions, but it should work out to be good enough for common cases. Paginating overflow
     // with scrollbars present is not the end of the world and is what we used to do in the old model anyway.
     return !style().logicalHeight().isIntrinsicOrAuto()
-        || (!style().logicalMaxHeight().isIntrinsicOrAuto() && !style().logicalMaxHeight().isUndefined() && (!style().logicalMaxHeight().isPercent() || percentageLogicalHeightIsResolvable(this)))
-        || (!style().logicalMinHeight().isIntrinsicOrAuto() && style().logicalMinHeight().isPositive() && (!style().logicalMinHeight().isPercent() || percentageLogicalHeightIsResolvable(this)));
+        || (!style().logicalMaxHeight().isIntrinsicOrAuto() && !style().logicalMaxHeight().isUndefined() && (!style().logicalMaxHeight().isPercentOrCalculated() || percentageLogicalHeightIsResolvable(this)))
+        || (!style().logicalMinHeight().isIntrinsicOrAuto() && style().logicalMinHeight().isPositive() && (!style().logicalMinHeight().isPercentOrCalculated() || percentageLogicalHeightIsResolvable(this)));
 }
 
 bool RenderBox::isUnsplittableForPagination() const
@@ -4869,23 +4869,23 @@
 
 bool RenderBox::hasRelativeDimensions() const
 {
-    return style().height().isPercent() || style().width().isPercent()
-            || style().maxHeight().isPercent() || style().maxWidth().isPercent()
-            || style().minHeight().isPercent() || style().minWidth().isPercent();
+    return style().height().isPercentOrCalculated() || style().width().isPercentOrCalculated()
+        || style().maxHeight().isPercentOrCalculated() || style().maxWidth().isPercentOrCalculated()
+        || style().minHeight().isPercentOrCalculated() || style().minWidth().isPercentOrCalculated();
 }
 
 bool RenderBox::hasRelativeLogicalHeight() const
 {
-    return style().logicalHeight().isPercent()
-            || style().logicalMinHeight().isPercent()
-            || style().logicalMaxHeight().isPercent();
+    return style().logicalHeight().isPercentOrCalculated()
+        || style().logicalMinHeight().isPercentOrCalculated()
+        || style().logicalMaxHeight().isPercentOrCalculated();
 }
 
 bool RenderBox::hasRelativeLogicalWidth() const
 {
-    return style().logicalWidth().isPercent()
-        || style().logicalMinWidth().isPercent()
-        || style().logicalMaxWidth().isPercent();
+    return style().logicalWidth().isPercentOrCalculated()
+        || style().logicalMinWidth().isPercentOrCalculated()
+        || style().logicalMaxWidth().isPercentOrCalculated();
 }
 
 static void markBoxForRelayoutAfterSplit(RenderBox& box)

Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp (184054 => 184055)


--- trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2015-05-10 21:26:51 UTC (rev 184054)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp	2015-05-10 21:43:26 UTC (rev 184055)
@@ -244,7 +244,7 @@
     // For percentage heights: The percentage is calculated with respect to the height of the generated box's
     // containing block. If the height of the containing block is not specified explicitly (i.e., it depends
     // on content height), and this element is not absolutely positioned, the value computes to 'auto'.
-    if (!logicalHeightLength.isPercent() || isOutOfFlowPositioned() || document().inQuirksMode())
+    if (!logicalHeightLength.isPercentOrCalculated() || isOutOfFlowPositioned() || document().inQuirksMode())
         return false;
 
     // Anonymous block boxes are ignored when resolving percentage values that would refer to it:
@@ -299,13 +299,13 @@
     // calculate the percent offset based on this height.
     // See <https://bugs.webkit.org/show_bug.cgi?id=26396>.
     if (!style().top().isAuto()
-        && (!style().top().isPercent()
+        && (!style().top().isPercentOrCalculated()
             || !containingBlock()->hasAutoHeightOrContainingBlockWithAutoHeight()
             || containingBlock()->stretchesToViewport()))
         offset.expand(0, valueForLength(style().top(), !style().top().isFixed() ? containingBlock()->availableHeight() : LayoutUnit()));
 
     else if (!style().bottom().isAuto()
-        && (!style().bottom().isPercent()
+        && (!style().bottom().isPercentOrCalculated()
             || !containingBlock()->hasAutoHeightOrContainingBlockWithAutoHeight()
             || containingBlock()->stretchesToViewport()))
         offset.expand(0, -valueForLength(style().bottom(), !style().bottom().isFixed() ? containingBlock()->availableHeight() : LayoutUnit()));
@@ -519,7 +519,7 @@
 LayoutUnit RenderBoxModelObject::computedCSSPadding(const Length& padding) const
 {
     LayoutUnit w = 0;
-    if (padding.isPercent())
+    if (padding.isPercentOrCalculated())
         w = containingBlockLogicalWidthForContent();
     return minimumValueForLength(padding, w);
 }
@@ -932,8 +932,8 @@
     FloatSize intrinsicRatio;
     image->computeIntrinsicDimensions(this, intrinsicWidth, intrinsicHeight, intrinsicRatio);
 
-    ASSERT(!intrinsicWidth.isPercent());
-    ASSERT(!intrinsicHeight.isPercent());
+    ASSERT(!intrinsicWidth.isPercentOrCalculated());
+    ASSERT(!intrinsicHeight.isPercentOrCalculated());
 
     LayoutSize resolvedSize(intrinsicWidth.value(), intrinsicHeight.value());
     LayoutSize minimumSize(resolvedSize.width() > 0 ? 1 : 0, resolvedSize.height() > 0 ? 1 : 0);
@@ -983,12 +983,12 @@
 
             if (layerWidth.isFixed())
                 tileSize.setWidth(layerWidth.value());
-            else if (layerWidth.isPercent())
+            else if (layerWidth.isPercentOrCalculated())
                 tileSize.setWidth(valueForLength(layerWidth, positioningAreaSize.width()));
             
             if (layerHeight.isFixed())
                 tileSize.setHeight(layerHeight.value());
-            else if (layerHeight.isPercent())
+            else if (layerHeight.isPercentOrCalculated())
                 tileSize.setHeight(valueForLength(layerHeight, positioningAreaSize.height()));
 
             // If one of the values is auto we have to use the appropriate

Modified: trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp (184054 => 184055)


--- trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp	2015-05-10 21:26:51 UTC (rev 184054)
+++ trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp	2015-05-10 21:43:26 UTC (rev 184055)
@@ -934,7 +934,7 @@
             continue;
 
         child->clearOverrideSize();
-        if (relayoutChildren || (child->isReplaced() && (child->style().width().isPercent() || child->style().height().isPercent()))
+        if (relayoutChildren || (child->isReplaced() && (child->style().width().isPercentOrCalculated() || child->style().height().isPercentOrCalculated()))
             || (child->style().height().isAuto() && is<RenderBlockFlow>(*child))) {
             child->setChildNeedsLayout(MarkOnlyThis);
 
@@ -1034,7 +1034,7 @@
             continue;
 
         child->clearOverrideSize();
-        if ((child->isReplaced() && (child->style().width().isPercent() || child->style().height().isPercent()))
+        if ((child->isReplaced() && (child->style().width().isPercentOrCalculated() || child->style().height().isPercentOrCalculated()))
             || (child->style().height().isAuto() && is<RenderBlockFlow>(*child))) {
             child->setChildNeedsLayout();
 

Modified: trunk/Source/WebCore/rendering/RenderElement.cpp (184054 => 184055)


--- trunk/Source/WebCore/rendering/RenderElement.cpp	2015-05-10 21:26:51 UTC (rev 184054)
+++ trunk/Source/WebCore/rendering/RenderElement.cpp	2015-05-10 21:43:26 UTC (rev 184055)
@@ -1216,7 +1216,7 @@
 
     if (sizeType == SizeLength) {
         LengthSize size = layer->sizeLength();
-        if (size.width().isPercent() || size.height().isPercent())
+        if (size.width().isPercentOrCalculated() || size.height().isPercentOrCalculated())
             return true;
         // If the image has neither an intrinsic width nor an intrinsic height, its size is determined as for 'contain'.
         if ((size.width().isAuto() || size.height().isAuto()) && image->isGeneratedImage())

Modified: trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp (184054 => 184055)


--- trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp	2015-05-10 21:26:51 UTC (rev 184054)
+++ trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp	2015-05-10 21:43:26 UTC (rev 184055)
@@ -213,7 +213,7 @@
             defaultLabelWidth += buttonRenderer->maxPreferredLogicalWidth() + afterButtonSpacing;
     maxLogicalWidth = static_cast<int>(ceilf(std::max(minDefaultLabelWidth, defaultLabelWidth)));
 
-    if (!style().width().isPercent())
+    if (!style().width().isPercentOrCalculated())
         minLogicalWidth = maxLogicalWidth;
 }
 

Modified: trunk/Source/WebCore/rendering/RenderFrameSet.cpp (184054 => 184055)


--- trunk/Source/WebCore/rendering/RenderFrameSet.cpp	2015-05-10 21:26:51 UTC (rev 184054)
+++ trunk/Source/WebCore/rendering/RenderFrameSet.cpp	2015-05-10 21:43:26 UTC (rev 184055)
@@ -206,7 +206,7 @@
         
         // Count the total percentage of all of the percentage columns/rows -> totalPercent
         // Count the number of columns/rows which are percentages -> countPercent
-        if (grid[i].isPercent()) {
+        if (grid[i].isPercentOrCalculated()) {
             gridLayout[i] = std::max(intValueForLength(grid[i], availableLen), 0);
             totalPercent += gridLayout[i];
             countPercent++;
@@ -244,7 +244,7 @@
         int remainingPercent = remainingLen;
 
         for (int i = 0; i < gridLen; ++i) {
-            if (grid[i].isPercent()) {
+            if (grid[i].isPercentOrCalculated()) {
                 gridLayout[i] = (gridLayout[i] * remainingPercent) / totalPercent;
                 remainingLen -= gridLayout[i];
             }
@@ -288,7 +288,7 @@
             int changePercent = 0;
 
             for (int i = 0; i < gridLen; ++i) {
-                if (grid[i].isPercent()) {
+                if (grid[i].isPercentOrCalculated()) {
                     changePercent = (remainingPercent * gridLayout[i]) / totalPercent;
                     gridLayout[i] += changePercent;
                     remainingLen -= changePercent;
@@ -320,7 +320,7 @@
         int changePercent = 0;
 
         for (int i = 0; i < gridLen; ++i) {
-            if (grid[i].isPercent()) {
+            if (grid[i].isPercentOrCalculated()) {
                 changePercent = remainingPercent / countPercent;
                 gridLayout[i] += changePercent;
                 remainingLen -= changePercent;

Modified: trunk/Source/WebCore/rendering/RenderImage.cpp (184054 => 184055)


--- trunk/Source/WebCore/rendering/RenderImage.cpp	2015-05-10 21:26:51 UTC (rev 184054)
+++ trunk/Source/WebCore/rendering/RenderImage.cpp	2015-05-10 21:43:26 UTC (rev 184055)
@@ -315,9 +315,9 @@
     // if the containing block's size depends on the image's size (i.e., the container uses shrink-to-fit sizing).
     // There's no easy way to detect that shrink-to-fit is needed, always force a layout.
     bool containingBlockNeedsToRecomputePreferredSize =
-        style().logicalWidth().isPercent()
-        || style().logicalMaxWidth().isPercent()
-        || style().logicalMinWidth().isPercent();
+        style().logicalWidth().isPercentOrCalculated()
+        || style().logicalMaxWidth().isPercentOrCalculated()
+        || style().logicalMinWidth().isPercentOrCalculated();
 
     bool layoutSizeDependsOnIntrinsicSize = style().aspectRatioType() == AspectRatioFromIntrinsic;
 

Modified: trunk/Source/WebCore/rendering/RenderInline.cpp (184054 => 184055)


--- trunk/Source/WebCore/rendering/RenderInline.cpp	2015-05-10 21:26:51 UTC (rev 184054)
+++ trunk/Source/WebCore/rendering/RenderInline.cpp	2015-05-10 21:43:26 UTC (rev 184055)
@@ -791,7 +791,7 @@
         return 0;
     if (margin.isFixed())
         return margin.value();
-    if (margin.isPercent())
+    if (margin.isPercentOrCalculated())
         return minimumValueForLength(margin, std::max<LayoutUnit>(0, renderer->containingBlock()->availableLogicalWidth()));
     return 0;
 }

Modified: trunk/Source/WebCore/rendering/RenderListBox.cpp (184054 => 184055)


--- trunk/Source/WebCore/rendering/RenderListBox.cpp	2015-05-10 21:26:51 UTC (rev 184054)
+++ trunk/Source/WebCore/rendering/RenderListBox.cpp	2015-05-10 21:43:26 UTC (rev 184055)
@@ -193,7 +193,7 @@
     maxLogicalWidth = m_optionsWidth + 2 * optionsSpacingHorizontal;
     if (m_vBar)
         maxLogicalWidth += m_vBar->width();
-    if (!style().width().isPercent())
+    if (!style().width().isPercentOrCalculated())
         minLogicalWidth = maxLogicalWidth;
 }
 

Modified: trunk/Source/WebCore/rendering/RenderMenuList.cpp (184054 => 184055)


--- trunk/Source/WebCore/rendering/RenderMenuList.cpp	2015-05-10 21:26:51 UTC (rev 184054)
+++ trunk/Source/WebCore/rendering/RenderMenuList.cpp	2015-05-10 21:43:26 UTC (rev 184055)
@@ -324,7 +324,7 @@
 void RenderMenuList::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const
 {
     maxLogicalWidth = std::max(m_optionsWidth, theme().minimumMenuListSize(style())) + m_innerBlock->paddingLeft() + m_innerBlock->paddingRight();
-    if (!style().width().isPercent())
+    if (!style().width().isPercentOrCalculated())
         minLogicalWidth = maxLogicalWidth;
 }
 

Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (184054 => 184055)


--- trunk/Source/WebCore/rendering/RenderObject.cpp	2015-05-10 21:26:51 UTC (rev 184054)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp	2015-05-10 21:43:26 UTC (rev 184055)
@@ -543,7 +543,7 @@
     if (!object->hasOverflowClip())
         return false;
 
-    if (object->style().width().isIntrinsicOrAuto() || object->style().height().isIntrinsicOrAuto() || object->style().height().isPercent())
+    if (object->style().width().isIntrinsicOrAuto() || object->style().height().isIntrinsicOrAuto() || object->style().height().isPercentOrCalculated())
         return false;
 
     // Table parts can't be relayout roots since the table is responsible for layouting all the parts.

Modified: trunk/Source/WebCore/rendering/RenderReplaced.cpp (184054 => 184055)


--- trunk/Source/WebCore/rendering/RenderReplaced.cpp	2015-05-10 21:26:51 UTC (rev 184054)
+++ trunk/Source/WebCore/rendering/RenderReplaced.cpp	2015-05-10 21:43:26 UTC (rev 184055)
@@ -486,13 +486,13 @@
 
     // We cannot resolve any percent logical width here as the available logical
     // width may not be set on our containing block.
-    if (style().logicalWidth().isPercent())
+    if (style().logicalWidth().isPercentOrCalculated())
         computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth);
     else
         m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = computeReplacedLogicalWidth(ComputePreferred);
 
     const RenderStyle& styleToUse = style();
-    if (styleToUse.logicalWidth().isPercent() || styleToUse.logicalMaxWidth().isPercent())
+    if (styleToUse.logicalWidth().isPercentOrCalculated() || styleToUse.logicalMaxWidth().isPercentOrCalculated())
         m_minPreferredLogicalWidth = 0;
 
     if (styleToUse.logicalMinWidth().isFixed() && styleToUse.logicalMinWidth().value() > 0) {

Modified: trunk/Source/WebCore/rendering/RenderSlider.cpp (184054 => 184055)


--- trunk/Source/WebCore/rendering/RenderSlider.cpp	2015-05-10 21:26:51 UTC (rev 184054)
+++ trunk/Source/WebCore/rendering/RenderSlider.cpp	2015-05-10 21:43:26 UTC (rev 184055)
@@ -72,7 +72,7 @@
 void RenderSlider::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const
 {
     maxLogicalWidth = defaultTrackLength * style().effectiveZoom();
-    if (!style().width().isPercent())
+    if (!style().width().isPercentOrCalculated())
         minLogicalWidth = maxLogicalWidth;
 }
 

Modified: trunk/Source/WebCore/rendering/RenderTable.cpp (184054 => 184055)


--- trunk/Source/WebCore/rendering/RenderTable.cpp	2015-05-10 21:26:51 UTC (rev 184054)
+++ trunk/Source/WebCore/rendering/RenderTable.cpp	2015-05-10 21:43:26 UTC (rev 184055)
@@ -368,7 +368,7 @@
             borders = borderAndPaddingBefore + borderAndPaddingAfter;
         }
         computedLogicalHeight = styleLogicalHeight.value() - borders;
-    } else if (styleLogicalHeight.isPercent())
+    } else if (styleLogicalHeight.isPercentOrCalculated())
         computedLogicalHeight = computePercentageLogicalHeight(styleLogicalHeight);
     else
         ASSERT_NOT_REACHED();

Modified: trunk/Source/WebCore/rendering/RenderTableSection.cpp (184054 => 184055)


--- trunk/Source/WebCore/rendering/RenderTableSection.cpp	2015-05-10 21:26:51 UTC (rev 184054)
+++ trunk/Source/WebCore/rendering/RenderTableSection.cpp	2015-05-10 21:43:26 UTC (rev 184055)
@@ -67,7 +67,7 @@
         Length cRowLogicalHeight = row.logicalHeight;
         switch (logicalHeight.type()) {
         case Percent:
-            if (!cRowLogicalHeight.isPercentNotCalculated() || cRowLogicalHeight.percent() < logicalHeight.percent())
+            if (!cRowLogicalHeight.isPercent() || cRowLogicalHeight.percent() < logicalHeight.percent())
                 row.logicalHeight = logicalHeight;
             break;
         case Fixed:
@@ -425,7 +425,7 @@
     totalPercent = std::min(totalPercent, 100);
     int rowHeight = m_rowPos[1] - m_rowPos[0];
     for (unsigned r = 0; r < totalRows; ++r) {
-        if (totalPercent > 0 && m_grid[r].logicalHeight.isPercentNotCalculated()) {
+        if (totalPercent > 0 && m_grid[r].logicalHeight.isPercent()) {
             int toAdd = std::min<int>(extraLogicalHeight, (totalHeight * m_grid[r].logicalHeight.percent() / 100) - rowHeight);
             // If toAdd is negative, then we don't want to shrink the row (this bug
             // affected Outlook Web Access).
@@ -497,7 +497,7 @@
     for (unsigned r = 0; r < totalRows; r++) {
         if (m_grid[r].logicalHeight.isAuto())
             ++autoRowsCount;
-        else if (m_grid[r].logicalHeight.isPercentNotCalculated())
+        else if (m_grid[r].logicalHeight.isPercent())
             totalPercent += m_grid[r].logicalHeight.percent();
     }
 
@@ -568,7 +568,7 @@
                 || (!table()->style().logicalHeight().isAuto() && rHeight != cell->logicalHeight());
 
             for (RenderObject* renderer = cell->firstChild(); renderer; renderer = renderer->nextSibling()) {
-                if (!is<RenderText>(*renderer) && renderer->style().logicalHeight().isPercent() && (flexAllChildren || ((renderer->isReplaced() || (is<RenderBox>(*renderer) && downcast<RenderBox>(*renderer).scrollsOverflow())) && !is<RenderTextControl>(*renderer)))) {
+                if (!is<RenderText>(*renderer) && renderer->style().logicalHeight().isPercentOrCalculated() && (flexAllChildren || ((renderer->isReplaced() || (is<RenderBox>(*renderer) && downcast<RenderBox>(*renderer).scrollsOverflow())) && !is<RenderTextControl>(*renderer)))) {
                     // Tables with no sections do not flex.
                     if (!is<RenderTable>(*renderer) || downcast<RenderTable>(*renderer).hasSections()) {
                         renderer->setNeedsLayout(MarkOnlyThis);

Modified: trunk/Source/WebCore/rendering/RenderTextControl.cpp (184054 => 184055)


--- trunk/Source/WebCore/rendering/RenderTextControl.cpp	2015-05-10 21:26:51 UTC (rev 184054)
+++ trunk/Source/WebCore/rendering/RenderTextControl.cpp	2015-05-10 21:43:26 UTC (rev 184055)
@@ -198,7 +198,7 @@
     maxLogicalWidth = preferredContentLogicalWidth(const_cast<RenderTextControl*>(this)->getAverageCharWidth());
     if (RenderBox* innerTextRenderBox = innerTextElement()->renderBox())
         maxLogicalWidth += innerTextRenderBox->paddingStart() + innerTextRenderBox->paddingEnd();
-    if (!style().logicalWidth().isPercent())
+    if (!style().logicalWidth().isPercentOrCalculated())
         minLogicalWidth = maxLogicalWidth;
 }
 

Modified: trunk/Source/WebCore/rendering/RenderView.cpp (184054 => 184055)


--- trunk/Source/WebCore/rendering/RenderView.cpp	2015-05-10 21:26:51 UTC (rev 184054)
+++ trunk/Source/WebCore/rendering/RenderView.cpp	2015-05-10 21:43:26 UTC (rev 184055)
@@ -333,9 +333,9 @@
 
         for (auto& box : childrenOfType<RenderBox>(*this)) {
             if (box.hasRelativeLogicalHeight()
-                || box.style().logicalHeight().isPercent()
-                || box.style().logicalMinHeight().isPercent()
-                || box.style().logicalMaxHeight().isPercent()
+                || box.style().logicalHeight().isPercentOrCalculated()
+                || box.style().logicalMinHeight().isPercentOrCalculated()
+                || box.style().logicalMaxHeight().isPercentOrCalculated()
                 || box.isSVGRoot()
                 )
                 box.setChildNeedsLayout(MarkOnlyThis);

Modified: trunk/Source/WebCore/rendering/RootInlineBox.cpp (184054 => 184055)


--- trunk/Source/WebCore/rendering/RootInlineBox.cpp	2015-05-10 21:26:51 UTC (rev 184054)
+++ trunk/Source/WebCore/rendering/RootInlineBox.cpp	2015-05-10 21:43:26 UTC (rev 184055)
@@ -1050,7 +1050,7 @@
         else if (verticalAlign == LENGTH) {
             LayoutUnit lineHeight;
             //Per http://www.w3.org/TR/CSS21/visudet.html#propdef-vertical-align: 'Percentages: refer to the 'line-height' of the element itself'.
-            if (renderer->style().verticalAlignLength().isPercent())
+            if (renderer->style().verticalAlignLength().isPercentOrCalculated())
                 lineHeight = renderer->style().computedLineHeight();
             else
                 lineHeight = renderer->lineHeight(firstLine, lineDirection);

Modified: trunk/Source/WebCore/rendering/style/GridLength.h (184054 => 184055)


--- trunk/Source/WebCore/rendering/style/GridLength.h	2015-05-10 21:26:51 UTC (rev 184054)
+++ trunk/Source/WebCore/rendering/style/GridLength.h	2015-05-10 21:43:26 UTC (rev 184055)
@@ -64,7 +64,7 @@
 
     double flex() const { ASSERT(isFlex()); return m_flex; }
 
-    bool isPercentage() const { return m_type == LengthType && m_length.isPercent(); }
+    bool isPercentage() const { return m_type == LengthType && m_length.isPercentOrCalculated(); }
 
     bool operator==(const GridLength& o) const
     {

Modified: trunk/Source/WebCore/rendering/style/GridTrackSize.h (184054 => 184055)


--- trunk/Source/WebCore/rendering/style/GridTrackSize.h	2015-05-10 21:26:51 UTC (rev 184054)
+++ trunk/Source/WebCore/rendering/style/GridTrackSize.h	2015-05-10 21:43:26 UTC (rev 184055)
@@ -92,7 +92,7 @@
 
     bool isContentSized() const { return m_minTrackBreadth.isContentSized() || m_maxTrackBreadth.isContentSized(); }
 
-    bool isPercentage() const { return m_type == LengthTrackSizing && length().isLength() && length().length().isPercent(); }
+    bool isPercentage() const { return m_type == LengthTrackSizing && length().isLength() && length().length().isPercentOrCalculated(); }
 
     bool operator==(const GridTrackSize& other) const
     {

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (184054 => 184055)


--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2015-05-10 21:26:51 UTC (rev 184054)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2015-05-10 21:43:26 UTC (rev 184055)
@@ -1077,8 +1077,8 @@
     auto& operations = rareNonInheritedData->m_transform->m_operations.operations();
     bool applyTransformOrigin = requireTransformOrigin(operations, applyOrigin);
 
-    float offsetX = transformOriginX().isPercentNotCalculated() ? boundingBox.x() : 0;
-    float offsetY = transformOriginY().isPercentNotCalculated() ? boundingBox.y() : 0;
+    float offsetX = transformOriginX().isPercent() ? boundingBox.x() : 0;
+    float offsetY = transformOriginY().isPercent() ? boundingBox.y() : 0;
 
     if (applyTransformOrigin) {
         transform.translate3d(floatValueForLength(transformOriginX(), boundingBox.width()) + offsetX,
@@ -1456,7 +1456,7 @@
     if (lh.isNegative())
         return fontMetrics().lineSpacing();
 
-    if (lh.isPercent())
+    if (lh.isPercentOrCalculated())
         return minimumValueForLength(lh, fontSize());
 
     return clampTo<int>(lh.value());

Modified: trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp (184054 => 184055)


--- trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp	2015-05-10 21:26:51 UTC (rev 184054)
+++ trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp	2015-05-10 21:43:26 UTC (rev 184055)
@@ -436,7 +436,7 @@
 
 bool RenderSVGRoot::hasRelativeDimensions() const
 {
-    return svgSVGElement().intrinsicHeight().isPercent() || svgSVGElement().intrinsicWidth().isPercent();
+    return svgSVGElement().intrinsicHeight().isPercentOrCalculated() || svgSVGElement().intrinsicWidth().isPercentOrCalculated();
 }
 
 void RenderSVGRoot::addResourceForClientInvalidation(RenderSVGResourceContainer* resource)

Modified: trunk/Source/WebCore/svg/SVGLengthContext.cpp (184054 => 184055)


--- trunk/Source/WebCore/svg/SVGLengthContext.cpp	2015-05-10 21:26:51 UTC (rev 184054)
+++ trunk/Source/WebCore/svg/SVGLengthContext.cpp	2015-05-10 21:43:26 UTC (rev 184055)
@@ -89,7 +89,7 @@
 
 float SVGLengthContext::valueForLength(const Length& length, SVGLengthMode mode)
 {
-    if (length.isPercent() && !length.isCalculated())
+    if (length.isPercent())
         return convertValueFromPercentageToUserUnits(length.value() / 100, mode, IGNORE_EXCEPTION);
     if (length.isAuto())
         return 0;

Modified: trunk/Source/WebCore/svg/graphics/SVGImage.cpp (184054 => 184055)


--- trunk/Source/WebCore/svg/graphics/SVGImage.cpp	2015-05-10 21:26:51 UTC (rev 184054)
+++ trunk/Source/WebCore/svg/graphics/SVGImage.cpp	2015-05-10 21:43:26 UTC (rev 184055)
@@ -286,7 +286,7 @@
     SVGSVGElement* rootElement = this->rootElement();
     if (!rootElement)
         return false;
-    return rootElement->intrinsicWidth().isPercent();
+    return rootElement->intrinsicWidth().isPercentOrCalculated();
 }
 
 bool SVGImage::hasRelativeHeight() const
@@ -294,7 +294,7 @@
     SVGSVGElement* rootElement = this->rootElement();
     if (!rootElement)
         return false;
-    return rootElement->intrinsicHeight().isPercent();
+    return rootElement->intrinsicHeight().isPercentOrCalculated();
 }
 
 void SVGImage::computeIntrinsicDimensions(Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to