4 testRunner
.dumpAsText();
5 var style
= document
.defaultView
.getComputedStyle(document
.getElementById("test"), "");
6 var result
= document
.getElementById("result");
7 if (style
.top
== "-1px")
8 result
.appendChild(document
.createTextNode("Test succeeded! Top is " + style
.top
+ "."));
10 result
.appendChild(document
.createTextNode("Test failed! Top is " + style
.top
+ "."));
13 <body onload=
"test()">
14 <div id=
"test" style=
"position:relative; top:-1px"></div>
15 <div id=
"result"></div>