1 <?xml version=
"1.0" encoding=
"UTF-8"?>
3 Any copyright is dedicated to the Public Domain.
4 http://creativecommons.org/publicdomain/zero/1.0/
7 This test is a variant of flexbox-dyn-insertAroundText-3.xhtml with the
8 inserted spans being empty & having padding. This triggered invalidation
9 issues with an older work-in-progress patch, so I'm adding this reftest to
10 track that issue & prevent it from regressing.
12 <html xmlns=
"http://www.w3.org/1999/xhtml"
16 body { font-size:
10px; }
18 <!-- to make inserted span elements stand out -->
25 border:
1px dashed blue;
28 justify-content: space-around;
34 function insertNodeAtPosnInElem(aNodeToInsert, aPosn, aParentId) {
35 var parent = document.getElementById(aParentId);
36 var insertBeforeTarget = parent.firstChild;
37 for (var i =
0; i
< aPosn; i++) {
38 insertBeforeTarget = insertBeforeTarget.nextSibling;
40 parent.insertBefore(aNodeToInsert, insertBeforeTarget);
43 function createSpanElem() {
44 return document.createElement(
"span");
48 // Inserting span, on either side of existing content
49 // --------------------------------------------------
50 insertNodeAtPosnInElem(createSpanElem(),
0,
"f0");
51 insertNodeAtPosnInElem(createSpanElem(),
1,
"f1");
53 // Inserting span and whitespace, before existing content
54 // ------------------------------------------------------
55 insertNodeAtPosnInElem(document.createTextNode(
" "),
0,
"f2");
56 insertNodeAtPosnInElem(createSpanElem(),
0,
"f2");
58 insertNodeAtPosnInElem(createSpanElem(),
0,
"f3");
59 insertNodeAtPosnInElem(document.createTextNode(
" "),
0,
"f3");
61 // Inserting span and whitespace, after existing content
62 // -----------------------------------------------------
63 insertNodeAtPosnInElem(document.createTextNode(
" "),
1,
"f4");
64 insertNodeAtPosnInElem(createSpanElem(),
1,
"f4");
66 insertNodeAtPosnInElem(createSpanElem(),
1,
"f5");
67 insertNodeAtPosnInElem(document.createTextNode(
" "),
1,
"f5");
69 // Inserting span and text, before existing content
70 // ------------------------------------------------
71 insertNodeAtPosnInElem(document.createTextNode(
"[NewText]"),
0,
"f6");
72 insertNodeAtPosnInElem(createSpanElem(),
0,
"f6");
74 insertNodeAtPosnInElem(createSpanElem(),
0,
"f7");
75 insertNodeAtPosnInElem(document.createTextNode(
"[NewText]"),
0,
"f7");
77 // Inserting span and text, after existing content
78 // -----------------------------------------------
79 insertNodeAtPosnInElem(document.createTextNode(
"[NewText]"),
1,
"f8");
80 insertNodeAtPosnInElem(createSpanElem(),
1,
"f8");
82 insertNodeAtPosnInElem(createSpanElem(),
1,
"f9");
83 insertNodeAtPosnInElem(document.createTextNode(
"[NewText]"),
1,
"f9");
85 document.documentElement.removeAttribute(
"class");
88 window.addEventListener(
"MozReftestInvalidate", tweak, false);
92 <div class=
"flexbox" id=
"f0">[orig]
</div>
93 <div class=
"flexbox" id=
"f1">[orig]
</div>
94 <div class=
"flexbox" id=
"f2">[orig]
</div>
95 <div class=
"flexbox" id=
"f3">[orig]
</div>
96 <div class=
"flexbox" id=
"f4">[orig]
</div>
97 <div class=
"flexbox" id=
"f5">[orig]
</div>
98 <div class=
"flexbox" id=
"f6">[orig]
</div>
99 <div class=
"flexbox" id=
"f7">[orig]
</div>
100 <div class=
"flexbox" id=
"f8">[orig]
</div>
101 <div class=
"flexbox" id=
"f9">[orig]
</div>