Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / block / positioning / offsetLeft-relative-td.html
blobf8bf79f2450a3472edf14b065541a330e3e23f25
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script>
5 if (window.testRunner)
6 testRunner.dumpAsText();
8 function log(str) {
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) {
16 var ret = 0;
17 do {
18 ret += obj.offsetLeft;
19 obj = obj.offsetParent;
20 } while (obj);
21 return ret;
24 // This code was reduced from the menu system on doula.co.il which is why we call offsetParent.offsetLeft rather than
25 // just retreiving the element directly.
26 function printDivPlacement() {
27 var the_node = document.getElementById('menu_node');
28 log("node.offsetParent.offsetLeft=" + the_node.offsetParent.offsetLeft + " (Should be 302 as in FF and IE)");
29 log("findPosX=" + findPosX(the_node.offsetParent) + " (Should be 302 as in FF and IE)");
31 </script>
32 </head>
33 <body onload="printDivPlacement()">
34 <div style="position:absolute; top:0px; left:0px; width:800px; background-color:#C3DCBF;">
35 <table width="200px" style="margin: auto;">
36 <tr>
37 <td style="position:relative">
38 <div id=menu_node>Menu Node</div>
39 </td>
40 </tr>
41 </table>
42 </div>
43 <br><br>
44 <h3>This test verifies that offsetLeft is calculated correctly for a relatively positioned td element.</h3>
45 <ul id=console></ul>
46 </body>
47 </html>