diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /layout/reftests/flexbox/flexbox-dyn-insertEmptySpan-1.xhtml | |
parent | Initial commit. (diff) | |
download | thunderbird-upstream.tar.xz thunderbird-upstream.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/reftests/flexbox/flexbox-dyn-insertEmptySpan-1.xhtml')
-rw-r--r-- | layout/reftests/flexbox/flexbox-dyn-insertEmptySpan-1.xhtml | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/layout/reftests/flexbox/flexbox-dyn-insertEmptySpan-1.xhtml b/layout/reftests/flexbox/flexbox-dyn-insertEmptySpan-1.xhtml new file mode 100644 index 0000000000..9bcd133529 --- /dev/null +++ b/layout/reftests/flexbox/flexbox-dyn-insertEmptySpan-1.xhtml @@ -0,0 +1,103 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ +--> +<!-- + This test is a variant of flexbox-dyn-insertAroundText-3.xhtml with the + inserted spans being empty & having padding. This triggered invalidation + issues with an older work-in-progress patch, so I'm adding this reftest to + track that issue & prevent it from regressing. +--> +<html xmlns="http://www.w3.org/1999/xhtml" + class="reftest-wait"> + <head> + <style> + body { font-size: 10px; } + + <!-- to make inserted span elements stand out --> + span { + background: teal; + padding: 3px; + } + + 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 < aPosn; i++) { + insertBeforeTarget = insertBeforeTarget.nextSibling; + } + parent.insertBefore(aNodeToInsert, insertBeforeTarget); + } + + function createSpanElem() { + return document.createElement("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">[orig]</div> + <div class="flexbox" id="f1">[orig]</div> + <div class="flexbox" id="f2">[orig]</div> + <div class="flexbox" id="f3">[orig]</div> + <div class="flexbox" id="f4">[orig]</div> + <div class="flexbox" id="f5">[orig]</div> + <div class="flexbox" id="f6">[orig]</div> + <div class="flexbox" id="f7">[orig]</div> + <div class="flexbox" id="f8">[orig]</div> + <div class="flexbox" id="f9">[orig]</div> + </body> +</html> |