4 <script src=
"../../resources/js-test.js"></script>
8 description("An event generated on the edge of a table cell is not being consumed by the appropriate underlying element. This test verifies that the hittest result on the bottom edge of a table cell (with borders) returns the proper underlying element.");
11 ['tr1-td1', 'tr1-td2', 'tr1-td3', 'tr1-td4',
12 'tr2-td1', 'tr2-td2', 'tr2-td3', 'tr2-td4',
13 'tr3-td1', 'tr3-td2', 'tr3-td3', 'tr3-td4',
14 'tr4-td1', 'tr4-td2', 'tr4-td3', 'tr4-td4'].forEach(function(a
) {
15 ele
[a
] = document
.getElementById(a
);
17 ele
[a
].innerHTML
= '';
20 isSuccessfullyParsed();
22 function hittest(ele
, orgElement
, expected1
, expected2
)
24 middleX
= ele
.getBoundingClientRect().right
/ 2;
25 edge
= ele
.getBoundingClientRect().bottom
;
26 debug('Executing for element '+orgElement
+' on the bottom edge of the table cell:');
30 shouldBe("document.elementFromPoint(middleX, edge - 1).id", "'tr1-td1'");
31 shouldBe("document.elementFromPoint(middleX, edge).id", "'tr2-td1'");
32 shouldBe("document.elementFromPoint(middleX, edge + 1).id", "'tr2-td1'");
36 shouldBe("document.elementFromPoint(middleX, edge - 1).id", "'tr1-td1'");
37 shouldBe("document.elementFromPoint(middleX, edge).id", "'tr2-td1'");
38 shouldBe("document.elementFromPoint(middleX, edge + 1).id", "'tr2-td1'");
41 shouldBe("document.elementFromPoint(middleX, edge - 1).id", "'tr1-td2'");
42 shouldBe("document.elementFromPoint(middleX, edge).id", "'tr2-td2'");
43 shouldBe("document.elementFromPoint(middleX, edge + 1).id", "'tr2-td2'");
46 shouldBe("document.elementFromPoint(middleX, edge - 1).id", "'tr2-td1'");
47 shouldBe("document.elementFromPoint(middleX, edge).id", "'tr3-td1'");
48 shouldBe("document.elementFromPoint(middleX, edge + 1).id", "'tr3-td1'");
52 shouldBe("document.elementFromPoint(middleX, edge - 1).id", "'tr2-td1'");
53 shouldBe("document.elementFromPoint(middleX, edge).id", "'tr3-td1'");
54 shouldBe("document.elementFromPoint(middleX, edge + 1).id", "'tr3-td1'");
57 shouldBe("document.elementFromPoint(middleX, edge - 1).id", "'tr2-td2'");
58 shouldBe("document.elementFromPoint(middleX, edge).id", "'tr3-td2'");
59 shouldBe("document.elementFromPoint(middleX, edge + 1).id", "'tr3-td2'");
64 shouldBe("document.elementFromPoint(middleX, edge - 1).id", "'tr3-td1'");
65 shouldBe("document.elementFromPoint(middleX, edge).id", "'tr4-td1'");
66 shouldBe("document.elementFromPoint(middleX, edge + 1).id", "'tr4-td1'");
69 shouldBe("document.elementFromPoint(middleX, edge - 1).id", "'tr3-td2'");
70 shouldBe("document.elementFromPoint(middleX, edge).id", "'tr4-td2'");
71 shouldBe("document.elementFromPoint(middleX, edge + 1).id", "'tr4-td2'");
74 shouldBe("document.elementFromPoint(middleX, edge - 1).id", "'tr4-td1'");
75 shouldBe("document.elementFromPoint(middleX, edge).id", "''");
76 shouldBe("document.elementFromPoint(middleX, edge + 1).id", "''");
79 shouldBe("document.elementFromPoint(middleX, edge - 1).id", "'tr4-td2'");
80 shouldBe("document.elementFromPoint(middleX, edge).id", "''");
81 shouldBe("document.elementFromPoint(middleX, edge + 1).id", "''");
84 shouldBe("document.elementFromPoint(middleX, edge - 1).id", "''");
85 shouldBe("document.elementFromPoint(middleX, edge).id", "''");
86 shouldBe("document.elementFromPoint(middleX, edge + 1).id", "''");
89 shouldBe("document.elementFromPoint(middleX, edge - 1).id", "'tr4-td4'");
90 shouldBe("document.elementFromPoint(middleX, edge).id", "''");
91 shouldBe("document.elementFromPoint(middleX, edge + 1).id", "''");
107 border:
1px solid black;
111 <body onload=
"test()">
112 <p>Test for Bugzilla
<a href=
"https://bugs.webkit.org/show_bug.cgi?id=74864">Bug
74864</a>: There is additional space not belonged to a table between the table cells.
</p>
113 <table cellspacing=
0>
115 <td id=
"tr1-td1">1</td>
116 <td id=
"tr1-td2">1</td>
117 <td id=
"tr1-td3"></td>
118 <td id=
"tr1-td4">1</td>
121 <td id=
"tr2-td1">1</td>
122 <td id=
"tr2-td2">1</td>
123 <td id=
"tr2-td3"></td>
124 <td id=
"tr2-td4">1</td>
127 <td id=
"tr3-td1"></td>
128 <td id=
"tr3-td2"></td>
129 <td id=
"tr3-td3"></td>
130 <td id=
"tr3-td4"></td>
133 <td id=
"tr4-td1">1</td>
134 <td id=
"tr4-td2">1</td>
135 <td id=
"tr4-td3"></td>
136 <td id=
"tr4-td4">1</td>
139 <p id=
"description"></p>
140 <div id=
"console"></div>