Added: trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-background-shorthand-expected.txt (0 => 104169)
--- trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-background-shorthand-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-background-shorthand-expected.txt 2012-01-05 17:29:54 UTC (rev 104169)
@@ -0,0 +1,93 @@
+Test to make sure background shorthand properties returns CSSValueList properly.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) none repeat scroll 0% 0%'
+PASS computedStyle.getPropertyCSSValue('background').toString() is '[object CSSValueList]'
+PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(255, 0, 0) none repeat scroll 0% 0%'
+PASS computedStyle.getPropertyCSSValue('background').length is 5
+PASS computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 255
+PASS computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
+PASS computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
+PASS computedStyle.getPropertyCSSValue('background').item(1).getStringValue() is 'none'
+PASS computedStyle.getPropertyCSSValue('background').item(2).getStringValue() is 'repeat'
+PASS computedStyle.getPropertyCSSValue('background').item(3).getStringValue() is 'scroll'
+PASS computedStyle.getPropertyCSSValue('background').item(4).toString() is '[object CSSValueList]'
+PASS computedStyle.getPropertyCSSValue('background').item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 0
+PASS computedStyle.getPropertyCSSValue('background').item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 0
+PASS checkComputedStyleValue() is true
+PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) url(dummy://test.png) repeat scroll 0% 0%'
+PASS computedStyle.getPropertyCSSValue('background').toString() is '[object CSSValueList]'
+PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(255, 0, 0) url(dummy://test.png) repeat scroll 0% 0%'
+PASS computedStyle.getPropertyCSSValue('background').length is 5
+PASS computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 255
+PASS computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
+PASS computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
+PASS computedStyle.getPropertyCSSValue('background').item(1).getStringValue() is 'dummy://test.png'
+PASS computedStyle.getPropertyCSSValue('background').item(2).getStringValue() is 'repeat'
+PASS computedStyle.getPropertyCSSValue('background').item(3).getStringValue() is 'scroll'
+PASS computedStyle.getPropertyCSSValue('background').item(4).toString() is '[object CSSValueList]'
+PASS computedStyle.getPropertyCSSValue('background').item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 0
+PASS computedStyle.getPropertyCSSValue('background').item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 0
+PASS checkComputedStyleValue() is true
+PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat scroll 0% 0%'
+PASS computedStyle.getPropertyCSSValue('background').toString() is '[object CSSValueList]'
+PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat scroll 0% 0%'
+PASS computedStyle.getPropertyCSSValue('background').length is 5
+PASS computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 255
+PASS computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
+PASS computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
+PASS computedStyle.getPropertyCSSValue('background').item(1).getStringValue() is 'dummy://test.png'
+PASS computedStyle.getPropertyCSSValue('background').item(2).getStringValue() is 'no-repeat'
+PASS computedStyle.getPropertyCSSValue('background').item(3).getStringValue() is 'scroll'
+PASS computedStyle.getPropertyCSSValue('background').item(4).toString() is '[object CSSValueList]'
+PASS computedStyle.getPropertyCSSValue('background').item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 0
+PASS computedStyle.getPropertyCSSValue('background').item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 0
+PASS checkComputedStyleValue() is true
+PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 0% 0%'
+PASS computedStyle.getPropertyCSSValue('background').toString() is '[object CSSValueList]'
+PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 0% 0%'
+PASS computedStyle.getPropertyCSSValue('background').length is 5
+PASS computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 255
+PASS computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
+PASS computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
+PASS computedStyle.getPropertyCSSValue('background').item(1).getStringValue() is 'dummy://test.png'
+PASS computedStyle.getPropertyCSSValue('background').item(2).getStringValue() is 'no-repeat'
+PASS computedStyle.getPropertyCSSValue('background').item(3).getStringValue() is 'fixed'
+PASS computedStyle.getPropertyCSSValue('background').item(4).toString() is '[object CSSValueList]'
+PASS computedStyle.getPropertyCSSValue('background').item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 0
+PASS computedStyle.getPropertyCSSValue('background').item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 0
+PASS checkComputedStyleValue() is true
+PASS computedStyle.getPropertyValue('background') is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100%'
+PASS computedStyle.getPropertyCSSValue('background').toString() is '[object CSSValueList]'
+PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100%'
+PASS computedStyle.getPropertyCSSValue('background').length is 5
+PASS computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 255
+PASS computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
+PASS computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
+PASS computedStyle.getPropertyCSSValue('background').item(1).getStringValue() is 'dummy://test.png'
+PASS computedStyle.getPropertyCSSValue('background').item(2).getStringValue() is 'no-repeat'
+PASS computedStyle.getPropertyCSSValue('background').item(3).getStringValue() is 'fixed'
+PASS computedStyle.getPropertyCSSValue('background').item(4).toString() is '[object CSSValueList]'
+PASS computedStyle.getPropertyCSSValue('background').item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 100
+PASS computedStyle.getPropertyCSSValue('background').item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 100
+PASS checkComputedStyleValue() is true
+PASS computedStyle.getPropertyValue('background') is 'rgb(0, 128, 0) url(dummy://test.png) repeat fixed 45% 50%'
+PASS computedStyle.getPropertyCSSValue('background').toString() is '[object CSSValueList]'
+PASS computedStyle.getPropertyCSSValue('background').cssText is 'rgb(0, 128, 0) url(dummy://test.png) repeat fixed 45% 50%'
+PASS computedStyle.getPropertyCSSValue('background').length is 5
+PASS computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
+PASS computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 128
+PASS computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER) is 0
+PASS computedStyle.getPropertyCSSValue('background').item(1).getStringValue() is 'dummy://test.png'
+PASS computedStyle.getPropertyCSSValue('background').item(2).getStringValue() is 'repeat'
+PASS computedStyle.getPropertyCSSValue('background').item(3).getStringValue() is 'fixed'
+PASS computedStyle.getPropertyCSSValue('background').item(4).toString() is '[object CSSValueList]'
+PASS computedStyle.getPropertyCSSValue('background').item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 45
+PASS computedStyle.getPropertyCSSValue('background').item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE) is 50
+PASS checkComputedStyleValue() is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-background-shorthand.html (0 => 104169)
--- trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-background-shorthand.html (rev 0)
+++ trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-background-shorthand.html 2012-01-05 17:29:54 UTC (rev 104169)
@@ -0,0 +1,129 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<script src=""
+</head>
+<body>
+<script>
+
+description("Test to make sure background shorthand properties returns CSSValueList properly.")
+
+var testContainer = document.createElement("div");
+testContainer.contentEditable = true;
+document.body.appendChild(testContainer);
+
+testContainer.innerHTML = '<div id="test">hello</div>';
+
+e = document.getElementById('test');
+computedStyle = window.getComputedStyle(e, null);
+
+function checkComputedStyleValue() {
+ var before = window.getComputedStyle(e, null).getPropertyValue('background');
+ e.style.background = '';
+ e.style.background = ""
+ return (window.getComputedStyle(e, null).getPropertyValue('background') == before);
+}
+
+e.style.background = ""
+shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) none repeat scroll 0% 0%'");
+shouldBe("computedStyle.getPropertyCSSValue('background').toString()", "'[object CSSValueList]'");
+shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(255, 0, 0) none repeat scroll 0% 0%'");
+shouldBe("computedStyle.getPropertyCSSValue('background').length", "5");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "255");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(1).getStringValue()", "'none'");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(2).getStringValue()", "'repeat'");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(3).getStringValue()", "'scroll'");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(4).toString()", "'[object CSSValueList]'");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "0");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "0");
+shouldBe("checkComputedStyleValue()", "true");
+
+e.style.backgroundImage = "url(dummy://test.png)";
+shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) url(dummy://test.png) repeat scroll 0% 0%'");
+shouldBe("computedStyle.getPropertyCSSValue('background').toString()", "'[object CSSValueList]'");
+shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(255, 0, 0) url(dummy://test.png) repeat scroll 0% 0%'");
+shouldBe("computedStyle.getPropertyCSSValue('background').length", "5");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "255");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(1).getStringValue()", "'dummy://test.png'");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(2).getStringValue()", "'repeat'");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(3).getStringValue()", "'scroll'");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(4).toString()", "'[object CSSValueList]'");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "0");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "0");
+shouldBe("checkComputedStyleValue()", "true");
+
+e.style.backgroundRepeat = "no-repeat";
+shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat scroll 0% 0%'");
+shouldBe("computedStyle.getPropertyCSSValue('background').toString()", "'[object CSSValueList]'");
+shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat scroll 0% 0%'");
+shouldBe("computedStyle.getPropertyCSSValue('background').length", "5");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "255");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(1).getStringValue()", "'dummy://test.png'");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(2).getStringValue()", "'no-repeat'");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(3).getStringValue()", "'scroll'");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(4).toString()", "'[object CSSValueList]'");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "0");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "0");
+shouldBe("checkComputedStyleValue()", "true");
+
+e.style.backgroundAttachment = "fixed";
+shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 0% 0%'");
+shouldBe("computedStyle.getPropertyCSSValue('background').toString()", "'[object CSSValueList]'");
+shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 0% 0%'");
+shouldBe("computedStyle.getPropertyCSSValue('background').length", "5");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "255");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(1).getStringValue()", "'dummy://test.png'");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(2).getStringValue()", "'no-repeat'");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(3).getStringValue()", "'fixed'");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(4).toString()", "'[object CSSValueList]'");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "0");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "0");
+shouldBe("checkComputedStyleValue()", "true");
+
+e.style.backgroundPosition = "right bottom";
+shouldBe("computedStyle.getPropertyValue('background')", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100%'");
+shouldBe("computedStyle.getPropertyCSSValue('background').toString()", "'[object CSSValueList]'");
+shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(255, 0, 0) url(dummy://test.png) no-repeat fixed 100% 100%'");
+shouldBe("computedStyle.getPropertyCSSValue('background').length", "5");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "255");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(1).getStringValue()", "'dummy://test.png'");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(2).getStringValue()", "'no-repeat'");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(3).getStringValue()", "'fixed'");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(4).toString()", "'[object CSSValueList]'");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "100");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "100");
+shouldBe("checkComputedStyleValue()", "true");
+
+e.style.background = "" green 45% repeat fixed";
+shouldBe("computedStyle.getPropertyValue('background')", "'rgb(0, 128, 0) url(dummy://test.png) repeat fixed 45% 50%'");
+shouldBe("computedStyle.getPropertyCSSValue('background').toString()", "'[object CSSValueList]'");
+shouldBe("computedStyle.getPropertyCSSValue('background').cssText", "'rgb(0, 128, 0) url(dummy://test.png) repeat fixed 45% 50%'");
+shouldBe("computedStyle.getPropertyCSSValue('background').length", "5");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().red.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().green.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "128");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(0).getRGBColorValue().blue.getFloatValue(CSSPrimitiveValue.CSS_NUMBER)", "0");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(1).getStringValue()", "'dummy://test.png'");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(2).getStringValue()", "'repeat'");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(3).getStringValue()", "'fixed'");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(4).toString()", "'[object CSSValueList]'");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(4).item(0).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "45");
+shouldBe("computedStyle.getPropertyCSSValue('background').item(4).item(1).getFloatValue(CSSPrimitiveValue.CSS_PERCENTAGE)", "50");
+shouldBe("checkComputedStyleValue()", "true");
+
+document.body.removeChild(testContainer);
+
+</script>
+<script src=""
+</body>
+</html>