diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:47:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:47:29 +0000 |
commit | 0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d (patch) | |
tree | a31f07c9bcca9d56ce61e9a1ffd30ef350d513aa /layout/reftests/dom | |
parent | Initial commit. (diff) | |
download | firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.tar.xz firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.zip |
Adding upstream version 115.8.0esr.upstream/115.8.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/reftests/dom')
34 files changed, 1046 insertions, 0 deletions
diff --git a/layout/reftests/dom/appendmultiple-ref.html b/layout/reftests/dom/appendmultiple-ref.html new file mode 100644 index 0000000000..e634909e89 --- /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 0000000000..26d2d85401 --- /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 0000000000..e634909e89 --- /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 0000000000..321c60da43 --- /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 0000000000..e634909e89 --- /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 0000000000..cb58f5bdd8 --- /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 0000000000..20cec325a3 --- /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 0000000000..5a9845b7b2 --- /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 0000000000..f9fdb2d33c --- /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 0000000000..01da6614ce --- /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 0000000000..0bd911e7fe --- /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 0000000000..b5d5b8236c --- /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 0000000000..e634909e89 --- /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 0000000000..42a12ee7bf --- /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 0000000000..7219e786dc --- /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 0000000000..cdd0ccdc4a --- /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 0000000000..0bd911e7fe --- /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 0000000000..daf6c06271 --- /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 0000000000..16b94491dd --- /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 0000000000..fb80a5faca --- /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 0000000000..71fefd5192 --- /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 0000000000..2f79bc0271 --- /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 0000000000..762a15b846 --- /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 0000000000..0573a5df9d --- /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 0000000000..365d4b37cb --- /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-shadow.xhtml b/layout/reftests/dom/multipleinsertionpoints-appendmultiple-shadow.xhtml new file mode 100644 index 0000000000..046d7e5f56 --- /dev/null +++ b/layout/reftests/dom/multipleinsertionpoints-appendmultiple-shadow.xhtml @@ -0,0 +1,47 @@ +<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait"> +<head> +<script> +customElements.define("custom-element", class extends HTMLElement { + constructor() { + super(); + const template = document.getElementById("template"); + const shadowRoot = this.attachShadow({mode: "open"}) + .appendChild(template.content.cloneNode(true)); + } +}); + +function boom() +{ + document.body.offsetHeight; + + var parent = document.getElementById("parent"); + + var newelt = document.createElement("span"); + newelt.setAttribute("slot", "foo"); + 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();"> +<template id="template"> + <div> + <slot name="foo"/> + </div> + <div> + <slot/> + </div> +</template> +<custom-element id="parent" style="display: block;"> + <div>3</div><span slot="foo">1</span><div>4</div> +</custom-element> +</body> +</html> diff --git a/layout/reftests/dom/multipleinsertionpoints-appendsingle-1-shadow.xhtml b/layout/reftests/dom/multipleinsertionpoints-appendsingle-1-shadow.xhtml new file mode 100644 index 0000000000..fa79f4d34c --- /dev/null +++ b/layout/reftests/dom/multipleinsertionpoints-appendsingle-1-shadow.xhtml @@ -0,0 +1,42 @@ +<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait"> +<head> +<script> +customElements.define("custom-element", class extends HTMLElement { + constructor() { + super(); + const template = document.getElementById("template"); + const shadowRoot = this.attachShadow({mode: "open"}) + .appendChild(template.content.cloneNode(true)); + } +}); + +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();"> +<template id="template"> + <div> + <slot name="foo"/> + </div> + <div> + <slot/> + </div> +</template> +<custom-element id="parent" style="display: block;"> + <div>3</div><span slot="foo">1</span><div>4</div><span slot="foo">2</span> +</custom-element> +</body> +</html> diff --git a/layout/reftests/dom/multipleinsertionpoints-appendsingle-2-shadow.xhtml b/layout/reftests/dom/multipleinsertionpoints-appendsingle-2-shadow.xhtml new file mode 100644 index 0000000000..1b11798663 --- /dev/null +++ b/layout/reftests/dom/multipleinsertionpoints-appendsingle-2-shadow.xhtml @@ -0,0 +1,43 @@ +<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait"> +<head> +<script> +customElements.define("custom-element", class extends HTMLElement { + constructor() { + super(); + const template = document.getElementById("template"); + const shadowRoot = this.attachShadow({mode: "open"}) + .appendChild(template.content.cloneNode(true)); + } +}); + +function boom() +{ + document.body.offsetHeight; + + var parent = document.getElementById("parent"); + + var newelt = document.createElement("span"); + newelt.setAttribute("slot", "foo"); + newelt.appendChild(document.createTextNode(2)); + parent.appendChild(newelt); + + document.body.offsetHeight; + document.documentElement.className = ""; +} +</script> + +</head> +<body onload="boom();"> +<template id="template"> + <div> + <slot name="foo"/> + </div> + <div> + <slot/> + </div> +</template> +<custom-element id="parent" style="display: block;"> + <div>3</div><span slot="foo">1</span><div>4</div><div>5</div> +</custom-element> +</body> +</html> diff --git a/layout/reftests/dom/multipleinsertionpoints-insertmultiple-shadow.xhtml b/layout/reftests/dom/multipleinsertionpoints-insertmultiple-shadow.xhtml new file mode 100644 index 0000000000..89f138cb67 --- /dev/null +++ b/layout/reftests/dom/multipleinsertionpoints-insertmultiple-shadow.xhtml @@ -0,0 +1,53 @@ +<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait"> +<head> +<script> +customElements.define("custom-element", class extends HTMLElement { + constructor() { + super(); + const template = document.getElementById("template"); + const shadowRoot = this.attachShadow({mode: "open"}) + .appendChild(template.content.cloneNode(true)); + } +}); + +function boom() +{ + document.body.offsetHeight; + + var lastdiv = document.getElementById("last"); + var parent = lastdiv.parentNode; + + var newelt = document.createElement("span"); + newelt.setAttribute("slot", "foo"); + 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.setAttribute("slot", "foo"); + newelt.appendChild(document.createTextNode(2)); + parent.insertBefore(newelt, lastdiv); + + document.body.offsetHeight; + document.documentElement.className = ""; +} +</script> + +</head> +<body onload="boom();"> +<template id="template"> + <div> + <slot name="foo"/> + </div> + <div> + <slot/> + </div> +</template> +<custom-element style="display: block;"> + <div>3</div><div id="last">5</div> +</custom-element> +</body> +</html> diff --git a/layout/reftests/dom/multipleinsertionpoints-insertsingle-1-shadow.xhtml b/layout/reftests/dom/multipleinsertionpoints-insertsingle-1-shadow.xhtml new file mode 100644 index 0000000000..dcefb20017 --- /dev/null +++ b/layout/reftests/dom/multipleinsertionpoints-insertsingle-1-shadow.xhtml @@ -0,0 +1,44 @@ +<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait"> +<head> +<script> +customElements.define("custom-element", class extends HTMLElement { + constructor() { + super(); + const template = document.getElementById("template"); + const shadowRoot = this.attachShadow({mode: "open"}) + .appendChild(template.content.cloneNode(true)); + } +}); + +function boom() +{ + document.body.offsetHeight; + + var lastdiv = document.getElementById("last"); + var parent = lastdiv.parentNode; + + var newelt = document.createElement("span"); + newelt.setAttribute("slot", "foo"); + newelt.appendChild(document.createTextNode(2)); + parent.insertBefore(newelt, lastdiv); + + document.body.offsetHeight; + document.documentElement.className = ""; +} +</script> + +</head> +<body onload="boom();"> +<template id="template"> + <div> + <slot name="foo"/> + </div> + <div> + <slot/> + </div> +</template> +<custom-element style="display: block;"> + <div>3</div><span slot="foo">1</span><div>4</div><div id="last">5</div> +</custom-element> +</body> +</html> diff --git a/layout/reftests/dom/multipleinsertionpoints-insertsingle-2-shadow.xhtml b/layout/reftests/dom/multipleinsertionpoints-insertsingle-2-shadow.xhtml new file mode 100644 index 0000000000..987d533376 --- /dev/null +++ b/layout/reftests/dom/multipleinsertionpoints-insertsingle-2-shadow.xhtml @@ -0,0 +1,43 @@ +<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait"> +<head> +<script> +customElements.define("custom-element", class extends HTMLElement { + constructor() { + super(); + const template = document.getElementById("template"); + const shadowRoot = this.attachShadow({mode: "open"}) + .appendChild(template.content.cloneNode(true)); + } +}); + +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();"> +<template id="template"> + <div> + <slot name="foo"/> + </div> + <div> + <slot/> + </div> +</template> +<custom-element style="display: block;"> + <div>3</div><span slot="foo">1</span><span id="after" slot="foo">2</span><div>5</div> +</custom-element> +</body> +</html> diff --git a/layout/reftests/dom/multipleinsertionpoints-ref.xhtml b/layout/reftests/dom/multipleinsertionpoints-ref.xhtml new file mode 100644 index 0000000000..0f8ed42066 --- /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-shadow.xhtml b/layout/reftests/dom/multipleinsertionpoints-ref2-shadow.xhtml new file mode 100644 index 0000000000..7503c7d4b0 --- /dev/null +++ b/layout/reftests/dom/multipleinsertionpoints-ref2-shadow.xhtml @@ -0,0 +1,28 @@ +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<script> +customElements.define("custom-element", class extends HTMLElement { + constructor() { + super(); + const template = document.getElementById("template"); + const shadowRoot = this.attachShadow({mode: "open"}) + .appendChild(template.content.cloneNode(true)); + } +}); +</script> +</head> + +<body> +<template id="template"> + <div> + <slot name="foo"/> + </div> + <div> + <slot/> + </div> +</template> +<custom-element style="display: block;"> + <div>3</div><span slot="foo">1</span><div>4</div><span slot="foo">2</span><div>5</div> +</custom-element> +</body> +</html> diff --git a/layout/reftests/dom/reftest.list b/layout/reftests/dom/reftest.list new file mode 100644 index 0000000000..64ac914010 --- /dev/null +++ b/layout/reftests/dom/reftest.list @@ -0,0 +1,51 @@ +# 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-shadow.xhtml multipleinsertionpoints-ref.xhtml +# append a single element +== multipleinsertionpoints-appendsingle-1-shadow.xhtml multipleinsertionpoints-ref.xhtml +== multipleinsertionpoints-appendsingle-2-shadow.xhtml multipleinsertionpoints-ref.xhtml +# append several elements +== multipleinsertionpoints-appendmultiple-shadow.xhtml multipleinsertionpoints-ref.xhtml +# insert a single element +== multipleinsertionpoints-insertsingle-1-shadow.xhtml multipleinsertionpoints-ref.xhtml +== multipleinsertionpoints-insertsingle-2-shadow.xhtml multipleinsertionpoints-ref.xhtml +# insert several elements +== multipleinsertionpoints-insertmultiple-shadow.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 + |