Spec renamed Viewport-relative lengths to Viewport-percentage lengths
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 31 Mar 2012 00:05:21 +0000 (00:05 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 31 Mar 2012 00:05:21 +0000 (00:05 +0000)
https://bugs.webkit.org/show_bug.cgi?id=82773

Patch by Joe Thomas <joethomas@motorola.com> on 2012-03-30
Reviewed by Antti Koivisto.

As per the latest version of CSS Values and Units Module Level 3 specification released on 29 March 2012
(http://dev.w3.org/csswg/css3-values/#viewport-relative-lengths) Viewport-relative lengths is renamed to Viewport-percentage lengths.

Source/WebCore:

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::getPositionOffsetValue):
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
* css/CSSPrimitiveValue.cpp:
(WebCore::unitCategory):
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::canonicalUnitTypeForCategory):
(WebCore::CSSPrimitiveValue::viewportPercentageLength):
* css/CSSPrimitiveValue.h:
(WebCore::CSSPrimitiveValue::isViewportPercentageLength):
(CSSPrimitiveValue):
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::convertToLength):
* css/CSSStyleApplyProperty.cpp:
(WebCore::ApplyPropertyLength::applyValue):
(WebCore::ApplyPropertyBorderRadius::applyValue):
(WebCore::ApplyPropertyFontSize::applyValue):
(WebCore::ApplyPropertyLineHeight::applyValue):
(WebCore::ApplyPropertyVerticalAlign::applyValue):
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::collectMatchingRulesForList):
* css/LengthFunctions.cpp:
(WebCore::minimumValueForLength):
(WebCore::valueForLength):
(WebCore::floatValueForLength):
* platform/Length.h:
(WebCore::Length::isViewportPercentage):
(WebCore::Length::viewportPercentageLength):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::textIndentOffset):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeContentLogicalHeightUsing):
(WebCore::RenderBox::computeReplacedLogicalHeightUsing):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paddingTop):
(WebCore::RenderBoxModelObject::paddingBottom):
(WebCore::RenderBoxModelObject::paddingLeft):
(WebCore::RenderBoxModelObject::paddingRight):
(WebCore::RenderBoxModelObject::paddingBefore):
(WebCore::RenderBoxModelObject::paddingAfter):
(WebCore::RenderBoxModelObject::paddingStart):
(WebCore::RenderBoxModelObject::paddingEnd):
(WebCore::RenderBoxModelObject::calculateFillTileSize):
* rendering/RenderInline.cpp:
(WebCore::computeMargin):
* rendering/style/RenderStyle.h:

LayoutTests:

* css3/viewport-percentage-lengths: Added.
* css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-getStyle-expected.txt: Added.
* css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-getStyle.html: Added.
* css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vh-absolute-expected.html: Added.
* css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vh-absolute.html: Added.
* css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vh-expected.html: Added.
* css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vh.html: Added.
* css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vmin-absolute-expected.html: Added.
* css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vmin-absolute.html: Added.
* css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vmin-expected.html: Added.
* css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vmin.html: Added.
* css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vw-absolute-expected.html: Added.
* css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vw-absolute.html: Added.
* css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vw-expected.html: Added.
* css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vw.html: Added.
* css3/viewport-relative-lengths: Removed.
* css3/viewport-relative-lengths/css3-viewport-relative-lengths-getStyle-expected.txt: Removed.
* css3/viewport-relative-lengths/css3-viewport-relative-lengths-getStyle.html: Removed.
* css3/viewport-relative-lengths/css3-viewport-relative-lengths-vh-absolute-expected.html: Removed.
* css3/viewport-relative-lengths/css3-viewport-relative-lengths-vh-absolute.html: Removed.
* css3/viewport-relative-lengths/css3-viewport-relative-lengths-vh-expected.html: Removed.
* css3/viewport-relative-lengths/css3-viewport-relative-lengths-vh.html: Removed.
* css3/viewport-relative-lengths/css3-viewport-relative-lengths-vmin-absolute-expected.html: Removed.
* css3/viewport-relative-lengths/css3-viewport-relative-lengths-vmin-absolute.html: Removed.
* css3/viewport-relative-lengths/css3-viewport-relative-lengths-vmin-expected.html: Removed.
* css3/viewport-relative-lengths/css3-viewport-relative-lengths-vmin.html: Removed.
* css3/viewport-relative-lengths/css3-viewport-relative-lengths-vw-absolute-expected.html: Removed.
* css3/viewport-relative-lengths/css3-viewport-relative-lengths-vw-absolute.html: Removed.
* css3/viewport-relative-lengths/css3-viewport-relative-lengths-vw-expected.html: Removed.
* css3/viewport-relative-lengths/css3-viewport-relative-lengths-vw.html: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@112749 268f45cc-cd09-0410-ab3c-d52691b4dbfc

29 files changed:
LayoutTests/ChangeLog
LayoutTests/css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-getStyle-expected.txt [moved from LayoutTests/css3/viewport-relative-lengths/css3-viewport-relative-lengths-getStyle-expected.txt with 100% similarity]
LayoutTests/css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-getStyle.html [moved from LayoutTests/css3/viewport-relative-lengths/css3-viewport-relative-lengths-getStyle.html with 100% similarity]
LayoutTests/css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vh-absolute-expected.html [moved from LayoutTests/css3/viewport-relative-lengths/css3-viewport-relative-lengths-vh-absolute-expected.html with 100% similarity]
LayoutTests/css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vh-absolute.html [moved from LayoutTests/css3/viewport-relative-lengths/css3-viewport-relative-lengths-vh-absolute.html with 100% similarity]
LayoutTests/css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vh-expected.html [moved from LayoutTests/css3/viewport-relative-lengths/css3-viewport-relative-lengths-vh-expected.html with 100% similarity]
LayoutTests/css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vh.html [moved from LayoutTests/css3/viewport-relative-lengths/css3-viewport-relative-lengths-vh.html with 100% similarity]
LayoutTests/css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vmin-absolute-expected.html [moved from LayoutTests/css3/viewport-relative-lengths/css3-viewport-relative-lengths-vmin-absolute-expected.html with 100% similarity]
LayoutTests/css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vmin-absolute.html [moved from LayoutTests/css3/viewport-relative-lengths/css3-viewport-relative-lengths-vmin-absolute.html with 100% similarity]
LayoutTests/css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vmin-expected.html [moved from LayoutTests/css3/viewport-relative-lengths/css3-viewport-relative-lengths-vmin-expected.html with 100% similarity]
LayoutTests/css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vmin.html [moved from LayoutTests/css3/viewport-relative-lengths/css3-viewport-relative-lengths-vmin.html with 100% similarity]
LayoutTests/css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vw-absolute-expected.html [moved from LayoutTests/css3/viewport-relative-lengths/css3-viewport-relative-lengths-vw-absolute-expected.html with 100% similarity]
LayoutTests/css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vw-absolute.html [moved from LayoutTests/css3/viewport-relative-lengths/css3-viewport-relative-lengths-vw-absolute.html with 100% similarity]
LayoutTests/css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vw-expected.html [moved from LayoutTests/css3/viewport-relative-lengths/css3-viewport-relative-lengths-vw-expected.html with 100% similarity]
LayoutTests/css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vw.html [moved from LayoutTests/css3/viewport-relative-lengths/css3-viewport-relative-lengths-vw.html with 100% similarity]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSPrimitiveValue.cpp
Source/WebCore/css/CSSPrimitiveValue.h
Source/WebCore/css/CSSPrimitiveValueMappings.h
Source/WebCore/css/CSSStyleApplyProperty.cpp
Source/WebCore/css/CSSStyleSelector.cpp
Source/WebCore/css/LengthFunctions.cpp
Source/WebCore/platform/Length.h
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderBoxModelObject.cpp
Source/WebCore/rendering/RenderInline.cpp
Source/WebCore/rendering/style/RenderStyle.h

index a3f0d7e..cf64ab1 100644 (file)
@@ -1,3 +1,44 @@
+2012-03-30  Joe Thomas  <joethomas@motorola.com>
+
+        Spec renamed Viewport-relative lengths to Viewport-percentage lengths
+        https://bugs.webkit.org/show_bug.cgi?id=82773
+
+        Reviewed by Antti Koivisto.
+
+        As per the latest version of CSS Values and Units Module Level 3 specification released on 29 March 2012
+        (http://dev.w3.org/csswg/css3-values/#viewport-relative-lengths) Viewport-relative lengths is renamed to Viewport-percentage lengths.
+
+        * css3/viewport-percentage-lengths: Added.
+        * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-getStyle-expected.txt: Added.
+        * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-getStyle.html: Added.
+        * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vh-absolute-expected.html: Added.
+        * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vh-absolute.html: Added.
+        * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vh-expected.html: Added.
+        * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vh.html: Added.
+        * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vmin-absolute-expected.html: Added.
+        * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vmin-absolute.html: Added.
+        * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vmin-expected.html: Added.
+        * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vmin.html: Added.
+        * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vw-absolute-expected.html: Added.
+        * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vw-absolute.html: Added.
+        * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vw-expected.html: Added.
+        * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-vw.html: Added.
+        * css3/viewport-relative-lengths: Removed.
+        * css3/viewport-relative-lengths/css3-viewport-relative-lengths-getStyle-expected.txt: Removed.
+        * css3/viewport-relative-lengths/css3-viewport-relative-lengths-getStyle.html: Removed.
+        * css3/viewport-relative-lengths/css3-viewport-relative-lengths-vh-absolute-expected.html: Removed.
+        * css3/viewport-relative-lengths/css3-viewport-relative-lengths-vh-absolute.html: Removed.
+        * css3/viewport-relative-lengths/css3-viewport-relative-lengths-vh-expected.html: Removed.
+        * css3/viewport-relative-lengths/css3-viewport-relative-lengths-vh.html: Removed.
+        * css3/viewport-relative-lengths/css3-viewport-relative-lengths-vmin-absolute-expected.html: Removed.
+        * css3/viewport-relative-lengths/css3-viewport-relative-lengths-vmin-absolute.html: Removed.
+        * css3/viewport-relative-lengths/css3-viewport-relative-lengths-vmin-expected.html: Removed.
+        * css3/viewport-relative-lengths/css3-viewport-relative-lengths-vmin.html: Removed.
+        * css3/viewport-relative-lengths/css3-viewport-relative-lengths-vw-absolute-expected.html: Removed.
+        * css3/viewport-relative-lengths/css3-viewport-relative-lengths-vw-absolute.html: Removed.
+        * css3/viewport-relative-lengths/css3-viewport-relative-lengths-vw-expected.html: Removed.
+        * css3/viewport-relative-lengths/css3-viewport-relative-lengths-vw.html: Removed.
+
 2012-03-30  Dirk Pranke  <dpranke@chromium.org>
 
         Note more flaky crashes for bug 82505.
index cad3829..58a2b03 100644 (file)
@@ -1,3 +1,60 @@
+2012-03-30  Joe Thomas  <joethomas@motorola.com>
+
+        Spec renamed Viewport-relative lengths to Viewport-percentage lengths
+        https://bugs.webkit.org/show_bug.cgi?id=82773
+
+        Reviewed by Antti Koivisto.
+
+        As per the latest version of CSS Values and Units Module Level 3 specification released on 29 March 2012
+        (http://dev.w3.org/csswg/css3-values/#viewport-relative-lengths) Viewport-relative lengths is renamed to Viewport-percentage lengths.
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::getPositionOffsetValue):
+        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+        * css/CSSPrimitiveValue.cpp:
+        (WebCore::unitCategory):
+        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+        (WebCore::CSSPrimitiveValue::canonicalUnitTypeForCategory):
+        (WebCore::CSSPrimitiveValue::viewportPercentageLength):
+        * css/CSSPrimitiveValue.h:
+        (WebCore::CSSPrimitiveValue::isViewportPercentageLength):
+        (CSSPrimitiveValue):
+        * css/CSSPrimitiveValueMappings.h:
+        (WebCore::CSSPrimitiveValue::convertToLength):
+        * css/CSSStyleApplyProperty.cpp:
+        (WebCore::ApplyPropertyLength::applyValue):
+        (WebCore::ApplyPropertyBorderRadius::applyValue):
+        (WebCore::ApplyPropertyFontSize::applyValue):
+        (WebCore::ApplyPropertyLineHeight::applyValue):
+        (WebCore::ApplyPropertyVerticalAlign::applyValue):
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::collectMatchingRulesForList):
+        * css/LengthFunctions.cpp:
+        (WebCore::minimumValueForLength):
+        (WebCore::valueForLength):
+        (WebCore::floatValueForLength):
+        * platform/Length.h:
+        (WebCore::Length::isViewportPercentage):
+        (WebCore::Length::viewportPercentageLength):
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::textIndentOffset):
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::computeContentLogicalHeightUsing):
+        (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
+        * rendering/RenderBoxModelObject.cpp:
+        (WebCore::RenderBoxModelObject::paddingTop):
+        (WebCore::RenderBoxModelObject::paddingBottom):
+        (WebCore::RenderBoxModelObject::paddingLeft):
+        (WebCore::RenderBoxModelObject::paddingRight):
+        (WebCore::RenderBoxModelObject::paddingBefore):
+        (WebCore::RenderBoxModelObject::paddingAfter):
+        (WebCore::RenderBoxModelObject::paddingStart):
+        (WebCore::RenderBoxModelObject::paddingEnd):
+        (WebCore::RenderBoxModelObject::calculateFillTileSize):
+        * rendering/RenderInline.cpp:
+        (WebCore::computeMargin):
+        * rendering/style/RenderStyle.h:
+
 2012-03-30  Alexandru Chiculita  <achicu@adobe.com>
 
         [CSS Filters] Drop Shadow is not repainting correctly when repaint area is smaller than the filtered element
index 8d2cf36..e061293 100644 (file)
@@ -572,7 +572,7 @@ static PassRefPtr<CSSValue> getPositionOffsetValue(RenderStyle* style, int prope
     if (style->position() == AbsolutePosition || style->position() == FixedPosition) {
         if (l.type() == WebCore::Fixed)
             return zoomAdjustedPixelValue(l.value(), style, cssValuePool);
-        else if (l.isViewportRelative())
+        else if (l.isViewportPercentage())
             return zoomAdjustedPixelValue(valueForLength(l, 0, renderView), style, cssValuePool);
         return cssValuePool->createValue(l);
     }
@@ -1777,7 +1777,7 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
             if (marginRight.isFixed() || !renderer || !renderer->isBox())
                 return zoomAdjustedPixelValueForLength(marginRight, style.get(), cssValuePool);
             int value;
-            if (marginRight.isPercent() || marginRight.isViewportRelative())
+            if (marginRight.isPercent() || marginRight.isViewportPercentage())
                 // 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.
index 508297b..4f3b376 100644 (file)
@@ -136,7 +136,7 @@ static CSSPrimitiveValue::UnitCategory unitCategory(CSSPrimitiveValue::UnitTypes
     case CSSPrimitiveValue::CSS_VW:
     case CSSPrimitiveValue::CSS_VH:
     case CSSPrimitiveValue::CSS_VMIN:
-        return CSSPrimitiveValue::UViewportRelativeLength;
+        return CSSPrimitiveValue::UViewportPercentageLength;
     default:
         return CSSPrimitiveValue::UOther;
     }
@@ -253,17 +253,17 @@ CSSPrimitiveValue::CSSPrimitiveValue(const Length& length)
             ASSERT(isfinite(length.percent()));
             m_value.num = length.percent();
             break;
-        case ViewportRelativeWidth:
+        case ViewportPercentageWidth:
             m_primitiveUnitType = CSS_VW;
-            m_value.num = length.viewportRelativeLength();
+            m_value.num = length.viewportPercentageLength();
             break;
-        case ViewportRelativeHeight:
+        case ViewportPercentageHeight:
             m_primitiveUnitType = CSS_VH;
-            m_value.num = length.viewportRelativeLength();
+            m_value.num = length.viewportPercentageLength();
             break;
-        case ViewportRelativeMin:
+        case ViewportPercentageMin:
             m_primitiveUnitType = CSS_VMIN;
-            m_value.num = length.viewportRelativeLength();
+            m_value.num = length.viewportPercentageLength();
             break;
         case Calculated:
         case Relative:
@@ -593,7 +593,7 @@ CSSPrimitiveValue::UnitTypes CSSPrimitiveValue::canonicalUnitTypeForCategory(Uni
         return CSS_DEG;
     case UFrequency:
         return CSS_HZ;
-    case UViewportRelativeLength:
+    case UViewportPercentageLength:
         return CSS_UNKNOWN; // Cannot convert between numbers and relative lengths.
     default:
         return CSS_UNKNOWN;
@@ -1038,19 +1038,19 @@ void CSSPrimitiveValue::addSubresourceStyleURLs(ListHashSet<KURL>& urls, const C
         addSubresourceURL(urls, styleSheet->completeURL(m_value.string));
 }
 
-Length CSSPrimitiveValue::viewportRelativeLength()
+Length CSSPrimitiveValue::viewportPercentageLength()
 {
-    ASSERT(isViewportRelativeLength());
+    ASSERT(isViewportPercentageLength());
     Length viewportLength;
     switch (m_primitiveUnitType) {
     case CSS_VW:
-        viewportLength = Length(getDoubleValue(), ViewportRelativeWidth);
+        viewportLength = Length(getDoubleValue(), ViewportPercentageWidth);
         break;
     case CSS_VH:
-        viewportLength = Length(getDoubleValue(), ViewportRelativeHeight);
+        viewportLength = Length(getDoubleValue(), ViewportPercentageHeight);
         break;
     case CSS_VMIN:
-        viewportLength = Length(getDoubleValue(), ViewportRelativeMin);
+        viewportLength = Length(getDoubleValue(), ViewportPercentageMin);
         break;
     default:
         break;
index 9b980d5..37453f7 100644 (file)
@@ -80,7 +80,7 @@ public:
         CSS_COUNTER = 23,
         CSS_RECT = 24,
         CSS_RGBCOLOR = 25,
-        // From CSS Values and Units. Viewport Relative Lengths (vw/vh/vmin).
+        // From CSS Values and Units. Viewport-percentage Lengths (vw/vh/vmin).
         CSS_VW = 26,
         CSS_VH = 27,
         CSS_VMIN = 28,
@@ -122,7 +122,7 @@ public:
         UAngle,
         UTime,
         UFrequency,
-        UViewportRelativeLength,
+        UViewportPercentageLength,
         UOther
     };
 
@@ -158,7 +158,7 @@ public:
     bool isCalculated() const { return m_primitiveUnitType == CSS_CALC; }
     bool isCalculatedPercentageWithNumber() const { return primitiveType() == CSS_CALC_PERCENTAGE_WITH_NUMBER; }
     bool isCalculatedPercentageWithLength() const { return primitiveType() == CSS_CALC_PERCENTAGE_WITH_LENGTH; }
-    bool isViewportRelativeLength() const { return m_primitiveUnitType >= CSS_VW && m_primitiveUnitType <= CSS_VMIN; }
+    bool isViewportPercentageLength() const { return m_primitiveUnitType >= CSS_VW && m_primitiveUnitType <= CSS_VMIN; }
 
     static PassRefPtr<CSSPrimitiveValue> createIdentifier(int identifier) { return adoptRef(new CSSPrimitiveValue(identifier)); }
     static PassRefPtr<CSSPrimitiveValue> createColor(unsigned rgbValue) { return adoptRef(new CSSPrimitiveValue(rgbValue)); }
@@ -274,7 +274,7 @@ public:
 
     void addSubresourceStyleURLs(ListHashSet<KURL>&, const CSSStyleSheet*);
 
-    Length viewportRelativeLength();
+    Length viewportPercentageLength();
 
 private:
     // FIXME: int vs. unsigned overloading is too subtle to distinguish the color and identifier cases.
index 71ceae2..767758b 100644 (file)
@@ -3775,7 +3775,7 @@ enum LengthConversion {
     PercentConversion = 1 << 3,
     FractionConversion = 1 << 4,
     CalculatedConversion = 1 << 5,
-    ViewportRelativeConversion = 1 << 6
+    ViewportPercentageConversion = 1 << 6
 };
 
 template<int supported> Length CSSPrimitiveValue::convertToLength(RenderStyle* style, RenderStyle* rootStyle, double multiplier, bool computingFontSize)
@@ -3794,8 +3794,8 @@ template<int supported> Length CSSPrimitiveValue::convertToLength(RenderStyle* s
         return Length(Auto);
     if ((supported & CalculatedConversion) && isCalculated())
         return Length(cssCalcValue()->toCalcValue(style, rootStyle, multiplier));
-    if ((supported & ViewportRelativeConversion) && isViewportRelativeLength())
-        return viewportRelativeLength();
+    if ((supported & ViewportPercentageConversion) && isViewportPercentageLength())
+        return viewportPercentageLength();
     return Length(Undefined);
 }
 
index 041d6c8..3061f05 100644 (file)
@@ -393,8 +393,8 @@ public:
                 setValue(selector->style(), Length(primitiveValue->getDoubleValue(), Percent));
             else if (primitiveValue->isCalculatedPercentageWithLength())
                 setValue(selector->style(), Length(primitiveValue->cssCalcValue()->toCalcValue(selector->style(), selector->rootElementStyle(), selector->style()->effectiveZoom())));            
-            else if (primitiveValue->isViewportRelativeLength())
-                setValue(selector->style(), primitiveValue->viewportRelativeLength());
+            else if (primitiveValue->isViewportPercentageLength())
+                setValue(selector->style(), primitiveValue->viewportPercentageLength());
         }
     }
 
@@ -446,8 +446,8 @@ public:
         Length radiusHeight;
         if (pair->first()->isPercentage())
             radiusWidth = Length(pair->first()->getDoubleValue(), Percent);
-        else if (pair->first()->isViewportRelativeLength())
-            radiusWidth = pair->first()->viewportRelativeLength();
+        else if (pair->first()->isViewportPercentageLength())
+            radiusWidth = pair->first()->viewportPercentageLength();
         else if (pair->first()->isCalculatedPercentageWithLength()) {
             // FIXME calc(): http://webkit.org/b/16662
             // handle this case
@@ -456,8 +456,8 @@ public:
             radiusWidth = pair->first()->computeLength<Length>(selector->style(), selector->rootElementStyle(), selector->style()->effectiveZoom());
         if (pair->second()->isPercentage())
             radiusHeight = Length(pair->second()->getDoubleValue(), Percent);
-        else if (pair->second()->isViewportRelativeLength())
-            radiusHeight = pair->second()->viewportRelativeLength();
+        else if (pair->second()->isViewportPercentageLength())
+            radiusHeight = pair->second()->viewportPercentageLength();
         else if (pair->second()->isCalculatedPercentageWithLength()) {
             // FIXME calc(): http://webkit.org/b/16662
             // handle this case
@@ -752,8 +752,8 @@ public:
                 size = (primitiveValue->getFloatValue() * parentSize) / 100.0f;
             else if (primitiveValue->isCalculatedPercentageWithLength())
                 size = primitiveValue->cssCalcValue()->toCalcValue(selector->parentStyle(), selector->rootElementStyle())->evaluate(parentSize);                
-            else if (primitiveValue->isViewportRelativeLength())
-                size = valueForLength(primitiveValue->viewportRelativeLength(), 0, selector->document()->renderView());
+            else if (primitiveValue->isViewportPercentageLength())
+                size = valueForLength(primitiveValue->viewportPercentageLength(), 0, selector->document()->renderView());
             else
                 return;
         }
@@ -1215,8 +1215,8 @@ public:
         } else if (primitiveValue->isNumber()) {
             // FIXME: number and percentage values should produce the same type of Length (ie. Fixed or Percent).
             lineHeight = Length(primitiveValue->getDoubleValue() * 100.0, Percent);
-        } else if (primitiveValue->isViewportRelativeLength()) {
-            lineHeight = primitiveValue->viewportRelativeLength();
+        } else if (primitiveValue->isViewportPercentageLength()) {
+            lineHeight = primitiveValue->viewportPercentageLength();
         } else
             return;
         selector->style()->setLineHeight(lineHeight);
@@ -1578,7 +1578,7 @@ public:
         if (primitiveValue->getIdent())
             return selector->style()->setVerticalAlign(*primitiveValue);
 
-        selector->style()->setVerticalAlignLength(primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion | CalculatedConversion | ViewportRelativeConversion>(selector->style(), selector->rootElementStyle(), selector->style()->effectiveZoom()));
+        selector->style()->setVerticalAlignLength(primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion | CalculatedConversion | ViewportPercentageConversion>(selector->style(), selector->rootElementStyle(), selector->style()->effectiveZoom()));
     }
 
     static PropertyHandler createHandler()
index 1cfcee2..a7b2cc6 100644 (file)
@@ -2563,12 +2563,12 @@ void RuleSet::shrinkToFit()
 
 Length CSSStyleSelector::convertToIntLength(CSSPrimitiveValue* primitiveValue, RenderStyle* style, RenderStyle* rootStyle, double multiplier)
 {
-    return primitiveValue ? primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion | FractionConversion | ViewportRelativeConversion>(style, rootStyle, multiplier) : Length(Undefined);
+    return primitiveValue ? primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion | FractionConversion | ViewportPercentageConversion>(style, rootStyle, multiplier) : Length(Undefined);
 }
 
 Length CSSStyleSelector::convertToFloatLength(CSSPrimitiveValue* primitiveValue, RenderStyle* style, RenderStyle* rootStyle, double multiplier)
 {
-    return primitiveValue ? primitiveValue->convertToLength<FixedFloatConversion | PercentConversion | FractionConversion | ViewportRelativeConversion>(style, rootStyle, multiplier) : Length(Undefined);
+    return primitiveValue ? primitiveValue->convertToLength<FixedFloatConversion | PercentConversion | FractionConversion | ViewportPercentageConversion>(style, rootStyle, multiplier) : Length(Undefined);
 }
 
 template <bool applyFirst>
@@ -2953,7 +2953,7 @@ bool CSSStyleSelector::useSVGZoomRules()
 
 static bool createGridTrackBreadth(CSSPrimitiveValue* primitiveValue, CSSStyleSelector* selector, Length& length)
 {
-    Length workingLength = primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion | ViewportRelativeConversion | AutoConversion>(selector->style(), selector->rootElementStyle(), selector->style()->effectiveZoom());
+    Length workingLength = primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion | ViewportPercentageConversion | AutoConversion>(selector->style(), selector->rootElementStyle(), selector->style()->effectiveZoom());
     if (workingLength.isUndefined())
         return false;
 
@@ -4297,8 +4297,8 @@ void CSSStyleSelector::mapFillXPosition(CSSPropertyID, FillLayer* layer, CSSValu
         l = Length(primitiveValue->getDoubleValue(), Percent);
     else if (primitiveValue->isCalculatedPercentageWithLength())
         l = Length(primitiveValue->cssCalcValue()->toCalcValue(style(), m_rootElementStyle, zoomFactor));
-    else if (primitiveValue->isViewportRelativeLength())
-        l = primitiveValue->viewportRelativeLength();
+    else if (primitiveValue->isViewportPercentageLength())
+        l = primitiveValue->viewportPercentageLength();
     else
         return;
     layer->setXPosition(l);
@@ -4324,8 +4324,8 @@ void CSSStyleSelector::mapFillYPosition(CSSPropertyID, FillLayer* layer, CSSValu
         l = Length(primitiveValue->getDoubleValue(), Percent);
     else if (primitiveValue->isCalculatedPercentageWithLength())
         l = Length(primitiveValue->cssCalcValue()->toCalcValue(style(), m_rootElementStyle, zoomFactor));
-    else if (primitiveValue->isViewportRelativeLength())
-        l = primitiveValue->viewportRelativeLength();
+    else if (primitiveValue->isViewportPercentageLength())
+        l = primitiveValue->viewportPercentageLength();
     else
         return;
     layer->setYPosition(l);
index a9364be..2645314 100644 (file)
@@ -41,18 +41,18 @@ int minimumValueForLength(const Length& length, int maximumValue, RenderView* re
         return static_cast<int>(static_cast<float>(maximumValue * length.percent() / 100.0f));
     case Calculated:
         return length.nonNanCalculatedValue(maximumValue);
-    case ViewportRelativeWidth:
+    case ViewportPercentageWidth:
         if (renderView)
-            return static_cast<int>(renderView->viewportSize().width() * length.viewportRelativeLength() / 100.0f);
+            return static_cast<int>(renderView->viewportSize().width() * length.viewportPercentageLength() / 100.0f);
         return 0;
-    case ViewportRelativeHeight:
+    case ViewportPercentageHeight:
         if (renderView)
-            return static_cast<int>(renderView->viewportSize().height() * length.viewportRelativeLength() / 100.0f);
+            return static_cast<int>(renderView->viewportSize().height() * length.viewportPercentageLength() / 100.0f);
         return 0;
-    case ViewportRelativeMin:
+    case ViewportPercentageMin:
         if (renderView) {
             IntSize viewportSize = renderView->viewportSize();
-            return static_cast<int>(std::min(viewportSize.width(), viewportSize.height()) * length.viewportRelativeLength() / 100.0f);
+            return static_cast<int>(std::min(viewportSize.width(), viewportSize.height()) * length.viewportPercentageLength() / 100.0f);
         }
         return 0;
     case Auto:
@@ -74,9 +74,9 @@ int valueForLength(const Length& length, int maximumValue, RenderView* renderVie
     case Fixed:
     case Percent:
     case Calculated:
-    case ViewportRelativeWidth:
-    case ViewportRelativeHeight:
-    case ViewportRelativeMin:
+    case ViewportPercentageWidth:
+    case ViewportPercentageHeight:
+    case ViewportPercentageMin:
         return minimumValueForLength(length, maximumValue, renderView, roundPercentages);
     case Auto:
         return maximumValue;
@@ -107,18 +107,18 @@ float floatValueForLength(const Length& length, int maximumValue, RenderView* re
         return static_cast<float>(maximumValue);
     case Calculated:
         return length.nonNanCalculatedValue(maximumValue);                
-    case ViewportRelativeWidth:
+    case ViewportPercentageWidth:
         if (renderView)
-            return static_cast<int>(renderView->viewportSize().width() * length.viewportRelativeLength() / 100.0f);
+            return static_cast<int>(renderView->viewportSize().width() * length.viewportPercentageLength() / 100.0f);
         return 0;
-    case ViewportRelativeHeight:
+    case ViewportPercentageHeight:
         if (renderView)
-            return static_cast<int>(renderView->viewportSize().height() * length.viewportRelativeLength() / 100.0f);
+            return static_cast<int>(renderView->viewportSize().height() * length.viewportPercentageLength() / 100.0f);
         return 0;
-    case ViewportRelativeMin:
+    case ViewportPercentageMin:
         if (renderView) {
             IntSize viewportSize = renderView->viewportSize();
-            return static_cast<int>(std::min(viewportSize.width(), viewportSize.height()) * length.viewportRelativeLength() / 100.0f);
+            return static_cast<int>(std::min(viewportSize.width(), viewportSize.height()) * length.viewportPercentageLength() / 100.0f);
         }
         return 0;
     case Relative:
@@ -143,18 +143,18 @@ float floatValueForLength(const Length& length, float maximumValue, RenderView*
         return static_cast<float>(maximumValue);
     case Calculated:
         return length.nonNanCalculatedValue(maximumValue);
-    case ViewportRelativeWidth:
+    case ViewportPercentageWidth:
         if (renderView)
-            return static_cast<int>(renderView->viewportSize().width() * length.viewportRelativeLength() / 100.0f);
+            return static_cast<int>(renderView->viewportSize().width() * length.viewportPercentageLength() / 100.0f);
         return 0;
-    case ViewportRelativeHeight:
+    case ViewportPercentageHeight:
         if (renderView)
-            return static_cast<int>(renderView->viewportSize().height() * length.viewportRelativeLength() / 100.0f);
+            return static_cast<int>(renderView->viewportSize().height() * length.viewportPercentageLength() / 100.0f);
         return 0;
-    case ViewportRelativeMin:
+    case ViewportPercentageMin:
         if (renderView) {
             IntSize viewportSize = renderView->viewportSize();
-            return static_cast<int>(std::min(viewportSize.width(), viewportSize.height()) * length.viewportRelativeLength() / 100.0f);
+            return static_cast<int>(std::min(viewportSize.width(), viewportSize.height()) * length.viewportPercentageLength() / 100.0f);
         }
         return 0;
     case Relative:
index 9786a1e..27c3470 100644 (file)
@@ -33,7 +33,7 @@
 
 namespace WebCore {
 
-enum LengthType { Auto, Relative, Percent, Fixed, Intrinsic, MinIntrinsic, Calculated, ViewportRelativeWidth, ViewportRelativeHeight, ViewportRelativeMin, Undefined };
+enum LengthType { Auto, Relative, Percent, Fixed, Intrinsic, MinIntrinsic, Calculated, ViewportPercentageWidth, ViewportPercentageHeight, ViewportPercentageMin, Undefined };
  
 class CalculationValue;    
     
@@ -226,14 +226,14 @@ public:
     }
     float nonNanCalculatedValue(int maxValue) const;
 
-    bool isViewportRelative() const
+    bool isViewportPercentage() const
     {
         LengthType lengthType = type();
-        return lengthType >= ViewportRelativeWidth && lengthType <= ViewportRelativeMin;
+        return lengthType >= ViewportPercentageWidth && lengthType <= ViewportPercentageMin;
     }
-    float viewportRelativeLength() const
+    float viewportPercentageLength() const
     {
-        ASSERT(isViewportRelative());
+        ASSERT(isViewportPercentage());
         return getFloatValue();
     }
 private:
index 43716b9..0438d1b 100755 (executable)
@@ -3947,7 +3947,7 @@ LayoutUnit RenderBlock::textIndentOffset() const
     RenderView* renderView = 0;
     if (style()->textIndent().isPercent())
         cw = containingBlock()->availableLogicalWidth();
-    else if (style()->textIndent().isViewportRelative())
+    else if (style()->textIndent().isViewportPercentage())
         renderView = view();
     return minimumValueForLength(style()->textIndent(), cw, renderView);
 }
index fb99fb2..e3b81a7 100644 (file)
@@ -2164,7 +2164,7 @@ LayoutUnit RenderBox::computeContentLogicalHeightUsing(const Length& height)
             logicalHeight = height.value();
         else if (height.isPercent())
             logicalHeight = computePercentageLogicalHeight(height);
-        else if (height.isViewportRelative())
+        else if (height.isViewportPercentage())
             logicalHeight = valueForLength(height, 0, view());
     }
     return logicalHeight;
@@ -2351,9 +2351,9 @@ LayoutUnit RenderBox::computeReplacedLogicalHeightUsing(Length logicalHeight) co
             }
             return computeContentBoxLogicalHeight(valueForLength(logicalHeight, availableHeight));
         }
-        case ViewportRelativeWidth:
-        case ViewportRelativeHeight:
-        case ViewportRelativeMin:
+        case ViewportPercentageWidth:
+        case ViewportPercentageHeight:
+        case ViewportPercentageMin:
             return computeContentBoxLogicalHeight(valueForLength(logicalHeight, 0, view()));
         default:
             return intrinsicLogicalHeight();
index 6f400d9..2e55e7f 100644 (file)
@@ -562,7 +562,7 @@ LayoutUnit RenderBoxModelObject::paddingTop(PaddingOptions) const
     Length padding = style()->paddingTop();
     if (padding.isPercent())
         w = containingBlock()->availableLogicalWidth();
-    else if (padding.isViewportRelative())
+    else if (padding.isViewportPercentage())
         renderView = view();
     return minimumValueForLength(padding, w, renderView);
 }
@@ -574,7 +574,7 @@ LayoutUnit RenderBoxModelObject::paddingBottom(PaddingOptions) const
     Length padding = style()->paddingBottom();
     if (padding.isPercent())
         w = containingBlock()->availableLogicalWidth();
-    else if (padding.isViewportRelative())
+    else if (padding.isViewportPercentage())
         renderView = view();
     return minimumValueForLength(padding, w, renderView);
 }
@@ -586,7 +586,7 @@ LayoutUnit RenderBoxModelObject::paddingLeft(PaddingOptions) const
     Length padding = style()->paddingLeft();
     if (padding.isPercent())
         w = containingBlock()->availableLogicalWidth();
-    else if (padding.isViewportRelative())
+    else if (padding.isViewportPercentage())
         renderView = view();
     return minimumValueForLength(padding, w, renderView);
 }
@@ -598,7 +598,7 @@ LayoutUnit RenderBoxModelObject::paddingRight(PaddingOptions) const
     Length padding = style()->paddingRight();
     if (padding.isPercent())
         w = containingBlock()->availableLogicalWidth();
-    else if (padding.isViewportRelative())
+    else if (padding.isViewportPercentage())
         renderView = view();
     return minimumValueForLength(padding, w, renderView);
 }
@@ -610,7 +610,7 @@ LayoutUnit RenderBoxModelObject::paddingBefore(PaddingOptions) const
     Length padding = style()->paddingBefore();
     if (padding.isPercent())
         w = containingBlock()->availableLogicalWidth();
-    else if (padding.isViewportRelative())
+    else if (padding.isViewportPercentage())
         renderView = view();
     return minimumValueForLength(padding, w, renderView);
 }
@@ -622,7 +622,7 @@ LayoutUnit RenderBoxModelObject::paddingAfter(PaddingOptions) const
     Length padding = style()->paddingAfter();
     if (padding.isPercent())
         w = containingBlock()->availableLogicalWidth();
-    else if (padding.isViewportRelative())
+    else if (padding.isViewportPercentage())
         renderView = view();
     return minimumValueForLength(padding, w, renderView);
 }
@@ -634,7 +634,7 @@ LayoutUnit RenderBoxModelObject::paddingStart(PaddingOptions) const
     Length padding = style()->paddingStart();
     if (padding.isPercent())
         w = containingBlock()->availableLogicalWidth();
-    else if (padding.isViewportRelative())
+    else if (padding.isViewportPercentage())
         renderView = view();
     return minimumValueForLength(padding, w, renderView);
 }
@@ -646,7 +646,7 @@ LayoutUnit RenderBoxModelObject::paddingEnd(PaddingOptions) const
     Length padding = style()->paddingEnd();
     if (padding.isPercent())
         w = containingBlock()->availableLogicalWidth();
-    else if (padding.isViewportRelative())
+    else if (padding.isViewportPercentage())
         renderView = view();
     return minimumValueForLength(padding, w, renderView);
 }
@@ -1027,12 +1027,12 @@ IntSize RenderBoxModelObject::calculateFillTileSize(const FillLayer* fillLayer,
 
             if (layerWidth.isFixed())
                 w = layerWidth.value();
-            else if (layerWidth.isPercent() || layerHeight.isViewportRelative())
+            else if (layerWidth.isPercent() || layerHeight.isViewportPercentage())
                 w = valueForLength(layerWidth, positioningAreaSize.width(), renderView);
             
             if (layerHeight.isFixed())
                 h = layerHeight.value();
-            else if (layerHeight.isPercent() || layerHeight.isViewportRelative())
+            else if (layerHeight.isPercent() || layerHeight.isViewportPercentage())
                 h = valueForLength(layerHeight, positioningAreaSize.height(), renderView);
             
             // If one of the values is auto we have to use the appropriate
index 42682de..301479b 100644 (file)
@@ -702,7 +702,7 @@ static LayoutUnit computeMargin(const RenderInline* renderer, const Length& marg
         return margin.value();
     if (margin.isPercent())
         return minimumValueForLength(margin, max<LayoutUnit>(0, renderer->containingBlock()->availableLogicalWidth()));
-    if (margin.isViewportRelative())
+    if (margin.isViewportPercentage())
         return valueForLength(margin, 0, renderer->view());
     return 0;
 }
index bb0940a..6b4c1ed 100644 (file)
@@ -633,7 +633,7 @@ public:
         if (lh.isPercent())
             return minimumValueForLength(lh, fontSize());
 
-        if (lh.isViewportRelative())
+        if (lh.isViewportPercentage())
             return valueForLength(lh, 0, renderView);
 
         return lh.value();