Bug 502937. Part 5. Create some tests.
authorTimothy Nikkel <tnikkel@gmail.com>
Fri, 16 Apr 2010 13:15:28 -0500
changeset 40940 699e6f9a366031743d1fd6c1ca4085113a28fa8b
parent 40939 7a19bc84e5729cf2eb9d33d5524bcd2c822eae3b
child 40941 935bb616b8a699537f2bbc2ef6392be1a263f4d3
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs502937
milestone1.9.3a5pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
Bug 502937. Part 5. Create some tests.
layout/reftests/dom/appendmultiple-ref.html
layout/reftests/dom/appendmultiple.html
layout/reftests/dom/appendsingle-ref.html
layout/reftests/dom/appendsingle.html
layout/reftests/dom/insertmultiple-ref.html
layout/reftests/dom/insertmultiple.html
layout/reftests/dom/insertmultiplemultiple-1.html
layout/reftests/dom/insertmultiplemultiple-2.html
layout/reftests/dom/insertmultiplemultiple-3.html
layout/reftests/dom/insertmultiplemultiple-ref.html
layout/reftests/dom/insertparentandchild-ref.html
layout/reftests/dom/insertparentandchild.html
layout/reftests/dom/insertsingle-ref.html
layout/reftests/dom/insertsingle.html
layout/reftests/dom/inserttoparentandchild-1.html
layout/reftests/dom/inserttoparentandchild-2.html
layout/reftests/dom/inserttoparentandchild-ref.html
layout/reftests/dom/inserttwoparents-ref.html
layout/reftests/dom/inserttwoparents.html
layout/reftests/dom/multipleappendwitheditable-ref.xhtml
layout/reftests/dom/multipleappendwitheditable.xhtml
layout/reftests/dom/multipleappendwithinput-ref.xhtml
layout/reftests/dom/multipleappendwithinput.xhtml
layout/reftests/dom/multipleappendwithxul-ref.xhtml
layout/reftests/dom/multipleappendwithxul.xhtml
layout/reftests/dom/multipleinsertionpoints-appendmultiple.xhtml
layout/reftests/dom/multipleinsertionpoints-appendsingle-1.xhtml
layout/reftests/dom/multipleinsertionpoints-appendsingle-2.xhtml
layout/reftests/dom/multipleinsertionpoints-insertmultiple.xhtml
layout/reftests/dom/multipleinsertionpoints-insertsingle-1.xhtml
layout/reftests/dom/multipleinsertionpoints-insertsingle-2.xhtml
layout/reftests/dom/multipleinsertionpoints-ref.xhtml
layout/reftests/dom/multipleinsertionpoints-ref2.xhtml
layout/reftests/dom/reftest.list
layout/reftests/reftest.list
layout/reftests/table-dom/insertCaptionsAndRows1-ref.html
layout/reftests/table-dom/insertCaptionsAndRows1.html
layout/reftests/table-dom/insertCaptionsAndRows2-ref.html
layout/reftests/table-dom/insertCaptionsAndRows2.html
layout/reftests/table-dom/insertCaptionsAndRows3-ref.html
layout/reftests/table-dom/insertCaptionsAndRows3.html
layout/reftests/table-dom/insertCaptionsAndRows4-ref.html
layout/reftests/table-dom/insertCaptionsAndRows4.html
layout/reftests/table-dom/insertColgroupAndRowgroup-ref.html
layout/reftests/table-dom/insertColgroupAndRowgroup.html
layout/reftests/table-dom/reftest.list
new file mode 100644
--- /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>
new file mode 100644
--- /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>
new file mode 100644
--- /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>
new file mode 100644
--- /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>
new file mode 100644
--- /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>
new file mode 100644
--- /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>
new file mode 100644
--- /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>
new file mode 100644
--- /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>
new file mode 100644
--- /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>
new file mode 100644
--- /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>
new file mode 100644
--- /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>
new file mode 100644
--- /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>
new file mode 100644
--- /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>
new file mode 100644
--- /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>
new file mode 100644
--- /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>
new file mode 100644
--- /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>
new file mode 100644
--- /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>
new file mode 100644
--- /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>
new file mode 100644
--- /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>
new file mode 100644
--- /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
new file mode 100644
--- /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
new file mode 100644
--- /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
new file mode 100644
--- /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
new file mode 100644
--- /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
new file mode 100644
--- /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
new file mode 100644
--- /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>
new file mode 100644
--- /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>
new file mode 100644
--- /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>
new file mode 100644
--- /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>
new file mode 100644
--- /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>
new file mode 100644
--- /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>
new file mode 100644
--- /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>
new file mode 100644
--- /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>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/dom/reftest.list
@@ -0,0 +1,50 @@
+# 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 child
+== 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
--- a/layout/reftests/reftest.list
+++ b/layout/reftests/reftest.list
@@ -12,16 +12,19 @@ include reftest-sanity/reftest.list
 include ../../modules/libpr0n/test/reftest/reftest.list
 
 # relative and absolute positioning
 include abs-pos/reftest.list
 
 # backgrounds/
 include backgrounds/reftest.list
 
+# dom/
+include dom/reftest.list
+
 # bidi/
 include bidi/reftest.list
 
 # border-image
 include border-image/reftest.list
 
 # border-radius/
 include border-radius/reftest.list
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-dom/insertCaptionsAndRows1-ref.html
@@ -0,0 +1,16 @@
+<html>
+<head>
+
+<style>
+ caption { color: green }
+</style>
+
+</head>
+<body>
+<table id="table">
+<tbody><tr><td>a new row 1</td></tr></tbody>
+<caption>this is the caption</caption>
+<tbody><tr><td>a new row 2</td></tr></tbody>
+</table>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-dom/insertCaptionsAndRows1.html
@@ -0,0 +1,45 @@
+<html class="reftest-wait">
+<head>
+
+<style>
+ caption { color: green }
+</style>
+
+<script>
+function boom()
+{
+  document.body.offsetHeight;
+
+  var table = document.getElementById("table");
+
+  var newtbody = document.createElement("tbody");
+  var newrow = document.createElement("tr");
+  var newcell = document.createElement("td");
+  newcell.appendChild(document.createTextNode("a new row 2"));
+  newrow.appendChild(newcell);
+  newtbody.appendChild(newrow);
+  table.insertBefore(newtbody, table.firstChild);
+
+  var caption = document.createElement("caption");
+  caption.appendChild(document.createTextNode("this is the caption"));
+  table.insertBefore(caption, table.firstChild);
+
+  newtbody = document.createElement("tbody");
+  newrow = document.createElement("tr");
+  newcell = document.createElement("td");
+  newcell.appendChild(document.createTextNode("a new row 1"));
+  newrow.appendChild(newcell);
+  newtbody.appendChild(newrow);
+  table.insertBefore(newtbody, table.firstChild);
+
+  document.body.offsetHeight;
+  document.documentElement.className = "";
+}
+</script>
+
+</head>
+<body onload="boom();">
+<table id="table">
+</table>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-dom/insertCaptionsAndRows2-ref.html
@@ -0,0 +1,19 @@
+<html>
+<head>
+
+<style>
+ caption { color: green }
+</style>
+
+</head>
+<body>
+<table id="table">
+<caption>this is the caption</caption>
+<tbody><tr><td>a new row 1</td></tr></tbody>
+<tbody><tr><td>a new row 2</td></tr></tbody>
+<tbody>
+<tr><td>a row</td></tr>
+</tbody>
+</table>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-dom/insertCaptionsAndRows2.html
@@ -0,0 +1,46 @@
+<html class="reftest-wait">
+<head>
+
+<style>
+ caption { color: green }
+</style>
+
+<script>
+function boom()
+{
+  document.body.offsetHeight;
+
+  var table = document.getElementById("table");
+
+  var newtbody = document.createElement("tbody");
+  var newrow = document.createElement("tr");
+  var newcell = document.createElement("td");
+  newcell.appendChild(document.createTextNode("a new row 2"));
+  newrow.appendChild(newcell);
+  newtbody.appendChild(newrow);
+  table.insertBefore(newtbody, table.firstChild);
+
+  var caption = document.createElement("caption");
+  caption.appendChild(document.createTextNode("this is the caption"));
+  table.insertBefore(caption, table.firstChild);
+
+  newtbody = document.createElement("tbody");
+  newrow = document.createElement("tr");
+  newcell = document.createElement("td");
+  newcell.appendChild(document.createTextNode("a new row 1"));
+  newrow.appendChild(newcell);
+  newtbody.appendChild(newrow);
+  table.insertBefore(newtbody, table.firstChild);
+
+  document.body.offsetHeight;
+  document.documentElement.className = "";
+}
+</script>
+
+</head>
+<body onload="boom();">
+<table id="table"><tbody>
+<tr><td>a row</td></tr>
+</tbody></table>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-dom/insertCaptionsAndRows3-ref.html
@@ -0,0 +1,18 @@
+<html>
+<head>
+
+<style>
+ caption { color: green }
+</style>
+
+</head>
+<body>
+<table id="table">
+<tbody><tr><td>a new row 1</td></tr></tbody>
+<caption>this is the caption</caption>
+<tbody><tr><td>a new row 2</td></tr></tbody>
+<caption>this is a caption that you shouldn't see</caption>
+<tbody><tr><td>a row</td></tr></tbody>
+</table>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-dom/insertCaptionsAndRows3.html
@@ -0,0 +1,48 @@
+<html class="reftest-wait">
+<head>
+
+<style>
+ caption { color: green }
+</style>
+
+<script>
+function boom()
+{
+  document.body.offsetHeight;
+
+  var table = document.getElementById("table");
+  var cap = document.getElementById("cap");
+
+  var newtbody = document.createElement("tbody");
+  var newrow = document.createElement("tr");
+  var newcell = document.createElement("td");
+  newcell.appendChild(document.createTextNode("a new row 1"));
+  newrow.appendChild(newcell);
+  newtbody.appendChild(newrow);
+  table.insertBefore(newtbody, cap);
+
+  var caption = document.createElement("caption");
+  caption.appendChild(document.createTextNode("this is the caption"));
+  table.insertBefore(caption, cap);
+
+  newtbody = document.createElement("tbody");
+  newrow = document.createElement("tr");
+  newcell = document.createElement("td");
+  newcell.appendChild(document.createTextNode("a new row 2"));
+  newrow.appendChild(newcell);
+  newtbody.appendChild(newrow);
+  table.insertBefore(newtbody, cap);
+
+  document.body.offsetHeight;
+  document.documentElement.className = "";
+}
+</script>
+
+</head>
+<body onload="boom();">
+<table id="table">
+<caption id="cap">this is a caption that you shouldn't see</caption>
+<tbody><tr><td>a row</td></tr></tbody>
+</table>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-dom/insertCaptionsAndRows4-ref.html
@@ -0,0 +1,18 @@
+<html>
+<head>
+
+<style>
+ caption { color: green }
+</style>
+
+</head>
+<body>
+<table id="table">
+<caption>this is the caption</caption>
+<tbody><tr><td>a new row 1</td></tr></tbody>
+<caption>this is a caption that you shouldn't see</caption>
+<tbody><tr><td>a new row 2</td></tr></tbody>
+<tbody><tr><td>a row</td></tr></tbody>
+</table>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-dom/insertCaptionsAndRows4.html
@@ -0,0 +1,48 @@
+<html class="reftest-wait">
+<head>
+
+<style>
+ caption { color: green }
+</style>
+
+<script>
+function boom()
+{
+  document.body.offsetHeight;
+
+  var table = document.getElementById("table");
+  var tbody = document.getElementById("tbody");
+
+  var newtbody = document.createElement("tbody");
+  var newrow = document.createElement("tr");
+  var newcell = document.createElement("td");
+  newcell.appendChild(document.createTextNode("a new row 1"));
+  newrow.appendChild(newcell);
+  newtbody.appendChild(newrow);
+  table.insertBefore(newtbody, tbody);
+
+  var caption = document.createElement("caption");
+  caption.appendChild(document.createTextNode("this is a caption that you shouldn't see"));
+  table.insertBefore(caption, tbody);
+
+  newtbody = document.createElement("tbody");
+  newrow = document.createElement("tr");
+  newcell = document.createElement("td");
+  newcell.appendChild(document.createTextNode("a new row 2"));
+  newrow.appendChild(newcell);
+  newtbody.appendChild(newrow);
+  table.insertBefore(newtbody, tbody);
+
+  document.body.offsetHeight;
+  document.documentElement.className = "";
+}
+</script>
+
+</head>
+<body onload="boom();">
+<table id="table">
+<caption>this is the caption</caption>
+<tbody id="tbody"><tr><td>a row</td></tr></tbody>
+</table>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-dom/insertColgroupAndRowgroup-ref.html
@@ -0,0 +1,17 @@
+<html>
+<head>
+
+<style>
+ colgroup#s { width: 200px; }
+</style>
+
+</head>
+<body>
+<table border="1">
+<colgroup></colgroup>
+<colgroup id="s"></colgroup>
+<tbody><tr><td>cell 1,1</td><td>cell 1,2</td></tr></tbody>
+<tbody><tr><td>cell 2,1</td><td>cell 2,2</td></tr></tbody>
+</table>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-dom/insertColgroupAndRowgroup.html
@@ -0,0 +1,43 @@
+<html class="reftest-wait">
+<head>
+
+<style>
+ colgroup#s { width: 200px; }
+</style>
+
+<script>
+function boom()
+{
+  document.body.offsetHeight;
+
+  var last = document.getElementById("last");
+  var parent = last.parentNode;
+
+  var colgroup = document.createElement("colgroup");
+  colgroup.setAttribute("id", "s");
+  parent.insertBefore(colgroup, last);
+
+  var newtbody = document.createElement("tbody");
+  var newrow = document.createElement("tr");
+  var newcell = document.createElement("td");
+  newcell.appendChild(document.createTextNode("cell 1,1"));
+  newrow.appendChild(newcell);
+  newcell = document.createElement("td");
+  newcell.appendChild(document.createTextNode("cell 1,2"));
+  newrow.appendChild(newcell);
+  newtbody.appendChild(newrow);
+  parent.insertBefore(newtbody, last);
+
+  document.body.offsetHeight;
+  document.documentElement.className = "";
+}
+</script>
+
+</head>
+<body onload="boom();">
+<table border="1">
+<colgroup></colgroup>
+<tbody id="last"><tr><td>cell 2,1</td><td>cell 2,2</td></tr></tbody>
+</table>
+</body>
+</html>
--- a/layout/reftests/table-dom/reftest.list
+++ b/layout/reftests/table-dom/reftest.list
@@ -15,24 +15,29 @@
 == deleteCol3.html deleteCol3-ref.html
 == deleteColGroup1.html deleteColGroup1-ref.html
 == deleteColGroup2.html deleteColGroup2-ref.html
 == deleteRowsRebuild1.html deleteRowsRebuild1-ref.html
 == deleteRowsRebuild1a.html deleteRowsRebuild1a-ref.html
 == deleteRowsShrink1.html deleteRowsShrink1-ref.html
 == deleteTbodyExpand1.html deleteTbodyExpand1-ref.html
 == deleteTbodyRebuild1.html deleteTbodyRebuild1-ref.html
+== insertCaptionsAndRows1.html insertCaptionsAndRows1-ref.html
+== insertCaptionsAndRows2.html insertCaptionsAndRows2-ref.html
+== insertCaptionsAndRows3.html insertCaptionsAndRows3-ref.html
+== insertCaptionsAndRows4.html insertCaptionsAndRows4-ref.html
 == insertCellsExpand1.html insertCellsExpand1-ref.html
 == insertCellsExpand2.html insertCellsExpand2-ref.html
 == insertCellsExpandZeroRowspan.html insertCellsExpandZeroRowspan-ref.html
 == insertCellsRebuild1.html insertCellsRebuild1-ref.html
 == insertCellsRebuild2.html insertCellsRebuild2-ref.html
 == insertCellsZeroColspan.html insertCellsZeroColspan-ref.html
 == insertColGroups1.html insertColGroups1-ref.html
 == insertColGroups2.html insertColGroups2-ref.html
+== insertColgroupAndRowgroup.html insertColgroupAndRowgroup-ref.html
 == insertCols1.html insertCols1-ref.html
 == insertCols2.html insertCols2-ref.html
 == insertCols3.html insertCols3-ref.html
 == insertCols4.html insertCols4-ref.html
 == insertCols5.html insertCols5-ref.html
 == insertRowsExpand1.html insertRowsExpand1-ref.html
 == insertRowsRebuild1.html insertRowsRebuild1-ref.html
 == insertTbodyExpand1.html insertTbodyExpand1-ref.html