summaryrefslogtreecommitdiffstats
path: root/layout/reftests/dom
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 /layout/reftests/dom
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 'layout/reftests/dom')
-rw-r--r--layout/reftests/dom/appendmultiple-ref.html9
-rw-r--r--layout/reftests/dom/appendmultiple.html27
-rw-r--r--layout/reftests/dom/appendsingle-ref.html9
-rw-r--r--layout/reftests/dom/appendsingle.html27
-rw-r--r--layout/reftests/dom/insertmultiple-ref.html9
-rw-r--r--layout/reftests/dom/insertmultiple.html28
-rw-r--r--layout/reftests/dom/insertmultiplemultiple-1.html51
-rw-r--r--layout/reftests/dom/insertmultiplemultiple-2.html39
-rw-r--r--layout/reftests/dom/insertmultiplemultiple-3.html48
-rw-r--r--layout/reftests/dom/insertmultiplemultiple-ref.html19
-rw-r--r--layout/reftests/dom/insertparentandchild-ref.html18
-rw-r--r--layout/reftests/dom/insertparentandchild.html44
-rw-r--r--layout/reftests/dom/insertsingle-ref.html9
-rw-r--r--layout/reftests/dom/insertsingle.html28
-rw-r--r--layout/reftests/dom/inserttoparentandchild-1.html47
-rw-r--r--layout/reftests/dom/inserttoparentandchild-2.html47
-rw-r--r--layout/reftests/dom/inserttoparentandchild-ref.html18
-rw-r--r--layout/reftests/dom/inserttwoparents-ref.html18
-rw-r--r--layout/reftests/dom/inserttwoparents.html45
-rw-r--r--layout/reftests/dom/multipleappendwitheditable-ref.xhtml11
-rw-r--r--layout/reftests/dom/multipleappendwitheditable.xhtml37
-rw-r--r--layout/reftests/dom/multipleappendwithinput-ref.xhtml11
-rw-r--r--layout/reftests/dom/multipleappendwithinput.xhtml36
-rw-r--r--layout/reftests/dom/multipleappendwithxul-ref.xhtml11
-rw-r--r--layout/reftests/dom/multipleappendwithxul.xhtml37
-rw-r--r--layout/reftests/dom/multipleinsertionpoints-appendmultiple.xhtml44
-rw-r--r--layout/reftests/dom/multipleinsertionpoints-appendsingle-1.xhtml40
-rw-r--r--layout/reftests/dom/multipleinsertionpoints-appendsingle-2.xhtml40
-rw-r--r--layout/reftests/dom/multipleinsertionpoints-insertmultiple.xhtml49
-rw-r--r--layout/reftests/dom/multipleinsertionpoints-insertsingle-1.xhtml41
-rw-r--r--layout/reftests/dom/multipleinsertionpoints-insertsingle-2.xhtml41
-rw-r--r--layout/reftests/dom/multipleinsertionpoints-ref.xhtml12
-rw-r--r--layout/reftests/dom/multipleinsertionpoints-ref2.xhtml25
-rw-r--r--layout/reftests/dom/reftest-stylo.list76
-rw-r--r--layout/reftests/dom/reftest.list55
-rw-r--r--layout/reftests/dom/xbl-children-1-ref.xhtml16
-rw-r--r--layout/reftests/dom/xbl-children-1.xhtml39
-rw-r--r--layout/reftests/dom/xbl-children-2.xhtml28
-rw-r--r--layout/reftests/dom/xbl-children-3-ref.html20
-rw-r--r--layout/reftests/dom/xbl-children-3.xhtml61
-rw-r--r--layout/reftests/dom/xbl-children-4-ref.html7
-rw-r--r--layout/reftests/dom/xbl-children-4.xhtml29
42 files changed, 1306 insertions, 0 deletions
diff --git a/layout/reftests/dom/appendmultiple-ref.html b/layout/reftests/dom/appendmultiple-ref.html
new file mode 100644
index 000000000..e634909e8
--- /dev/null
+++ b/layout/reftests/dom/appendmultiple-ref.html
@@ -0,0 +1,9 @@
+<html>
+<body>
+<div>1</div>
+<div>2</div>
+<div>3</div>
+<div>4</div>
+<div>5</div>
+</body>
+</html>
diff --git a/layout/reftests/dom/appendmultiple.html b/layout/reftests/dom/appendmultiple.html
new file mode 100644
index 000000000..26d2d8540
--- /dev/null
+++ b/layout/reftests/dom/appendmultiple.html
@@ -0,0 +1,27 @@
+<html class="reftest-wait">
+<head>
+
+<script>
+function boom()
+{
+ document.body.offsetHeight;
+
+ var parent = document.getElementById("body");
+
+ for (var i = 3; i <= 5; i++) {
+ var newdiv = document.createElement("div");
+ newdiv.appendChild(document.createTextNode(i));
+ parent.appendChild(newdiv);
+ }
+
+ document.body.offsetHeight;
+ document.documentElement.className = "";
+}
+</script>
+
+</head>
+<body id="body" onload="boom();">
+<div>1</div>
+<div>2</div>
+</body>
+</html>
diff --git a/layout/reftests/dom/appendsingle-ref.html b/layout/reftests/dom/appendsingle-ref.html
new file mode 100644
index 000000000..e634909e8
--- /dev/null
+++ b/layout/reftests/dom/appendsingle-ref.html
@@ -0,0 +1,9 @@
+<html>
+<body>
+<div>1</div>
+<div>2</div>
+<div>3</div>
+<div>4</div>
+<div>5</div>
+</body>
+</html>
diff --git a/layout/reftests/dom/appendsingle.html b/layout/reftests/dom/appendsingle.html
new file mode 100644
index 000000000..321c60da4
--- /dev/null
+++ b/layout/reftests/dom/appendsingle.html
@@ -0,0 +1,27 @@
+<html class="reftest-wait">
+<head>
+
+<script>
+function boom()
+{
+ document.body.offsetHeight;
+
+ var parent = document.getElementById("body");
+
+ var newdiv = document.createElement("div");
+ newdiv.appendChild(document.createTextNode("5"));
+ parent.appendChild(newdiv);
+
+ document.body.offsetHeight;
+ document.documentElement.className = "";
+}
+</script>
+
+</head>
+<body id="body" onload="boom();">
+<div>1</div>
+<div>2</div>
+<div>3</div>
+<div>4</div>
+</body>
+</html>
diff --git a/layout/reftests/dom/insertmultiple-ref.html b/layout/reftests/dom/insertmultiple-ref.html
new file mode 100644
index 000000000..e634909e8
--- /dev/null
+++ b/layout/reftests/dom/insertmultiple-ref.html
@@ -0,0 +1,9 @@
+<html>
+<body>
+<div>1</div>
+<div>2</div>
+<div>3</div>
+<div>4</div>
+<div>5</div>
+</body>
+</html>
diff --git a/layout/reftests/dom/insertmultiple.html b/layout/reftests/dom/insertmultiple.html
new file mode 100644
index 000000000..cb58f5bdd
--- /dev/null
+++ b/layout/reftests/dom/insertmultiple.html
@@ -0,0 +1,28 @@
+<html class="reftest-wait">
+<head>
+
+<script>
+function boom()
+{
+ document.body.offsetHeight;
+
+ var lastdiv = document.getElementById("last");
+ var parent = lastdiv.parentNode;
+
+ for (var i = 2; i <= 4; i++) {
+ var newdiv = document.createElement("div");
+ newdiv.appendChild(document.createTextNode(i));
+ parent.insertBefore(newdiv, lastdiv);
+ }
+
+ document.body.offsetHeight;
+ document.documentElement.className = "";
+}
+</script>
+
+</head>
+<body onload="boom();">
+<div>1</div>
+<div id="last">5</div>
+</body>
+</html>
diff --git a/layout/reftests/dom/insertmultiplemultiple-1.html b/layout/reftests/dom/insertmultiplemultiple-1.html
new file mode 100644
index 000000000..20cec325a
--- /dev/null
+++ b/layout/reftests/dom/insertmultiplemultiple-1.html
@@ -0,0 +1,51 @@
+<html class="reftest-wait">
+<head>
+
+<script>
+function boom()
+{
+ document.body.offsetHeight;
+
+ var sixdiv = document.getElementById("six");
+ var parent = sixdiv.parentNode;
+
+ for (var i = 3; i <= 5; i++) {
+ var newdiv = document.createElement("div");
+ newdiv.appendChild(document.createTextNode(i));
+ parent.insertBefore(newdiv, sixdiv);
+ }
+
+ var elevendiv = document.getElementById("eleven");
+ parent = elevendiv.parentNode;
+
+ for (var i = 8; i <= 10; i++) {
+ var newdiv = document.createElement("div");
+ newdiv.appendChild(document.createTextNode(i));
+ parent.insertBefore(newdiv, elevendiv);
+ }
+
+ var lastdiv = document.getElementById("last");
+ parent = lastdiv.parentNode;
+
+ for (var i = 13; i <= 14; i++) {
+ var newdiv = document.createElement("div");
+ newdiv.appendChild(document.createTextNode(i));
+ parent.insertBefore(newdiv, lastdiv);
+ }
+
+ document.body.offsetHeight;
+ document.documentElement.className = "";
+}
+</script>
+
+</head>
+<body onload="boom();">
+<div>1</div>
+<div>2</div>
+<div id="six">6</div>
+<div>7</div>
+<div id="eleven">11</div>
+<div>12</div>
+<div id="last">15</div>
+</body>
+</html>
diff --git a/layout/reftests/dom/insertmultiplemultiple-2.html b/layout/reftests/dom/insertmultiplemultiple-2.html
new file mode 100644
index 000000000..5a9845b7b
--- /dev/null
+++ b/layout/reftests/dom/insertmultiplemultiple-2.html
@@ -0,0 +1,39 @@
+<html class="reftest-wait">
+<head>
+
+<script>
+function boom()
+{
+ document.body.offsetHeight;
+
+ var ninediv = document.getElementById("nine");
+ var parent = ninediv.parentNode;
+
+ for (var i = 4; i <= 8; i++) {
+ var newdiv = document.createElement("div");
+ newdiv.appendChild(document.createTextNode(i));
+ parent.insertBefore(newdiv, ninediv);
+ }
+
+ for (var i = 13; i <= 15; i++) {
+ var newdiv = document.createElement("div");
+ newdiv.appendChild(document.createTextNode(i));
+ parent.appendChild(newdiv);
+ }
+
+ document.body.offsetHeight;
+ document.documentElement.className = "";
+}
+</script>
+
+</head>
+<body onload="boom();">
+<div>1</div>
+<div>2</div>
+<div>3</div>
+<div id="nine">9</div>
+<div>10</div>
+<div>11</div>
+<div>12</div>
+</body>
+</html>
diff --git a/layout/reftests/dom/insertmultiplemultiple-3.html b/layout/reftests/dom/insertmultiplemultiple-3.html
new file mode 100644
index 000000000..f9fdb2d33
--- /dev/null
+++ b/layout/reftests/dom/insertmultiplemultiple-3.html
@@ -0,0 +1,48 @@
+<html class="reftest-wait">
+<head>
+
+<script>
+function boom()
+{
+ document.body.offsetHeight;
+
+ var sixdiv = document.getElementById("six");
+ var parent = sixdiv.parentNode;
+
+ for (var i = 3; i <= 5; i++) {
+ var newdiv = document.createElement("div");
+ newdiv.appendChild(document.createTextNode(i));
+ parent.insertBefore(newdiv, sixdiv);
+ }
+
+ var elevendiv = document.getElementById("eleven");
+ parent = elevendiv.parentNode;
+
+ for (var i = 8; i <= 10; i++) {
+ var newdiv = document.createElement("div");
+ newdiv.appendChild(document.createTextNode(i));
+ parent.insertBefore(newdiv, elevendiv);
+ }
+
+ for (var i = 14; i <= 15; i++) {
+ var newdiv = document.createElement("div");
+ newdiv.appendChild(document.createTextNode(i));
+ parent.appendChild(newdiv);
+ }
+
+ document.body.offsetHeight;
+ document.documentElement.className = "";
+}
+</script>
+
+</head>
+<body onload="boom();">
+<div>1</div>
+<div>2</div>
+<div id="six">6</div>
+<div>7</div>
+<div id="eleven">11</div>
+<div>12</div>
+<div>13</div>
+</body>
+</html>
diff --git a/layout/reftests/dom/insertmultiplemultiple-ref.html b/layout/reftests/dom/insertmultiplemultiple-ref.html
new file mode 100644
index 000000000..01da6614c
--- /dev/null
+++ b/layout/reftests/dom/insertmultiplemultiple-ref.html
@@ -0,0 +1,19 @@
+<html>
+<body>
+<div>1</div>
+<div>2</div>
+<div>3</div>
+<div>4</div>
+<div>5</div>
+<div>6</div>
+<div>7</div>
+<div>8</div>
+<div>9</div>
+<div>10</div>
+<div>11</div>
+<div>12</div>
+<div>13</div>
+<div>14</div>
+<div>15</div>
+</body>
+</html>
diff --git a/layout/reftests/dom/insertparentandchild-ref.html b/layout/reftests/dom/insertparentandchild-ref.html
new file mode 100644
index 000000000..0bd911e7f
--- /dev/null
+++ b/layout/reftests/dom/insertparentandchild-ref.html
@@ -0,0 +1,18 @@
+<html>
+<body>
+<div>1</div>
+<div>2</div>
+<div>3</div>
+<div>4</div>
+<div>
+ <div>5a</div>
+ <div>5b</div>
+ <div>5c</div>
+ <div>5d</div>
+</div>
+<div>6</div>
+<div>7</div>
+<div>8</div>
+<div>9</div>
+</body>
+</html>
diff --git a/layout/reftests/dom/insertparentandchild.html b/layout/reftests/dom/insertparentandchild.html
new file mode 100644
index 000000000..b5d5b8236
--- /dev/null
+++ b/layout/reftests/dom/insertparentandchild.html
@@ -0,0 +1,44 @@
+<html class="reftest-wait">
+<head>
+
+<script>
+function boom()
+{
+ document.body.offsetHeight;
+
+ var sixdiv = document.getElementById("six");
+ var parent = sixdiv.parentNode;
+
+ var newdiv = document.createElement("div");
+ var childdiv = document.createElement("div");
+ childdiv.appendChild(document.createTextNode("5c"));
+ newdiv.appendChild(childdiv);
+ childdiv = document.createElement("div");
+ childdiv.appendChild(document.createTextNode("5d"));
+ newdiv.appendChild(childdiv);
+ parent.insertBefore(newdiv, sixdiv);
+
+ childdiv = document.createElement("div");
+ childdiv.appendChild(document.createTextNode("5b"));
+ newdiv.insertBefore(childdiv, newdiv.firstChild);
+ childdiv = document.createElement("div");
+ childdiv.appendChild(document.createTextNode("5a"));
+ newdiv.insertBefore(childdiv, newdiv.firstChild);
+
+ document.body.offsetHeight;
+ document.documentElement.className = "";
+}
+</script>
+
+</head>
+<body onload="boom();">
+<div>1</div>
+<div>2</div>
+<div>3</div>
+<div>4</div>
+<div id="six">6</div>
+<div>7</div>
+<div>8</div>
+<div>9</div>
+</body>
+</html>
diff --git a/layout/reftests/dom/insertsingle-ref.html b/layout/reftests/dom/insertsingle-ref.html
new file mode 100644
index 000000000..e634909e8
--- /dev/null
+++ b/layout/reftests/dom/insertsingle-ref.html
@@ -0,0 +1,9 @@
+<html>
+<body>
+<div>1</div>
+<div>2</div>
+<div>3</div>
+<div>4</div>
+<div>5</div>
+</body>
+</html>
diff --git a/layout/reftests/dom/insertsingle.html b/layout/reftests/dom/insertsingle.html
new file mode 100644
index 000000000..42a12ee7b
--- /dev/null
+++ b/layout/reftests/dom/insertsingle.html
@@ -0,0 +1,28 @@
+<html class="reftest-wait">
+<head>
+
+<script>
+function boom()
+{
+ document.body.offsetHeight;
+
+ var fourdiv = document.getElementById("four");
+ var parent = fourdiv.parentNode;
+
+ var newdiv = document.createElement("div");
+ newdiv.appendChild(document.createTextNode("3"));
+ parent.insertBefore(newdiv, fourdiv);
+
+ document.body.offsetHeight;
+ document.documentElement.className = "";
+}
+</script>
+
+</head>
+<body onload="boom();">
+<div>1</div>
+<div>2</div>
+<div id="four">4</div>
+<div>5</div>
+</body>
+</html>
diff --git a/layout/reftests/dom/inserttoparentandchild-1.html b/layout/reftests/dom/inserttoparentandchild-1.html
new file mode 100644
index 000000000..7219e786d
--- /dev/null
+++ b/layout/reftests/dom/inserttoparentandchild-1.html
@@ -0,0 +1,47 @@
+<html class="reftest-wait">
+<head>
+
+<script>
+function boom()
+{
+ document.body.offsetHeight;
+
+ var fivediv = document.getElementById("five");
+ var parent = fivediv.parentNode;
+
+ for (var i = 3; i <= 4; i++) {
+ var newdiv = document.createElement("div");
+ newdiv.appendChild(document.createTextNode(i));
+ parent.insertBefore(newdiv, fivediv);
+ }
+
+ var fivedeediv = document.getElementById("fivedee");
+ parent = fivedeediv.parentNode;
+
+ var newdiv = document.createElement("div");
+ newdiv.appendChild(document.createTextNode("5b"));
+ parent.insertBefore(newdiv, fivedeediv);
+
+ newdiv = document.createElement("div");
+ newdiv.appendChild(document.createTextNode("5c"));
+ parent.insertBefore(newdiv, fivedeediv);
+
+ document.body.offsetHeight;
+ document.documentElement.className = "";
+}
+</script>
+
+</head>
+<body onload="boom();">
+<div>1</div>
+<div>2</div>
+<div id="five">
+ <div>5a</div>
+ <div id="fivedee">5d</div>
+</div>
+<div>6</div>
+<div>7</div>
+<div>8</div>
+<div>9</div>
+</body>
+</html>
diff --git a/layout/reftests/dom/inserttoparentandchild-2.html b/layout/reftests/dom/inserttoparentandchild-2.html
new file mode 100644
index 000000000..cdd0ccdc4
--- /dev/null
+++ b/layout/reftests/dom/inserttoparentandchild-2.html
@@ -0,0 +1,47 @@
+<html class="reftest-wait">
+<head>
+
+<script>
+function boom()
+{
+ document.body.offsetHeight;
+
+ var eightdiv = document.getElementById("eight");
+ var parent = eightdiv.parentNode;
+
+ for (var i = 6; i <= 7; i++) {
+ var newdiv = document.createElement("div");
+ newdiv.appendChild(document.createTextNode(i));
+ parent.insertBefore(newdiv, eightdiv);
+ }
+
+ var fivedeediv = document.getElementById("fivedee");
+ parent = fivedeediv.parentNode;
+
+ var newdiv = document.createElement("div");
+ newdiv.appendChild(document.createTextNode("5b"));
+ parent.insertBefore(newdiv, fivedeediv);
+
+ newdiv = document.createElement("div");
+ newdiv.appendChild(document.createTextNode("5c"));
+ parent.insertBefore(newdiv, fivedeediv);
+
+ document.body.offsetHeight;
+ document.documentElement.className = "";
+}
+</script>
+
+</head>
+<body onload="boom();">
+<div>1</div>
+<div>2</div>
+<div>3</div>
+<div>4</div>
+<div id="five">
+ <div>5a</div>
+ <div id="fivedee">5d</div>
+</div>
+<div id="eight">8</div>
+<div>9</div>
+</body>
+</html>
diff --git a/layout/reftests/dom/inserttoparentandchild-ref.html b/layout/reftests/dom/inserttoparentandchild-ref.html
new file mode 100644
index 000000000..0bd911e7f
--- /dev/null
+++ b/layout/reftests/dom/inserttoparentandchild-ref.html
@@ -0,0 +1,18 @@
+<html>
+<body>
+<div>1</div>
+<div>2</div>
+<div>3</div>
+<div>4</div>
+<div>
+ <div>5a</div>
+ <div>5b</div>
+ <div>5c</div>
+ <div>5d</div>
+</div>
+<div>6</div>
+<div>7</div>
+<div>8</div>
+<div>9</div>
+</body>
+</html>
diff --git a/layout/reftests/dom/inserttwoparents-ref.html b/layout/reftests/dom/inserttwoparents-ref.html
new file mode 100644
index 000000000..daf6c0627
--- /dev/null
+++ b/layout/reftests/dom/inserttwoparents-ref.html
@@ -0,0 +1,18 @@
+<html>
+<body>
+<div>
+ <div>1a</div>
+ <div>2a</div>
+ <div>3a</div>
+ <div>4a</div>
+ <div>5a</div>
+</div>
+<div>
+ <div>1b</div>
+ <div>2b</div>
+ <div>3b</div>
+ <div>4b</div>
+ <div>5b</div>
+</div>
+</body>
+</html>
diff --git a/layout/reftests/dom/inserttwoparents.html b/layout/reftests/dom/inserttwoparents.html
new file mode 100644
index 000000000..16b94491d
--- /dev/null
+++ b/layout/reftests/dom/inserttwoparents.html
@@ -0,0 +1,45 @@
+<html class="reftest-wait">
+<head>
+
+<script>
+function boom()
+{
+ document.body.offsetHeight;
+
+ var fourehdiv = document.getElementById("foureh");
+ var parent = fourehdiv.parentNode;
+
+ for (var i = 2; i <= 3; i++) {
+ var newdiv = document.createElement("div");
+ newdiv.appendChild(document.createTextNode(i + "a"));
+ parent.insertBefore(newdiv, fourehdiv);
+ }
+
+ var fourbeediv = document.getElementById("fourbee");
+ parent = fourbeediv.parentNode;
+
+ for (var i = 2; i <= 3; i++) {
+ var newdiv = document.createElement("div");
+ newdiv.appendChild(document.createTextNode(i + "b"));
+ parent.insertBefore(newdiv, fourbeediv);
+ }
+
+ document.body.offsetHeight;
+ document.documentElement.className = "";
+}
+</script>
+
+</head>
+<body onload="boom();">
+<div>
+ <div>1a</div>
+ <div id="foureh">4a</div>
+ <div>5a</div>
+</div>
+<div>
+ <div>1b</div>
+ <div id="fourbee">4b</div>
+ <div>5b</div>
+</div>
+</body>
+</html>
diff --git a/layout/reftests/dom/multipleappendwitheditable-ref.xhtml b/layout/reftests/dom/multipleappendwitheditable-ref.xhtml
new file mode 100644
index 000000000..fb80a5fac
--- /dev/null
+++ b/layout/reftests/dom/multipleappendwitheditable-ref.xhtml
@@ -0,0 +1,11 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<body>
+<div id="parent">
+ <div>1</div>
+ <div>2</div>
+ <div>3</div>
+ <div>4</div>
+ <div contenteditable="true">5</div>
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/layout/reftests/dom/multipleappendwitheditable.xhtml b/layout/reftests/dom/multipleappendwitheditable.xhtml
new file mode 100644
index 000000000..71fefd519
--- /dev/null
+++ b/layout/reftests/dom/multipleappendwitheditable.xhtml
@@ -0,0 +1,37 @@
+<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait">
+<head>
+<script type="text/javascript">
+
+function boom()
+{
+ document.body.offsetHeight;
+
+ var parent = document.getElementById("parent");
+
+ var newelt = document.createElement("div");
+ newelt.appendChild(document.createTextNode(3));
+ parent.appendChild(newelt);
+
+ newelt = document.createElement("div");
+ newelt.appendChild(document.createTextNode(4));
+ parent.appendChild(newelt);
+
+ newelt = document.createElement("div");
+ newelt.appendChild(document.createTextNode(5));
+ newelt.setAttribute("contenteditable", "true");
+ parent.appendChild(newelt);
+
+ document.body.offsetHeight;
+ document.documentElement.className = "";
+}
+
+</script>
+</head>
+
+<body onload="boom();">
+<div id="parent">
+ <div>1</div>
+ <div>2</div>
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/layout/reftests/dom/multipleappendwithinput-ref.xhtml b/layout/reftests/dom/multipleappendwithinput-ref.xhtml
new file mode 100644
index 000000000..2f79bc027
--- /dev/null
+++ b/layout/reftests/dom/multipleappendwithinput-ref.xhtml
@@ -0,0 +1,11 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<body>
+<div id="parent">
+ <div>1</div>
+ <div>2</div>
+ <div>3</div>
+ <div>4</div>
+ <input type="text"></input>
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/layout/reftests/dom/multipleappendwithinput.xhtml b/layout/reftests/dom/multipleappendwithinput.xhtml
new file mode 100644
index 000000000..762a15b84
--- /dev/null
+++ b/layout/reftests/dom/multipleappendwithinput.xhtml
@@ -0,0 +1,36 @@
+<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait">
+<head>
+<script type="text/javascript">
+
+function boom()
+{
+ document.body.offsetHeight;
+
+ var parent = document.getElementById("parent");
+
+ var newelt = document.createElement("div");
+ newelt.appendChild(document.createTextNode(3));
+ parent.appendChild(newelt);
+
+ newelt = document.createElement("div");
+ newelt.appendChild(document.createTextNode(4));
+ parent.appendChild(newelt);
+
+ var input = document.createElement("input");
+ input.setAttribute("type", "text");
+ parent.appendChild(input);
+
+ document.body.offsetHeight;
+ document.documentElement.className = "";
+}
+
+</script>
+</head>
+
+<body onload="boom();">
+<div id="parent">
+ <div>1</div>
+ <div>2</div>
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/layout/reftests/dom/multipleappendwithxul-ref.xhtml b/layout/reftests/dom/multipleappendwithxul-ref.xhtml
new file mode 100644
index 000000000..0573a5df9
--- /dev/null
+++ b/layout/reftests/dom/multipleappendwithxul-ref.xhtml
@@ -0,0 +1,11 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<body>
+<div id="parent">
+ <div>1</div>
+ <div>2</div>
+ <div>3</div>
+ <div>4</div>
+ <hbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">5</hbox>
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/layout/reftests/dom/multipleappendwithxul.xhtml b/layout/reftests/dom/multipleappendwithxul.xhtml
new file mode 100644
index 000000000..365d4b37c
--- /dev/null
+++ b/layout/reftests/dom/multipleappendwithxul.xhtml
@@ -0,0 +1,37 @@
+<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait">
+<head>
+<script type="text/javascript">
+
+function boom()
+{
+ document.body.offsetHeight;
+
+ var parent = document.getElementById("parent");
+
+ var newelt = document.createElement("div");
+ newelt.appendChild(document.createTextNode(3));
+ parent.appendChild(newelt);
+
+ newelt = document.createElement("div");
+ newelt.appendChild(document.createTextNode(4));
+ parent.appendChild(newelt);
+
+ var XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
+ var hbox = document.createElementNS(XUL_NS, "hbox");
+ hbox.appendChild(document.createTextNode(5));
+ parent.appendChild(hbox);
+
+ document.body.offsetHeight;
+ document.documentElement.className = "";
+}
+
+</script>
+</head>
+
+<body onload="boom();">
+<div id="parent">
+ <div>1</div>
+ <div>2</div>
+</div>
+</body>
+</html> \ No newline at end of file
diff --git a/layout/reftests/dom/multipleinsertionpoints-appendmultiple.xhtml b/layout/reftests/dom/multipleinsertionpoints-appendmultiple.xhtml
new file mode 100644
index 000000000..c92da0ba2
--- /dev/null
+++ b/layout/reftests/dom/multipleinsertionpoints-appendmultiple.xhtml
@@ -0,0 +1,44 @@
+<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait">
+<head>
+
+<bindings xmlns="http://www.mozilla.org/xbl"
+ xmlns:xhtml="http://www.w3.org/1999/xhtml">
+ <binding id="a">
+ <content>
+ <xhtml:div>
+ <children includes="span"/>
+ </xhtml:div>
+ <xhtml:div>
+ <children/>
+ </xhtml:div>
+ </content>
+ </binding>
+</bindings>
+
+<script>
+function boom()
+{
+ document.body.offsetHeight;
+
+ var parent = document.getElementById("parent");
+
+ var newelt = document.createElement("span");
+ newelt.appendChild(document.createTextNode(2));
+ parent.appendChild(newelt);
+
+ newelt = document.createElement("div");
+ newelt.appendChild(document.createTextNode(5));
+ parent.appendChild(newelt);
+
+ document.body.offsetHeight;
+ document.documentElement.className = "";
+}
+</script>
+
+</head>
+<body onload="boom();">
+<div id="parent" style="-moz-binding: url(#a);">
+ <div>3</div><span>1</span><div>4</div>
+</div>
+</body>
+</html>
diff --git a/layout/reftests/dom/multipleinsertionpoints-appendsingle-1.xhtml b/layout/reftests/dom/multipleinsertionpoints-appendsingle-1.xhtml
new file mode 100644
index 000000000..5bfb94674
--- /dev/null
+++ b/layout/reftests/dom/multipleinsertionpoints-appendsingle-1.xhtml
@@ -0,0 +1,40 @@
+<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait">
+<head>
+
+<bindings xmlns="http://www.mozilla.org/xbl"
+ xmlns:xhtml="http://www.w3.org/1999/xhtml">
+ <binding id="a">
+ <content>
+ <xhtml:div>
+ <children includes="span"/>
+ </xhtml:div>
+ <xhtml:div>
+ <children/>
+ </xhtml:div>
+ </content>
+ </binding>
+</bindings>
+
+<script>
+function boom()
+{
+ document.body.offsetHeight;
+
+ var parent = document.getElementById("parent");
+
+ var newelt = document.createElement("div");
+ newelt.appendChild(document.createTextNode(5));
+ parent.appendChild(newelt);
+
+ document.body.offsetHeight;
+ document.documentElement.className = "";
+}
+</script>
+
+</head>
+<body onload="boom();">
+<div id="parent" style="-moz-binding: url(#a);">
+ <div>3</div><span>1</span><div>4</div><span>2</span>
+</div>
+</body>
+</html>
diff --git a/layout/reftests/dom/multipleinsertionpoints-appendsingle-2.xhtml b/layout/reftests/dom/multipleinsertionpoints-appendsingle-2.xhtml
new file mode 100644
index 000000000..0a12f0d5a
--- /dev/null
+++ b/layout/reftests/dom/multipleinsertionpoints-appendsingle-2.xhtml
@@ -0,0 +1,40 @@
+<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait">
+<head>
+
+<bindings xmlns="http://www.mozilla.org/xbl"
+ xmlns:xhtml="http://www.w3.org/1999/xhtml">
+ <binding id="a">
+ <content>
+ <xhtml:div>
+ <children includes="span"/>
+ </xhtml:div>
+ <xhtml:div>
+ <children/>
+ </xhtml:div>
+ </content>
+ </binding>
+</bindings>
+
+<script>
+function boom()
+{
+ document.body.offsetHeight;
+
+ var parent = document.getElementById("parent");
+
+ var newelt = document.createElement("span");
+ newelt.appendChild(document.createTextNode(2));
+ parent.appendChild(newelt);
+
+ document.body.offsetHeight;
+ document.documentElement.className = "";
+}
+</script>
+
+</head>
+<body onload="boom();">
+<div id="parent" style="-moz-binding: url(#a);">
+ <div>3</div><span>1</span><div>4</div><div>5</div>
+</div>
+</body>
+</html>
diff --git a/layout/reftests/dom/multipleinsertionpoints-insertmultiple.xhtml b/layout/reftests/dom/multipleinsertionpoints-insertmultiple.xhtml
new file mode 100644
index 000000000..7af09689a
--- /dev/null
+++ b/layout/reftests/dom/multipleinsertionpoints-insertmultiple.xhtml
@@ -0,0 +1,49 @@
+<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait">
+<head>
+
+<bindings xmlns="http://www.mozilla.org/xbl"
+ xmlns:xhtml="http://www.w3.org/1999/xhtml">
+ <binding id="a">
+ <content>
+ <xhtml:div>
+ <children includes="span"/>
+ </xhtml:div>
+ <xhtml:div>
+ <children/>
+ </xhtml:div>
+ </content>
+ </binding>
+</bindings>
+
+<script>
+function boom()
+{
+ document.body.offsetHeight;
+
+ var lastdiv = document.getElementById("last");
+ var parent = lastdiv.parentNode;
+
+ var newelt = document.createElement("span");
+ newelt.appendChild(document.createTextNode(1));
+ parent.insertBefore(newelt, lastdiv);
+
+ newelt = document.createElement("div");
+ newelt.appendChild(document.createTextNode(4));
+ parent.insertBefore(newelt, lastdiv);
+
+ newelt = document.createElement("span");
+ newelt.appendChild(document.createTextNode(2));
+ parent.insertBefore(newelt, lastdiv);
+
+ document.body.offsetHeight;
+ document.documentElement.className = "";
+}
+</script>
+
+</head>
+<body onload="boom();">
+<div style="-moz-binding: url(#a);">
+ <div>3</div><div id="last">5</div>
+</div>
+</body>
+</html>
diff --git a/layout/reftests/dom/multipleinsertionpoints-insertsingle-1.xhtml b/layout/reftests/dom/multipleinsertionpoints-insertsingle-1.xhtml
new file mode 100644
index 000000000..b7abfbffb
--- /dev/null
+++ b/layout/reftests/dom/multipleinsertionpoints-insertsingle-1.xhtml
@@ -0,0 +1,41 @@
+<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait">
+<head>
+
+<bindings xmlns="http://www.mozilla.org/xbl"
+ xmlns:xhtml="http://www.w3.org/1999/xhtml">
+ <binding id="a">
+ <content>
+ <xhtml:div>
+ <children includes="span"/>
+ </xhtml:div>
+ <xhtml:div>
+ <children/>
+ </xhtml:div>
+ </content>
+ </binding>
+</bindings>
+
+<script>
+function boom()
+{
+ document.body.offsetHeight;
+
+ var lastdiv = document.getElementById("last");
+ var parent = lastdiv.parentNode;
+
+ var newelt = document.createElement("span");
+ newelt.appendChild(document.createTextNode(2));
+ parent.insertBefore(newelt, lastdiv);
+
+ document.body.offsetHeight;
+ document.documentElement.className = "";
+}
+</script>
+
+</head>
+<body onload="boom();">
+<div style="-moz-binding: url(#a);">
+ <div>3</div><span>1</span><div>4</div><div id="last">5</div>
+</div>
+</body>
+</html>
diff --git a/layout/reftests/dom/multipleinsertionpoints-insertsingle-2.xhtml b/layout/reftests/dom/multipleinsertionpoints-insertsingle-2.xhtml
new file mode 100644
index 000000000..46b16cd79
--- /dev/null
+++ b/layout/reftests/dom/multipleinsertionpoints-insertsingle-2.xhtml
@@ -0,0 +1,41 @@
+<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait">
+<head>
+
+<bindings xmlns="http://www.mozilla.org/xbl"
+ xmlns:xhtml="http://www.w3.org/1999/xhtml">
+ <binding id="a">
+ <content>
+ <xhtml:div>
+ <children includes="span"/>
+ </xhtml:div>
+ <xhtml:div>
+ <children/>
+ </xhtml:div>
+ </content>
+ </binding>
+</bindings>
+
+<script>
+function boom()
+{
+ document.body.offsetHeight;
+
+ var afterelt = document.getElementById("after");
+ var parent = afterelt.parentNode;
+
+ var newelt = document.createElement("div");
+ newelt.appendChild(document.createTextNode(4));
+ parent.insertBefore(newelt, afterelt);
+
+ document.body.offsetHeight;
+ document.documentElement.className = "";
+}
+</script>
+
+</head>
+<body onload="boom();">
+<div style="-moz-binding: url(#a);">
+ <div>3</div><span>1</span><span id="after">2</span><div>5</div>
+</div>
+</body>
+</html>
diff --git a/layout/reftests/dom/multipleinsertionpoints-ref.xhtml b/layout/reftests/dom/multipleinsertionpoints-ref.xhtml
new file mode 100644
index 000000000..0f8ed4206
--- /dev/null
+++ b/layout/reftests/dom/multipleinsertionpoints-ref.xhtml
@@ -0,0 +1,12 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<body>
+<div>
+ <div>
+ <span>1</span><span>2</span>
+ </div>
+ <div>
+ <div>3</div><div>4</div><div>5</div>
+ </div>
+</div>
+</body>
+</html>
diff --git a/layout/reftests/dom/multipleinsertionpoints-ref2.xhtml b/layout/reftests/dom/multipleinsertionpoints-ref2.xhtml
new file mode 100644
index 000000000..b5b9a0750
--- /dev/null
+++ b/layout/reftests/dom/multipleinsertionpoints-ref2.xhtml
@@ -0,0 +1,25 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+
+<bindings xmlns="http://www.mozilla.org/xbl"
+ xmlns:xhtml="http://www.w3.org/1999/xhtml">
+ <binding id="a">
+ <content>
+ <xhtml:div>
+ <children includes="span"/>
+ </xhtml:div>
+ <xhtml:div>
+ <children/>
+ </xhtml:div>
+ </content>
+ </binding>
+</bindings>
+
+</head>
+
+<body>
+<div style="-moz-binding: url(#a);">
+ <div>3</div><span>1</span><div>4</div><span>2</span><div>5</div>
+</div>
+</body>
+</html>
diff --git a/layout/reftests/dom/reftest-stylo.list b/layout/reftests/dom/reftest-stylo.list
new file mode 100644
index 000000000..266ec1c2b
--- /dev/null
+++ b/layout/reftests/dom/reftest-stylo.list
@@ -0,0 +1,76 @@
+# DO NOT EDIT! This is a auto-generated temporary list for Stylo testing
+# various tests involving dynamic insertion using the DOM
+
+# append a single element
+skip == appendsingle.html appendsingle.html
+
+# append several elements
+skip == appendmultiple.html appendmultiple.html
+
+# insert a single element
+== insertsingle.html insertsingle.html
+
+# insert several elements
+== insertmultiple.html insertmultiple.html
+
+# insert multiple nodes to a parent and one of its children
+== inserttoparentandchild-1.html inserttoparentandchild-1.html
+== inserttoparentandchild-2.html inserttoparentandchild-2.html
+
+# insert a parent with child and then insert more children to the parent
+== insertparentandchild.html insertparentandchild.html
+
+# insert nodes to two different parents
+== inserttwoparents.html inserttwoparents.html
+
+# multiple content inserts and appends
+# multiple range inserts
+== insertmultiplemultiple-1.html insertmultiplemultiple-1.html
+# a range insert and an append
+== insertmultiplemultiple-2.html insertmultiplemultiple-2.html
+# multiple range inserts and an append
+== insertmultiplemultiple-2.html insertmultiplemultiple-2.html
+
+# testing bindings that have multiple insertion points
+# skip XBL test case on B2G
+skip-if(B2G||Mulet) == multipleinsertionpoints-ref2.xhtml multipleinsertionpoints-ref2.xhtml
+# Initial mulet triage: parity with B2G/B2G Desktop
+# append a single element
+skip skip-if(B2G||Mulet) == multipleinsertionpoints-appendsingle-1.xhtml multipleinsertionpoints-appendsingle-1.xhtml
+# bug 773482
+# Initial mulet triage: parity with B2G/B2G Desktop
+skip skip-if(B2G||Mulet) == multipleinsertionpoints-appendsingle-2.xhtml multipleinsertionpoints-appendsingle-2.xhtml
+# bug 773482
+# Initial mulet triage: parity with B2G/B2G Desktop
+# append several elements
+skip skip-if(B2G||Mulet) == multipleinsertionpoints-appendmultiple.xhtml multipleinsertionpoints-appendmultiple.xhtml
+# bug 773482
+# Initial mulet triage: parity with B2G/B2G Desktop
+# insert a single element
+skip-if(B2G||Mulet) == multipleinsertionpoints-insertsingle-1.xhtml multipleinsertionpoints-insertsingle-1.xhtml
+# bug 773482
+# Initial mulet triage: parity with B2G/B2G Desktop
+skip-if(B2G||Mulet) == multipleinsertionpoints-insertsingle-2.xhtml multipleinsertionpoints-insertsingle-2.xhtml
+# bug 773482
+# Initial mulet triage: parity with B2G/B2G Desktop
+# insert several elements
+skip-if(B2G||Mulet) == multipleinsertionpoints-insertmultiple.xhtml multipleinsertionpoints-insertmultiple.xhtml
+# bug 773482
+# Initial mulet triage: parity with B2G/B2G Desktop
+
+# test appending some nodes whose frame construction should be done lazily
+# followed by appending a node that might not be done lazily
+skip skip-if((B2G&&browserIsRemote)||Mulet) == multipleappendwithxul.xhtml multipleappendwithxul.xhtml
+# Bug 974780
+# Initial mulet triage: parity with B2G/B2G Desktop
+skip == multipleappendwithinput.xhtml multipleappendwithinput.xhtml
+skip == multipleappendwitheditable.xhtml multipleappendwitheditable.xhtml
+
+skip-if(B2G||Mulet) == xbl-children-1.xhtml xbl-children-1.xhtml
+# Initial mulet triage: parity with B2G/B2G Desktop
+skip-if(B2G||Mulet) == xbl-children-2.xhtml xbl-children-2.xhtml
+# Initial mulet triage: parity with B2G/B2G Desktop
+skip-if(B2G||Mulet) == xbl-children-3.xhtml xbl-children-3.xhtml
+# Initial mulet triage: parity with B2G/B2G Desktop
+skip-if(B2G||Mulet) == xbl-children-4.xhtml xbl-children-4.xhtml
+# Initial mulet triage: parity with B2G/B2G Desktop
diff --git a/layout/reftests/dom/reftest.list b/layout/reftests/dom/reftest.list
new file mode 100644
index 000000000..6e8a18108
--- /dev/null
+++ b/layout/reftests/dom/reftest.list
@@ -0,0 +1,55 @@
+# various tests involving dynamic insertion using the DOM
+
+# append a single element
+== appendsingle.html appendsingle-ref.html
+
+# append several elements
+== appendmultiple.html appendmultiple-ref.html
+
+# insert a single element
+== insertsingle.html insertsingle-ref.html
+
+# insert several elements
+== insertmultiple.html insertmultiple-ref.html
+
+# insert multiple nodes to a parent and one of its children
+== inserttoparentandchild-1.html inserttoparentandchild-ref.html
+== inserttoparentandchild-2.html inserttoparentandchild-ref.html
+
+# insert a parent with child and then insert more children to the parent
+== insertparentandchild.html insertparentandchild-ref.html
+
+# insert nodes to two different parents
+== inserttwoparents.html inserttwoparents-ref.html
+
+# multiple content inserts and appends
+# multiple range inserts
+== insertmultiplemultiple-1.html insertmultiplemultiple-ref.html
+# a range insert and an append
+== insertmultiplemultiple-2.html insertmultiplemultiple-ref.html
+# multiple range inserts and an append
+== insertmultiplemultiple-2.html insertmultiplemultiple-ref.html
+
+# testing bindings that have multiple insertion points
+== multipleinsertionpoints-ref2.xhtml multipleinsertionpoints-ref.xhtml
+# append a single element
+== multipleinsertionpoints-appendsingle-1.xhtml multipleinsertionpoints-ref.xhtml
+== multipleinsertionpoints-appendsingle-2.xhtml multipleinsertionpoints-ref.xhtml
+# append several elements
+== multipleinsertionpoints-appendmultiple.xhtml multipleinsertionpoints-ref.xhtml
+# insert a single element
+== multipleinsertionpoints-insertsingle-1.xhtml multipleinsertionpoints-ref.xhtml
+== multipleinsertionpoints-insertsingle-2.xhtml multipleinsertionpoints-ref.xhtml
+# insert several elements
+== multipleinsertionpoints-insertmultiple.xhtml multipleinsertionpoints-ref.xhtml
+
+# test appending some nodes whose frame construction should be done lazily
+# followed by appending a node that might not be done lazily
+== multipleappendwithxul.xhtml multipleappendwithxul-ref.xhtml
+== multipleappendwithinput.xhtml multipleappendwithinput-ref.xhtml
+== multipleappendwitheditable.xhtml multipleappendwitheditable-ref.xhtml
+
+== xbl-children-1.xhtml xbl-children-1-ref.xhtml
+== xbl-children-2.xhtml about:blank
+== xbl-children-3.xhtml xbl-children-3-ref.html
+== xbl-children-4.xhtml xbl-children-4-ref.html
diff --git a/layout/reftests/dom/xbl-children-1-ref.xhtml b/layout/reftests/dom/xbl-children-1-ref.xhtml
new file mode 100644
index 000000000..db526e901
--- /dev/null
+++ b/layout/reftests/dom/xbl-children-1-ref.xhtml
@@ -0,0 +1,16 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <style>
+ #result {
+ color: green;
+ text-decoration: underline;
+ text-transform: lowercase;
+ background: yellow;
+ }
+ </style>
+ </head>
+ <body>
+ <div id="result">text</div>
+ </body>
+</html>
+
diff --git a/layout/reftests/dom/xbl-children-1.xhtml b/layout/reftests/dom/xbl-children-1.xhtml
new file mode 100644
index 000000000..6d065b61a
--- /dev/null
+++ b/layout/reftests/dom/xbl-children-1.xhtml
@@ -0,0 +1,39 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+
+<bindings xmlns="http://www.mozilla.org/xbl"
+ xmlns:xhtml="http://www.w3.org/1999/xhtml">
+ <binding id="a">
+ <content>
+ <xhtml:div class="aparent">
+ <xhtml:div class="a">
+ <children>
+ <xhtml:div class="b">
+ TEXT
+ </xhtml:div>
+ </children>
+ </xhtml:div>
+ </xhtml:div>
+ </content>
+ </binding>
+</bindings>
+
+<style>
+
+ @namespace xbl "http://www.mozilla.org/xbl";
+ .a > .b { color: green; }
+ .a > xbl|children > .b { text-decoration: underline; }
+ .a .b { text-transform: lowercase; }
+ .aparent > * > .b { background: yellow; }
+
+ /* Inverse cases. */
+ .a > * > xbl|children > .b { color: red !important; }
+
+</style>
+
+</head>
+
+<body>
+<div style="-moz-binding: url(#a);" />
+</body>
+</html>
diff --git a/layout/reftests/dom/xbl-children-2.xhtml b/layout/reftests/dom/xbl-children-2.xhtml
new file mode 100644
index 000000000..97b511538
--- /dev/null
+++ b/layout/reftests/dom/xbl-children-2.xhtml
@@ -0,0 +1,28 @@
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:xbl="http://www.mozilla.org/xbl">
+<head>
+ <style>
+ .forced { display:block; }
+ </style>
+</head>
+<body>
+ <xbl:children>
+ FAIL
+ </xbl:children>
+
+ <xbl:children class="forced">
+ FAIL
+ </xbl:children>
+
+ <xbl:children />
+
+ <script>
+ var third = document.body.children[2];
+ third.appendChild(document.createTextNode("FAIL"));
+
+ var fourth = document.createElementNS("http://www.mozilla.org/xbl", "children");
+ fourth.appendChild(document.createTextNode("FAIL"));
+ document.body.appendChild(fourth);
+ </script>
+</body>
+</html>
diff --git a/layout/reftests/dom/xbl-children-3-ref.html b/layout/reftests/dom/xbl-children-3-ref.html
new file mode 100644
index 000000000..5c749d9c8
--- /dev/null
+++ b/layout/reftests/dom/xbl-children-3-ref.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="UTF-8">
+ </head>
+ <body>
+ <div style="border: dashed green">
+ <span style="color: green">should be green in a green border</span>
+ </div>
+ <div style="border: dashed green">
+ <span style="color: green">should be green in a green border</span>
+ </div>
+ <div><div>Should be uncolored with no border</div></div>
+ <div>true, true</div>
+ <div><span>In a span</span><div>Should be uncolored with no border</div></div>
+ <div>PASS</div>
+ <div><span style="color: green">PASS</span></div>
+ <div>PASS</div>
+ </body>
+</html>
diff --git a/layout/reftests/dom/xbl-children-3.xhtml b/layout/reftests/dom/xbl-children-3.xhtml
new file mode 100644
index 000000000..50ceca357
--- /dev/null
+++ b/layout/reftests/dom/xbl-children-3.xhtml
@@ -0,0 +1,61 @@
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:html="http://www.w3.org/1999/xhtml"
+ xmlns:xbl="http://www.mozilla.org/xbl"
+ xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+ class="reftest-wait">
+<head>
+ <xbl:bindings xmlns="http://www.mozilla.org/xbl">
+ <binding id="base">
+ <content>
+ <html:div style="border: solid red">
+ <children />
+ </html:div>
+ </content>
+ <implementation>
+ <property name="foo" onget="return 42" />
+ </implementation>
+ </binding>
+ <binding id="derived" extends="#base">
+ <content>
+ <html:div style="border: dashed green">
+ <children includes="span" />
+ </html:div>
+ </content>
+ </binding>
+ <binding id="nochildren">
+ <content>
+ PASS
+ </content>
+ </binding>
+ </xbl:bindings>
+</head>
+<body>
+ <!-- Control case: our (only) child matches the children element. -->
+ <div id="first" style="-moz-binding: url(#derived)"><span style="color: green">should be green in a green border</span></div>
+ <!-- Make sure we ignore xul:template and xul:observes elements! -->
+ <div style="-moz-binding: url(#derived)"><xul:template /><xul:observes /><span style="color: green">should be green in a green border</span></div>
+ <!-- Case where our (only) child doesn't match any children elements. -->
+ <div id="second" style="-moz-binding: url(#derived)"><div>Should be uncolored with no border</div></div>
+ <!-- But make sure the binding was still applied! -->
+ <div id="output" />
+ <script>
+ var $ = document.getElementById.bind(document);
+ // Note: Done in an onload handler because binding instantiation is
+ // asynchronous.
+ onload = function() {
+ $('output').textContent =
+ ($('first').foo === 42) + ", " + ($('first').foo === $('second').foo);
+ document.documentElement.removeAttribute('class');
+ }
+ </script>
+ <!-- Case where one of our children matches but the other one doesn't. -->
+ <div id="third" style="-moz-binding: url(#derived)"><span>In a span</span><div>Should be uncolored with no border</div></div>
+
+ <!-- Control case with no <children> in the binding. -->
+ <div style="-moz-binding: url(#nochildren)" />
+ <!-- Case where we have a child but no <children> in the binding. -->
+ <div style="-moz-binding: url(#nochildren)"><span style="color: green">PASS</span></div>
+ <!-- But we must ignore xul:template and xul:observes elements! -->
+ <div style="-moz-binding: url(#nochildren)"><xul:template /><xul:observes /></div>
+</body>
+</html>
diff --git a/layout/reftests/dom/xbl-children-4-ref.html b/layout/reftests/dom/xbl-children-4-ref.html
new file mode 100644
index 000000000..9a4534998
--- /dev/null
+++ b/layout/reftests/dom/xbl-children-4-ref.html
@@ -0,0 +1,7 @@
+<html>
+ <body>
+ <div>
+ <span>PASS</span>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/dom/xbl-children-4.xhtml b/layout/reftests/dom/xbl-children-4.xhtml
new file mode 100644
index 000000000..b8d8f8b59
--- /dev/null
+++ b/layout/reftests/dom/xbl-children-4.xhtml
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:xbl="http://www.mozilla.org/xbl"
+ class="reftest-wait">
+<head>
+ <meta charset="UTF-8" />
+ <style>
+ children { display:block; }
+ </style>
+</head>
+<body>
+ <xbl:children />
+ <script>
+ onload = function() {
+ /* First, schedule a pending restyle of the whole tree. */
+ var newSheet = document.createElementNS("http://www.w3.org/1999/xhtml", "style");
+ newSheet.appendChild(document.createTextNode("#nosuchelement { }"));
+ document.head.appendChild(newSheet);
+
+ /* Now, append a frame to our children element, causing the pending restyle to descend into it. */
+ var children = document.getElementsByTagName("xbl:children")[0];
+ var span = document.createElementNS("http://www.w3.org/1999/xhtml", "span");
+ span.appendChild(document.createTextNode("PASS"));
+ children.appendChild(span);
+ document.documentElement.removeAttribute("class");
+ }
+ </script>
+</body>
+</html>