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 like flexbox-float-1b.xhtml, but with the float-styled
8 element dynamically inserted.
10 <html xmlns=
"http://www.w3.org/1999/xhtml" class=
"reftest-wait">
13 function generateFloat(aFloatDirection) {
14 var newElem = document.createElement(
"div");
15 newElem.setAttribute(
"style",
"float: " + aFloatDirection);
16 newElem.innerHTML = aFloatDirection ==
"left" ?
"[[[" :
"]]]";
21 var containerList = document.getElementsByClassName(
"flexbox");
22 for (var i =
0; i
< containerList.length; i++) {
23 var container = containerList[i];
24 var newElem = generateFloat(container.getAttribute(
"floatValToUse"));
26 var nodeToInsertBefore;
27 var insertPosn = container.getAttribute(
"insertPosn");
28 if (insertPosn ==
"begin") {
29 nodeToInsertBefore = container.firstChild;
30 } else if (insertPosn ==
"mid") {
31 nodeToInsertBefore = container.firstChild.nextSibling;
32 } else if (insertPosn ==
"end") {
33 nodeToInsertBefore = null;
36 container.insertBefore(newElem, nodeToInsertBefore);
39 document.documentElement.removeAttribute(
"class");
42 window.addEventListener(
"MozReftestInvalidate", tweak, false);
49 font-family: sans-serif;
50 background: lightgreen;
51 justify-content: space-around;
56 <div class=
"flexbox" floatValToUse=
"left" insertPosn=
"mid">
59 <div class=
"flexbox" floatValToUse=
"right" insertPosn=
"mid">
62 <div class=
"flexbox" floatValToUse=
"left" insertPosn=
"end">
65 <div class=
"flexbox" floatValToUse=
"right" insertPosn=
"end">
68 <div class=
"flexbox" floatValToUse=
"left" insertPosn=
"begin">
71 <div class=
"flexbox" floatValToUse=
"right" insertPosn=
"begin">