summaryrefslogtreecommitdiffstats
path: root/dom/tests/reftest
diff options
context:
space:
mode:
Diffstat (limited to 'dom/tests/reftest')
-rw-r--r--dom/tests/reftest/bug1389406-01.xsl15
-rw-r--r--dom/tests/reftest/bug1389406-02.xsl15
-rw-r--r--dom/tests/reftest/bug1389406-ref.xml2
-rw-r--r--dom/tests/reftest/bug1389406.xml3
-rw-r--r--dom/tests/reftest/bug427779-ref.xml3
-rw-r--r--dom/tests/reftest/bug427779.xml4
-rw-r--r--dom/tests/reftest/bug439965-ref.html20
-rw-r--r--dom/tests/reftest/bug439965.html21
-rw-r--r--dom/tests/reftest/bug453105-ref.html7
-rw-r--r--dom/tests/reftest/bug453105.html9
-rw-r--r--dom/tests/reftest/bug456008-ref.html10
-rw-r--r--dom/tests/reftest/bug456008.xhtml11
-rw-r--r--dom/tests/reftest/bug559996-iframe.html7
-rw-r--r--dom/tests/reftest/bug559996-ref-iframe.html8
-rw-r--r--dom/tests/reftest/bug559996-ref.html16
-rw-r--r--dom/tests/reftest/bug559996.html16
-rw-r--r--dom/tests/reftest/bug591981-1.html32
-rw-r--r--dom/tests/reftest/bug591981-2.html32
-rw-r--r--dom/tests/reftest/bug591981-ref.html9
-rw-r--r--dom/tests/reftest/bug591981-script.js1
-rw-r--r--dom/tests/reftest/bug592366-1.html7
-rw-r--r--dom/tests/reftest/bug592366-1.xhtml6
-rw-r--r--dom/tests/reftest/bug592366-2.html7
-rw-r--r--dom/tests/reftest/bug592366-2.xhtml6
-rw-r--r--dom/tests/reftest/bug592366-ref.html9
-rw-r--r--dom/tests/reftest/bug592366-ref.xhtml9
-rw-r--r--dom/tests/reftest/bug798068-ref.xhtml18
-rw-r--r--dom/tests/reftest/bug798068.xhtml19
-rw-r--r--dom/tests/reftest/child592366-1.html19
-rw-r--r--dom/tests/reftest/child592366-1.xhtml18
-rw-r--r--dom/tests/reftest/child592366-2.html17
-rw-r--r--dom/tests/reftest/child592366-2.xhtml16
-rw-r--r--dom/tests/reftest/optiontext-ref.html8
-rw-r--r--dom/tests/reftest/optiontext.html8
-rw-r--r--dom/tests/reftest/reftest.list14
-rw-r--r--dom/tests/reftest/script592366-2.js2
-rw-r--r--dom/tests/reftest/xml-stylesheet/css_relative_href.xml2
-rw-r--r--dom/tests/reftest/xml-stylesheet/css_relative_href_also_external.xml2
-rw-r--r--dom/tests/reftest/xml-stylesheet/css_relative_href_also_external.xml^headers^1
-rw-r--r--dom/tests/reftest/xml-stylesheet/css_relative_href_also_external_override.xml2
-rw-r--r--dom/tests/reftest/xml-stylesheet/css_relative_href_also_external_override.xml^headers^1
-rw-r--r--dom/tests/reftest/xml-stylesheet/embedded_dtd_id.svg20
-rw-r--r--dom/tests/reftest/xml-stylesheet/error_no_href.svg8
-rw-r--r--dom/tests/reftest/xml-stylesheet/fail.svg4
-rw-r--r--dom/tests/reftest/xml-stylesheet/failer.css1
-rw-r--r--dom/tests/reftest/xml-stylesheet/lreas_selflink_dtd_id.svg9
-rw-r--r--dom/tests/reftest/xml-stylesheet/lreas_selflink_empty_href.svg8
-rw-r--r--dom/tests/reftest/xml-stylesheet/lreas_selflink_relative_href.svg9
-rw-r--r--dom/tests/reftest/xml-stylesheet/pass.svg4
-rw-r--r--dom/tests/reftest/xml-stylesheet/passer.css1
-rw-r--r--dom/tests/reftest/xml-stylesheet/passer_override.css1
-rw-r--r--dom/tests/reftest/xml-stylesheet/reftest.list12
-rw-r--r--dom/tests/reftest/xml-stylesheet/svg_passer.xslt11
-rw-r--r--dom/tests/reftest/xml-stylesheet/xslt_relative_href.svg4
-rw-r--r--dom/tests/reftest/xml-stylesheet/xslt_selflink_dtd_id.xml11
-rw-r--r--dom/tests/reftest/xml-stylesheet/xslt_selflink_empty_href.xml10
-rw-r--r--dom/tests/reftest/xml-stylesheet/xslt_selflink_relative_href.xml11
57 files changed, 556 insertions, 0 deletions
diff --git a/dom/tests/reftest/bug1389406-01.xsl b/dom/tests/reftest/bug1389406-01.xsl
new file mode 100644
index 0000000000..856a6a711e
--- /dev/null
+++ b/dom/tests/reftest/bug1389406-01.xsl
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.1"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+>
+
+<xsl:import href="bug1389406-02.xsl"/>
+
+<xsl:template mode="title" match="*">
+ <xsl:value-of select="."/>
+ <xsl:apply-imports />
+</xsl:template>
+
+<xsl:template match="text()|@*"></xsl:template>
+
+</xsl:stylesheet>
diff --git a/dom/tests/reftest/bug1389406-02.xsl b/dom/tests/reftest/bug1389406-02.xsl
new file mode 100644
index 0000000000..60ab6936fa
--- /dev/null
+++ b/dom/tests/reftest/bug1389406-02.xsl
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+>
+
+<xsl:template mode="title" match="*">
+ <xsl:text> — TEST CASE</xsl:text>
+ <xsl:apply-imports/>
+</xsl:template>
+
+<xsl:template match="/">
+ <h3 xmlns="http://www.w3.org/1999/xhtml"><xsl:apply-templates select="title" mode="title"/></h3>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/dom/tests/reftest/bug1389406-ref.xml b/dom/tests/reftest/bug1389406-ref.xml
new file mode 100644
index 0000000000..8bfccb9c11
--- /dev/null
+++ b/dom/tests/reftest/bug1389406-ref.xml
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<h3 xmlns="http://www.w3.org/1999/xhtml">Firefox bug — TEST CASEFirefox bug</h3>
diff --git a/dom/tests/reftest/bug1389406.xml b/dom/tests/reftest/bug1389406.xml
new file mode 100644
index 0000000000..58b00a56ac
--- /dev/null
+++ b/dom/tests/reftest/bug1389406.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="bug1389406-01.xsl"?>
+<title>Firefox bug</title>
diff --git a/dom/tests/reftest/bug427779-ref.xml b/dom/tests/reftest/bug427779-ref.xml
new file mode 100644
index 0000000000..b3631c0d14
--- /dev/null
+++ b/dom/tests/reftest/bug427779-ref.xml
@@ -0,0 +1,3 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<body>This is a test</body>
+</html>
diff --git a/dom/tests/reftest/bug427779.xml b/dom/tests/reftest/bug427779.xml
new file mode 100644
index 0000000000..59e7a36ebf
--- /dev/null
+++ b/dom/tests/reftest/bug427779.xml
@@ -0,0 +1,4 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head><base href="." /></head>
+<body>This is a test</body>
+</html>
diff --git a/dom/tests/reftest/bug439965-ref.html b/dom/tests/reftest/bug439965-ref.html
new file mode 100644
index 0000000000..c3465c3911
--- /dev/null
+++ b/dom/tests/reftest/bug439965-ref.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script>
+function doe(aEl) {
+var doc = aEl.contentDocument;
+doc.designMode = 'on';
+
+try {
+doc.execCommand("insertHTML",false,'some text');
+} catch(e) {
+ document.getElementById('result').innerHTML = e;
+}
+}
+</script>
+
+<iframe onload="doe(this)"></iframe><br>
+<pre id="result" style="background-color: red; width: 300px; white-space: -moz-pre-wrap;"></pre>
+</body>
+</html>
diff --git a/dom/tests/reftest/bug439965.html b/dom/tests/reftest/bug439965.html
new file mode 100644
index 0000000000..da3f90ebe2
--- /dev/null
+++ b/dom/tests/reftest/bug439965.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script>
+function doe(aEl) {
+aEl.style.display = '';
+var doc = aEl.contentDocument;
+doc.designMode = 'on';
+
+try {
+doc.execCommand("insertHTML",false,'some text');
+} catch(e) {
+ document.getElementById('result').innerHTML = e;
+}
+}
+</script>
+
+<iframe onload="doe(this)" style="display:none"></iframe><br>
+<pre id="result" style="background-color: red; width: 300px; white-space: -moz-pre-wrap;"></pre>
+</body>
+</html>
diff --git a/dom/tests/reftest/bug453105-ref.html b/dom/tests/reftest/bug453105-ref.html
new file mode 100644
index 0000000000..cc10953858
--- /dev/null
+++ b/dom/tests/reftest/bug453105-ref.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<body>
+<form name="f">
+<select name="s">
+</select>
+</form>
+</body>
diff --git a/dom/tests/reftest/bug453105.html b/dom/tests/reftest/bug453105.html
new file mode 100644
index 0000000000..0ace6d5a0d
--- /dev/null
+++ b/dom/tests/reftest/bug453105.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<body onload="document.forms.f.s.options.length = 0;">
+<form name="f">
+<select name="s">
+<option name="o1">option 1</option>
+<option name="o2">option 2</option>
+</select>
+</form>
+</body>
diff --git a/dom/tests/reftest/bug456008-ref.html b/dom/tests/reftest/bug456008-ref.html
new file mode 100644
index 0000000000..e605de5314
--- /dev/null
+++ b/dom/tests/reftest/bug456008-ref.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <div id="target"></div>
+ <script>
+ document.getElementById("target").innerHTML =
+ "<object type='text/html' data='data:text/html,&lt;body bgcolor=&quot;green&quot;&gt;' width='300' height='200'></object>";
+ </script>
+ </body>
+</html>
diff --git a/dom/tests/reftest/bug456008.xhtml b/dom/tests/reftest/bug456008.xhtml
new file mode 100644
index 0000000000..43027343cb
--- /dev/null
+++ b/dom/tests/reftest/bug456008.xhtml
@@ -0,0 +1,11 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <body>
+ <div id="target"></div>
+ <script>
+ <![CDATA[
+ document.getElementById("target").innerHTML =
+ "<object type='text/html' data='data:text/html,&lt;body bgcolor=&quot;green&quot;&gt;' width='300' height='200'></object>";
+ ]]>
+ </script>
+ </body>
+</html>
diff --git a/dom/tests/reftest/bug559996-iframe.html b/dom/tests/reftest/bug559996-iframe.html
new file mode 100644
index 0000000000..b576d1d223
--- /dev/null
+++ b/dom/tests/reftest/bug559996-iframe.html
@@ -0,0 +1,7 @@
+<html>
+<!-- This page is loaded in a 200px-square iframe scrolled to #down. -->
+<body>
+<div id="first" style="height: 150px; background: lightblue;">first</div>
+<div id="down" style="height: 250px; background: lightgreen;">second</div>
+</body>
+</html>
diff --git a/dom/tests/reftest/bug559996-ref-iframe.html b/dom/tests/reftest/bug559996-ref-iframe.html
new file mode 100644
index 0000000000..2b13b8b343
--- /dev/null
+++ b/dom/tests/reftest/bug559996-ref-iframe.html
@@ -0,0 +1,8 @@
+<html>
+<!-- This page is loaded in a 200px-square iframe scrolled to #down. -->
+<body>
+<div id="first" style="height: 150px; background: lightblue;">first</div>
+<div id="down" style="height: 250px; background: lightgreen;">second</div>
+<script>document.documentElement.offsetWidth;</script>
+</body>
+</html>
diff --git a/dom/tests/reftest/bug559996-ref.html b/dom/tests/reftest/bug559996-ref.html
new file mode 100644
index 0000000000..f7124e8698
--- /dev/null
+++ b/dom/tests/reftest/bug559996-ref.html
@@ -0,0 +1,16 @@
+<html class="reftest-wait">
+<body>
+
+<iframe src="bug559996-ref-iframe.html#down" style="height: 200px; width: 200px"></iframe>
+<script>
+function endTest() {
+ document.documentElement.removeAttribute("class");
+}
+function waitForInactivity() {
+ setTimeout(endTest, 1000);
+}
+document.addEventListener("MozReftestInvalidate", waitForInactivity);
+</script>
+
+</body>
+</html>
diff --git a/dom/tests/reftest/bug559996.html b/dom/tests/reftest/bug559996.html
new file mode 100644
index 0000000000..1ade11db22
--- /dev/null
+++ b/dom/tests/reftest/bug559996.html
@@ -0,0 +1,16 @@
+<html class="reftest-wait">
+<body>
+
+<iframe src="bug559996-iframe.html#down" style="height: 200px; width: 200px"></iframe>
+<script>
+function endTest() {
+ document.documentElement.removeAttribute("class");
+}
+function waitForInactivity() {
+ setTimeout(endTest, 1000);
+}
+document.addEventListener("MozReftestInvalidate", waitForInactivity);
+</script>
+
+</body>
+</html>
diff --git a/dom/tests/reftest/bug591981-1.html b/dom/tests/reftest/bug591981-1.html
new file mode 100644
index 0000000000..5c48ca8123
--- /dev/null
+++ b/dom/tests/reftest/bug591981-1.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Script-inserted script</title>
+</head>
+<body>
+<div></div>
+<script>
+function log(text) {
+ var p = document.createElement("p");
+ p.appendChild(document.createTextNode(text));
+ document.getElementsByTagName("div")[0].appendChild(p);
+}
+
+var head = document.getElementsByTagName("head")[0];
+
+var external = document.createElement("script");
+external.src = "bug591981-script.js";
+head.insertBefore(external, head.firstChild); // what jQuery does
+
+var internal = document.createElement("script");
+var data = "log('internal')";
+try {
+ internal.text = data;
+} catch(e) {
+ internal.appendChild(document.createTextNode(data));
+}
+head.insertBefore(internal, head.firstChild); // what jQuery does
+
+</script>
+</body>
+</html>
diff --git a/dom/tests/reftest/bug591981-2.html b/dom/tests/reftest/bug591981-2.html
new file mode 100644
index 0000000000..7d05d5179a
--- /dev/null
+++ b/dom/tests/reftest/bug591981-2.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Script trying to execute parser-inserted non-executed scripts</title>
+</head>
+<body>
+<div></div>
+<script></script>
+<script></script>
+<script>
+function log(text) {
+ var p = document.createElement("p");
+ p.appendChild(document.createTextNode(text));
+ document.getElementsByTagName("div")[0].appendChild(p);
+}
+
+var head = document.getElementsByTagName("head")[0];
+
+var external = document.getElementsByTagName("script")[0];
+external.src = "bug591981-script.js";
+
+var internal = document.getElementsByTagName("script")[1];
+var data = "log('internal')";
+try {
+ internal.text = data;
+} catch(e) {
+ internal.appendChild(document.createTextNode(data));
+}
+
+</script>
+</body>
+</html>
diff --git a/dom/tests/reftest/bug591981-ref.html b/dom/tests/reftest/bug591981-ref.html
new file mode 100644
index 0000000000..8a19a40b9d
--- /dev/null
+++ b/dom/tests/reftest/bug591981-ref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Script-inserted script</title>
+</head>
+<body>
+<div><p>internal</p><p>external</p></div>
+</body>
+</html>
diff --git a/dom/tests/reftest/bug591981-script.js b/dom/tests/reftest/bug591981-script.js
new file mode 100644
index 0000000000..818596af3c
--- /dev/null
+++ b/dom/tests/reftest/bug591981-script.js
@@ -0,0 +1 @@
+log("external");
diff --git a/dom/tests/reftest/bug592366-1.html b/dom/tests/reftest/bug592366-1.html
new file mode 100644
index 0000000000..42e2971542
--- /dev/null
+++ b/dom/tests/reftest/bug592366-1.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html><head>
+<title>Move node during parse</title>
+</head>
+<body>
+<iframe src=child592366-1.html></iframe>After iframe
+</body></html>
diff --git a/dom/tests/reftest/bug592366-1.xhtml b/dom/tests/reftest/bug592366-1.xhtml
new file mode 100644
index 0000000000..7f9f57b273
--- /dev/null
+++ b/dom/tests/reftest/bug592366-1.xhtml
@@ -0,0 +1,6 @@
+<html xmlns="http://www.w3.org/1999/xhtml"><head>
+<title>Move node during parse</title>
+</head>
+<body>
+<iframe src="child592366-1.xhtml"></iframe>After iframe
+</body></html>
diff --git a/dom/tests/reftest/bug592366-2.html b/dom/tests/reftest/bug592366-2.html
new file mode 100644
index 0000000000..42e2971542
--- /dev/null
+++ b/dom/tests/reftest/bug592366-2.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html><head>
+<title>Move node during parse</title>
+</head>
+<body>
+<iframe src=child592366-1.html></iframe>After iframe
+</body></html>
diff --git a/dom/tests/reftest/bug592366-2.xhtml b/dom/tests/reftest/bug592366-2.xhtml
new file mode 100644
index 0000000000..db08a195a0
--- /dev/null
+++ b/dom/tests/reftest/bug592366-2.xhtml
@@ -0,0 +1,6 @@
+<html xmlns="http://www.w3.org/1999/xhtml"><head>
+<title>Move node during parse</title>
+</head>
+<body>
+<iframe src="child592366-1.html"></iframe>After iframe
+</body></html>
diff --git a/dom/tests/reftest/bug592366-ref.html b/dom/tests/reftest/bug592366-ref.html
new file mode 100644
index 0000000000..7e1ee242c4
--- /dev/null
+++ b/dom/tests/reftest/bug592366-ref.html
@@ -0,0 +1,9 @@
+<html><head>
+<title>Move node during parse</title>
+</head>
+<body>
+<iframe></iframe>After iframe
+<div><p>This text should not show inside the iframe. It should show inside the parent. Furthermore, there should be text saying "Middle of Page" and then "End of Page" below (also in the parent).</p>
+<p>Middle of Page</p>
+<p>End of Page</p>
+</div></body></html>
diff --git a/dom/tests/reftest/bug592366-ref.xhtml b/dom/tests/reftest/bug592366-ref.xhtml
new file mode 100644
index 0000000000..a75444d694
--- /dev/null
+++ b/dom/tests/reftest/bug592366-ref.xhtml
@@ -0,0 +1,9 @@
+<html xmlns="http://www.w3.org/1999/xhtml"><head>
+<title>Move node during parse</title>
+</head>
+<body>
+<iframe></iframe>After iframe
+<div><p>This text should not show inside the iframe. It should show inside the parent. Furthermore, there should be text saying "Middle of Page" and then "End of Page" below (also in the parent).</p>
+<p>Middle of Page</p>
+<p>End of Page</p>
+</div></body></html>
diff --git a/dom/tests/reftest/bug798068-ref.xhtml b/dom/tests/reftest/bug798068-ref.xhtml
new file mode 100644
index 0000000000..eaa2772c74
--- /dev/null
+++ b/dom/tests/reftest/bug798068-ref.xhtml
@@ -0,0 +1,18 @@
+<?xml version = '1.0' encoding = 'utf-8'?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <script>
+ function doTest() {
+ var defaultZoom = {}, allowZoom = {}, minZoom = {}, maxZoom ={}, width = {}, height = {}, autoSize = {};
+ var windowUtils = window.windowUtils;
+ windowUtils.getViewportInfo(1, 1, defaultZoom, allowZoom, minZoom, maxZoom, width, height, autoSize);
+ document.getElementById("minZoom").innerHTML = minZoom.value.toPrecision(10);
+ document.getElementById("maxZoom").innerHTML = maxZoom.value.toPrecision(10);
+ }
+ </script>
+ </head>
+ <body onload="doTest();">
+ MinZoom: <span id="minZoom"></span><br />
+ MaxZoom: <span id="maxZoom"></span>
+ </body>
+</html>
diff --git a/dom/tests/reftest/bug798068.xhtml b/dom/tests/reftest/bug798068.xhtml
new file mode 100644
index 0000000000..7fe0aea245
--- /dev/null
+++ b/dom/tests/reftest/bug798068.xhtml
@@ -0,0 +1,19 @@
+<?xml version = '1.0' encoding = 'utf-8'?>
+<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <script>
+ function doTest() {
+ var defaultZoom = {}, allowZoom = {}, minZoom = {}, maxZoom ={}, width = {}, height = {}, autoSize = {};
+ var windowUtils = window.windowUtils;
+ windowUtils.getViewportInfo(1, 1, defaultZoom, allowZoom, minZoom, maxZoom, width, height, autoSize);
+ document.getElementById("minZoom").innerHTML = minZoom.value.toPrecision(10);
+ document.getElementById("maxZoom").innerHTML = maxZoom.value.toPrecision(10);
+ }
+ </script>
+ </head>
+ <body onload="doTest();">
+ MinZoom: <span id="minZoom"></span><br />
+ MaxZoom: <span id="maxZoom"></span>
+ </body>
+</html>
diff --git a/dom/tests/reftest/child592366-1.html b/dom/tests/reftest/child592366-1.html
new file mode 100644
index 0000000000..acd123571d
--- /dev/null
+++ b/dom/tests/reftest/child592366-1.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Move node during parse</title>
+</head>
+<body>
+<div>
+<p>This text should not show inside the iframe. It should show inside the parent. Furthermore, there should be text saying "Middle of Page" and then "End of Page" below (also in the parent).</p>
+<script>
+parent.document.documentElement.lastChild.appendChild(document.getElementsByTagName("div")[0]);
+</script>
+<p>Middle of Page</p>
+<script>
+document.body.insertBefore(document.createTextNode("FAIL"), document.body.firstChild);
+</script>
+<p>End of Page</p>
+</div>
+</body>
+</html>
diff --git a/dom/tests/reftest/child592366-1.xhtml b/dom/tests/reftest/child592366-1.xhtml
new file mode 100644
index 0000000000..0193e4cea4
--- /dev/null
+++ b/dom/tests/reftest/child592366-1.xhtml
@@ -0,0 +1,18 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Move node during parse</title>
+</head>
+<body>
+<div>
+<p>This text should not show inside the iframe. It should show inside the parent. Furthermore, there should be text saying "Middle of Page" and then "End of Page" below (also in the parent).</p>
+<script>
+parent.document.documentElement.lastChild.appendChild(document.getElementsByTagName("div")[0]);
+</script>
+<p>Middle of Page</p>
+<script>
+document.body.insertBefore(document.createTextNode("FAIL"), document.body.firstChild);
+</script>
+<p>End of Page</p>
+</div>
+</body>
+</html>
diff --git a/dom/tests/reftest/child592366-2.html b/dom/tests/reftest/child592366-2.html
new file mode 100644
index 0000000000..e2e6c3a651
--- /dev/null
+++ b/dom/tests/reftest/child592366-2.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Move node during parse</title>
+</head>
+<body>
+<div>
+<p>This text should not show inside the iframe. It should show inside the parent. Furthermore, there should be text saying "Middle of Page" and then "End of Page" below (also in the parent).</p>
+<script>
+parent.document.documentElement.lastChild.appendChild(document.getElementsByTagName("div")[0]);
+</script>
+<p>Middle of Page</p>
+<script src="script592366-2.js"></script>
+<p>End of Page</p>
+</div>
+</body>
+</html>
diff --git a/dom/tests/reftest/child592366-2.xhtml b/dom/tests/reftest/child592366-2.xhtml
new file mode 100644
index 0000000000..a64dc83ae0
--- /dev/null
+++ b/dom/tests/reftest/child592366-2.xhtml
@@ -0,0 +1,16 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Move node during parse</title>
+</head>
+<body>
+<div>
+<p>This text should not show inside the iframe. It should show inside the parent. Furthermore, there should be text saying "Middle of Page" and then "End of Page" below (also in the parent).</p>
+<script>
+parent.document.documentElement.lastChild.appendChild(document.getElementsByTagName("div")[0]);
+</script>
+<p>Middle of Page</p>
+<script src="script592366-2.js"></script>
+<p>End of Page</p>
+</div>
+</body>
+</html>
diff --git a/dom/tests/reftest/optiontext-ref.html b/dom/tests/reftest/optiontext-ref.html
new file mode 100644
index 0000000000..6250c1fb27
--- /dev/null
+++ b/dom/tests/reftest/optiontext-ref.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<body>
+<form name="f">
+<select name="s">
+<option name="o1">ok</option>
+</select>
+</form>
+</body>
diff --git a/dom/tests/reftest/optiontext.html b/dom/tests/reftest/optiontext.html
new file mode 100644
index 0000000000..5297e6caa3
--- /dev/null
+++ b/dom/tests/reftest/optiontext.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<body onload="document.forms.f.s.options[0].text = 'ok';">
+<form name="f">
+<select name="s">
+<option name="o1">-</option>
+</select>
+</form>
+</body>
diff --git a/dom/tests/reftest/reftest.list b/dom/tests/reftest/reftest.list
new file mode 100644
index 0000000000..ee7069e2af
--- /dev/null
+++ b/dom/tests/reftest/reftest.list
@@ -0,0 +1,14 @@
+fuzzy-if(Android,0-4,0-1) == bug453105.html bug453105-ref.html # bug 1600534
+fuzzy-if(Android,0-4,0-1) == optiontext.html optiontext-ref.html
+== bug456008.xhtml bug456008-ref.html
+fuzzy(0-2,0-3) == bug439965.html bug439965-ref.html
+== bug427779.xml bug427779-ref.xml
+fuzzy(0-1,0-5) == bug559996.html bug559996-ref.html
+== bug591981-1.html bug591981-ref.html
+== bug591981-2.html bug591981-ref.html
+== bug592366-1.html bug592366-ref.html
+== bug592366-2.html bug592366-ref.html
+== bug592366-1.xhtml bug592366-ref.xhtml
+== bug592366-2.xhtml bug592366-ref.xhtml
+== bug798068.xhtml bug798068-ref.xhtml
+== bug1389406.xml bug1389406-ref.xml
diff --git a/dom/tests/reftest/script592366-2.js b/dom/tests/reftest/script592366-2.js
new file mode 100644
index 0000000000..c3c8e143e3
--- /dev/null
+++ b/dom/tests/reftest/script592366-2.js
@@ -0,0 +1,2 @@
+document.body.insertBefore(document.createTextNode("FAIL"), document.body.firstChild);
+
diff --git a/dom/tests/reftest/xml-stylesheet/css_relative_href.xml b/dom/tests/reftest/xml-stylesheet/css_relative_href.xml
new file mode 100644
index 0000000000..8576e56d8f
--- /dev/null
+++ b/dom/tests/reftest/xml-stylesheet/css_relative_href.xml
@@ -0,0 +1,2 @@
+<?xml-stylesheet type="text/css" href="passer.css"?>
+<element/>
diff --git a/dom/tests/reftest/xml-stylesheet/css_relative_href_also_external.xml b/dom/tests/reftest/xml-stylesheet/css_relative_href_also_external.xml
new file mode 100644
index 0000000000..8576e56d8f
--- /dev/null
+++ b/dom/tests/reftest/xml-stylesheet/css_relative_href_also_external.xml
@@ -0,0 +1,2 @@
+<?xml-stylesheet type="text/css" href="passer.css"?>
+<element/>
diff --git a/dom/tests/reftest/xml-stylesheet/css_relative_href_also_external.xml^headers^ b/dom/tests/reftest/xml-stylesheet/css_relative_href_also_external.xml^headers^
new file mode 100644
index 0000000000..581aae3439
--- /dev/null
+++ b/dom/tests/reftest/xml-stylesheet/css_relative_href_also_external.xml^headers^
@@ -0,0 +1 @@
+Link: <failer.css>;rel="stylesheet";type="text/css"
diff --git a/dom/tests/reftest/xml-stylesheet/css_relative_href_also_external_override.xml b/dom/tests/reftest/xml-stylesheet/css_relative_href_also_external_override.xml
new file mode 100644
index 0000000000..7859e6078c
--- /dev/null
+++ b/dom/tests/reftest/xml-stylesheet/css_relative_href_also_external_override.xml
@@ -0,0 +1,2 @@
+<?xml-stylesheet type="text/css" href="failer.css"?>
+<element/>
diff --git a/dom/tests/reftest/xml-stylesheet/css_relative_href_also_external_override.xml^headers^ b/dom/tests/reftest/xml-stylesheet/css_relative_href_also_external_override.xml^headers^
new file mode 100644
index 0000000000..f9e96867b6
--- /dev/null
+++ b/dom/tests/reftest/xml-stylesheet/css_relative_href_also_external_override.xml^headers^
@@ -0,0 +1 @@
+Link: <passer_override.css>;rel="stylesheet";type="text/css"
diff --git a/dom/tests/reftest/xml-stylesheet/embedded_dtd_id.svg b/dom/tests/reftest/xml-stylesheet/embedded_dtd_id.svg
new file mode 100644
index 0000000000..dee0d44f0d
--- /dev/null
+++ b/dom/tests/reftest/xml-stylesheet/embedded_dtd_id.svg
@@ -0,0 +1,20 @@
+<!DOCTYPE svg:svg [<!ATTLIST transform id ID #IMPLIED>]>
+<?xml-stylesheet type="application/xml" href="#transform"?>
+<svg:svg xmlns="http://www.w3.org/1999/XSL/Transform"
+ xmlns:svg="http://www.w3.org/2000/svg">
+ <svg:defs>
+ <transform id="transform" version="1.0">
+ <template match="node()|@*">
+ <copy>
+ <apply-templates select="@*"/>
+ <apply-templates/>
+ </copy>
+ </template>
+ <template match="svg:defs"/>
+ <template match="@fill">
+ <attribute name="fill">lime</attribute>
+ </template>
+ </transform>
+ </svg:defs>
+ <svg:rect width="100%" height="100%" fill="red"/>
+</svg:svg>
diff --git a/dom/tests/reftest/xml-stylesheet/error_no_href.svg b/dom/tests/reftest/xml-stylesheet/error_no_href.svg
new file mode 100644
index 0000000000..63719f9302
--- /dev/null
+++ b/dom/tests/reftest/xml-stylesheet/error_no_href.svg
@@ -0,0 +1,8 @@
+<?xml-stylesheet type="application/xml"?>
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xslt="http://www.w3.org/1999/XSL/Transform"
+ xslt:version="1.0">
+ <rect width="100%" height="100%" fill="lime">
+ <xslt:attribute name="fill">red</xslt:attribute>
+ </rect>
+</svg>
diff --git a/dom/tests/reftest/xml-stylesheet/fail.svg b/dom/tests/reftest/xml-stylesheet/fail.svg
new file mode 100644
index 0000000000..fcffde5235
--- /dev/null
+++ b/dom/tests/reftest/xml-stylesheet/fail.svg
@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <desc>Fail</desc>
+ <rect width="100%" height="100%" fill="red"/>
+</svg>
diff --git a/dom/tests/reftest/xml-stylesheet/failer.css b/dom/tests/reftest/xml-stylesheet/failer.css
new file mode 100644
index 0000000000..08f46a7a8f
--- /dev/null
+++ b/dom/tests/reftest/xml-stylesheet/failer.css
@@ -0,0 +1 @@
+:root { background: red; }
diff --git a/dom/tests/reftest/xml-stylesheet/lreas_selflink_dtd_id.svg b/dom/tests/reftest/xml-stylesheet/lreas_selflink_dtd_id.svg
new file mode 100644
index 0000000000..8c05fc8b5b
--- /dev/null
+++ b/dom/tests/reftest/xml-stylesheet/lreas_selflink_dtd_id.svg
@@ -0,0 +1,9 @@
+<!DOCTYPE svg [<!ATTLIST svg id ID #IMPLIED>]>
+<?xml-stylesheet type="application/xml" href="#transform"?>
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xslt="http://www.w3.org/1999/XSL/Transform"
+ id="transform" xslt:version="1.0">
+ <rect width="100%" height="100%" fill="red">
+ <xslt:attribute name="fill">lime</xslt:attribute>
+ </rect>
+</svg>
diff --git a/dom/tests/reftest/xml-stylesheet/lreas_selflink_empty_href.svg b/dom/tests/reftest/xml-stylesheet/lreas_selflink_empty_href.svg
new file mode 100644
index 0000000000..5a995697b4
--- /dev/null
+++ b/dom/tests/reftest/xml-stylesheet/lreas_selflink_empty_href.svg
@@ -0,0 +1,8 @@
+<?xml-stylesheet type="application/xml" href=""?>
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xslt="http://www.w3.org/1999/XSL/Transform"
+ xslt:version="1.0">
+ <rect width="100%" height="100%" fill="red">
+ <xslt:attribute name="fill">lime</xslt:attribute>
+ </rect>
+</svg>
diff --git a/dom/tests/reftest/xml-stylesheet/lreas_selflink_relative_href.svg b/dom/tests/reftest/xml-stylesheet/lreas_selflink_relative_href.svg
new file mode 100644
index 0000000000..e8d62584f9
--- /dev/null
+++ b/dom/tests/reftest/xml-stylesheet/lreas_selflink_relative_href.svg
@@ -0,0 +1,9 @@
+<?xml-stylesheet type="application/xml"
+ href="lreas_selflink_relative_href.svg"?>
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xslt="http://www.w3.org/1999/XSL/Transform"
+ xslt:version="1.0">
+ <rect width="100%" height="100%" fill="red">
+ <xslt:attribute name="fill">lime</xslt:attribute>
+ </rect>
+</svg>
diff --git a/dom/tests/reftest/xml-stylesheet/pass.svg b/dom/tests/reftest/xml-stylesheet/pass.svg
new file mode 100644
index 0000000000..65780d0f02
--- /dev/null
+++ b/dom/tests/reftest/xml-stylesheet/pass.svg
@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <desc>Pass</desc>
+ <rect width="100%" height="100%" fill="lime"/>
+</svg>
diff --git a/dom/tests/reftest/xml-stylesheet/passer.css b/dom/tests/reftest/xml-stylesheet/passer.css
new file mode 100644
index 0000000000..642b7cc108
--- /dev/null
+++ b/dom/tests/reftest/xml-stylesheet/passer.css
@@ -0,0 +1 @@
+:root { background: lime; }
diff --git a/dom/tests/reftest/xml-stylesheet/passer_override.css b/dom/tests/reftest/xml-stylesheet/passer_override.css
new file mode 100644
index 0000000000..671e9e47bd
--- /dev/null
+++ b/dom/tests/reftest/xml-stylesheet/passer_override.css
@@ -0,0 +1 @@
+:root { background: lime !important; }
diff --git a/dom/tests/reftest/xml-stylesheet/reftest.list b/dom/tests/reftest/xml-stylesheet/reftest.list
new file mode 100644
index 0000000000..caf3920cb1
--- /dev/null
+++ b/dom/tests/reftest/xml-stylesheet/reftest.list
@@ -0,0 +1,12 @@
+== css_relative_href.xml pass.svg
+HTTP == css_relative_href_also_external.xml pass.svg
+HTTP == css_relative_href_also_external_override.xml pass.svg
+== embedded_dtd_id.svg pass.svg
+!= error_no_href.svg fail.svg
+fails == lreas_selflink_dtd_id.svg pass.svg # fails after bug 631575
+== lreas_selflink_empty_href.svg pass.svg
+== lreas_selflink_relative_href.svg pass.svg
+== xslt_relative_href.svg pass.svg
+== xslt_selflink_dtd_id.xml pass.svg
+== xslt_selflink_empty_href.xml pass.svg
+== xslt_selflink_relative_href.xml pass.svg
diff --git a/dom/tests/reftest/xml-stylesheet/svg_passer.xslt b/dom/tests/reftest/xml-stylesheet/svg_passer.xslt
new file mode 100644
index 0000000000..392127cee5
--- /dev/null
+++ b/dom/tests/reftest/xml-stylesheet/svg_passer.xslt
@@ -0,0 +1,11 @@
+<transform xmlns="http://www.w3.org/1999/XSL/Transform" version="1.0">
+ <template match="node()|@*">
+ <copy>
+ <apply-templates select="@*"/>
+ <apply-templates/>
+ </copy>
+ </template>
+ <template match="@fill">
+ <attribute name="fill">lime</attribute>
+ </template>
+</transform>
diff --git a/dom/tests/reftest/xml-stylesheet/xslt_relative_href.svg b/dom/tests/reftest/xml-stylesheet/xslt_relative_href.svg
new file mode 100644
index 0000000000..33231847f7
--- /dev/null
+++ b/dom/tests/reftest/xml-stylesheet/xslt_relative_href.svg
@@ -0,0 +1,4 @@
+<?xml-stylesheet type="application/xml" href="svg_passer.xslt"?>
+<svg xmlns="http://www.w3.org/2000/svg">
+ <rect width="100%" height="100%" fill="red"/>
+</svg>
diff --git a/dom/tests/reftest/xml-stylesheet/xslt_selflink_dtd_id.xml b/dom/tests/reftest/xml-stylesheet/xslt_selflink_dtd_id.xml
new file mode 100644
index 0000000000..626738b1b4
--- /dev/null
+++ b/dom/tests/reftest/xml-stylesheet/xslt_selflink_dtd_id.xml
@@ -0,0 +1,11 @@
+<!DOCTYPE xslt:transform [<!ATTLIST xslt:transform id ID #IMPLIED>]>
+<?xml-stylesheet type="application/xml" href="#transform"?>
+<xslt:transform xmlns:xslt="http://www.w3.org/1999/XSL/Transform"
+ xmlns="http://www.w3.org/2000/svg"
+ id="transform" version="1.0">
+ <xslt:template match="/xslt:transform">
+ <svg>
+ <rect width="100%" height="100%" fill="lime"/>
+ </svg>
+ </xslt:template>
+</xslt:transform>
diff --git a/dom/tests/reftest/xml-stylesheet/xslt_selflink_empty_href.xml b/dom/tests/reftest/xml-stylesheet/xslt_selflink_empty_href.xml
new file mode 100644
index 0000000000..9e0834b7ed
--- /dev/null
+++ b/dom/tests/reftest/xml-stylesheet/xslt_selflink_empty_href.xml
@@ -0,0 +1,10 @@
+<?xml-stylesheet type="application/xml" href=""?>
+<xslt:transform xmlns:xslt="http://www.w3.org/1999/XSL/Transform"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.0">
+ <xslt:template match="/xslt:transform">
+ <svg>
+ <rect width="100%" height="100%" fill="lime"/>
+ </svg>
+ </xslt:template>
+</xslt:transform>
diff --git a/dom/tests/reftest/xml-stylesheet/xslt_selflink_relative_href.xml b/dom/tests/reftest/xml-stylesheet/xslt_selflink_relative_href.xml
new file mode 100644
index 0000000000..88d06a7296
--- /dev/null
+++ b/dom/tests/reftest/xml-stylesheet/xslt_selflink_relative_href.xml
@@ -0,0 +1,11 @@
+<?xml-stylesheet type="application/xml"
+ href="xslt_selflink_relative_href.xml"?>
+<xslt:transform xmlns:xslt="http://www.w3.org/1999/XSL/Transform"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.0">
+ <xslt:template match="/xslt:transform">
+ <svg>
+ <rect width="100%" height="100%" fill="lime"/>
+ </svg>
+ </xslt:template>
+</xslt:transform>