3 caption div { width:
50px; height:
50px; }
4 td { width:
50px; height:
25px; }
5 #console { margin:
8px; }
7 <table cellpadding=
"0" cellspacing=
"0" id=
"table">
31 <pre id=
"console"></pre>
33 if (window
.testRunner
)
34 testRunner
.dumpAsText();
38 document
.getElementById("console").appendChild(document
.createTextNode(message
+ "\n"));
41 function checkElementAtPoint(x
, y
, id
)
43 var actualID
= document
.elementFromPoint(x
, y
).id
;
45 log("PASS: " + id
+ " at (" + x
+ ", " + y
+ ")");
47 log("FAIL: " + actualID
+ " instead of " + id
+ " at (" + x
+ ", " + y
+ ")");
50 var style
= document
.getElementById("table").style
;
52 checkElementAtPoint(1, 1, "c");
53 checkElementAtPoint(1, 51, "1-1-1");
54 checkElementAtPoint(51, 51, "1-1-2");
55 checkElementAtPoint(101, 51, "1-1-3");
56 checkElementAtPoint(1, 76, "1-2-1");
57 checkElementAtPoint(51, 76, "1-2-2");
58 checkElementAtPoint(101, 76, "1-2-3");
59 checkElementAtPoint(1, 101, "2-1-1");
60 checkElementAtPoint(51, 101, "2-1-2");
61 checkElementAtPoint(101, 101, "2-1-3");
63 log("\nTesting horizontal-bt:");
64 style
.webkitWritingMode
= "horizontal-bt";
65 checkElementAtPoint(1, 101, "c");
66 checkElementAtPoint(1, 51, "1-1-1");
67 checkElementAtPoint(51, 51, "1-1-2");
68 checkElementAtPoint(101, 51, "1-1-3");
69 checkElementAtPoint(1, 26, "1-2-1");
70 checkElementAtPoint(51, 26, "1-2-2");
71 checkElementAtPoint(101, 26, "1-2-3");
72 checkElementAtPoint(1, 1, "2-1-1");
73 checkElementAtPoint(51, 1, "2-1-2");
74 checkElementAtPoint(101, 1, "2-1-3");
76 log("\nTesting vertical-lr:");
77 style
.webkitWritingMode
= "vertical-lr";
78 checkElementAtPoint(1, 1, "c");
79 checkElementAtPoint(51, 1, "1-1-1");
80 checkElementAtPoint(51, 26, "1-1-2");
81 checkElementAtPoint(51, 51, "1-1-3");
82 checkElementAtPoint(101, 1, "1-2-1");
83 checkElementAtPoint(101, 26, "1-2-2");
84 checkElementAtPoint(101, 51, "1-2-3");
85 checkElementAtPoint(151, 1, "2-1-1");
86 checkElementAtPoint(151, 26, "2-1-2");
87 checkElementAtPoint(151, 51, "2-1-3");
89 log("\nTesting vertical-rl:");
90 style
.webkitWritingMode
= "vertical-rl";
91 checkElementAtPoint(151, 1, "c");
92 checkElementAtPoint(101, 1, "1-1-1");
93 checkElementAtPoint(101, 26, "1-1-2");
94 checkElementAtPoint(101, 51, "1-1-3");
95 checkElementAtPoint(51, 1, "1-2-1");
96 checkElementAtPoint(51, 26, "1-2-2");
97 checkElementAtPoint(51, 51, "1-2-3");
98 checkElementAtPoint(1, 1, "2-1-1");
99 checkElementAtPoint(1, 26, "2-1-2");
100 checkElementAtPoint(1, 51, "2-1-3");