1 <pre id=
"console"></pre>
2 <div id=
"test1">Lorem
<span style=
"float: left;">-
</span>ipsum
</div>
3 <div id=
"test2">Lorem
<span style=
"float: left;"></span>ipsum
</div>
4 <div id=
"test3">Lorem
<div style=
"position: absolute;">-
</div>ipsum
</div>
5 <div id=
"test4">Lorem
<div style=
"position: absolute;"></div>ipsum
</div>
9 var console
= document
.getElementById("console");
10 console
.appendChild(document
.createTextNode(message
+ "\n"));
13 function test(id
, expected
)
15 var actual
= document
.getElementById(id
).innerText
;
16 if (actual
== expected
)
17 log(id
+ " PASS: innerText is " + actual
+ " as expected");
19 log(id
+ " FAIL: innerText is " + actual
+ " instead of " + expected
);
22 if (window
.testRunner
)
23 testRunner
.dumpAsText();
25 test("test1", "Lorem-ipsum");
26 test("test2", "Loremipsum");
27 test("test3", "Lorem-ipsum");
28 test("test4", "Loremipsum");