Diff
Modified: trunk/LayoutTests/ChangeLog (148226 => 148227)
--- trunk/LayoutTests/ChangeLog 2013-04-11 20:01:55 UTC (rev 148226)
+++ trunk/LayoutTests/ChangeLog 2013-04-11 20:05:17 UTC (rev 148227)
@@ -1,3 +1,21 @@
+2013-04-11 Dirk Schulze <[email protected]>
+
+ [CSS Shaders] Parse parameters descriptor
+ https://bugs.webkit.org/show_bug.cgi?id=114455
+
+ Reviewed by Dean Jackson.
+
+ Tests for the 'parameters' descriptor on @filter rule.
+
+ * css3/filters/custom-with-at-rule-syntax/parsing-parameters-property-invalid-expected.txt: Added.
+ * css3/filters/custom-with-at-rule-syntax/parsing-parameters-property-invalid.html: Added.
+ * css3/filters/custom-with-at-rule-syntax/parsing-parameters-property-valid-expected.txt: Added.
+ * css3/filters/custom-with-at-rule-syntax/parsing-parameters-property-valid.html: Added.
+ * css3/filters/custom-with-at-rule-syntax/script-tests/parsing-parameters-property-invalid.js: Added.
+ (testInvalidParametersProperty):
+ * css3/filters/custom-with-at-rule-syntax/script-tests/parsing-parameters-property-valid.js: Added.
+ (testParametersProperty):
+
2013-04-11 Robert Hogan <[email protected]>
REGRESSION (142152): ensure we skip past out-of-flow objects when detecting whitespace to ignore after leading empty inlines
Added: trunk/LayoutTests/css3/filters/custom-with-at-rule-syntax/parsing-parameters-property-invalid-expected.txt (0 => 148227)
--- trunk/LayoutTests/css3/filters/custom-with-at-rule-syntax/parsing-parameters-property-invalid-expected.txt (rev 0)
+++ trunk/LayoutTests/css3/filters/custom-with-at-rule-syntax/parsing-parameters-property-invalid-expected.txt 2013-04-11 20:05:17 UTC (rev 148227)
@@ -0,0 +1,237 @@
+Test parameters property parsing in the @-webkit-filter at-rule.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+========================================
+Number parameter tests.
+========================================
+
+Too many parameter values.
+parameters: n 1 2 3 4 5;
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 0
+PASS styleDeclaration.getPropertyValue('parameters') is null
+
+Invalid parameter type.
+parameters: n 1.0 2.0 'text';
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 0
+PASS styleDeclaration.getPropertyValue('parameters') is null
+
+No parameter definition.
+parameters: ;
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 0
+PASS styleDeclaration.getPropertyValue('parameters') is null
+
+No parameter definition with comma.
+parameters: ,;
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 0
+PASS styleDeclaration.getPropertyValue('parameters') is null
+
+No parameter definition before valid parameter defintion.
+parameters: , n 1;
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 0
+PASS styleDeclaration.getPropertyValue('parameters') is null
+
+No parameter value.
+parameters: n;
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 0
+PASS styleDeclaration.getPropertyValue('parameters') is null
+
+No parameter value with multiple parameters.
+parameters: n1, n2, n3;
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 0
+PASS styleDeclaration.getPropertyValue('parameters') is null
+
+========================================
+Transform parameter tests.
+========================================
+
+One invalid transform function.
+parameters: t invalid-rotate(0deg);
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 0
+PASS styleDeclaration.getPropertyValue('parameters') is null
+
+Multiple invalid transform functions.
+parameters: t invalid-rotate(0deg) invalid-perspective(0);
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 0
+PASS styleDeclaration.getPropertyValue('parameters') is null
+
+Invalid transform function between valid ones.
+parameters: t rotate(0deg) invalid-rotate(0deg) perspective(0);
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 0
+PASS styleDeclaration.getPropertyValue('parameters') is null
+
+Valid transform function between invalid ones.
+parameters: t invalid-rotate(0deg) perspective(0) invalid-translate(0);
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 0
+PASS styleDeclaration.getPropertyValue('parameters') is null
+
+Valid transform function with trailing comma.
+parameters: t perspective(0),;
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 0
+PASS styleDeclaration.getPropertyValue('parameters') is null
+
+Invalid transform with trailing comma.
+parameters: t invalid-rotate(0deg),;
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 0
+PASS styleDeclaration.getPropertyValue('parameters') is null
+
+Valid transform with invalid characters
+parameters: t rotate(0deg) *.-,;
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 0
+PASS styleDeclaration.getPropertyValue('parameters') is null
+
+========================================
+Array parameter tests.
+========================================
+
+Empty array.
+parameters: a array();
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 0
+PASS styleDeclaration.getPropertyValue('parameters') is null
+
+One comma in array.
+parameters: a array(,);
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 0
+PASS styleDeclaration.getPropertyValue('parameters') is null
+
+Multiple commas in array.
+parameters: a array(,,,);
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 0
+PASS styleDeclaration.getPropertyValue('parameters') is null
+
+Multiple commas with a value in array.
+parameters: a array(,,1,);
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 0
+PASS styleDeclaration.getPropertyValue('parameters') is null
+
+One comma followed by a negative value in array.
+parameters: a array(,-4);
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 0
+PASS styleDeclaration.getPropertyValue('parameters') is null
+
+One comma followed by a value in array.
+parameters: a array(,4);
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 0
+PASS styleDeclaration.getPropertyValue('parameters') is null
+
+One negative value followed by a comma in array.
+parameters: a array(-4,);
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 0
+PASS styleDeclaration.getPropertyValue('parameters') is null
+
+One value followed by a comma in array.
+parameters: a array(4,);
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 0
+PASS styleDeclaration.getPropertyValue('parameters') is null
+
+Valid values followed by a comma in array.
+parameters: a array(1, 2, 3, 4,);
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 0
+PASS styleDeclaration.getPropertyValue('parameters') is null
+
+Valid values followed by a letter in array.
+parameters: a array(1, 2, 3, 4, x);
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 0
+PASS styleDeclaration.getPropertyValue('parameters') is null
+
+Two commas as separator between values in array.
+parameters: a array(1, 2, , 4);
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 0
+PASS styleDeclaration.getPropertyValue('parameters') is null
+
+Leading comma in array.
+parameters: a array(,1, 2, 3, 4);
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 0
+PASS styleDeclaration.getPropertyValue('parameters') is null
+
+Semicolon separated values in array.
+parameters: a array(1; 2; 3; 4);
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 0
+PASS styleDeclaration.getPropertyValue('parameters') is null
+
+Space separated values in array.
+parameters: a array(1 2 3 4);
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 0
+PASS styleDeclaration.getPropertyValue('parameters') is null
+
+Space separated values with comma terminator in array.
+parameters: a array(1 2 3 4,);
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 0
+PASS styleDeclaration.getPropertyValue('parameters') is null
+
+Space separated values with leading comma in array.
+parameters: a array(, 1 2 3 4);
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 0
+PASS styleDeclaration.getPropertyValue('parameters') is null
+
+NaN in array.
+parameters: a array(NaN);
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 0
+PASS styleDeclaration.getPropertyValue('parameters') is null
+
+NaN between valid values in array.
+parameters: a array(1, 2, NaN, 3);
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 0
+PASS styleDeclaration.getPropertyValue('parameters') is null
+
+Invalid value 'none' in array.
+parameters: a array(none);
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 0
+PASS styleDeclaration.getPropertyValue('parameters') is null
+
+Invalid value unit 'px' in array.
+parameters: a array(1px);
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 0
+PASS styleDeclaration.getPropertyValue('parameters') is null
+
+Invalid value unit 'deg' in array.
+parameters: a array(1deg);
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 0
+PASS styleDeclaration.getPropertyValue('parameters') is null
+
+Invalid value unit 'px' in array after valid values.
+parameters: a array(1, 2, 3, 4px);
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 0
+PASS styleDeclaration.getPropertyValue('parameters') is null
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/css3/filters/custom-with-at-rule-syntax/parsing-parameters-property-invalid.html (0 => 148227)
--- trunk/LayoutTests/css3/filters/custom-with-at-rule-syntax/parsing-parameters-property-invalid.html (rev 0)
+++ trunk/LayoutTests/css3/filters/custom-with-at-rule-syntax/parsing-parameters-property-invalid.html 2013-04-11 20:05:17 UTC (rev 148227)
@@ -0,0 +1,14 @@
+<!doctype html>
+<html>
+<head>
+<link rel="stylesheet" href=""
+<script src=""
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src=""
+<script src=""
+<script src=""
+</body>
+</html>
Added: trunk/LayoutTests/css3/filters/custom-with-at-rule-syntax/parsing-parameters-property-valid-expected.txt (0 => 148227)
--- trunk/LayoutTests/css3/filters/custom-with-at-rule-syntax/parsing-parameters-property-valid-expected.txt (rev 0)
+++ trunk/LayoutTests/css3/filters/custom-with-at-rule-syntax/parsing-parameters-property-valid-expected.txt 2013-04-11 20:05:17 UTC (rev 148227)
@@ -0,0 +1,201 @@
+Test parameters property parsing in the @-webkit-filter at-rule.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+========================================
+Number parameter tests.
+========================================
+
+Integer parameters.
+parameters: n1 1, n2 2 3, n3 3 4 5, n4 4 5 6 7;
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 1
+PASS removeBaseURL(styleDeclaration.getPropertyValue('parameters')) is "n1 1, n2 2 3, n3 3 4 5, n4 4 5 6 7"
+PASS parametersPropertyValue instanceof CSSValueList is true
+PASS parametersPropertyValue.constructor === CSSValueList is true
+PASS parametersPropertyValue.__proto__ === CSSValueList.prototype is true
+PASS parametersPropertyValue.length is 4
+PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
+PASS removeBaseURL(subValue.cssText) is "n1 1"
+PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
+PASS removeBaseURL(subValue.cssText) is "n2 2 3"
+PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
+PASS removeBaseURL(subValue.cssText) is "n3 3 4 5"
+PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
+PASS removeBaseURL(subValue.cssText) is "n4 4 5 6 7"
+
+Float parameters.
+parameters: n1 1.1, n2 2.2 3.3, n3 3.1 4.1 5.1, n4 4.1 5.2 6.3 7.4;
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 1
+PASS removeBaseURL(styleDeclaration.getPropertyValue('parameters')) is "n1 1.1, n2 2.2 3.3, n3 3.1 4.1 5.1, n4 4.1 5.2 6.3 7.4"
+PASS parametersPropertyValue instanceof CSSValueList is true
+PASS parametersPropertyValue.constructor === CSSValueList is true
+PASS parametersPropertyValue.__proto__ === CSSValueList.prototype is true
+PASS parametersPropertyValue.length is 4
+PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
+PASS removeBaseURL(subValue.cssText) is "n1 1.1"
+PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
+PASS removeBaseURL(subValue.cssText) is "n2 2.2 3.3"
+PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
+PASS removeBaseURL(subValue.cssText) is "n3 3.1 4.1 5.1"
+PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
+PASS removeBaseURL(subValue.cssText) is "n4 4.1 5.2 6.3 7.4"
+
+Parameter name same as CSS keyword.
+parameters: background 0 1 0 1;
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 1
+PASS removeBaseURL(styleDeclaration.getPropertyValue('parameters')) is "background 0 1 0 1"
+PASS parametersPropertyValue instanceof CSSValueList is true
+PASS parametersPropertyValue.constructor === CSSValueList is true
+PASS parametersPropertyValue.__proto__ === CSSValueList.prototype is true
+PASS parametersPropertyValue.length is 1
+PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
+PASS removeBaseURL(subValue.cssText) is "background 0 1 0 1"
+
+========================================
+Transform parameter tests.
+========================================
+
+Transform parameter with one transform function.
+parameters: t rotate(0deg);
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 1
+PASS removeBaseURL(styleDeclaration.getPropertyValue('parameters')) is "t rotate(0deg)"
+PASS parametersPropertyValue instanceof CSSValueList is true
+PASS parametersPropertyValue.constructor === CSSValueList is true
+PASS parametersPropertyValue.__proto__ === CSSValueList.prototype is true
+PASS parametersPropertyValue.length is 1
+PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
+PASS removeBaseURL(subValue.cssText) is "t rotate(0deg)"
+
+Transform parameter with multiple transform functions.
+parameters: t rotate(0deg) perspective(0) scale(0, 0) translate(0px, 0px);
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 1
+PASS removeBaseURL(styleDeclaration.getPropertyValue('parameters')) is "t rotate(0deg) perspective(0) scale(0, 0) translate(0px, 0px)"
+PASS parametersPropertyValue instanceof CSSValueList is true
+PASS parametersPropertyValue.constructor === CSSValueList is true
+PASS parametersPropertyValue.__proto__ === CSSValueList.prototype is true
+PASS parametersPropertyValue.length is 1
+PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
+PASS removeBaseURL(subValue.cssText) is "t rotate(0deg) perspective(0) scale(0, 0) translate(0px, 0px)"
+
+Mulitple transform parameters.
+parameters: t1 rotate(0deg), t2 rotate(0deg);
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 1
+PASS removeBaseURL(styleDeclaration.getPropertyValue('parameters')) is "t1 rotate(0deg), t2 rotate(0deg)"
+PASS parametersPropertyValue instanceof CSSValueList is true
+PASS parametersPropertyValue.constructor === CSSValueList is true
+PASS parametersPropertyValue.__proto__ === CSSValueList.prototype is true
+PASS parametersPropertyValue.length is 2
+PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
+PASS removeBaseURL(subValue.cssText) is "t1 rotate(0deg)"
+PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
+PASS removeBaseURL(subValue.cssText) is "t2 rotate(0deg)"
+
+========================================
+Array parameter tests.
+========================================
+
+Array parameter with name 'array'.
+parameters: array array(1);
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 1
+PASS removeBaseURL(styleDeclaration.getPropertyValue('parameters')) is "array array(1)"
+PASS parametersPropertyValue instanceof CSSValueList is true
+PASS parametersPropertyValue.constructor === CSSValueList is true
+PASS parametersPropertyValue.__proto__ === CSSValueList.prototype is true
+PASS parametersPropertyValue.length is 1
+PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
+PASS removeBaseURL(subValue.cssText) is "array array(1)"
+
+Array parameter with one positive integer.
+parameters: a array(1);
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 1
+PASS removeBaseURL(styleDeclaration.getPropertyValue('parameters')) is "a array(1)"
+PASS parametersPropertyValue instanceof CSSValueList is true
+PASS parametersPropertyValue.constructor === CSSValueList is true
+PASS parametersPropertyValue.__proto__ === CSSValueList.prototype is true
+PASS parametersPropertyValue.length is 1
+PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
+PASS removeBaseURL(subValue.cssText) is "a array(1)"
+
+Array parameter with one negative float.
+parameters: a array(-1.01);
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 1
+PASS removeBaseURL(styleDeclaration.getPropertyValue('parameters')) is "a array(-1.01)"
+PASS parametersPropertyValue instanceof CSSValueList is true
+PASS parametersPropertyValue.constructor === CSSValueList is true
+PASS parametersPropertyValue.__proto__ === CSSValueList.prototype is true
+PASS parametersPropertyValue.length is 1
+PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
+PASS removeBaseURL(subValue.cssText) is "a array(-1.01)"
+
+Array parameter with multiple positive integers.
+parameters: a array(1, 2, 3, 4, 5);
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 1
+PASS removeBaseURL(styleDeclaration.getPropertyValue('parameters')) is "a array(1, 2, 3, 4, 5)"
+PASS parametersPropertyValue instanceof CSSValueList is true
+PASS parametersPropertyValue.constructor === CSSValueList is true
+PASS parametersPropertyValue.__proto__ === CSSValueList.prototype is true
+PASS parametersPropertyValue.length is 1
+PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
+PASS removeBaseURL(subValue.cssText) is "a array(1, 2, 3, 4, 5)"
+
+Array parameter with multiple signed floats.
+parameters: a array(1, -2.2, 3.14, 0.4, 5);
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 1
+PASS removeBaseURL(styleDeclaration.getPropertyValue('parameters')) is "a array(1, -2.2, 3.14, 0.4, 5)"
+PASS parametersPropertyValue instanceof CSSValueList is true
+PASS parametersPropertyValue.constructor === CSSValueList is true
+PASS parametersPropertyValue.__proto__ === CSSValueList.prototype is true
+PASS parametersPropertyValue.length is 1
+PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
+PASS removeBaseURL(subValue.cssText) is "a array(1, -2.2, 3.14, 0.4, 5)"
+
+Multiple array parameters.
+parameters: a1 array(1, -2.2, 3.14, 0.4, 5), a2 array(1, 2, 3);
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 1
+PASS removeBaseURL(styleDeclaration.getPropertyValue('parameters')) is "a1 array(1, -2.2, 3.14, 0.4, 5), a2 array(1, 2, 3)"
+PASS parametersPropertyValue instanceof CSSValueList is true
+PASS parametersPropertyValue.constructor === CSSValueList is true
+PASS parametersPropertyValue.__proto__ === CSSValueList.prototype is true
+PASS parametersPropertyValue.length is 2
+PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
+PASS removeBaseURL(subValue.cssText) is "a1 array(1, -2.2, 3.14, 0.4, 5)"
+PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
+PASS removeBaseURL(subValue.cssText) is "a2 array(1, 2, 3)"
+
+========================================
+Combined parameter tests.
+========================================
+
+Number parameter, transform parameter, and array parameter.
+parameters: n 1, t rotate(0deg), a array(1);
+PASS filterAtRule.type is CSSRule.WEBKIT_FILTER_RULE
+PASS styleDeclaration.length is 1
+PASS removeBaseURL(styleDeclaration.getPropertyValue('parameters')) is "n 1, t rotate(0deg), a array(1)"
+PASS parametersPropertyValue instanceof CSSValueList is true
+PASS parametersPropertyValue.constructor === CSSValueList is true
+PASS parametersPropertyValue.__proto__ === CSSValueList.prototype is true
+PASS parametersPropertyValue.length is 3
+PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
+PASS removeBaseURL(subValue.cssText) is "n 1"
+PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
+PASS removeBaseURL(subValue.cssText) is "t rotate(0deg)"
+PASS subValue.cssValueType is CSSValue.CSS_VALUE_LIST
+PASS removeBaseURL(subValue.cssText) is "a array(1)"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/css3/filters/custom-with-at-rule-syntax/parsing-parameters-property-valid.html (0 => 148227)
--- trunk/LayoutTests/css3/filters/custom-with-at-rule-syntax/parsing-parameters-property-valid.html (rev 0)
+++ trunk/LayoutTests/css3/filters/custom-with-at-rule-syntax/parsing-parameters-property-valid.html 2013-04-11 20:05:17 UTC (rev 148227)
@@ -0,0 +1,14 @@
+<!doctype html>
+<html>
+<head>
+<link rel="stylesheet" href=""
+<script src=""
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src=""
+<script src=""
+<script src=""
+</body>
+</html>
Added: trunk/LayoutTests/css3/filters/custom-with-at-rule-syntax/script-tests/parsing-parameters-property-invalid.js (0 => 148227)
--- trunk/LayoutTests/css3/filters/custom-with-at-rule-syntax/script-tests/parsing-parameters-property-invalid.js (rev 0)
+++ trunk/LayoutTests/css3/filters/custom-with-at-rule-syntax/script-tests/parsing-parameters-property-invalid.js 2013-04-11 20:05:17 UTC (rev 148227)
@@ -0,0 +1,64 @@
+// Requires custom-filter-parsing-common.js.
+
+description("Test parameters property parsing in the @-webkit-filter at-rule.");
+
+// These have to be global for the test helpers to see them.
+var filterAtRule, styleDeclaration;
+
+function testInvalidParametersProperty(description, propertyValue)
+{
+ var parametersProperty = "parameters: " + propertyValue + ";";
+ debug("\n" + description + "\n" + parametersProperty);
+
+ stylesheet.insertRule("@-webkit-filter my-filter { " + parametersProperty + " }", 0);
+
+ filterAtRule = stylesheet.cssRules.item(0);
+ shouldBe("filterAtRule.type", "CSSRule.WEBKIT_FILTER_RULE");
+
+ styleDeclaration = filterAtRule.style;
+ shouldBe("styleDeclaration.length", "0");
+ shouldBe("styleDeclaration.getPropertyValue('parameters')", "null");
+}
+
+heading("Number parameter tests.");
+testInvalidParametersProperty("Too many parameter values.", "n 1 2 3 4 5");
+testInvalidParametersProperty("Invalid parameter type.", "n 1.0 2.0 'text'");
+
+testInvalidParametersProperty("No parameter definition.", "");
+testInvalidParametersProperty("No parameter definition with comma.", ",");
+testInvalidParametersProperty("No parameter definition before valid parameter defintion.", ", n 1");
+testInvalidParametersProperty("No parameter value.", "n");
+testInvalidParametersProperty("No parameter value with multiple parameters.", "n1, n2, n3");
+
+heading("Transform parameter tests.");
+testInvalidParametersProperty("One invalid transform function.", "t invalid-rotate(0deg)");
+testInvalidParametersProperty("Multiple invalid transform functions.", "t invalid-rotate(0deg) invalid-perspective(0)");
+testInvalidParametersProperty("Invalid transform function between valid ones.", "t rotate(0deg) invalid-rotate(0deg) perspective(0)");
+testInvalidParametersProperty("Valid transform function between invalid ones.", "t invalid-rotate(0deg) perspective(0) invalid-translate(0)");
+testInvalidParametersProperty("Valid transform function with trailing comma.", "t perspective(0),");
+testInvalidParametersProperty("Invalid transform with trailing comma.", "t invalid-rotate(0deg),");
+testInvalidParametersProperty("Valid transform with invalid characters", "t rotate(0deg) *.-,");
+
+heading("Array parameter tests.");
+testInvalidParametersProperty("Empty array.", "a array()");
+testInvalidParametersProperty("One comma in array.", "a array(,)");
+testInvalidParametersProperty("Multiple commas in array.", "a array(,,,)");
+testInvalidParametersProperty("Multiple commas with a value in array.", "a array(,,1,)");
+testInvalidParametersProperty("One comma followed by a negative value in array.", "a array(,-4)");
+testInvalidParametersProperty("One comma followed by a value in array.", "a array(,4)");
+testInvalidParametersProperty("One negative value followed by a comma in array.", "a array(-4,)");
+testInvalidParametersProperty("One value followed by a comma in array.", "a array(4,)");
+testInvalidParametersProperty("Valid values followed by a comma in array.", "a array(1, 2, 3, 4,)");
+testInvalidParametersProperty("Valid values followed by a letter in array.", "a array(1, 2, 3, 4, x)");
+testInvalidParametersProperty("Two commas as separator between values in array.", "a array(1, 2, , 4)");
+testInvalidParametersProperty("Leading comma in array.", "a array(,1, 2, 3, 4)");
+testInvalidParametersProperty("Semicolon separated values in array.", "a array(1; 2; 3; 4)");
+testInvalidParametersProperty("Space separated values in array.", "a array(1 2 3 4)");
+testInvalidParametersProperty("Space separated values with comma terminator in array.", "a array(1 2 3 4,)");
+testInvalidParametersProperty("Space separated values with leading comma in array.", "a array(, 1 2 3 4)");
+testInvalidParametersProperty("NaN in array.", "a array(NaN)");
+testInvalidParametersProperty("NaN between valid values in array.", "a array(1, 2, NaN, 3)");
+testInvalidParametersProperty("Invalid value 'none' in array.", "a array(none)");
+testInvalidParametersProperty("Invalid value unit 'px' in array.", "a array(1px)");
+testInvalidParametersProperty("Invalid value unit 'deg' in array.", "a array(1deg)");
+testInvalidParametersProperty("Invalid value unit 'px' in array after valid values.", "a array(1, 2, 3, 4px)");
Added: trunk/LayoutTests/css3/filters/custom-with-at-rule-syntax/script-tests/parsing-parameters-property-valid.js (0 => 148227)
--- trunk/LayoutTests/css3/filters/custom-with-at-rule-syntax/script-tests/parsing-parameters-property-valid.js (rev 0)
+++ trunk/LayoutTests/css3/filters/custom-with-at-rule-syntax/script-tests/parsing-parameters-property-valid.js 2013-04-11 20:05:17 UTC (rev 148227)
@@ -0,0 +1,93 @@
+// Requires custom-filter-parsing-common.js.
+
+description("Test parameters property parsing in the @-webkit-filter at-rule.");
+
+// These have to be global for the test helpers to see them.
+var filterAtRule, styleDeclaration, parametersPropertyValue, subValue;
+
+function testParametersProperty(description, propertyValue, expectedValue, expectedTexts)
+{
+ var parametersProperty = "parameters: " + propertyValue + ";"
+ debug("\n" + description + "\n" + parametersProperty);
+
+ stylesheet.insertRule("@-webkit-filter my-filter { " + parametersProperty + " }", 0);
+ filterAtRule = stylesheet.cssRules.item(0);
+ shouldBe("filterAtRule.type", "CSSRule.WEBKIT_FILTER_RULE");
+
+ styleDeclaration = filterAtRule.style;
+ shouldBe("styleDeclaration.length", "1");
+ shouldBe("removeBaseURL(styleDeclaration.getPropertyValue('parameters'))", "\"" + expectedValue + "\"");
+
+ parametersPropertyValue = styleDeclaration.getPropertyCSSValue('parameters');
+ shouldHaveConstructor("parametersPropertyValue", "CSSValueList");
+
+ shouldBe("parametersPropertyValue.length", expectedTexts.length.toString()); // shouldBe expects string arguments
+
+ if (parametersPropertyValue) {
+ for (var i = 0; i < expectedTexts.length; i++) {
+ subValue = parametersPropertyValue[i];
+ shouldBe("subValue.cssValueType", "CSSValue.CSS_VALUE_LIST");
+ shouldBe("removeBaseURL(subValue.cssText)", "\"" + expectedTexts[i] + "\"");
+ }
+ }
+}
+
+heading("Number parameter tests.")
+testParametersProperty("Integer parameters.",
+ "n1 1, n2 2 3, n3 3 4 5, n4 4 5 6 7",
+ "n1 1, n2 2 3, n3 3 4 5, n4 4 5 6 7",
+ ["n1 1","n2 2 3", "n3 3 4 5", "n4 4 5 6 7"]);
+testParametersProperty("Float parameters.",
+ "n1 1.1, n2 2.2 3.3, n3 3.1 4.1 5.1, n4 4.1 5.2 6.3 7.4",
+ "n1 1.1, n2 2.2 3.3, n3 3.1 4.1 5.1, n4 4.1 5.2 6.3 7.4",
+ ["n1 1.1", "n2 2.2 3.3", "n3 3.1 4.1 5.1", "n4 4.1 5.2 6.3 7.4"]);
+testParametersProperty("Parameter name same as CSS keyword.",
+ "background 0 1 0 1",
+ "background 0 1 0 1",
+ ["background 0 1 0 1"]);
+
+heading("Transform parameter tests.")
+testParametersProperty("Transform parameter with one transform function.",
+ "t rotate(0deg)",
+ "t rotate(0deg)",
+ ["t rotate(0deg)"]);
+testParametersProperty("Transform parameter with multiple transform functions.",
+ "t rotate(0deg) perspective(0) scale(0, 0) translate(0px, 0px)",
+ "t rotate(0deg) perspective(0) scale(0, 0) translate(0px, 0px)",
+ ["t rotate(0deg) perspective(0) scale(0, 0) translate(0px, 0px)"]);
+testParametersProperty("Mulitple transform parameters.",
+ "t1 rotate(0deg), t2 rotate(0deg)",
+ "t1 rotate(0deg), t2 rotate(0deg)",
+ ["t1 rotate(0deg)", "t2 rotate(0deg)"]);
+
+heading("Array parameter tests.");
+testParametersProperty("Array parameter with name 'array'.",
+ "array array(1)",
+ "array array(1)",
+ ["array array(1)"]);
+testParametersProperty("Array parameter with one positive integer.",
+ "a array(1)",
+ "a array(1)",
+ ["a array(1)"]);
+testParametersProperty("Array parameter with one negative float.",
+ "a array(-1.01)",
+ "a array(-1.01)",
+ ["a array(-1.01)"]);
+testParametersProperty("Array parameter with multiple positive integers.",
+ "a array(1, 2, 3, 4, 5)",
+ "a array(1, 2, 3, 4, 5)",
+ ["a array(1, 2, 3, 4, 5)"]);
+testParametersProperty("Array parameter with multiple signed floats.",
+ "a array(1, -2.2, 3.14, 0.4, 5)",
+ "a array(1, -2.2, 3.14, 0.4, 5)",
+ ["a array(1, -2.2, 3.14, 0.4, 5)"]);
+testParametersProperty("Multiple array parameters.",
+ "a1 array(1, -2.2, 3.14, 0.4, 5), a2 array(1, 2, 3)",
+ "a1 array(1, -2.2, 3.14, 0.4, 5), a2 array(1, 2, 3)",
+ ["a1 array(1, -2.2, 3.14, 0.4, 5)", "a2 array(1, 2, 3)"]);
+
+heading("Combined parameter tests.");
+testParametersProperty("Number parameter, transform parameter, and array parameter.",
+ "n 1, t rotate(0deg), a array(1)",
+ "n 1, t rotate(0deg), a array(1)",
+ ["n 1", "t rotate(0deg)", "a array(1)"]);
\ No newline at end of file
Modified: trunk/Source/WebCore/ChangeLog (148226 => 148227)
--- trunk/Source/WebCore/ChangeLog 2013-04-11 20:01:55 UTC (rev 148226)
+++ trunk/Source/WebCore/ChangeLog 2013-04-11 20:05:17 UTC (rev 148227)
@@ -1,3 +1,33 @@
+2013-04-11 Dirk Schulze <[email protected]>
+
+ [CSS Shaders] Parse parameters descriptor
+ https://bugs.webkit.org/show_bug.cgi?id=114455
+
+ Reviewed by Dean Jackson.
+
+ Add support for the 'parameters' descriptor in the filter at-rule to support
+ parameterization of CSS Shaders.
+
+ https://dvcs.w3.org/hg/FXTF/raw-file/tip/filters/index.html#custom-filter-parameters
+
+ Tests: css3/filters/custom-with-at-rule-syntax/parsing-parameters-property-invalid.html
+ css3/filters/custom-with-at-rule-syntax/parsing-parameters-property-valid.html
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+ * css/CSSParser.cpp: Added 'parameters' property and fail parsing if not inside
+ of an @filter rule.
+ (WebCore::CSSParser::parseValue):
+ (WebCore::CSSParser::parseFilterRuleParameters): New helper function to verify
+ values.
+ (WebCore):
+ * css/CSSParser.h:
+ * css/CSSProperty.cpp:
+ (WebCore::CSSProperty::isInheritedProperty):
+ * css/CSSPropertyNames.in: Added new property name 'parameters'.
+ * css/StyleResolver.cpp:
+ (WebCore::StyleResolver::applyProperty):
+
2013-04-11 Arunprasad Rajkumar <[email protected]>
Default Implementation of toString for NPObject shouldn't return NPClass & NPObject address as String
Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (148226 => 148227)
--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp 2013-04-11 20:01:55 UTC (rev 148226)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp 2013-04-11 20:05:17 UTC (rev 148227)
@@ -2819,6 +2819,7 @@
#endif
#if ENABLE(CSS_SHADERS)
case CSSPropertyMix:
+ case CSSPropertyParameters:
#endif
break;
Modified: trunk/Source/WebCore/css/CSSParser.cpp (148226 => 148227)
--- trunk/Source/WebCore/css/CSSParser.cpp 2013-04-11 20:01:55 UTC (rev 148226)
+++ trunk/Source/WebCore/css/CSSParser.cpp 2013-04-11 20:05:17 UTC (rev 148227)
@@ -2363,6 +2363,11 @@
if (!m_inFilterRule)
return false;
return parseFilterRuleMix();
+ case CSSPropertyParameters:
+ // The parameters property is just supported inside of an @filter rule.
+ if (!m_inFilterRule)
+ return false;
+ return parseFilterRuleParameters();
#endif
case CSSPropertyUnicodeRange:
@@ -8919,6 +8924,16 @@
return true;
}
+bool CSSParser::parseFilterRuleParameters()
+{
+ RefPtr<CSSValueList> paramsList = parseCustomFilterParameters(m_valueList.get());
+ if (!paramsList)
+ return false;
+
+ addProperty(CSSPropertyParameters, paramsList.release(), m_important);
+ return true;
+}
+
StyleRuleBase* CSSParser::createFilterRule(const CSSParserString& filterName)
{
RefPtr<StyleRuleFilter> rule = StyleRuleFilter::create(filterName);
Modified: trunk/Source/WebCore/css/CSSParser.h (148226 => 148227)
--- trunk/Source/WebCore/css/CSSParser.h 2013-04-11 20:01:55 UTC (rev 148226)
+++ trunk/Source/WebCore/css/CSSParser.h 2013-04-11 20:05:17 UTC (rev 148227)
@@ -256,6 +256,7 @@
bool parseFilterRuleMix();
bool parseGeometry(CSSPropertyID, CSSParserValue*, bool);
bool parseGridDimensions(CSSParserValueList*, RefPtr<CSSValueList>&);
+ bool parseFilterRuleParameters();
PassRefPtr<WebKitCSSShaderValue> parseFilterRuleSrcUriAndFormat(CSSParserValueList*);
#endif
#endif
Modified: trunk/Source/WebCore/css/CSSProperty.cpp (148226 => 148227)
--- trunk/Source/WebCore/css/CSSProperty.cpp 2013-04-11 20:01:55 UTC (rev 148226)
+++ trunk/Source/WebCore/css/CSSProperty.cpp 2013-04-11 20:05:17 UTC (rev 148227)
@@ -681,6 +681,7 @@
#endif
#if ENABLE(CSS_SHADERS)
case CSSPropertyMix:
+ case CSSPropertyParameters:
#endif
#if ENABLE(SVG)
case CSSPropertyClipPath:
Modified: trunk/Source/WebCore/css/CSSPropertyNames.in (148226 => 148227)
--- trunk/Source/WebCore/css/CSSPropertyNames.in 2013-04-11 20:01:55 UTC (rev 148226)
+++ trunk/Source/WebCore/css/CSSPropertyNames.in 2013-04-11 20:05:17 UTC (rev 148227)
@@ -133,6 +133,7 @@
min-width
#if defined(ENABLE_CSS_SHADERS) && ENABLE_CSS_SHADERS
mix
+parameters
#endif
opacity
// Honor -webkit-opacity as a synonym for opacity. This was the only syntax that worked in Safari 1.1,
Modified: trunk/Source/WebCore/css/StyleResolver.cpp (148226 => 148227)
--- trunk/Source/WebCore/css/StyleResolver.cpp 2013-04-11 20:01:55 UTC (rev 148226)
+++ trunk/Source/WebCore/css/StyleResolver.cpp 2013-04-11 20:05:17 UTC (rev 148227)
@@ -3149,6 +3149,7 @@
#endif
#if ENABLE(CSS_SHADERS)
case CSSPropertyMix:
+ case CSSPropertyParameters:
#endif
case CSSPropertyWhiteSpace:
case CSSPropertyWidows: