⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 184055 in webkit


Ignore:
Timestamp:
May 10, 2015, 2:43:26 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

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

Patch by Sungmann Cho <sungmann.cho@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()

  1. 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):

Location:
trunk/Source/WebCore
Files:
33 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r184054 r184055  
     12015-05-10  Sungmann Cho  <sungmann.cho@navercorp.com>
     2
     3        Rename Length::isPercent() and Length::isPercentNotCalculated().
     4        https://bugs.webkit.org/show_bug.cgi?id=144791
     5
     6        Reviewed by Darin Adler.
     7
     8        1. Rename these methods as below for consistency and clarity.
     9
     10        Length::isPercentNotCalculated() => Length::isPercent()
     11        Length::isPercent() => Length::isPercentOrCalculated()
     12
     13        2. Simplify the condition check of length type in SVGLengthContext::valueForLength().
     14
     15        "length.isPercent() && !length.isCalculated()" => "length.isPercent()"
     16
     17        No new tests, no behavior change.
     18
     19        * css/CSSComputedStyleDeclaration.cpp:
     20        (WebCore::valueForImageSliceSide):
     21        (WebCore::valueForReflection):
     22        (WebCore::percentageOrZoomAdjustedValue):
     23        (WebCore::lineHeightFromStyle):
     24        (WebCore::ComputedStyleExtractor::propertyValue):
     25        * html/HTMLPlugInImageElement.cpp:
     26        (WebCore::is100Percent):
     27        * page/animation/AnimationBase.cpp:
     28        (WebCore::AnimationBase::computeTransformedExtentViaTransformList):
     29        * platform/Length.h:
     30        (WebCore::Length::percent):
     31        (WebCore::Length::isPercent):
     32        (WebCore::Length::isPercentOrCalculated):
     33        (WebCore::Length::isSpecified):
     34        (WebCore::Length::isPercentNotCalculated): Deleted.
     35        * platform/graphics/transforms/TranslateTransformOperation.h:
     36        * rendering/AutoTableLayout.cpp:
     37        (WebCore::AutoTableLayout::recalcColumn):
     38        (WebCore::AutoTableLayout::fullRecalc):
     39        (WebCore::shouldScaleColumns):
     40        (WebCore::AutoTableLayout::computeIntrinsicLogicalWidths):
     41        (WebCore::AutoTableLayout::calcEffectiveLogicalWidth):
     42        (WebCore::AutoTableLayout::layout):
     43        * rendering/FixedTableLayout.cpp:
     44        (WebCore::FixedTableLayout::calcWidthArray):
     45        (WebCore::FixedTableLayout::applyPreferredLogicalWidthQuirks):
     46        (WebCore::FixedTableLayout::layout):
     47        * rendering/RenderBlock.cpp:
     48        (WebCore::RenderBlock::isSelfCollapsingBlock):
     49        (WebCore::RenderBlock::textIndentOffset):
     50        * rendering/RenderBox.cpp:
     51        (WebCore::RenderBox::needsPreferredWidthsRecalculation):
     52        (WebCore::RenderBox::computeLogicalHeight):
     53        (WebCore::RenderBox::computeContentAndScrollbarLogicalHeightUsing):
     54        (WebCore::RenderBox::computePercentageLogicalHeight):
     55        (WebCore::RenderBox::computeReplacedLogicalWidthRespectingMinMaxWidth):
     56        (WebCore::RenderBox::computeReplacedLogicalWidthUsing):
     57        (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
     58        (WebCore::RenderBox::availableLogicalHeightUsing):
     59        (WebCore::logicalWidthIsResolvable):
     60        (WebCore::RenderBox::percentageLogicalHeightIsResolvableFromBlock):
     61        (WebCore::RenderBox::hasUnsplittableScrollingOverflow):
     62        (WebCore::RenderBox::layoutOverflowRectForPropagation):
     63        * rendering/RenderBoxModelObject.cpp:
     64        (WebCore::RenderBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight):
     65        (WebCore::RenderBoxModelObject::relativePositionOffset):
     66        (WebCore::RenderBoxModelObject::computedCSSPadding):
     67        (WebCore::RenderBoxModelObject::calculateImageIntrinsicDimensions):
     68        (WebCore::RenderBoxModelObject::calculateFillTileSize):
     69        * rendering/RenderDeprecatedFlexibleBox.cpp:
     70        (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
     71        (WebCore::RenderDeprecatedFlexibleBox::clearLineClamp):
     72        * rendering/RenderElement.cpp:
     73        (WebCore::mustRepaintFillLayers):
     74        * rendering/RenderFileUploadControl.cpp:
     75        (WebCore::RenderFileUploadControl::computeIntrinsicLogicalWidths):
     76        * rendering/RenderFrameSet.cpp:
     77        (WebCore::RenderFrameSet::layOutAxis):
     78        * rendering/RenderImage.cpp:
     79        (WebCore::RenderImage::repaintOrMarkForLayout):
     80        * rendering/RenderInline.cpp:
     81        (WebCore::computeMargin):
     82        * rendering/RenderListBox.cpp:
     83        (WebCore::RenderListBox::computeIntrinsicLogicalWidths):
     84        * rendering/RenderMenuList.cpp:
     85        (RenderMenuList::computeIntrinsicLogicalWidths):
     86        * rendering/RenderObject.cpp:
     87        (WebCore::objectIsRelayoutBoundary):
     88        * rendering/RenderReplaced.cpp:
     89        (WebCore::RenderReplaced::computePreferredLogicalWidths):
     90        * rendering/RenderSlider.cpp:
     91        (WebCore::RenderSlider::computeIntrinsicLogicalWidths):
     92        * rendering/RenderTable.cpp:
     93        (WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight):
     94        * rendering/RenderTableSection.cpp:
     95        (WebCore::RenderTableSection::layoutRows):
     96        * rendering/RenderTextControl.cpp:
     97        (WebCore::RenderTextControl::computeIntrinsicLogicalWidths):
     98        * rendering/RenderView.cpp:
     99        (WebCore::RenderView::layout):
     100        * rendering/RootInlineBox.cpp:
     101        (WebCore::RootInlineBox::verticalPositionForBox):
     102        * rendering/style/GridLength.h:
     103        (WebCore::GridLength::isPercentage):
     104        * rendering/style/GridTrackSize.h:
     105        (WebCore::GridTrackSize::isPercentage):
     106        * rendering/style/RenderStyle.cpp:
     107        (WebCore::RenderStyle::computedLineHeight):
     108        * rendering/svg/RenderSVGRoot.cpp:
     109        (WebCore::RenderSVGRoot::hasRelativeDimensions):
     110        * svg/SVGLengthContext.cpp:
     111        (WebCore::SVGLengthContext::valueForLength):
     112        * svg/graphics/SVGImage.cpp:
     113        (WebCore::SVGImage::hasRelativeWidth):
     114        (WebCore::SVGImage::hasRelativeHeight):
     115
    11162015-05-10  Sungmann Cho  <sungmann.cho@navercorp.com>
    2117
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r183913 r184055  
    484484    // These values can be percentages, numbers, or while an animation of mixed types is in progress,
    485485    // a calculation that combines a percentage and a number.
    486     if (length.isPercentNotCalculated())
     486    if (length.isPercent())
    487487        return cssValuePool().createValue(length.percent(), CSSPrimitiveValue::CSS_PERCENTAGE);
    488488    if (length.isFixed())
     
    647647
    648648    RefPtr<CSSPrimitiveValue> offset;
    649     if (reflection->offset().isPercent())
     649    if (reflection->offset().isPercentOrCalculated())
    650650        offset = cssValuePool().createValue(reflection->offset().percent(), CSSPrimitiveValue::CSS_PERCENTAGE);
    651651    else
     
    737737static Ref<CSSPrimitiveValue> percentageOrZoomAdjustedValue(Length length, const RenderStyle* style)
    738738{
    739     if (length.isPercentNotCalculated())
     739    if (length.isPercent())
    740740        return cssValuePool().createValue(length.percent(), CSSPrimitiveValue::CSS_PERCENTAGE);
    741741   
     
    15601560    if (length.isNegative()) // If true, line-height not set; use the font's line spacing.
    15611561        return zoomAdjustedPixelValue(style->fontMetrics().floatLineSpacing(), style);
    1562     if (length.isPercentNotCalculated()) {
     1562    if (length.isPercent()) {
    15631563        // This is imperfect, because it doesn't include the zoom factor and the real computation
    15641564        // for how high to be in pixels does include things like minimum font size and the zoom factor.
     
    24302430                return zoomAdjustedPixelValueForLength(marginRight, style.get());
    24312431            float value;
    2432             if (marginRight.isPercent()) {
     2432            if (marginRight.isPercentOrCalculated()) {
    24332433                // RenderBox gives a marginRight() that is the distance between the right-edge of the child box
    24342434                // and the right-edge of the containing box, when display == BLOCK. Let's calculate the absolute
  • trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp

    r183160 r184055  
    572572static inline bool is100Percent(Length length)
    573573{
    574     return length.isPercentNotCalculated() && length.percent() == 100;
     574    return length.isPercent() && length.percent() == 100;
    575575}
    576576   
  • trunk/Source/WebCore/page/animation/AnimationBase.cpp

    r183364 r184055  
    779779    bool applyTransformOrigin = containsRotation(style.transform().operations()) || style.transform().affectedByTransformOrigin();
    780780    if (applyTransformOrigin) {
    781         float offsetX = style.transformOriginX().isPercentNotCalculated() ? rendererBox.x() : 0;
    782         float offsetY = style.transformOriginY().isPercentNotCalculated() ? rendererBox.y() : 0;
     781        float offsetX = style.transformOriginX().isPercent() ? rendererBox.x() : 0;
     782        float offsetY = style.transformOriginY().isPercent() ? rendererBox.y() : 0;
    783783
    784784        transformOrigin.setX(floatValueForLength(style.transformOriginX(), rendererBox.width()) + offsetX);
  • trunk/Source/WebCore/platform/Length.h

    r179860 r184055  
    8585    bool isMaxContent() const;
    8686    bool isMinContent() const;
    87     bool isPercentNotCalculated() const; // FIXME: Rename to isPercent.
     87    bool isPercent() const;
    8888    bool isRelative() const;
    8989    bool isUndefined() const;
     
    9999    bool isNegative() const;
    100100
    101     bool isPercent() const; // Returns true for both Percent and Calculated. FIXME: Find a better name for this.
     101    bool isPercentOrCalculated() const; // Returns true for both Percent and Calculated.
    102102
    103103    bool isIntrinsic() const;
     
    261261inline float Length::percent() const
    262262{
    263     ASSERT(isPercentNotCalculated());
     263    ASSERT(isPercent());
    264264    return value();
    265265}
     
    334334}
    335335
    336 inline bool Length::isPercentNotCalculated() const
     336inline bool Length::isPercent() const
    337337{
    338338    return type() == Percent;
     
    349349}
    350350
    351 inline bool Length::isPercent() const
    352 {
    353     return isPercentNotCalculated() || isCalculated();
     351inline bool Length::isPercentOrCalculated() const
     352{
     353    return isPercent() || isCalculated();
    354354}
    355355
     
    393393inline bool Length::isSpecified() const
    394394{
    395     return isFixed() || isPercent();
     395    return isFixed() || isPercentOrCalculated();
    396396}
    397397
  • trunk/Source/WebCore/platform/graphics/transforms/TranslateTransformOperation.h

    r182159 r184055  
    6868    {
    6969        transform.translate3d(x(borderBoxSize), y(borderBoxSize), z(borderBoxSize));
    70         return m_x.isPercentNotCalculated() || m_y.isPercentNotCalculated();
     70        return m_x.isPercent() || m_y.isPercent();
    7171    }
    7272
  • trunk/Source/WebCore/rendering/AutoTableLayout.cpp

    r174653 r184055  
    9393                    case Fixed:
    9494                        // ignore width=0
    95                         if (cellLogicalWidth.isPositive() && !columnLayout.logicalWidth.isPercent()) {
     95                        if (cellLogicalWidth.isPositive() && !columnLayout.logicalWidth.isPercentOrCalculated()) {
    9696                            int logicalWidth = cell->adjustBorderBoxLogicalWidthForBoxSizing(cellLogicalWidth.value());
    9797                            if (columnLayout.logicalWidth.isFixed()) {
     
    110110                    case Percent:
    111111                        m_hasPercent = true;
    112                         if (cellLogicalWidth.isPositive() && (!columnLayout.logicalWidth.isPercentNotCalculated() || cellLogicalWidth.percent() > columnLayout.logicalWidth.percent()))
     112                        if (cellLogicalWidth.isPositive() && (!columnLayout.logicalWidth.isPercent() || cellLogicalWidth.percent() > columnLayout.logicalWidth.percent()))
    113113                            columnLayout.logicalWidth = cellLogicalWidth;
    114114                        break;
     
    160160            if (colLogicalWidth.isAuto())
    161161                colLogicalWidth = groupLogicalWidth;
    162             if ((colLogicalWidth.isFixed() || colLogicalWidth.isPercent()) && colLogicalWidth.isZero())
     162            if ((colLogicalWidth.isFixed() || colLogicalWidth.isPercentOrCalculated()) && colLogicalWidth.isZero())
    163163                colLogicalWidth = Length();
    164164            unsigned effCol = m_table->colToEffCol(currentColumn);
     
    189189    while (table) {
    190190        Length tableWidth = table->style().width();
    191         if ((tableWidth.isAuto() || tableWidth.isPercent()) && !table->isOutOfFlowPositioned()) {
     191        if ((tableWidth.isAuto() || tableWidth.isPercentOrCalculated()) && !table->isOutOfFlowPositioned()) {
    192192            RenderBlock* containingBlock = table->containingBlock();
    193193            while (containingBlock && !is<RenderView>(*containingBlock) && !is<RenderTableCell>(*containingBlock)
     
    197197            table = nullptr;
    198198            if (is<RenderTableCell>(containingBlock)
    199                 && (containingBlock->style().width().isAuto() || containingBlock->style().width().isPercent())) {
     199                && (containingBlock->style().width().isAuto() || containingBlock->style().width().isPercentOrCalculated())) {
    200200                RenderTableCell& cell = downcast<RenderTableCell>(*containingBlock);
    201201                if (cell.colSpan() > 1 || cell.table()->style().width().isAuto())
     
    231231        maxWidth += m_layoutStruct[i].effectiveMaxLogicalWidth;
    232232        if (scaleColumns) {
    233             if (m_layoutStruct[i].effectiveLogicalWidth.isPercentNotCalculated()) {
     233            if (m_layoutStruct[i].effectiveLogicalWidth.isPercent()) {
    234234                float percent = std::min(m_layoutStruct[i].effectiveLogicalWidth.percent(), remainingPercent);
    235235                float logicalWidth = static_cast<float>(m_layoutStruct[i].effectiveMaxLogicalWidth) * 100 / std::max(percent, epsilon);
     
    324324                //   <tr><td>1</td><td colspan=2 width=100%>2-3</td></tr>
    325325                // </table>
    326                 if (!columnLayout.effectiveLogicalWidth.isPercentNotCalculated()) {
     326                if (!columnLayout.effectiveLogicalWidth.isPercent()) {
    327327                    columnLayout.effectiveLogicalWidth = Length();
    328328                    allColsArePercent = false;
     
    342342
    343343        // adjust table max width if needed
    344         if (cellLogicalWidth.isPercentNotCalculated()) {
     344        if (cellLogicalWidth.isPercent()) {
    345345            if (totalPercent > cellLogicalWidth.percent() || allColsArePercent) {
    346346                // can't satify this condition, treat as variable
     
    353353                int totalWidth = 0;
    354354                for (unsigned pos = effCol; pos < lastCol; ++pos) {
    355                     if (!m_layoutStruct[pos].effectiveLogicalWidth.isPercent())
     355                    if (!m_layoutStruct[pos].effectiveLogicalWidth.isPercentOrCalculated())
    356356                        totalWidth += m_layoutStruct[pos].effectiveMaxLogicalWidth;
    357357                }
    358358
    359359                for (unsigned pos = effCol; pos < lastCol && totalWidth > 0; ++pos) {
    360                     if (!m_layoutStruct[pos].effectiveLogicalWidth.isPercent()) {
     360                    if (!m_layoutStruct[pos].effectiveLogicalWidth.isPercentOrCalculated()) {
    361361                        float percent = percentMissing * static_cast<float>(m_layoutStruct[pos].effectiveMaxLogicalWidth) / totalWidth;
    362362                        totalWidth -= m_layoutStruct[pos].effectiveMaxLogicalWidth;
     
    385385                int allocatedMaxLogicalWidth = 0;
    386386                for (unsigned pos = effCol; pos < lastCol; ++pos) {
    387                     ASSERT(m_layoutStruct[pos].logicalWidth.isPercentNotCalculated() || m_layoutStruct[pos].effectiveLogicalWidth.isPercentNotCalculated());
     387                    ASSERT(m_layoutStruct[pos].logicalWidth.isPercent() || m_layoutStruct[pos].effectiveLogicalWidth.isPercent());
    388388                    // |allColsArePercent| means that either the logicalWidth *or* the effectiveLogicalWidth are percents, handle both of them here.
    389                     float percent = m_layoutStruct[pos].logicalWidth.isPercentNotCalculated() ? m_layoutStruct[pos].logicalWidth.percent() : m_layoutStruct[pos].effectiveLogicalWidth.percent();
     389                    float percent = m_layoutStruct[pos].logicalWidth.isPercent() ? m_layoutStruct[pos].logicalWidth.percent() : m_layoutStruct[pos].effectiveLogicalWidth.percent();
    390390                    int columnMinLogicalWidth = static_cast<int>(percent * cellMinLogicalWidth / totalPercent);
    391391                    int columnMaxLogicalWidth = static_cast<int>(percent * cellMaxLogicalWidth / totalPercent);
     
    427427            }
    428428        }
    429         if (!cellLogicalWidth.isPercent()) {
     429        if (!cellLogicalWidth.isPercentOrCalculated()) {
    430430            if (cellMaxLogicalWidth > spanMaxLogicalWidth) {
    431431                for (unsigned pos = effCol; spanMaxLogicalWidth >= 0 && pos < lastCol; ++pos) {
     
    542542        for (size_t i = 0; i < nEffCols; ++i) {
    543543            Length& logicalWidth = m_layoutStruct[i].effectiveLogicalWidth;
    544             if (logicalWidth.isPercent()) {
     544            if (logicalWidth.isPercentOrCalculated()) {
    545545                int cellLogicalWidth = std::max<int>(m_layoutStruct[i].effectiveMinLogicalWidth, minimumValueForLength(logicalWidth, tableLogicalWidth));
    546546                available += m_layoutStruct[i].computedLogicalWidth - cellLogicalWidth;
     
    553553            for (unsigned i = nEffCols; i; ) {
    554554                --i;
    555                 if (m_layoutStruct[i].effectiveLogicalWidth.isPercent()) {
     555                if (m_layoutStruct[i].effectiveLogicalWidth.isPercentOrCalculated()) {
    556556                    int cellLogicalWidth = m_layoutStruct[i].computedLogicalWidth;
    557557                    int reduction = std::min(cellLogicalWidth,  excess);
     
    621621        for (size_t i = 0; i < nEffCols; ++i) {
    622622            Length& logicalWidth = m_layoutStruct[i].effectiveLogicalWidth;
    623             if (logicalWidth.isPercentNotCalculated()) {
     623            if (logicalWidth.isPercent()) {
    624624                int cellLogicalWidth = available * logicalWidth.percent() / totalPercent;
    625625                available -= cellLogicalWidth;
     
    734734                --i;
    735735                Length& logicalWidth = m_layoutStruct[i].effectiveLogicalWidth;
    736                 if (logicalWidth.isPercent())
     736                if (logicalWidth.isPercentOrCalculated())
    737737                    logicalWidthBeyondMin += m_layoutStruct[i].computedLogicalWidth - m_layoutStruct[i].effectiveMinLogicalWidth;
    738738            }
     
    741741                --i;
    742742                Length& logicalWidth = m_layoutStruct[i].effectiveLogicalWidth;
    743                 if (logicalWidth.isPercent()) {
     743                if (logicalWidth.isPercentOrCalculated()) {
    744744                    int minMaxDiff = m_layoutStruct[i].computedLogicalWidth - m_layoutStruct[i].effectiveMinLogicalWidth;
    745745                    int reduce = available * minMaxDiff / logicalWidthBeyondMin;
  • trunk/Source/WebCore/rendering/FixedTableLayout.cpp

    r166920 r184055  
    118118                spanInCurrentEffectiveColumn = m_table->spanOfEffCol(currentEffectiveColumn);
    119119            }
    120             if ((colStyleLogicalWidth.isFixed() || colStyleLogicalWidth.isPercent()) && colStyleLogicalWidth.isPositive()) {
     120            if ((colStyleLogicalWidth.isFixed() || colStyleLogicalWidth.isPercentOrCalculated()) && colStyleLogicalWidth.isPositive()) {
    121121                m_width[currentEffectiveColumn] = colStyleLogicalWidth;
    122122                m_width[currentEffectiveColumn] *= spanInCurrentEffectiveColumn;
     
    193193    // We can achieve this effect by making the maxwidth of fixed tables with percentage
    194194    // widths be infinite.
    195     if (m_table->style().logicalWidth().isPercent() && maxWidth < tableMaxWidth)
     195    if (m_table->style().logicalWidth().isPercentOrCalculated() && maxWidth < tableMaxWidth)
    196196        maxWidth = tableMaxWidth;
    197197}
     
    226226            calcWidth[i] = m_width[i].value();
    227227            totalFixedWidth += calcWidth[i];
    228         } else if (m_width[i].isPercentNotCalculated()) {
     228        } else if (m_width[i].isPercent()) {
    229229            calcWidth[i] = valueForLength(m_width[i], tableLogicalWidth);
    230230            totalPercentWidth += calcWidth[i];
     
    255255                totalPercentWidth = 0;
    256256                for (unsigned i = 0; i < nEffCols; i++) {
    257                     if (m_width[i].isPercentNotCalculated()) {
     257                    if (m_width[i].isPercent()) {
    258258                        calcWidth[i] = m_width[i].percent() * (tableLogicalWidth - totalFixedWidth) / totalPercent;
    259259                        totalPercentWidth += calcWidth[i];
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r183904 r184055  
    812812    Length logicalHeightLength = style().logicalHeight();
    813813    bool hasAutoHeight = logicalHeightLength.isAuto();
    814     if (logicalHeightLength.isPercent() && !document().inQuirksMode()) {
     814    if (logicalHeightLength.isPercentOrCalculated() && !document().inQuirksMode()) {
    815815        hasAutoHeight = true;
    816816        for (RenderBlock* cb = containingBlock(); !cb->isRenderView(); cb = cb->containingBlock()) {
     
    822822    // If the height is 0 or auto, then whether or not we are a self-collapsing block depends
    823823    // on whether we have content that is all self-collapsing or not.
    824     if (hasAutoHeight || ((logicalHeightLength.isFixed() || logicalHeightLength.isPercent()) && logicalHeightLength.isZero())) {
     824    if (hasAutoHeight || ((logicalHeightLength.isFixed() || logicalHeightLength.isPercentOrCalculated()) && logicalHeightLength.isZero())) {
    825825        // If the block has inline children, see if we generated any line boxes.  If we have any
    826826        // line boxes, then we can't be self-collapsing, since we have content.
     
    22572257{
    22582258    LayoutUnit cw = 0;
    2259     if (style().textIndent().isPercent())
     2259    if (style().textIndent().isPercentOrCalculated())
    22602260        cw = containingBlock()->availableLogicalWidth();
    22612261    return minimumValueForLength(style().textIndent(), cw);
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r183885 r184055  
    979979bool RenderBox::needsPreferredWidthsRecalculation() const
    980980{
    981     return style().paddingStart().isPercent() || style().paddingEnd().isPercent();
     981    return style().paddingStart().isPercentOrCalculated() || style().paddingEnd().isPercentOrCalculated();
    982982}
    983983
     
    27832783    // height since we don't set a height in RenderView when we're printing. So without this quirk, the
    27842784    // height has nothing to be a percentage of, and it ends up being 0. That is bad.
    2785     bool paginatedContentNeedsBaseHeight = document().printing() && h.isPercent()
    2786         && (isRoot() || (isBody() && document().documentElement()->renderer()->style().logicalHeight().isPercent())) && !isInline();
     2785    bool paginatedContentNeedsBaseHeight = document().printing() && h.isPercentOrCalculated()
     2786        && (isRoot() || (isBody() && document().documentElement()->renderer()->style().logicalHeight().isPercentOrCalculated())) && !isInline();
    27872787    if (stretchesToViewport() || paginatedContentNeedsBaseHeight) {
    27882788        LayoutUnit margins = collapsedMarginBefore() + collapsedMarginAfter();
     
    28172817    if (height.isFixed())
    28182818        return height.value();
    2819     if (height.isPercent())
     2819    if (height.isPercentOrCalculated())
    28202820        return computePercentageLogicalHeight(height);
    28212821    return -1;
     
    28922892        LayoutUnit contentBoxHeight = cb->adjustContentBoxLogicalHeightForBoxSizing(cbstyle.logicalHeight().value());
    28932893        availableHeight = std::max<LayoutUnit>(0, cb->constrainContentBoxLogicalHeightByMinMax(contentBoxHeight - cb->scrollbarLogicalHeight()));
    2894     } else if (cbstyle.logicalHeight().isPercent() && !isOutOfFlowPositionedWithSpecifiedHeight) {
     2894    } else if (cbstyle.logicalHeight().isPercentOrCalculated() && !isOutOfFlowPositionedWithSpecifiedHeight) {
    28952895        // We need to recur and compute the percentage height for our containing block.
    28962896        LayoutUnit heightWithScrollbar = cb->computePercentageLogicalHeight(cbstyle.logicalHeight());
     
    29372937LayoutUnit RenderBox::computeReplacedLogicalWidthRespectingMinMaxWidth(LayoutUnit logicalWidth, ShouldComputePreferred shouldComputePreferred) const
    29382938{
    2939     LayoutUnit minLogicalWidth = (shouldComputePreferred == ComputePreferred && style().logicalMinWidth().isPercent()) || style().logicalMinWidth().isUndefined() ? logicalWidth : computeReplacedLogicalWidthUsing(style().logicalMinWidth());
    2940     LayoutUnit maxLogicalWidth = (shouldComputePreferred == ComputePreferred && style().logicalMaxWidth().isPercent()) || style().logicalMaxWidth().isUndefined() ? logicalWidth : computeReplacedLogicalWidthUsing(style().logicalMaxWidth());
     2939    LayoutUnit minLogicalWidth = (shouldComputePreferred == ComputePreferred && style().logicalMinWidth().isPercentOrCalculated()) || style().logicalMinWidth().isUndefined() ? logicalWidth : computeReplacedLogicalWidthUsing(style().logicalMinWidth());
     2940    LayoutUnit maxLogicalWidth = (shouldComputePreferred == ComputePreferred && style().logicalMaxWidth().isPercentOrCalculated()) || style().logicalMaxWidth().isUndefined() ? logicalWidth : computeReplacedLogicalWidthUsing(style().logicalMaxWidth());
    29412941    return std::max(minLogicalWidth, std::min(logicalWidth, maxLogicalWidth));
    29422942}
     
    29662966            if (logicalWidth.isIntrinsic())
    29672967                return computeIntrinsicLogicalWidthUsing(logicalWidth, cw, borderAndPaddingLogicalWidth()) - borderAndPaddingLogicalWidth();
    2968             if (cw > 0 || (!cw && (containerLogicalWidth.isFixed() || containerLogicalWidth.isPercent())))
     2968            if (cw > 0 || (!cw && (containerLogicalWidth.isFixed() || containerLogicalWidth.isPercentOrCalculated())))
    29692969                return adjustContentBoxLogicalWidthForBoxSizing(minimumValueForLength(logicalWidth, cw));
    29702970        }
     
    30333033                // FIXME: This needs to be made block-flow-aware.  If the cell and image are perpendicular block-flows, this isn't right.
    30343034                // https://bugs.webkit.org/show_bug.cgi?id=46997
    3035                 while (cb && !cb->isRenderView() && (cb->style().logicalHeight().isAuto() || cb->style().logicalHeight().isPercent())) {
     3035                while (cb && !cb->isRenderView() && (cb->style().logicalHeight().isAuto() || cb->style().logicalHeight().isPercentOrCalculated())) {
    30363036                    if (cb->isTableCell()) {
    30373037                        // Don't let table cells squeeze percent-height replaced elements
     
    30613061    // artificially.  We're going to rely on this cell getting expanded to some new
    30623062    // height, and then when we lay out again we'll use the calculation below.
    3063     if (isTableCell() && (h.isAuto() || h.isPercent())) {
     3063    if (isTableCell() && (h.isAuto() || h.isPercentOrCalculated())) {
    30643064        if (hasOverrideLogicalContentHeight())
    30653065            return overrideLogicalContentHeight();
     
    30673067    }
    30683068
    3069     if (h.isPercent() && isOutOfFlowPositioned() && !isRenderFlowThread()) {
     3069    if (h.isPercentOrCalculated() && isOutOfFlowPositioned() && !isRenderFlowThread()) {
    30703070        // FIXME: This is wrong if the containingBlock has a perpendicular writing mode.
    30713071        LayoutUnit availableHeight = containingBlockLogicalHeightForPositioned(containingBlock());
     
    44994499        return box->overrideContainingBlockContentLogicalWidth() != -1;
    45004500#endif
    4501     if (box->style().logicalWidth().isPercent())
     4501    if (box->style().logicalWidth().isPercentOrCalculated())
    45024502        return logicalWidthIsResolvable(*box->containingBlock());
    45034503
     
    45514551    if (cb->style().logicalHeight().isFixed())
    45524552        return true;
    4553     if (cb->style().logicalHeight().isPercent() && !isOutOfFlowPositionedWithSpecifiedHeight)
     4553    if (cb->style().logicalHeight().isPercentOrCalculated() && !isOutOfFlowPositionedWithSpecifiedHeight)
    45544554        return percentageLogicalHeightIsResolvableFromBlock(cb->containingBlock(), cb->isOutOfFlowPositioned());
    45554555    if (cb->isRenderView() || inQuirksMode || isOutOfFlowPositionedWithSpecifiedHeight)
     
    45964596    // with scrollbars present is not the end of the world and is what we used to do in the old model anyway.
    45974597    return !style().logicalHeight().isIntrinsicOrAuto()
    4598         || (!style().logicalMaxHeight().isIntrinsicOrAuto() && !style().logicalMaxHeight().isUndefined() && (!style().logicalMaxHeight().isPercent() || percentageLogicalHeightIsResolvable(this)))
    4599         || (!style().logicalMinHeight().isIntrinsicOrAuto() && style().logicalMinHeight().isPositive() && (!style().logicalMinHeight().isPercent() || percentageLogicalHeightIsResolvable(this)));
     4598        || (!style().logicalMaxHeight().isIntrinsicOrAuto() && !style().logicalMaxHeight().isUndefined() && (!style().logicalMaxHeight().isPercentOrCalculated() || percentageLogicalHeightIsResolvable(this)))
     4599        || (!style().logicalMinHeight().isIntrinsicOrAuto() && style().logicalMinHeight().isPositive() && (!style().logicalMinHeight().isPercentOrCalculated() || percentageLogicalHeightIsResolvable(this)));
    46004600}
    46014601
     
    48704870bool RenderBox::hasRelativeDimensions() const
    48714871{
    4872     return style().height().isPercent() || style().width().isPercent()
    4873             || style().maxHeight().isPercent() || style().maxWidth().isPercent()
    4874             || style().minHeight().isPercent() || style().minWidth().isPercent();
     4872    return style().height().isPercentOrCalculated() || style().width().isPercentOrCalculated()
     4873        || style().maxHeight().isPercentOrCalculated() || style().maxWidth().isPercentOrCalculated()
     4874        || style().minHeight().isPercentOrCalculated() || style().minWidth().isPercentOrCalculated();
    48754875}
    48764876
    48774877bool RenderBox::hasRelativeLogicalHeight() const
    48784878{
    4879     return style().logicalHeight().isPercent()
    4880             || style().logicalMinHeight().isPercent()
    4881             || style().logicalMaxHeight().isPercent();
     4879    return style().logicalHeight().isPercentOrCalculated()
     4880        || style().logicalMinHeight().isPercentOrCalculated()
     4881        || style().logicalMaxHeight().isPercentOrCalculated();
    48824882}
    48834883
    48844884bool RenderBox::hasRelativeLogicalWidth() const
    48854885{
    4886     return style().logicalWidth().isPercent()
    4887         || style().logicalMinWidth().isPercent()
    4888         || style().logicalMaxWidth().isPercent();
     4886    return style().logicalWidth().isPercentOrCalculated()
     4887        || style().logicalMinWidth().isPercentOrCalculated()
     4888        || style().logicalMaxWidth().isPercentOrCalculated();
    48894889}
    48904890
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp

    r183885 r184055  
    245245    // containing block. If the height of the containing block is not specified explicitly (i.e., it depends
    246246    // on content height), and this element is not absolutely positioned, the value computes to 'auto'.
    247     if (!logicalHeightLength.isPercent() || isOutOfFlowPositioned() || document().inQuirksMode())
     247    if (!logicalHeightLength.isPercentOrCalculated() || isOutOfFlowPositioned() || document().inQuirksMode())
    248248        return false;
    249249
     
    300300    // See <https://bugs.webkit.org/show_bug.cgi?id=26396>.
    301301    if (!style().top().isAuto()
    302         && (!style().top().isPercent()
     302        && (!style().top().isPercentOrCalculated()
    303303            || !containingBlock()->hasAutoHeightOrContainingBlockWithAutoHeight()
    304304            || containingBlock()->stretchesToViewport()))
     
    306306
    307307    else if (!style().bottom().isAuto()
    308         && (!style().bottom().isPercent()
     308        && (!style().bottom().isPercentOrCalculated()
    309309            || !containingBlock()->hasAutoHeightOrContainingBlockWithAutoHeight()
    310310            || containingBlock()->stretchesToViewport()))
     
    520520{
    521521    LayoutUnit w = 0;
    522     if (padding.isPercent())
     522    if (padding.isPercentOrCalculated())
    523523        w = containingBlockLogicalWidthForContent();
    524524    return minimumValueForLength(padding, w);
     
    933933    image->computeIntrinsicDimensions(this, intrinsicWidth, intrinsicHeight, intrinsicRatio);
    934934
    935     ASSERT(!intrinsicWidth.isPercent());
    936     ASSERT(!intrinsicHeight.isPercent());
     935    ASSERT(!intrinsicWidth.isPercentOrCalculated());
     936    ASSERT(!intrinsicHeight.isPercentOrCalculated());
    937937
    938938    LayoutSize resolvedSize(intrinsicWidth.value(), intrinsicHeight.value());
     
    984984            if (layerWidth.isFixed())
    985985                tileSize.setWidth(layerWidth.value());
    986             else if (layerWidth.isPercent())
     986            else if (layerWidth.isPercentOrCalculated())
    987987                tileSize.setWidth(valueForLength(layerWidth, positioningAreaSize.width()));
    988988           
    989989            if (layerHeight.isFixed())
    990990                tileSize.setHeight(layerHeight.value());
    991             else if (layerHeight.isPercent())
     991            else if (layerHeight.isPercentOrCalculated())
    992992                tileSize.setHeight(valueForLength(layerHeight, positioningAreaSize.height()));
    993993
  • trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp

    r183100 r184055  
    935935
    936936        child->clearOverrideSize();
    937         if (relayoutChildren || (child->isReplaced() && (child->style().width().isPercent() || child->style().height().isPercent()))
     937        if (relayoutChildren || (child->isReplaced() && (child->style().width().isPercentOrCalculated() || child->style().height().isPercentOrCalculated()))
    938938            || (child->style().height().isAuto() && is<RenderBlockFlow>(*child))) {
    939939            child->setChildNeedsLayout(MarkOnlyThis);
     
    10351035
    10361036        child->clearOverrideSize();
    1037         if ((child->isReplaced() && (child->style().width().isPercent() || child->style().height().isPercent()))
     1037        if ((child->isReplaced() && (child->style().width().isPercentOrCalculated() || child->style().height().isPercentOrCalculated()))
    10381038            || (child->style().height().isAuto() && is<RenderBlockFlow>(*child))) {
    10391039            child->setChildNeedsLayout();
  • trunk/Source/WebCore/rendering/RenderElement.cpp

    r183461 r184055  
    12171217    if (sizeType == SizeLength) {
    12181218        LengthSize size = layer->sizeLength();
    1219         if (size.width().isPercent() || size.height().isPercent())
     1219        if (size.width().isPercentOrCalculated() || size.height().isPercentOrCalculated())
    12201220            return true;
    12211221        // If the image has neither an intrinsic width nor an intrinsic height, its size is determined as for 'contain'.
  • trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp

    r182207 r184055  
    214214    maxLogicalWidth = static_cast<int>(ceilf(std::max(minDefaultLabelWidth, defaultLabelWidth)));
    215215
    216     if (!style().width().isPercent())
     216    if (!style().width().isPercentOrCalculated())
    217217        minLogicalWidth = maxLogicalWidth;
    218218}
  • trunk/Source/WebCore/rendering/RenderFrameSet.cpp

    r177259 r184055  
    207207        // Count the total percentage of all of the percentage columns/rows -> totalPercent
    208208        // Count the number of columns/rows which are percentages -> countPercent
    209         if (grid[i].isPercent()) {
     209        if (grid[i].isPercentOrCalculated()) {
    210210            gridLayout[i] = std::max(intValueForLength(grid[i], availableLen), 0);
    211211            totalPercent += gridLayout[i];
     
    245245
    246246        for (int i = 0; i < gridLen; ++i) {
    247             if (grid[i].isPercent()) {
     247            if (grid[i].isPercentOrCalculated()) {
    248248                gridLayout[i] = (gridLayout[i] * remainingPercent) / totalPercent;
    249249                remainingLen -= gridLayout[i];
     
    289289
    290290            for (int i = 0; i < gridLen; ++i) {
    291                 if (grid[i].isPercent()) {
     291                if (grid[i].isPercentOrCalculated()) {
    292292                    changePercent = (remainingPercent * gridLayout[i]) / totalPercent;
    293293                    gridLayout[i] += changePercent;
     
    321321
    322322        for (int i = 0; i < gridLen; ++i) {
    323             if (grid[i].isPercent()) {
     323            if (grid[i].isPercentOrCalculated()) {
    324324                changePercent = remainingPercent / countPercent;
    325325                gridLayout[i] += changePercent;
  • trunk/Source/WebCore/rendering/RenderImage.cpp

    r181729 r184055  
    316316    // There's no easy way to detect that shrink-to-fit is needed, always force a layout.
    317317    bool containingBlockNeedsToRecomputePreferredSize =
    318         style().logicalWidth().isPercent()
    319         || style().logicalMaxWidth().isPercent()
    320         || style().logicalMinWidth().isPercent();
     318        style().logicalWidth().isPercentOrCalculated()
     319        || style().logicalMaxWidth().isPercentOrCalculated()
     320        || style().logicalMinWidth().isPercentOrCalculated();
    321321
    322322    bool layoutSizeDependsOnIntrinsicSize = style().aspectRatioType() == AspectRatioFromIntrinsic;
  • trunk/Source/WebCore/rendering/RenderInline.cpp

    r182835 r184055  
    792792    if (margin.isFixed())
    793793        return margin.value();
    794     if (margin.isPercent())
     794    if (margin.isPercentOrCalculated())
    795795        return minimumValueForLength(margin, std::max<LayoutUnit>(0, renderer->containingBlock()->availableLogicalWidth()));
    796796    return 0;
  • trunk/Source/WebCore/rendering/RenderListBox.cpp

    r183595 r184055  
    194194    if (m_vBar)
    195195        maxLogicalWidth += m_vBar->width();
    196     if (!style().width().isPercent())
     196    if (!style().width().isPercentOrCalculated())
    197197        minLogicalWidth = maxLogicalWidth;
    198198}
  • trunk/Source/WebCore/rendering/RenderMenuList.cpp

    r183591 r184055  
    325325{
    326326    maxLogicalWidth = std::max(m_optionsWidth, theme().minimumMenuListSize(style())) + m_innerBlock->paddingLeft() + m_innerBlock->paddingRight();
    327     if (!style().width().isPercent())
     327    if (!style().width().isPercentOrCalculated())
    328328        minLogicalWidth = maxLogicalWidth;
    329329}
  • trunk/Source/WebCore/rendering/RenderObject.cpp

    r183788 r184055  
    544544        return false;
    545545
    546     if (object->style().width().isIntrinsicOrAuto() || object->style().height().isIntrinsicOrAuto() || object->style().height().isPercent())
     546    if (object->style().width().isIntrinsicOrAuto() || object->style().height().isIntrinsicOrAuto() || object->style().height().isPercentOrCalculated())
    547547        return false;
    548548
  • trunk/Source/WebCore/rendering/RenderReplaced.cpp

    r183732 r184055  
    487487    // We cannot resolve any percent logical width here as the available logical
    488488    // width may not be set on our containing block.
    489     if (style().logicalWidth().isPercent())
     489    if (style().logicalWidth().isPercentOrCalculated())
    490490        computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth);
    491491    else
     
    493493
    494494    const RenderStyle& styleToUse = style();
    495     if (styleToUse.logicalWidth().isPercent() || styleToUse.logicalMaxWidth().isPercent())
     495    if (styleToUse.logicalWidth().isPercentOrCalculated() || styleToUse.logicalMaxWidth().isPercentOrCalculated())
    496496        m_minPreferredLogicalWidth = 0;
    497497
  • trunk/Source/WebCore/rendering/RenderSlider.cpp

    r177259 r184055  
    7373{
    7474    maxLogicalWidth = defaultTrackLength * style().effectiveZoom();
    75     if (!style().width().isPercent())
     75    if (!style().width().isPercentOrCalculated())
    7676        minLogicalWidth = maxLogicalWidth;
    7777}
  • trunk/Source/WebCore/rendering/RenderTable.cpp

    r182235 r184055  
    369369        }
    370370        computedLogicalHeight = styleLogicalHeight.value() - borders;
    371     } else if (styleLogicalHeight.isPercent())
     371    } else if (styleLogicalHeight.isPercentOrCalculated())
    372372        computedLogicalHeight = computePercentageLogicalHeight(styleLogicalHeight);
    373373    else
  • trunk/Source/WebCore/rendering/RenderTableSection.cpp

    r183100 r184055  
    6868        switch (logicalHeight.type()) {
    6969        case Percent:
    70             if (!cRowLogicalHeight.isPercentNotCalculated() || cRowLogicalHeight.percent() < logicalHeight.percent())
     70            if (!cRowLogicalHeight.isPercent() || cRowLogicalHeight.percent() < logicalHeight.percent())
    7171                row.logicalHeight = logicalHeight;
    7272            break;
     
    426426    int rowHeight = m_rowPos[1] - m_rowPos[0];
    427427    for (unsigned r = 0; r < totalRows; ++r) {
    428         if (totalPercent > 0 && m_grid[r].logicalHeight.isPercentNotCalculated()) {
     428        if (totalPercent > 0 && m_grid[r].logicalHeight.isPercent()) {
    429429            int toAdd = std::min<int>(extraLogicalHeight, (totalHeight * m_grid[r].logicalHeight.percent() / 100) - rowHeight);
    430430            // If toAdd is negative, then we don't want to shrink the row (this bug
     
    498498        if (m_grid[r].logicalHeight.isAuto())
    499499            ++autoRowsCount;
    500         else if (m_grid[r].logicalHeight.isPercentNotCalculated())
     500        else if (m_grid[r].logicalHeight.isPercent())
    501501            totalPercent += m_grid[r].logicalHeight.percent();
    502502    }
     
    569569
    570570            for (RenderObject* renderer = cell->firstChild(); renderer; renderer = renderer->nextSibling()) {
    571                 if (!is<RenderText>(*renderer) && renderer->style().logicalHeight().isPercent() && (flexAllChildren || ((renderer->isReplaced() || (is<RenderBox>(*renderer) && downcast<RenderBox>(*renderer).scrollsOverflow())) && !is<RenderTextControl>(*renderer)))) {
     571                if (!is<RenderText>(*renderer) && renderer->style().logicalHeight().isPercentOrCalculated() && (flexAllChildren || ((renderer->isReplaced() || (is<RenderBox>(*renderer) && downcast<RenderBox>(*renderer).scrollsOverflow())) && !is<RenderTextControl>(*renderer)))) {
    572572                    // Tables with no sections do not flex.
    573573                    if (!is<RenderTable>(*renderer) || downcast<RenderTable>(*renderer).hasSections()) {
  • trunk/Source/WebCore/rendering/RenderTextControl.cpp

    r182207 r184055  
    199199    if (RenderBox* innerTextRenderBox = innerTextElement()->renderBox())
    200200        maxLogicalWidth += innerTextRenderBox->paddingStart() + innerTextRenderBox->paddingEnd();
    201     if (!style().logicalWidth().isPercent())
     201    if (!style().logicalWidth().isPercentOrCalculated())
    202202        minLogicalWidth = maxLogicalWidth;
    203203}
  • trunk/Source/WebCore/rendering/RenderView.cpp

    r183885 r184055  
    334334        for (auto& box : childrenOfType<RenderBox>(*this)) {
    335335            if (box.hasRelativeLogicalHeight()
    336                 || box.style().logicalHeight().isPercent()
    337                 || box.style().logicalMinHeight().isPercent()
    338                 || box.style().logicalMaxHeight().isPercent()
     336                || box.style().logicalHeight().isPercentOrCalculated()
     337                || box.style().logicalMinHeight().isPercentOrCalculated()
     338                || box.style().logicalMaxHeight().isPercentOrCalculated()
    339339                || box.isSVGRoot()
    340340                )
  • trunk/Source/WebCore/rendering/RootInlineBox.cpp

    r182279 r184055  
    10511051            LayoutUnit lineHeight;
    10521052            //Per http://www.w3.org/TR/CSS21/visudet.html#propdef-vertical-align: 'Percentages: refer to the 'line-height' of the element itself'.
    1053             if (renderer->style().verticalAlignLength().isPercent())
     1053            if (renderer->style().verticalAlignLength().isPercentOrCalculated())
    10541054                lineHeight = renderer->style().computedLineHeight();
    10551055            else
  • trunk/Source/WebCore/rendering/style/GridLength.h

    r180140 r184055  
    6565    double flex() const { ASSERT(isFlex()); return m_flex; }
    6666
    67     bool isPercentage() const { return m_type == LengthType && m_length.isPercent(); }
     67    bool isPercentage() const { return m_type == LengthType && m_length.isPercentOrCalculated(); }
    6868
    6969    bool operator==(const GridLength& o) const
  • trunk/Source/WebCore/rendering/style/GridTrackSize.h

    r180142 r184055  
    9393    bool isContentSized() const { return m_minTrackBreadth.isContentSized() || m_maxTrackBreadth.isContentSized(); }
    9494
    95     bool isPercentage() const { return m_type == LengthTrackSizing && length().isLength() && length().length().isPercent(); }
     95    bool isPercentage() const { return m_type == LengthTrackSizing && length().isLength() && length().length().isPercentOrCalculated(); }
    9696
    9797    bool operator==(const GridTrackSize& other) const
  • trunk/Source/WebCore/rendering/style/RenderStyle.cpp

    r183805 r184055  
    10781078    bool applyTransformOrigin = requireTransformOrigin(operations, applyOrigin);
    10791079
    1080     float offsetX = transformOriginX().isPercentNotCalculated() ? boundingBox.x() : 0;
    1081     float offsetY = transformOriginY().isPercentNotCalculated() ? boundingBox.y() : 0;
     1080    float offsetX = transformOriginX().isPercent() ? boundingBox.x() : 0;
     1081    float offsetY = transformOriginY().isPercent() ? boundingBox.y() : 0;
    10821082
    10831083    if (applyTransformOrigin) {
     
    14571457        return fontMetrics().lineSpacing();
    14581458
    1459     if (lh.isPercent())
     1459    if (lh.isPercentOrCalculated())
    14601460        return minimumValueForLength(lh, fontSize());
    14611461
  • trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp

    r177259 r184055  
    437437bool RenderSVGRoot::hasRelativeDimensions() const
    438438{
    439     return svgSVGElement().intrinsicHeight().isPercent() || svgSVGElement().intrinsicWidth().isPercent();
     439    return svgSVGElement().intrinsicHeight().isPercentOrCalculated() || svgSVGElement().intrinsicWidth().isPercentOrCalculated();
    440440}
    441441
  • trunk/Source/WebCore/svg/SVGLengthContext.cpp

    r174225 r184055  
    9090float SVGLengthContext::valueForLength(const Length& length, SVGLengthMode mode)
    9191{
    92     if (length.isPercent() && !length.isCalculated())
     92    if (length.isPercent())
    9393        return convertValueFromPercentageToUserUnits(length.value() / 100, mode, IGNORE_EXCEPTION);
    9494    if (length.isAuto())
  • trunk/Source/WebCore/svg/graphics/SVGImage.cpp

    r180511 r184055  
    287287    if (!rootElement)
    288288        return false;
    289     return rootElement->intrinsicWidth().isPercent();
     289    return rootElement->intrinsicWidth().isPercentOrCalculated();
    290290}
    291291
     
    295295    if (!rootElement)
    296296        return false;
    297     return rootElement->intrinsicHeight().isPercent();
     297    return rootElement->intrinsicHeight().isPercentOrCalculated();
    298298}
    299299
Note: See TracChangeset for help on using the changeset viewer.