summaryrefslogtreecommitdiffstats
path: root/dom/tests/mochitest/bugs/test_bug529328.html
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /dom/tests/mochitest/bugs/test_bug529328.html
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/tests/mochitest/bugs/test_bug529328.html')
-rw-r--r--dom/tests/mochitest/bugs/test_bug529328.html122
1 files changed, 122 insertions, 0 deletions
diff --git a/dom/tests/mochitest/bugs/test_bug529328.html b/dom/tests/mochitest/bugs/test_bug529328.html
new file mode 100644
index 000000000..81eb62e81
--- /dev/null
+++ b/dom/tests/mochitest/bugs/test_bug529328.html
@@ -0,0 +1,122 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=529328
+-->
+<head>
+ <title>Test for Bug 529328</title>
+ <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+ <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=529328">Mozilla Bug 529328</a>
+<p id="display"></p>
+<div id="content" style="display: none">
+</div>
+<pre id="test">
+<script type="application/javascript">
+/** Test for Bug 529328 **/
+function testDOMTokenList() {
+ is(document.body.classList[-1], undefined, "Wrong value for out of bounds access (DOMTokenList)");
+ is(document.body.classList[0], undefined, "Wrong value for out of bounds access (DOMTokenList)");
+ is(document.body.classList[1], undefined, "Wrong value for out of bounds access (DOMTokenList)");
+ is(document.body.classList[2], undefined, "Wrong value for out of bounds access (DOMTokenList)");
+ is(document.body.classList.item(-1), null, "Wrong value for out of bounds access (DOMTokenList)");
+ is(document.body.classList.item(0), null, "Wrong value for out of bounds access (DOMTokenList)");
+ is(document.body.classList.item(1), null, "Wrong value for out of bounds access (DOMTokenList)");
+ is(document.body.classList.item(2), null, "Wrong value for out of bounds access (DOMTokenList)");
+
+ document.body.className = "a b";
+ is(document.body.classList[-1], undefined, "Wrong value for out of bounds access (DOMTokenList)");
+ is(document.body.classList[0], "a", "Wrong value for in bounds access (DOMTokenList)");
+ is(document.body.classList[1], "b", "Wrong value for in bounds access (DOMTokenList)");
+ is(document.body.classList[2], undefined, "Wrong value for out of bounds access (DOMTokenList)");
+ is(document.body.classList.item(-1), null, "Wrong value for out of bounds access (DOMTokenList)");
+ is(document.body.classList.item(0), "a", "Wrong value for in bounds access (DOMTokenList)");
+ is(document.body.classList.item(1), "b", "Wrong value for in bounds access (DOMTokenList)");
+ is(document.body.classList.item(2), null, "Wrong value for out of bounds access (DOMTokenList)");
+}
+
+function testDOMStringList() {
+ is(document.styleSheetSets[-1], undefined, "Wrong value for out of bounds access (DOMStringList)");
+ is(document.styleSheetSets[0], undefined, "Wrong value for out of bounds access (DOMStringList)");
+ is(document.styleSheetSets[1], undefined, "Wrong value for out of bounds access (DOMStringList)");
+ is(document.styleSheetSets[2], undefined, "Wrong value for out of bounds access (DOMStringList)");
+ is(document.styleSheetSets.item(-1), null, "Wrong value for out of bounds access (DOMStringList)");
+ is(document.styleSheetSets.item(0), null, "Wrong value for out of bounds access (DOMStringList)");
+ is(document.styleSheetSets.item(1), null, "Wrong value for out of bounds access (DOMStringList)");
+ is(document.styleSheetSets.item(2), null, "Wrong value for out of bounds access (DOMStringList)");
+
+ var s = document.createElement("style");
+ s.title = "a";
+ document.head.appendChild(s);
+ s = document.createElement("style");
+ s.title = "b";
+ document.head.appendChild(s);
+
+ is(document.styleSheetSets[-1], undefined, "Wrong value for out of bounds access (DOMStringList)");
+ is(document.styleSheetSets[0], "a", "Wrong value for in bounds access (DOMStringList)");
+ is(document.styleSheetSets[1], "b", "Wrong value for in bounds access (DOMStringList)");
+ is(document.styleSheetSets[2], undefined, "Wrong value for out of bounds access (DOMStringList)");
+ is(document.styleSheetSets.item(-1), null, "Wrong value for out of bounds access (DOMStringList)");
+ is(document.styleSheetSets.item(0), "a", "Wrong value for in bounds access (DOMStringList)");
+ is(document.styleSheetSets.item(1), "b", "Wrong value for in bounds access (DOMStringList)");
+ is(document.styleSheetSets.item(2), null, "Wrong value for out of bounds access (DOMStringList)");
+}
+
+function testMediaList() {
+ var s = document.createElement("style");
+ document.head.appendChild(s);
+ is(s.sheet.media[-1], undefined, "Wrong value for out of bounds access (MediaList)");
+ is(s.sheet.media[0], undefined, "Wrong value for out of bounds access (MediaList)");
+ is(s.sheet.media[1], undefined, "Wrong value for out of bounds access (MediaList)");
+ is(s.sheet.media[2], undefined, "Wrong value for out of bounds access (MediaList) (MediaList)");
+ is(s.sheet.media.item(-1), null, "Wrong value for out of bounds access (MediaList)");
+ is(s.sheet.media.item(0), null, "Wrong value for out of bounds access (MediaList)");
+ is(s.sheet.media.item(1), null, "Wrong value for out of bounds access (MediaList)");
+ is(s.sheet.media.item(2), null, "Wrong value for out of bounds access (MediaList) (MediaList)");
+
+ s.setAttribute("media", "a, b");
+
+ is(s.sheet.media[-1], undefined, "Wrong value for out of bounds access (MediaList)");
+ is(s.sheet.media[0], "a", "Wrong value for in bounds access (MediaList)");
+ is(s.sheet.media[1], "b", "Wrong value for in bounds access (MediaList)");
+ is(s.sheet.media[2], undefined, "Wrong value for out of bounds access (MediaList) (MediaList)");
+ is(s.sheet.media.item(-1), null, "Wrong value for out of bounds access (MediaList)");
+ is(s.sheet.media.item(0), "a", "Wrong value for in bounds access (MediaList)");
+ is(s.sheet.media.item(1), "b", "Wrong value for in bounds access (MediaList)");
+ is(s.sheet.media.item(2), null, "Wrong value for out of bounds access (MediaList) (MediaList)");
+}
+
+function testCSSStyleDeclaration() {
+ var s = document.createElement("span");
+
+ is(s.style[-1], undefined, "Wrong value for out of bounds access (CSSStyleDeclaration)");
+ is(s.style[0], undefined, "Wrong value for out of bounds access (CSSStyleDeclaration)");
+ is(s.style[1], undefined, "Wrong value for out of bounds access (CSSStyleDeclaration)");
+ is(s.style[2], undefined, "Wrong value for out of bounds access (CSSStyleDeclaration)");
+ is(s.style.item(-1), "", "Wrong value for out of bounds access (CSSStyleDeclaration)");
+ is(s.style.item(0), "", "Wrong value for out of bounds access (CSSStyleDeclaration)");
+ is(s.style.item(1), "", "Wrong value for out of bounds access (CSSStyleDeclaration)");
+ is(s.style.item(2), "", "Wrong value for out of bounds access (CSSStyleDeclaration)");
+
+ s.setAttribute("style", "color: blue; z-index: 42;");
+
+ is(s.style[-1], undefined, "Wrong value for out of bounds access (CSSStyleDeclaration)");
+ is(s.style[0], "color", "Wrong value for in bounds access (CSSStyleDeclaration)");
+ is(s.style[1], "z-index", "Wrong value for in bounds access (CSSStyleDeclaration)");
+ is(s.style[2], undefined, "Wrong value for out of bounds access (CSSStyleDeclaration)");
+ is(s.style.item(-1), "", "Wrong value for out of bounds access (CSSStyleDeclaration)");
+ is(s.style.item(0), "color", "Wrong value for in bounds access (CSSStyleDeclaration)");
+ is(s.style.item(1), "z-index", "Wrong value for in bounds access (CSSStyleDeclaration)");
+ is(s.style.item(2), "", "Wrong value for out of bounds access (CSSStyleDeclaration)");
+}
+
+testDOMTokenList();
+testDOMStringList();
+testMediaList();
+testCSSStyleDeclaration();
+</script>
+</pre>
+</body>
+</html>