diff options
Diffstat (limited to 'LayoutTests/fast/dom/CSSStyleDeclaration')
15 files changed, 241 insertions, 0 deletions
diff --git a/LayoutTests/fast/dom/CSSStyleDeclaration/css-computed-style-item-expected.txt b/LayoutTests/fast/dom/CSSStyleDeclaration/css-computed-style-item-expected.txt new file mode 100644 index 0000000..b425aab --- /dev/null +++ b/LayoutTests/fast/dom/CSSStyleDeclaration/css-computed-style-item-expected.txt @@ -0,0 +1,12 @@ +This tests indexing outside the range of the computed style object. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS typeof computedStyle.length is "number" +PASS computedStyle[computedStyle.length] is "" +PASS computedStyle[-1] is undefined. +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/LayoutTests/fast/dom/CSSStyleDeclaration/css-computed-style-item.html b/LayoutTests/fast/dom/CSSStyleDeclaration/css-computed-style-item.html new file mode 100644 index 0000000..155c672 --- /dev/null +++ b/LayoutTests/fast/dom/CSSStyleDeclaration/css-computed-style-item.html @@ -0,0 +1,13 @@ +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> +<html> +<head> +<link rel="stylesheet" href="../../js/resources/js-test-style.css"> +<script src="../../js/resources/js-test-pre.js"></script> +</head> +<body> +<p id="description"></p> +<div id="console"></div> +<script src="script-tests/css-computed-style-item.js"></script> +<script src="../../js/resources/js-test-post.js"></script> +</body> +</html> diff --git a/LayoutTests/fast/dom/CSSStyleDeclaration/css-properties-case-sensitive-expected.txt b/LayoutTests/fast/dom/CSSStyleDeclaration/css-properties-case-sensitive-expected.txt new file mode 100644 index 0000000..a56522b --- /dev/null +++ b/LayoutTests/fast/dom/CSSStyleDeclaration/css-properties-case-sensitive-expected.txt @@ -0,0 +1,34 @@ +This test checks that access to CSS properties via JavaScript properties on DOM elements is case sensitive. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +normal cases + +PASS element.style.zIndex is '1' +PASS element.style.ZIndex is undefined. + +"css" prefix + +PASS element.style.cssZIndex is '1' +PASS element.style.CssZIndex is '1' +PASS element.style.CsszIndex is undefined. +PASS element.style.csszIndex is undefined. + +"pixel" prefix + +PASS element.style.pixelZIndex is 1 +PASS element.style.PixelZIndex is 1 +PASS element.style.pixelzIndex is undefined. +PASS element.style.PixelzIndex is undefined. + +"pos" prefix + +PASS element.style.posZIndex is 1 +PASS element.style.PosZIndex is 1 +PASS element.style.poszIndex is undefined. +PASS element.style.PoszIndex is undefined. +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/LayoutTests/fast/dom/CSSStyleDeclaration/css-properties-case-sensitive.html b/LayoutTests/fast/dom/CSSStyleDeclaration/css-properties-case-sensitive.html new file mode 100644 index 0000000..9a17597 --- /dev/null +++ b/LayoutTests/fast/dom/CSSStyleDeclaration/css-properties-case-sensitive.html @@ -0,0 +1,13 @@ +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> +<html> +<head> +<link rel="stylesheet" href="../../js/resources/js-test-style.css"> +<script src="../../js/resources/js-test-pre.js"></script> +</head> +<body> +<p id="description"></p> +<div id="console"></div> +<script src="script-tests/css-properties-case-sensitive.js"></script> +<script src="../../js/resources/js-test-post.js"></script> +</body> +</html> diff --git a/LayoutTests/fast/dom/CSSStyleDeclaration/css-style-item-expected.txt b/LayoutTests/fast/dom/CSSStyleDeclaration/css-style-item-expected.txt new file mode 100644 index 0000000..5b57e49 --- /dev/null +++ b/LayoutTests/fast/dom/CSSStyleDeclaration/css-style-item-expected.txt @@ -0,0 +1,13 @@ +This tests indexing outside the range of the style object. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS style.length is 1 +PASS style[0] is "color" +PASS style[1] is "" +PASS style[-1] is undefined. +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/LayoutTests/fast/dom/CSSStyleDeclaration/css-style-item.html b/LayoutTests/fast/dom/CSSStyleDeclaration/css-style-item.html new file mode 100644 index 0000000..b0858cc --- /dev/null +++ b/LayoutTests/fast/dom/CSSStyleDeclaration/css-style-item.html @@ -0,0 +1,13 @@ +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> +<html> +<head> +<link rel="stylesheet" href="../../js/resources/js-test-style.css"> +<script src="../../js/resources/js-test-pre.js"></script> +</head> +<body> +<p id="description"></p> +<div id="console"></div> +<script src="script-tests/css-style-item.js"></script> +<script src="../../js/resources/js-test-post.js"></script> +</body> +</html> diff --git a/LayoutTests/fast/dom/CSSStyleDeclaration/empty-string-property-expected.txt b/LayoutTests/fast/dom/CSSStyleDeclaration/empty-string-property-expected.txt new file mode 100644 index 0000000..f5c31f9 --- /dev/null +++ b/LayoutTests/fast/dom/CSSStyleDeclaration/empty-string-property-expected.txt @@ -0,0 +1,5 @@ +Regression test for http://bugs.webkit.org/show_bug.cgi?id=15169 Freeze on Google maps using the "Dig a hole" tool. + +This tests that the empty string property of a CSSStyleDeclaration is undefined and that retrieving it does not cause a hang. + +PASS diff --git a/LayoutTests/fast/dom/CSSStyleDeclaration/empty-string-property.html b/LayoutTests/fast/dom/CSSStyleDeclaration/empty-string-property.html new file mode 100644 index 0000000..5f28965 --- /dev/null +++ b/LayoutTests/fast/dom/CSSStyleDeclaration/empty-string-property.html @@ -0,0 +1,18 @@ +<body> + <p> + Regression test for <i><a href="http://bugs.webkit.org/show_bug.cgi?id=15169">http://bugs.webkit.org/show_bug.cgi?id=15169</a> + Freeze on Google maps using the "Dig a hole" tool</i>. + </p> + <p> + This tests that the empty string property of a CSSStyleDeclaration is + undefined and that retrieving it does not cause a hang. + </p> + <p id="result">FAIL (timed out or did not finish)</p> + <script> + if (window.layoutTestController) + layoutTestController.dumpAsText(); + + var type = typeof document.body.style['']; + document.getElementById("result").innerText = type == "undefined" ? "PASS" : "FAIL (typeof document.body.style[''] is " + type + ")"; + </script> +</body> diff --git a/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/TEMPLATE.html b/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/TEMPLATE.html new file mode 100644 index 0000000..1951c43 --- /dev/null +++ b/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/TEMPLATE.html @@ -0,0 +1,13 @@ +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> +<html> +<head> +<link rel="stylesheet" href="../../js/resources/js-test-style.css"> +<script src="../../js/resources/js-test-pre.js"></script> +</head> +<body> +<p id="description"></p> +<div id="console"></div> +<script src="YOUR_JS_FILE_HERE"></script> +<script src="../../js/resources/js-test-post.js"></script> +</body> +</html> diff --git a/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/css-computed-style-item.js b/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/css-computed-style-item.js new file mode 100644 index 0000000..8522f65 --- /dev/null +++ b/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/css-computed-style-item.js @@ -0,0 +1,14 @@ +description("This tests indexing outside the range of the computed style object."); + +var element = document.createElement('div'); +element.style.color = 'rgb(120, 120, 120)'; +document.documentElement.appendChild(element); +var computedStyle = window.getComputedStyle(element, null); + +shouldBeEqualToString('typeof computedStyle.length', 'number'); +shouldBeEqualToString('computedStyle[computedStyle.length]', ''); +shouldBeUndefined('computedStyle[-1]') + +document.documentElement.removeChild(element); + +successfullyParsed = true; diff --git a/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/css-properties-case-sensitive.js b/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/css-properties-case-sensitive.js new file mode 100644 index 0000000..15949a2 --- /dev/null +++ b/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/css-properties-case-sensitive.js @@ -0,0 +1,41 @@ +description( +'This test checks that access to CSS properties via JavaScript properties on DOM elements is case sensitive.' +); + +var element = document.createElement('a'); +element.style.zIndex = 1; + +debug('normal cases'); +debug(''); + +shouldBe("element.style.zIndex", "'1'"); +shouldBeUndefined("element.style.ZIndex"); + +debug(''); +debug('"css" prefix'); +debug(''); + +shouldBe("element.style.cssZIndex", "'1'"); +shouldBe("element.style.CssZIndex", "'1'"); +shouldBeUndefined("element.style.CsszIndex"); +shouldBeUndefined("element.style.csszIndex"); + +debug(''); +debug('"pixel" prefix'); +debug(''); + +shouldBe("element.style.pixelZIndex", "1"); +shouldBe("element.style.PixelZIndex", "1"); +shouldBeUndefined("element.style.pixelzIndex"); +shouldBeUndefined("element.style.PixelzIndex"); + +debug(''); +debug('"pos" prefix'); +debug(''); + +shouldBe("element.style.posZIndex", "1"); +shouldBe("element.style.PosZIndex", "1"); +shouldBeUndefined("element.style.poszIndex"); +shouldBeUndefined("element.style.PoszIndex"); + +var successfullyParsed = true; diff --git a/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/css-style-item.js b/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/css-style-item.js new file mode 100644 index 0000000..ad85fb9 --- /dev/null +++ b/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/css-style-item.js @@ -0,0 +1,15 @@ +description("This tests indexing outside the range of the style object."); + +var element = document.createElement('div'); +element.style.color = 'red'; +document.documentElement.appendChild(element); +var style = element.style; + +shouldEvaluateTo('style.length', 1); +shouldBeEqualToString('style[0]', 'color'); +shouldBeEqualToString('style[1]', ''); +shouldBeUndefined('style[-1]') + +document.documentElement.removeChild(element); + +successfullyParsed = true; diff --git a/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/transition-property-names.js b/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/transition-property-names.js new file mode 100644 index 0000000..4fbfc43 --- /dev/null +++ b/LayoutTests/fast/dom/CSSStyleDeclaration/script-tests/transition-property-names.js @@ -0,0 +1,13 @@ +description( +'This test checks that CSS property names work round trip in the transition property.' +); + +var element = document.createElement('a'); + +element.style.webkitTransitionProperty = "height"; +shouldBe("element.style.webkitTransitionProperty", "'height'"); + +element.style.webkitTransitionProperty = "opacity"; +shouldBe("element.style.webkitTransitionProperty", "'opacity'"); + +var successfullyParsed = true; diff --git a/LayoutTests/fast/dom/CSSStyleDeclaration/transition-property-names-expected.txt b/LayoutTests/fast/dom/CSSStyleDeclaration/transition-property-names-expected.txt new file mode 100644 index 0000000..fe7940f --- /dev/null +++ b/LayoutTests/fast/dom/CSSStyleDeclaration/transition-property-names-expected.txt @@ -0,0 +1,11 @@ +This test checks that CSS property names work round trip in the transition property. + +On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". + + +PASS element.style.webkitTransitionProperty is 'height' +PASS element.style.webkitTransitionProperty is 'opacity' +PASS successfullyParsed is true + +TEST COMPLETE + diff --git a/LayoutTests/fast/dom/CSSStyleDeclaration/transition-property-names.html b/LayoutTests/fast/dom/CSSStyleDeclaration/transition-property-names.html new file mode 100644 index 0000000..55f87e0 --- /dev/null +++ b/LayoutTests/fast/dom/CSSStyleDeclaration/transition-property-names.html @@ -0,0 +1,13 @@ +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> +<html> +<head> +<link rel="stylesheet" href="../../js/resources/js-test-style.css"> +<script src="../../js/resources/js-test-pre.js"></script> +</head> +<body> +<p id="description"></p> +<div id="console"></div> +<script src="script-tests/transition-property-names.js"></script> +<script src="../../js/resources/js-test-post.js"></script> +</body> +</html> |