6 var console
= document
.getElementById('console');
7 console
.appendChild(document
.createTextNode(msg
+ "\n"));
12 if (window
.testRunner
)
13 testRunner
.dumpAsText();
15 var element
= document
.getElementById('nonPositionedDiv');
16 var compStyle
= element
.ownerDocument
.defaultView
.getComputedStyle(element
, null);
17 log("Non-positioned Div:");
18 log(" Computed Style = " + compStyle
.zIndex
+ " (Should be auto)");
19 log(" element.style.zIndex = " + element
.style
.zIndex
+ " (Should be 20)");
22 element
= document
.getElementById('positionedDiv');
23 compStyle
= element
.ownerDocument
.defaultView
.getComputedStyle(element
, null);
24 log("Positioned Div:");
25 log(" Computed Style = " + compStyle
.zIndex
+ " (Should be 20)");
26 log(" element.style.zIndex = " + element
.style
.zIndex
+ " (Should be 20)");
30 <body onload=
"test();">
31 <div style=
"z-index:20" id='nonPositionedDiv'
></div>
32 <div style=
"z-index:20; position: absolute" id='positionedDiv'
></div>
33 <pre id='console'
></pre>