3 <script type=
"text/javascript">
5 testRunner
.dumpAsText();
9 console
= document
.getElementById("console");
10 rowOffset
= document
.getElementById("row2").offsetTop
;
11 cellOffset
= document
.getElementById("cell2").offsetTop
;
12 console
.innerText
+= "Table 1 row 2 top offset:" + rowOffset
;
13 console
.innerText
+= "\n";
14 console
.innerText
+= "Table 1 cell 2 top offset:" + cellOffset
;
15 console
.innerText
+= "\n";
16 tr1Offset
= document
.getElementById("tr1").offsetTop
;
17 td1Offset
= document
.getElementById("td1").offsetTop
;
18 td2Offset
= document
.getElementById("td2").offsetTop
;
19 td3Offset
= document
.getElementById("td3").offsetTop
;
20 td4Offset
= document
.getElementById("td4").offsetTop
;
21 console
.innerText
+= "Table 2 row 1 top offset:" + tr1Offset
;
22 console
.innerText
+= "\n";
23 console
.innerText
+= "Table 2 cell 1 top offset:" + td1Offset
;
24 console
.innerText
+= "\n";
25 console
.innerText
+= "Table 2 cell 2 top offset:" + td2Offset
;
26 console
.innerText
+= "\n";
27 console
.innerText
+= "Table 2 cell 3 top offset:" + td3Offset
;
28 console
.innerText
+= "\n";
29 console
.innerText
+= "Table 3 cell 1 top offset:" + td4Offset
;
30 console
.innerText
+= "\n";
31 div5Offset
= document
.getElementById("div5").offsetTop
;
32 console
.innerText
+= "Table 4 div 1 top offset:" + div5Offset
;
33 console
.innerText
+= "\n";
34 console
.innerText
+= "Test result: "
35 console
.innerText
+= (rowOffset
== 50 && cellOffset
== 50 && tr1Offset
== 0
36 && tr1Offset
== td2Offset
&& tr1Offset
== td3Offset
&& td4Offset
== 0 && div5Offset
== 50 ? "PASS" : "FAIL");
40 <body onload=
"test()">
41 <p>This is a regression test for
<i><a href=
"https://bugs.webkit.org/show_bug.cgi?id=8085">https://bugs.webkit.org/show_bug.cgi?id=
8085</a> Main menu positioned incorrectly on eia.org and fedex.com/us
</i> and for
<i><a href=
"https://bugs.webkit.org/show_bug.cgi?id=19094">https://bugs.webkit.org/show_bug.cgi?id=
19094</a> offsetTop is wrong in cell
<td
>.
</i>
43 <pre id=
"console"></pre>
44 <table cellspacing=
"0" cellpadding=
"0">
45 <tr id=
"row1" style=
"height: 50px;"><td colspan=
"2"></td></tr>
46 <tr id=
"row2"><td id=
"cell1" style=
"height: 100px;"></td><td id=
"cell2" style=
"height: 20px;"><div></div></td></tr>
49 <table cellspacing=
"0" cellpadding=
"0" width=
"20px" border=
"1" align=
"center">
50 <tr id='tr1'
align=
"center">
53 <div>This
</div>is more text.
55 And a lot more text that should have the smallest offsetTop.
60 <table cellspacing=
"0" cellpadding=
"0" style=
"background-color: orange;"><tr style=
"background-color:
61 blue;"><td id=
"td4" style=
"width: 100px; height:
62 500px;background-color: red"></td></tr></table>
64 <table cellspacing=
"0" cellpadding=
"0"><tbody><tr>
65 <td style=
"height: 100px;">
66 <div style=
"margin: 50px 0px;"></div>