summaryrefslogtreecommitdiffstats
path: root/layout/reftests/flexbox/flexbox-dyn-insertAroundSpan-3.xhtml
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/flexbox/flexbox-dyn-insertAroundSpan-3.xhtml
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/flexbox/flexbox-dyn-insertAroundSpan-3.xhtml')
-rw-r--r--layout/reftests/flexbox/flexbox-dyn-insertAroundSpan-3.xhtml107
1 files changed, 107 insertions, 0 deletions
diff --git a/layout/reftests/flexbox/flexbox-dyn-insertAroundSpan-3.xhtml b/layout/reftests/flexbox/flexbox-dyn-insertAroundSpan-3.xhtml
new file mode 100644
index 000000000..9f60c4316
--- /dev/null
+++ b/layout/reftests/flexbox/flexbox-dyn-insertAroundSpan-3.xhtml
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<!--
+ This test verifies that we reconstruct frames as necessary, after content
+ (including whitespace & spans) is dynamically inserted as a child of a
+ flexbox. (Note that in cases where we know the whitespace is going to be
+ dropped, we don't bother reconstructing frames. This test is to be sure we
+ aren't overzealous with that optimization.)
+-->
+<html xmlns="http://www.w3.org/1999/xhtml"
+ class="reftest-wait">
+ <head>
+ <style>
+ body {
+ font-size: 10px;
+ }
+
+ span.inserted {
+ background: teal; /* To make inserted span elements stand out. */
+ }
+
+ div.flexbox {
+ border: 1px dashed blue;
+ width: 300px;
+ display: flex;
+ justify-content: space-around;
+ margin-bottom: 1px;
+ white-space: pre;
+ }
+ </style>
+ <script>
+ function insertNodeAtPosnInElem(aNodeToInsert, aPosn, aParentId) {
+ var parent = document.getElementById(aParentId);
+ var insertBeforeTarget = parent.firstChild;
+ for (var i = 0; i &lt; aPosn; i++) {
+ insertBeforeTarget = insertBeforeTarget.nextSibling;
+ }
+ parent.insertBefore(aNodeToInsert, insertBeforeTarget);
+ }
+
+ function createSpanElem() {
+ var span = document.createElement("span");
+ span.setAttribute("class", "inserted");
+ span.appendChild(document.createTextNode("[NewSpan]"));
+ return span;
+ }
+
+ function tweak() {
+ // Inserting span, on either side of existing content
+ // --------------------------------------------------
+ insertNodeAtPosnInElem(createSpanElem(), 0, "f0");
+ insertNodeAtPosnInElem(createSpanElem(), 1, "f1");
+
+ // Inserting span and whitespace, before existing content
+ // ------------------------------------------------------
+ insertNodeAtPosnInElem(document.createTextNode(" "), 0, "f2");
+ insertNodeAtPosnInElem(createSpanElem(), 0, "f2");
+
+ insertNodeAtPosnInElem(createSpanElem(), 0, "f3");
+ insertNodeAtPosnInElem(document.createTextNode(" "), 0, "f3");
+
+ // Inserting span and whitespace, after existing content
+ // -----------------------------------------------------
+ insertNodeAtPosnInElem(document.createTextNode(" "), 1, "f4");
+ insertNodeAtPosnInElem(createSpanElem(), 1, "f4");
+
+ insertNodeAtPosnInElem(createSpanElem(), 1, "f5");
+ insertNodeAtPosnInElem(document.createTextNode(" "), 1, "f5");
+
+ // Inserting span and text, before existing content
+ // ------------------------------------------------
+ insertNodeAtPosnInElem(document.createTextNode("[NewText]"), 0, "f6");
+ insertNodeAtPosnInElem(createSpanElem(), 0, "f6");
+
+ insertNodeAtPosnInElem(createSpanElem(), 0, "f7");
+ insertNodeAtPosnInElem(document.createTextNode("[NewText]"), 0, "f7");
+
+ // Inserting span and text, after existing content
+ // -----------------------------------------------
+ insertNodeAtPosnInElem(document.createTextNode("[NewText]"), 1, "f8");
+ insertNodeAtPosnInElem(createSpanElem(), 1, "f8");
+
+ insertNodeAtPosnInElem(createSpanElem(), 1, "f9");
+ insertNodeAtPosnInElem(document.createTextNode("[NewText]"), 1, "f9");
+
+ document.documentElement.removeAttribute("class");
+ }
+
+ window.addEventListener("MozReftestInvalidate", tweak, false);
+ </script>
+ </head>
+ <body>
+ <div class="flexbox" id="f0"><span>[OldText]</span></div>
+ <div class="flexbox" id="f1"><span>[OldText]</span></div>
+ <div class="flexbox" id="f2"><span>[OldText]</span></div>
+ <div class="flexbox" id="f3"><span>[OldText]</span></div>
+ <div class="flexbox" id="f4"><span>[OldText]</span></div>
+ <div class="flexbox" id="f5"><span>[OldText]</span></div>
+ <div class="flexbox" id="f6"><span>[OldText]</span></div>
+ <div class="flexbox" id="f7"><span>[OldText]</span></div>
+ <div class="flexbox" id="f8"><span>[OldText]</span></div>
+ <div class="flexbox" id="f9"><span>[OldText]</span></div>
+ </body>
+</html>