6 testRunner
.dumpAsText();
9 var li
= document
.createElement("li");
10 li
.appendChild(document
.createTextNode(str
));
11 var console
= document
.getElementById("console");
12 console
.appendChild(li
);
15 function findPosX(obj
) {
18 ret
+= obj
.offsetLeft
;
19 obj
= obj
.offsetParent
;
24 function printDivPlacement() {
25 var the_node
= document
.getElementById('frame');
26 log("node.offsetLeft=" + the_node
.offsetLeft
+ " (Should be 303 as in FF and IE)");
27 log("findPosX=" + findPosX(the_node
) + " (Should be 303 as in FF and IE)");
31 <body onload=
"printDivPlacement()">
32 <div style=
"position:absolute; top:0px; left:0px; width:800px; background-color:#C3DCBF;">
33 <table width=
"200px" style=
"margin: auto;">
36 <iframe id=frame
style=
"position: relative; width:20px; height:20px"></iframe>
42 <h3>This test verifies that offsetLeft is calculated correctly for a relatively positioned iframe element inside a table.
</h3>