[CSS Parser] Make intercap property values serialize correctly
authorhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Feb 2017 20:26:30 +0000 (20:26 +0000)
committerhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Feb 2017 20:26:30 +0000 (20:26 +0000)
https://bugs.webkit.org/show_bug.cgi?id=168073

Reviewed by Zalan Bujtas.

Source/WebCore:

Fix CSS value keywords to preserve case when the value contains capital
letters. Examples include optimizeSpeed, translateX, scaleY, etc.

* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator EPointerEvents):
(WebCore::CSSPrimitiveValue::operator TextRenderingMode):
(WebCore::CSSPrimitiveValue::operator EImageRendering):
(WebCore::CSSPrimitiveValue::operator EColorInterpolation):
(WebCore::CSSPrimitiveValue::operator EColorRendering):
(WebCore::CSSPrimitiveValue::operator EShapeRendering):
* css/MediaQueryEvaluator.cpp:
(WebCore::colorGamutEvaluate):
* css/SVGCSSValueKeywords.in:
* css/TransformFunctions.cpp:
(WebCore::transformOperationType):
(WebCore::transformsForValue):
* css/makevalues.pl:
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::parseTransformTranslateArguments):
(WebCore::parseSimpleTransformValue):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeTransformValue):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::parseColorFunctionParameters):

LayoutTests:

* fast/css/getComputedStyle/computed-style-expected.txt:
* fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
* fast/css/image-rendering-parsing-expected.txt:
* fast/css/parsing-text-rendering-expected.txt:
* fast/css/resources/parsing-text-rendering.js:
* fast/css/script-tests/image-rendering-parsing.js:
* svg/css/getComputedStyle-basic-expected.txt:
* svg/css/script-tests/shape-rendering-parsing.js:
* svg/css/shape-rendering-parsing-expected.txt:
* transforms/2d/transform-value-types-expected.txt:
* transforms/2d/transform-value-types.html:

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

21 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt
LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt
LayoutTests/fast/css/image-rendering-parsing-expected.txt
LayoutTests/fast/css/parsing-text-rendering-expected.txt
LayoutTests/fast/css/resources/parsing-text-rendering.js
LayoutTests/fast/css/script-tests/image-rendering-parsing.js
LayoutTests/svg/css/getComputedStyle-basic-expected.txt
LayoutTests/svg/css/script-tests/shape-rendering-parsing.js
LayoutTests/svg/css/shape-rendering-parsing-expected.txt
LayoutTests/transforms/2d/transform-value-types-expected.txt
LayoutTests/transforms/2d/transform-value-types.html
Source/WebCore/ChangeLog
Source/WebCore/css/CSSPrimitiveValueMappings.h
Source/WebCore/css/MediaQueryEvaluator.cpp
Source/WebCore/css/SVGCSSValueKeywords.in
Source/WebCore/css/TransformFunctions.cpp
Source/WebCore/css/makevalues.pl
Source/WebCore/css/parser/CSSParserFastPaths.cpp
Source/WebCore/css/parser/CSSPropertyParser.cpp
Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp

index 0d93d93..a74f9dc 100644 (file)
@@ -1,3 +1,22 @@
+2017-02-10  Dave Hyatt  <hyatt@apple.com>
+
+        [CSS Parser] Make intercap property values serialize correctly
+        https://bugs.webkit.org/show_bug.cgi?id=168073
+
+        Reviewed by Zalan Bujtas.
+
+        * fast/css/getComputedStyle/computed-style-expected.txt:
+        * fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
+        * fast/css/image-rendering-parsing-expected.txt:
+        * fast/css/parsing-text-rendering-expected.txt:
+        * fast/css/resources/parsing-text-rendering.js:
+        * fast/css/script-tests/image-rendering-parsing.js:
+        * svg/css/getComputedStyle-basic-expected.txt:
+        * svg/css/script-tests/shape-rendering-parsing.js:
+        * svg/css/shape-rendering-parsing-expected.txt:
+        * transforms/2d/transform-value-types-expected.txt:
+        * transforms/2d/transform-value-types.html:
+
 2017-02-08  Jiewen Tan  <jiewen_tan@apple.com>
 
         [WebCrypto] Import imported/w3c/web-platform-tests/WebCryptoAPI tests
index e9c6323..e16aa4e 100644 (file)
@@ -249,8 +249,8 @@ flood-opacity: 1;
 lighting-color: rgb(255, 255, 255);
 stop-color: rgb(0, 0, 0);
 stop-opacity: 1;
-color-interpolation: srgb;
-color-interpolation-filters: linearrgb;
+color-interpolation: sRGB;
+color-interpolation-filters: linearRGB;
 color-rendering: auto;
 fill: rgb(0, 0, 0);
 fill-opacity: 1;
index ee3d42a..8c64295 100644 (file)
@@ -248,8 +248,8 @@ flood-opacity: 1
 lighting-color: rgb(255, 255, 255)
 stop-color: rgb(0, 0, 0)
 stop-opacity: 1
-color-interpolation: srgb
-color-interpolation-filters: linearrgb
+color-interpolation: sRGB
+color-interpolation-filters: linearRGB
 color-rendering: auto
 fill: rgb(0, 0, 0)
 fill-opacity: 1
index 06ceb50..51e4b30 100644 (file)
@@ -19,11 +19,11 @@ PASS div.style.getPropertyCSSValue('image-rendering').cssValueType is CSSValue.C
 PASS div.style.getPropertyValue('image-rendering') is "-webkit-optimize-contrast"
 PASS getComputedStyle(div).getPropertyValue('image-rendering') is "crisp-edges"
 PASS div.style.getPropertyCSSValue('image-rendering').cssValueType is CSSValue.CSS_PRIMITIVE_VALUE
-PASS div.style.getPropertyValue('image-rendering') is "optimizespeed"
-PASS getComputedStyle(div).getPropertyValue('image-rendering') is "optimizespeed"
+PASS div.style.getPropertyValue('image-rendering') is "optimizeSpeed"
+PASS getComputedStyle(div).getPropertyValue('image-rendering') is "optimizeSpeed"
 PASS div.style.getPropertyCSSValue('image-rendering').cssValueType is CSSValue.CSS_PRIMITIVE_VALUE
-PASS div.style.getPropertyValue('image-rendering') is "optimizequality"
-PASS getComputedStyle(div).getPropertyValue('image-rendering') is "optimizequality"
+PASS div.style.getPropertyValue('image-rendering') is "optimizeQuality"
+PASS getComputedStyle(div).getPropertyValue('image-rendering') is "optimizeQuality"
 PASS successfullyParsed is true
 
 TEST COMPLETE
index 5c2a375..fcaee91 100644 (file)
@@ -4,9 +4,9 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 
 
 PASS test("text-rendering: auto;") is "auto"
-PASS test("text-rendering: optimizeSpeed;") is "optimizespeed"
-PASS test("text-rendering: optimizeLegibility;") is "optimizelegibility"
-PASS test("text-rendering: geometricPrecision;") is "geometricprecision"
+PASS test("text-rendering: optimizeSpeed;") is "optimizeSpeed"
+PASS test("text-rendering: optimizeLegibility;") is "optimizeLegibility"
+PASS test("text-rendering: geometricPrecision;") is "geometricPrecision"
 PASS test("text-rendering: auto auto;") is ""
 PASS test("text-rendering: optimizeCoconuts;") is ""
 PASS test("text-rendering: 15;") is ""
index d9f9458..1f15adc 100644 (file)
@@ -12,9 +12,9 @@ function test(value)
 }
 
 shouldBe('test("text-rendering: auto;")', '"auto"');
-shouldBe('test("text-rendering: optimizeSpeed;")', '"optimizespeed"');
-shouldBe('test("text-rendering: optimizeLegibility;")', '"optimizelegibility"');
-shouldBe('test("text-rendering: geometricPrecision;")', '"geometricprecision"');
+shouldBe('test("text-rendering: optimizeSpeed;")', '"optimizeSpeed"');
+shouldBe('test("text-rendering: optimizeLegibility;")', '"optimizeLegibility"');
+shouldBe('test("text-rendering: geometricPrecision;")', '"geometricPrecision"');
 
 shouldBeEqualToString('test("text-rendering: auto auto;")', '');
 shouldBeEqualToString('test("text-rendering: optimizeCoconuts;")', '');
index 1fb3c65..16cac93 100644 (file)
@@ -18,7 +18,7 @@ testImageRendering('crisp-edges', 'crisp-edges');
 testImageRendering('pixelated', 'pixelated');
 testImageRendering('-webkit-crisp-edges', 'crisp-edges');
 testImageRendering('-webkit-optimize-contrast', 'crisp-edges');
-testImageRendering('optimizespeed', 'optimizespeed');
-testImageRendering('optimizequality', 'optimizequality');
+testImageRendering('optimizeSpeed', 'optimizeSpeed');
+testImageRendering('optimizeQuality', 'optimizeQuality');
 
 successfullyParsed = true;
index 039d4b7..f02afa1 100644 (file)
@@ -496,9 +496,9 @@ rect: style.getPropertyValue(stop-color) : rgb(0, 0, 0)
 rect: style.getPropertyCSSValue(stop-color) : [object CSSPrimitiveValue]
 rect: style.getPropertyValue(stop-opacity) : 1
 rect: style.getPropertyCSSValue(stop-opacity) : [object CSSPrimitiveValue]
-rect: style.getPropertyValue(color-interpolation) : srgb
+rect: style.getPropertyValue(color-interpolation) : sRGB
 rect: style.getPropertyCSSValue(color-interpolation) : [object CSSPrimitiveValue]
-rect: style.getPropertyValue(color-interpolation-filters) : linearrgb
+rect: style.getPropertyValue(color-interpolation-filters) : linearRGB
 rect: style.getPropertyCSSValue(color-interpolation-filters) : [object CSSPrimitiveValue]
 rect: style.getPropertyValue(color-rendering) : auto
 rect: style.getPropertyCSSValue(color-rendering) : [object CSSPrimitiveValue]
@@ -1050,9 +1050,9 @@ g: style.getPropertyValue(stop-color) : rgb(0, 0, 0)
 g: style.getPropertyCSSValue(stop-color) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(stop-opacity) : 1
 g: style.getPropertyCSSValue(stop-opacity) : [object CSSPrimitiveValue]
-g: style.getPropertyValue(color-interpolation) : srgb
+g: style.getPropertyValue(color-interpolation) : sRGB
 g: style.getPropertyCSSValue(color-interpolation) : [object CSSPrimitiveValue]
-g: style.getPropertyValue(color-interpolation-filters) : linearrgb
+g: style.getPropertyValue(color-interpolation-filters) : linearRGB
 g: style.getPropertyCSSValue(color-interpolation-filters) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(color-rendering) : auto
 g: style.getPropertyCSSValue(color-rendering) : [object CSSPrimitiveValue]
index f0c8374..34dc8f9 100644 (file)
@@ -14,10 +14,10 @@ group.setAttribute("shape-rendering", "crispedges");
 shouldBeEqualToString("document.defaultView.getComputedStyle(group, null).shapeRendering", "crispedges");
 
 group.setAttribute("shape-rendering", "optimizeSpeed");
-shouldBeEqualToString("document.defaultView.getComputedStyle(group, null).shapeRendering", "optimizespeed");
+shouldBeEqualToString("document.defaultView.getComputedStyle(group, null).shapeRendering", "optimizeSpeed");
 
 group.setAttribute("shape-rendering", "geometricPrecision");
-shouldBeEqualToString("document.defaultView.getComputedStyle(group, null).shapeRendering", "geometricprecision");
+shouldBeEqualToString("document.defaultView.getComputedStyle(group, null).shapeRendering", "geometricPrecision");
 
 var successfullyParsed = true;
 
index 9b2190d..d19619d 100644 (file)
@@ -6,8 +6,8 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 PASS document.defaultView.getComputedStyle(group, null).shapeRendering is "auto"
 PASS document.defaultView.getComputedStyle(group, null).shapeRendering is "crispedges"
 PASS document.defaultView.getComputedStyle(group, null).shapeRendering is "crispedges"
-PASS document.defaultView.getComputedStyle(group, null).shapeRendering is "optimizespeed"
-PASS document.defaultView.getComputedStyle(group, null).shapeRendering is "geometricprecision"
+PASS document.defaultView.getComputedStyle(group, null).shapeRendering is "optimizeSpeed"
+PASS document.defaultView.getComputedStyle(group, null).shapeRendering is "geometricPrecision"
 PASS successfullyParsed is true
 
 TEST COMPLETE
index be90204..1cd31f9 100644 (file)
@@ -5,18 +5,18 @@ PASS jsWrapperClass(transformRule[0]) is 'CSSValue'
 PASS jsWrapperClass(transformRule[0].__proto__) is 'CSSValuePrototype'
 PASS jsWrapperClass(transformRule[0].constructor) is 'Function'
 PASS transformRule[0].cssText is 'translate(10px)'
-PASS transformRule[1].cssText is 'translatex(10px)'
-PASS transformRule[2].cssText is 'translatey(10px)'
+PASS transformRule[1].cssText is 'translateX(10px)'
+PASS transformRule[2].cssText is 'translateY(10px)'
 PASS transformRule[3].cssText is 'rotate(10deg)'
 PASS transformRule[4].cssText is 'rotate(11rad)'
 PASS transformRule[5].cssText is 'rotate(12grad)'
 PASS transformRule[6].cssText is 'rotate(13turn)'
 PASS transformRule[7].cssText is 'scale(2)'
-PASS transformRule[8].cssText is 'scalex(1.2)'
-PASS transformRule[9].cssText is 'scaley(1.2)'
+PASS transformRule[8].cssText is 'scaleX(1.2)'
+PASS transformRule[9].cssText is 'scaleY(1.2)'
 PASS transformRule[10].cssText is 'skew(10deg, 10rad)'
-PASS transformRule[11].cssText is 'skewx(10deg)'
-PASS transformRule[12].cssText is 'skewy(11grad)'
+PASS transformRule[11].cssText is 'skewX(10deg)'
+PASS transformRule[12].cssText is 'skewY(11grad)'
 PASS transformRule[13].cssText is 'matrix(1, 0, 0, 1, 0, 0)'
 PASS successfullyParsed is true
 
index 0c90688..e7ee1c1 100644 (file)
@@ -55,9 +55,9 @@
 
   shouldBe("transformRule[0].cssText", "'translate(10px)'");
 
-  shouldBe("transformRule[1].cssText", "'translatex(10px)'");
+  shouldBe("transformRule[1].cssText", "'translateX(10px)'");
 
-  shouldBe("transformRule[2].cssText", "'translatey(10px)'");
+  shouldBe("transformRule[2].cssText", "'translateY(10px)'");
 
   shouldBe("transformRule[3].cssText", "'rotate(10deg)'");
 
 
   shouldBe("transformRule[7].cssText", "'scale(2)'");
 
-  shouldBe("transformRule[8].cssText", "'scalex(1.2)'");
+  shouldBe("transformRule[8].cssText", "'scaleX(1.2)'");
 
-  shouldBe("transformRule[9].cssText", "'scaley(1.2)'");
+  shouldBe("transformRule[9].cssText", "'scaleY(1.2)'");
 
   shouldBe("transformRule[10].cssText", "'skew(10deg, 10rad)'");
 
-  shouldBe("transformRule[11].cssText", "'skewx(10deg)'");
+  shouldBe("transformRule[11].cssText", "'skewX(10deg)'");
 
-  shouldBe("transformRule[12].cssText", "'skewy(11grad)'");
+  shouldBe("transformRule[12].cssText", "'skewY(11grad)'");
 
   shouldBe("transformRule[13].cssText", "'matrix(1, 0, 0, 1, 0, 0)'");
   
index 72c0c63..f08e6d6 100644 (file)
@@ -1,3 +1,37 @@
+2017-02-10  Dave Hyatt  <hyatt@apple.com>
+
+        [CSS Parser] Make intercap property values serialize correctly
+        https://bugs.webkit.org/show_bug.cgi?id=168073
+
+        Reviewed by Zalan Bujtas.
+
+        Fix CSS value keywords to preserve case when the value contains capital
+        letters. Examples include optimizeSpeed, translateX, scaleY, etc.
+
+        * css/CSSPrimitiveValueMappings.h:
+        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+        (WebCore::CSSPrimitiveValue::operator EPointerEvents):
+        (WebCore::CSSPrimitiveValue::operator TextRenderingMode):
+        (WebCore::CSSPrimitiveValue::operator EImageRendering):
+        (WebCore::CSSPrimitiveValue::operator EColorInterpolation):
+        (WebCore::CSSPrimitiveValue::operator EColorRendering):
+        (WebCore::CSSPrimitiveValue::operator EShapeRendering):
+        * css/MediaQueryEvaluator.cpp:
+        (WebCore::colorGamutEvaluate):
+        * css/SVGCSSValueKeywords.in:
+        * css/TransformFunctions.cpp:
+        (WebCore::transformOperationType):
+        (WebCore::transformsForValue):
+        * css/makevalues.pl:
+        * css/parser/CSSParserFastPaths.cpp:
+        (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
+        (WebCore::parseTransformTranslateArguments):
+        (WebCore::parseSimpleTransformValue):
+        * css/parser/CSSPropertyParser.cpp:
+        (WebCore::consumeTransformValue):
+        * css/parser/CSSPropertyParserHelpers.cpp:
+        (WebCore::CSSPropertyParserHelpers::parseColorFunctionParameters):
+
 2017-02-10  Zan Dobersek  <zdobersek@igalia.com>
 
         [EME] Implement MediaKeySession::load()
index 2e802e7..6a64db1 100644 (file)
@@ -3504,13 +3504,13 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EPointerEvents e)
         m_value.valueID = CSSValueVisible;
         break;
     case PE_VISIBLE_STROKE:
-        m_value.valueID = CSSValueVisiblestroke;
+        m_value.valueID = CSSValueVisibleStroke;
         break;
     case PE_VISIBLE_FILL:
-        m_value.valueID = CSSValueVisiblefill;
+        m_value.valueID = CSSValueVisibleFill;
         break;
     case PE_VISIBLE_PAINTED:
-        m_value.valueID = CSSValueVisiblepainted;
+        m_value.valueID = CSSValueVisiblePainted;
         break;
     case PE_AUTO:
         m_value.valueID = CSSValueAuto;
@@ -3532,11 +3532,11 @@ template<> inline CSSPrimitiveValue::operator EPointerEvents() const
         return PE_AUTO;
     case CSSValueNone:
         return PE_NONE;
-    case CSSValueVisiblepainted:
+    case CSSValueVisiblePainted:
         return PE_VISIBLE_PAINTED;
-    case CSSValueVisiblefill:
+    case CSSValueVisibleFill:
         return PE_VISIBLE_FILL;
-    case CSSValueVisiblestroke:
+    case CSSValueVisibleStroke:
         return PE_VISIBLE_STROKE;
     case CSSValueVisible:
         return PE_VISIBLE;
@@ -3831,13 +3831,13 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextRenderingMode e)
         m_value.valueID = CSSValueAuto;
         break;
     case OptimizeSpeed:
-        m_value.valueID = CSSValueOptimizespeed;
+        m_value.valueID = CSSValueOptimizeSpeed;
         break;
     case OptimizeLegibility:
-        m_value.valueID = CSSValueOptimizelegibility;
+        m_value.valueID = CSSValueOptimizeLegibility;
         break;
     case GeometricPrecision:
-        m_value.valueID = CSSValueGeometricprecision;
+        m_value.valueID = CSSValueGeometricPrecision;
         break;
     }
 }
@@ -3849,11 +3849,11 @@ template<> inline CSSPrimitiveValue::operator TextRenderingMode() const
     switch (m_value.valueID) {
     case CSSValueAuto:
         return AutoTextRendering;
-    case CSSValueOptimizespeed:
+    case CSSValueOptimizeSpeed:
         return OptimizeSpeed;
-    case CSSValueOptimizelegibility:
+    case CSSValueOptimizeLegibility:
         return OptimizeLegibility;
-    case CSSValueGeometricprecision:
+    case CSSValueGeometricPrecision:
         return GeometricPrecision;
     default:
         break;
@@ -4453,10 +4453,10 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EImageRendering imageRend
         m_value.valueID = CSSValuePixelated;
         break;
     case ImageRenderingOptimizeSpeed:
-        m_value.valueID = CSSValueOptimizespeed;
+        m_value.valueID = CSSValueOptimizeSpeed;
         break;
     case ImageRenderingOptimizeQuality:
-        m_value.valueID = CSSValueOptimizequality;
+        m_value.valueID = CSSValueOptimizeQuality;
         break;
     }
 }
@@ -4474,9 +4474,9 @@ template<> inline CSSPrimitiveValue::operator EImageRendering() const
         return ImageRenderingCrispEdges;
     case CSSValuePixelated:
         return ImageRenderingPixelated;
-    case CSSValueOptimizespeed:
+    case CSSValueOptimizeSpeed:
         return ImageRenderingOptimizeSpeed;
-    case CSSValueOptimizequality:
+    case CSSValueOptimizeQuality:
         return ImageRenderingOptimizeQuality;
     default:
         break;
@@ -4669,10 +4669,10 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EColorInterpolation e)
         m_value.valueID = CSSValueAuto;
         break;
     case CI_SRGB:
-        m_value.valueID = CSSValueSrgb;
+        m_value.valueID = CSSValueSRGB;
         break;
     case CI_LINEARRGB:
-        m_value.valueID = CSSValueLinearrgb;
+        m_value.valueID = CSSValueLinearRGB;
         break;
     }
 }
@@ -4682,9 +4682,9 @@ template<> inline CSSPrimitiveValue::operator EColorInterpolation() const
     ASSERT(isValueID());
 
     switch (m_value.valueID) {
-    case CSSValueSrgb:
+    case CSSValueSRGB:
         return CI_SRGB;
-    case CSSValueLinearrgb:
+    case CSSValueLinearRGB:
         return CI_LINEARRGB;
     case CSSValueAuto:
         return CI_AUTO;
@@ -4705,10 +4705,10 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EColorRendering e)
         m_value.valueID = CSSValueAuto;
         break;
     case CR_OPTIMIZESPEED:
-        m_value.valueID = CSSValueOptimizespeed;
+        m_value.valueID = CSSValueOptimizeSpeed;
         break;
     case CR_OPTIMIZEQUALITY:
-        m_value.valueID = CSSValueOptimizequality;
+        m_value.valueID = CSSValueOptimizeQuality;
         break;
     }
 }
@@ -4718,9 +4718,9 @@ template<> inline CSSPrimitiveValue::operator EColorRendering() const
     ASSERT(isValueID());
 
     switch (m_value.valueID) {
-    case CSSValueOptimizespeed:
+    case CSSValueOptimizeSpeed:
         return CR_OPTIMIZESPEED;
-    case CSSValueOptimizequality:
+    case CSSValueOptimizeQuality:
         return CR_OPTIMIZEQUALITY;
     case CSSValueAuto:
         return CR_AUTO;
@@ -4822,13 +4822,13 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EShapeRendering e)
         m_value.valueID = CSSValueAuto;
         break;
     case SR_OPTIMIZESPEED:
-        m_value.valueID = CSSValueOptimizespeed;
+        m_value.valueID = CSSValueOptimizeSpeed;
         break;
     case SR_CRISPEDGES:
         m_value.valueID = CSSValueCrispedges;
         break;
     case SR_GEOMETRICPRECISION:
-        m_value.valueID = CSSValueGeometricprecision;
+        m_value.valueID = CSSValueGeometricPrecision;
         break;
     }
 }
@@ -4840,11 +4840,11 @@ template<> inline CSSPrimitiveValue::operator EShapeRendering() const
     switch (m_value.valueID) {
     case CSSValueAuto:
         return SR_AUTO;
-    case CSSValueOptimizespeed:
+    case CSSValueOptimizeSpeed:
         return SR_OPTIMIZESPEED;
     case CSSValueCrispedges:
         return SR_CRISPEDGES;
-    case CSSValueGeometricprecision:
+    case CSSValueGeometricPrecision:
         return SR_GEOMETRICPRECISION;
     default:
         break;
index 4900f9a..f7027d2 100644 (file)
@@ -256,7 +256,7 @@ static bool colorGamutEvaluate(CSSValue* value, const CSSToLengthConversionData&
         return true;
 
     switch (downcast<CSSPrimitiveValue>(*value).valueID()) {
-    case CSSValueSrgb:
+    case CSSValueSRGB:
         return true;
     case CSSValueP3:
         // FIXME: For the moment we just assume any "extended color" display is at least as good as P3.
index e1b03d0..82a986d 100644 (file)
@@ -212,7 +212,7 @@ linearRGB
 // CSS_PROP_SHAPE_RENDERING
 //auto
 //optimizeSpeed
-crispEdges
+crispedges
 //geometricPrecision
 
 // CSS_PROP_STROKE
index b706e45..71af13b 100644 (file)
@@ -51,39 +51,39 @@ static TransformOperation::OperationType transformOperationType(CSSValueID type)
     switch (type) {
     case CSSValueScale:
         return TransformOperation::SCALE;
-    case CSSValueScalex:
+    case CSSValueScaleX:
         return TransformOperation::SCALE_X;
-    case CSSValueScaley:
+    case CSSValueScaleY:
         return TransformOperation::SCALE_Y;
-    case CSSValueScalez:
+    case CSSValueScaleZ:
         return TransformOperation::SCALE_Z;
     case CSSValueScale3d:
         return TransformOperation::SCALE_3D;
     case CSSValueTranslate:
         return TransformOperation::TRANSLATE;
-    case CSSValueTranslatex:
+    case CSSValueTranslateX:
         return TransformOperation::TRANSLATE_X;
-    case CSSValueTranslatey:
+    case CSSValueTranslateY:
         return TransformOperation::TRANSLATE_Y;
-    case CSSValueTranslatez:
+    case CSSValueTranslateZ:
         return TransformOperation::TRANSLATE_Z;
     case CSSValueTranslate3d:
         return TransformOperation::TRANSLATE_3D;
     case CSSValueRotate:
         return TransformOperation::ROTATE;
-    case CSSValueRotatex:
+    case CSSValueRotateX:
         return TransformOperation::ROTATE_X;
-    case CSSValueRotatey:
+    case CSSValueRotateY:
         return TransformOperation::ROTATE_Y;
-    case CSSValueRotatez:
+    case CSSValueRotateZ:
         return TransformOperation::ROTATE_Z;
     case CSSValueRotate3d:
         return TransformOperation::ROTATE_3D;
     case CSSValueSkew:
         return TransformOperation::SKEW;
-    case CSSValueSkewx:
+    case CSSValueSkewX:
         return TransformOperation::SKEW_X;
-    case CSSValueSkewy:
+    case CSSValueSkewY:
         return TransformOperation::SKEW_Y;
     case CSSValueMatrix:
         return TransformOperation::MATRIX;
@@ -132,15 +132,15 @@ bool transformsForValue(const CSSValue& value, const CSSToLengthConversionData&
 
         switch (transformValue.name()) {
         case CSSValueScale:
-        case CSSValueScalex:
-        case CSSValueScaley: {
+        case CSSValueScaleX:
+        case CSSValueScaleY: {
             double sx = 1.0;
             double sy = 1.0;
-            if (transformValue.name() == CSSValueScaley)
+            if (transformValue.name() == CSSValueScaleY)
                 sy = firstValue.doubleValue();
             else {
                 sx = firstValue.doubleValue();
-                if (transformValue.name() != CSSValueScalex) {
+                if (transformValue.name() != CSSValueScaleX) {
                     if (transformValue.length() > 1) {
                         auto& secondValue = downcast<CSSPrimitiveValue>(*transformValue.itemWithoutBoundsCheck(1));
                         sy = secondValue.doubleValue();
@@ -151,18 +151,18 @@ bool transformsForValue(const CSSValue& value, const CSSToLengthConversionData&
             operations.operations().append(ScaleTransformOperation::create(sx, sy, 1.0, transformOperationType(transformValue.name())));
             break;
         }
-        case CSSValueScalez:
+        case CSSValueScaleZ:
         case CSSValueScale3d: {
             double sx = 1.0;
             double sy = 1.0;
             double sz = 1.0;
-            if (transformValue.name() == CSSValueScalez)
+            if (transformValue.name() == CSSValueScaleZ)
                 sz = firstValue.doubleValue();
-            else if (transformValue.name() == CSSValueScaley)
+            else if (transformValue.name() == CSSValueScaleY)
                 sy = firstValue.doubleValue();
             else {
                 sx = firstValue.doubleValue();
-                if (transformValue.name() != CSSValueScalex) {
+                if (transformValue.name() != CSSValueScaleX) {
                     if (transformValue.length() > 2) {
                         auto& thirdValue = downcast<CSSPrimitiveValue>(*transformValue.itemWithoutBoundsCheck(2));
                         sz = thirdValue.doubleValue();
@@ -178,15 +178,15 @@ bool transformsForValue(const CSSValue& value, const CSSToLengthConversionData&
             break;
         }
         case CSSValueTranslate:
-        case CSSValueTranslatex:
-        case CSSValueTranslatey: {
+        case CSSValueTranslateX:
+        case CSSValueTranslateY: {
             Length tx = Length(0, Fixed);
             Length ty = Length(0, Fixed);
-            if (transformValue.name() == CSSValueTranslatey)
+            if (transformValue.name() == CSSValueTranslateY)
                 ty = convertToFloatLength(&firstValue, conversionData);
             else {
                 tx = convertToFloatLength(&firstValue, conversionData);
-                if (transformValue.name() != CSSValueTranslatex) {
+                if (transformValue.name() != CSSValueTranslateX) {
                     if (transformValue.length() > 1) {
                         auto& secondValue = downcast<CSSPrimitiveValue>(*transformValue.itemWithoutBoundsCheck(1));
                         ty = convertToFloatLength(&secondValue, conversionData);
@@ -200,18 +200,18 @@ bool transformsForValue(const CSSValue& value, const CSSToLengthConversionData&
             operations.operations().append(TranslateTransformOperation::create(tx, ty, Length(0, Fixed), transformOperationType(transformValue.name())));
             break;
         }
-        case CSSValueTranslatez:
+        case CSSValueTranslateZ:
         case CSSValueTranslate3d: {
             Length tx = Length(0, Fixed);
             Length ty = Length(0, Fixed);
             Length tz = Length(0, Fixed);
-            if (transformValue.name() == CSSValueTranslatez)
+            if (transformValue.name() == CSSValueTranslateZ)
                 tz = convertToFloatLength(&firstValue, conversionData);
-            else if (transformValue.name() == CSSValueTranslatey)
+            else if (transformValue.name() == CSSValueTranslateY)
                 ty = convertToFloatLength(&firstValue, conversionData);
             else {
                 tx = convertToFloatLength(&firstValue, conversionData);
-                if (transformValue.name() != CSSValueTranslatex) {
+                if (transformValue.name() != CSSValueTranslateX) {
                     if (transformValue.length() > 2) {
                         auto& thirdValue = downcast<CSSPrimitiveValue>(*transformValue.itemWithoutBoundsCheck(2));
                         tz = convertToFloatLength(&thirdValue, conversionData);
@@ -234,17 +234,17 @@ bool transformsForValue(const CSSValue& value, const CSSToLengthConversionData&
             operations.operations().append(RotateTransformOperation::create(0, 0, 1, angle, transformOperationType(transformValue.name())));
             break;
         }
-        case CSSValueRotatex:
-        case CSSValueRotatey:
-        case CSSValueRotatez: {
+        case CSSValueRotateX:
+        case CSSValueRotateY:
+        case CSSValueRotateZ: {
             double x = 0;
             double y = 0;
             double z = 0;
             double angle = firstValue.computeDegrees();
 
-            if (transformValue.name() == CSSValueRotatex)
+            if (transformValue.name() == CSSValueRotateX)
                 x = 1;
-            else if (transformValue.name() == CSSValueRotatey)
+            else if (transformValue.name() == CSSValueRotateY)
                 y = 1;
             else
                 z = 1;
@@ -265,12 +265,12 @@ bool transformsForValue(const CSSValue& value, const CSSToLengthConversionData&
             break;
         }
         case CSSValueSkew:
-        case CSSValueSkewx:
-        case CSSValueSkewy: {
+        case CSSValueSkewX:
+        case CSSValueSkewY: {
             double angleX = 0;
             double angleY = 0;
             double angle = firstValue.computeDegrees();
-            if (transformValue.name() == CSSValueSkewy)
+            if (transformValue.name() == CSSValueSkewY)
                 angleY = angle;
             else {
                 angleX = angle;
index 47fdace..c0b11e4 100755 (executable)
@@ -40,6 +40,8 @@ my %namesHash;
 my @duplicates = ();
 
 my @names = ();
+my @lower_names = ();
+
 foreach (@NAMES) {
   next if (m/(^\s*$)/);
   next if (/^#/);
@@ -47,13 +49,13 @@ foreach (@NAMES) {
   # Input may use a different EOL sequence than $/, so avoid chomp.
   $_ =~ s/[\r\n]+$//g;
   # CSS values need to be lower case.
-  $_ = lc $_;
   if (exists $namesHash{$_}) {
     push @duplicates, $_;
   } else {
     $namesHash{$_} = 1;
   }
   push @names, $_;
+  push @lower_names, lc $_;
 }
 
 if (@duplicates > 0) {
@@ -92,10 +94,10 @@ struct Value;
 %%
 EOF
 
-foreach my $name (@names) {
-  my $id = $name;
+for my $i (0 .. $#names) {
+  my $id = $names[$i];
   $id =~ s/(^[^-])|-(.)/uc($1||$2)/ge;
-  print GPERF $name . ", CSSValue" . $id . "\n";
+  print GPERF $lower_names[$i] . ", CSSValue" . $id . "\n";
 }
 
 print GPERF << "EOF";
index 11f4051..7daf894 100644 (file)
@@ -537,9 +537,9 @@ bool CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyID propertyId
         return valueID == CSSValueNonzero || valueID == CSSValueEvenodd;
     case CSSPropertyColorInterpolation:
     case CSSPropertyColorInterpolationFilters:
-        return valueID == CSSValueAuto || valueID == CSSValueSrgb || valueID == CSSValueLinearrgb;
+        return valueID == CSSValueAuto || valueID == CSSValueSRGB || valueID == CSSValueLinearRGB;
     case CSSPropertyColorRendering:
-        return valueID == CSSValueAuto || valueID == CSSValueOptimizespeed || valueID == CSSValueOptimizequality;
+        return valueID == CSSValueAuto || valueID == CSSValueOptimizeSpeed || valueID == CSSValueOptimizeQuality;
     case CSSPropertyDirection: // ltr | rtl
         return valueID == CSSValueLtr || valueID == CSSValueRtl;
     case CSSPropertyDisplay:
@@ -568,7 +568,7 @@ bool CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyID propertyId
     case CSSPropertyFontStretch: // normal | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded
         return valueID == CSSValueNormal || (valueID >= CSSValueUltraCondensed && valueID <= CSSValueUltraExpanded);
     case CSSPropertyImageRendering: // auto | optimizeContrast | pixelated | optimizeSpeed | crispEdges | optimizeQuality | webkit-crispEdges
-        return valueID == CSSValueAuto || valueID == CSSValueOptimizespeed || valueID == CSSValueOptimizequality || valueID == CSSValueWebkitCrispEdges || valueID == CSSValueWebkitOptimizeContrast || valueID == CSSValueCrispEdges || valueID == CSSValuePixelated;
+        return valueID == CSSValueAuto || valueID == CSSValueOptimizeSpeed || valueID == CSSValueOptimizeQuality || valueID == CSSValueWebkitCrispEdges || valueID == CSSValueWebkitOptimizeContrast || valueID == CSSValueCrispEdges || valueID == CSSValuePixelated;
 #if ENABLE(CSS_COMPOSITING)
     case CSSPropertyIsolation: // auto | isolate
         return valueID == CSSValueAuto || valueID == CSSValueIsolate;
@@ -611,7 +611,7 @@ bool CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyID propertyId
     case CSSPropertyPointerEvents:
         // none | visiblePainted | visibleFill | visibleStroke | visible |
         // painted | fill | stroke | auto | all | bounding-box
-        return valueID == CSSValueVisible || valueID == CSSValueNone || valueID == CSSValueAll || valueID == CSSValueAuto || (valueID >= CSSValueVisiblepainted && valueID <= CSSValueStroke);
+        return valueID == CSSValueVisible || valueID == CSSValueNone || valueID == CSSValueAll || valueID == CSSValueAuto || (valueID >= CSSValueVisiblePainted && valueID <= CSSValueStroke);
     case CSSPropertyPosition: // static | relative | absolute | fixed | sticky
         return valueID == CSSValueStatic || valueID == CSSValueRelative || valueID == CSSValueAbsolute || valueID == CSSValueFixed || valueID == CSSValueWebkitSticky;
     case CSSPropertyResize: // none | both | horizontal | vertical | auto
@@ -621,7 +621,7 @@ bool CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyID propertyId
     //     ASSERT(RuntimeEnabledFeatures::cssomSmoothScrollEnabled());
     //   return valueID == CSSValueAuto || valueID == CSSValueSmooth;
     case CSSPropertyShapeRendering:
-        return valueID == CSSValueAuto || valueID == CSSValueOptimizespeed || valueID == CSSValueCrispedges || valueID == CSSValueGeometricprecision;
+        return valueID == CSSValueAuto || valueID == CSSValueOptimizeSpeed || valueID == CSSValueCrispedges || valueID == CSSValueGeometricPrecision;
     case CSSPropertySpeak: // none | normal | spell-out | digits | literal-punctuation | no-punctuation
         return valueID == CSSValueNone || valueID == CSSValueNormal || valueID == CSSValueSpellOut || valueID == CSSValueDigits || valueID == CSSValueLiteralPunctuation || valueID == CSSValueNoPunctuation;
     case CSSPropertyStrokeLinejoin:
@@ -655,7 +655,7 @@ bool CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyID propertyId
     case CSSPropertyTextOverflow: // clip | ellipsis
         return valueID == CSSValueClip || valueID == CSSValueEllipsis;
     case CSSPropertyTextRendering: // auto | optimizeSpeed | optimizeLegibility | geometricPrecision
-        return valueID == CSSValueAuto || valueID == CSSValueOptimizespeed || valueID == CSSValueOptimizelegibility || valueID == CSSValueGeometricprecision;
+        return valueID == CSSValueAuto || valueID == CSSValueOptimizeSpeed || valueID == CSSValueOptimizeLegibility || valueID == CSSValueGeometricPrecision;
     case CSSPropertyTextTransform: // capitalize | uppercase | lowercase | none
         return (valueID >= CSSValueCapitalize && valueID <= CSSValueLowercase) || valueID == CSSValueNone;
     case CSSPropertyUnicodeBidi:
@@ -1053,7 +1053,7 @@ static bool parseTransformTranslateArguments(CharType*& pos, CharType* end, unsi
             return false;
         if (!number && unit == CSSPrimitiveValue::CSS_NUMBER)
             unit = CSSPrimitiveValue::UnitType::CSS_PX;
-        if (unit == CSSPrimitiveValue::UnitType::CSS_NUMBER || (unit == CSSPrimitiveValue::UnitType::CSS_PERCENTAGE && (transformValue->name() == CSSValueTranslatez || (transformValue->name() == CSSValueTranslate3d && expectedCount == 1))))
+        if (unit == CSSPrimitiveValue::UnitType::CSS_NUMBER || (unit == CSSPrimitiveValue::UnitType::CSS_PERCENTAGE && (transformValue->name() == CSSValueTranslateZ || (transformValue->name() == CSSValueTranslate3d && expectedCount == 1))))
             return false;
         transformValue->append(CSSPrimitiveValue::create(number, unit));
         pos += argumentLength + 1;
@@ -1105,11 +1105,11 @@ static RefPtr<CSSFunctionValue> parseSimpleTransformValue(CharType*& pos, CharTy
         unsigned argumentStart = 11;
         CharType c9 = toASCIILower(pos[9]);
         if (c9 == 'x' && pos[10] == '(') {
-            transformType = CSSValueTranslatex;
+            transformType = CSSValueTranslateX;
         } else if (c9 == 'y' && pos[10] == '(') {
-            transformType = CSSValueTranslatey;
+            transformType = CSSValueTranslateY;
         } else if (c9 == 'z' && pos[10] == '(') {
-            transformType = CSSValueTranslatez;
+            transformType = CSSValueTranslateZ;
         } else if (c9 == '(') {
             transformType = CSSValueTranslate;
             expectedArgumentCount = 2;
index a020951..539a9ce 100644 (file)
@@ -1771,11 +1771,11 @@ static RefPtr<CSSValue> consumeTransformValue(CSSParserTokenRange& range, CSSPar
     RefPtr<CSSValue> parsedValue;
     switch (functionId) {
     case CSSValueRotate:
-    case CSSValueRotatex:
-    case CSSValueRotatey:
-    case CSSValueRotatez:
-    case CSSValueSkewx:
-    case CSSValueSkewy:
+    case CSSValueRotateX:
+    case CSSValueRotateY:
+    case CSSValueRotateZ:
+    case CSSValueSkewX:
+    case CSSValueSkewY:
     case CSSValueSkew:
         parsedValue = consumeAngle(args, cssParserMode, UnitlessQuirk::Forbid);
         if (!parsedValue)
@@ -1787,9 +1787,9 @@ static RefPtr<CSSValue> consumeTransformValue(CSSParserTokenRange& range, CSSPar
                 return nullptr;
         }
         break;
-    case CSSValueScalex:
-    case CSSValueScaley:
-    case CSSValueScalez:
+    case CSSValueScaleX:
+    case CSSValueScaleY:
+    case CSSValueScaleZ:
     case CSSValueScale:
         parsedValue = consumeNumber(args, ValueRangeAll);
         if (!parsedValue)
@@ -1805,8 +1805,8 @@ static RefPtr<CSSValue> consumeTransformValue(CSSParserTokenRange& range, CSSPar
         if (!consumePerspective(args, cssParserMode, transformValue))
             return nullptr;
         break;
-    case CSSValueTranslatex:
-    case CSSValueTranslatey:
+    case CSSValueTranslateX:
+    case CSSValueTranslateY:
     case CSSValueTranslate:
         parsedValue = consumeLengthOrPercent(args, cssParserMode, ValueRangeAll);
         if (!parsedValue)
@@ -1818,7 +1818,7 @@ static RefPtr<CSSValue> consumeTransformValue(CSSParserTokenRange& range, CSSPar
                 return nullptr;
         }
         break;
-    case CSSValueTranslatez:
+    case CSSValueTranslateZ:
         parsedValue = consumeLength(args, cssParserMode, ValueRangeAll);
         break;
     case CSSValueMatrix:
index 7977709..a917ed2 100644 (file)
@@ -495,7 +495,7 @@ static Color parseColorFunctionParameters(CSSParserTokenRange& range)
 
     ColorSpace colorSpace;
     switch (args.peek().id()) {
-    case CSSValueSrgb:
+    case CSSValueSRGB:
         colorSpace = ColorSpaceSRGB;
         break;
     case CSSValueDisplayP3: