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 right edge of a table cell 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 edge
= ele
.getBoundingClientRect().right
;
25 middleY
= ele
.getBoundingClientRect().bottom
/ 2;
26 debug('Executing for element '+orgElement
+' on the right edge of the table cell:');
30 shouldBe("document.elementFromPoint(edge - 1, middleY).id", "'tr1-td1'");
31 shouldBe("document.elementFromPoint(edge, middleY).id", "'tr1-td2'");
32 shouldBe("document.elementFromPoint(edge + 1, middleY).id", "'tr1-td2'");
35 shouldBe("document.elementFromPoint(edge - 1, middleY).id", "'tr1-td2'");
36 shouldBe("document.elementFromPoint(edge, middleY).id", "'tr1-td4'");
37 shouldBe("document.elementFromPoint(edge + 1, middleY).id", "'tr1-td4'");
40 shouldBe("document.elementFromPoint(edge - 1, middleY).id", "'tr1-td2'");
41 shouldBe("document.elementFromPoint(edge, middleY).id", "'tr1-td4'");
42 shouldBe("document.elementFromPoint(edge + 1, middleY).id", "'tr1-td4'");
45 shouldBe("document.elementFromPoint(edge - 1, middleY).id", "'tr1-td4'");
46 shouldBe("document.elementFromPoint(edge, middleY).id", "''");
47 shouldBe("document.elementFromPoint(edge + 1, middleY).id", "''");
50 shouldBe("document.elementFromPoint(edge - 1, middleY).id", "'tr2-td1'");
51 shouldBe("document.elementFromPoint(edge, middleY).id", "'tr2-td2'");
52 shouldBe("document.elementFromPoint(edge + 1, middleY).id", "'tr2-td2'");
56 shouldBe("document.elementFromPoint(edge - 1, middleY).id", "'tr2-td2'");
57 shouldBe("document.elementFromPoint(edge, middleY).id", "'tr2-td4'");
58 shouldBe("document.elementFromPoint(edge + 1, middleY).id", "'tr2-td4'");
61 shouldBe("document.elementFromPoint(edge - 1, middleY).id", "'tr2-td4'");
62 shouldBe("document.elementFromPoint(edge, middleY).id", "''");
63 shouldBe("document.elementFromPoint(edge + 1, middleY).id", "''");
69 shouldBe("document.elementFromPoint(edge - 1, middleY).id", "''");
70 shouldBe("document.elementFromPoint(edge, middleY).id", "''");
71 shouldBe("document.elementFromPoint(edge + 1, middleY).id", "''");
74 shouldBe("document.elementFromPoint(edge - 1, middleY).id", "'tr4-td1'");
75 shouldBe("document.elementFromPoint(edge, middleY).id", "'tr4-td2'");
76 shouldBe("document.elementFromPoint(edge + 1, middleY).id", "'tr4-td2'");
79 shouldBe("document.elementFromPoint(edge - 1, middleY).id", "'tr4-td2'");
80 shouldBe("document.elementFromPoint(edge, middleY).id", "'tr4-td4'");
81 shouldBe("document.elementFromPoint(edge + 1, middleY).id", "'tr4-td4'");
84 shouldBe("document.elementFromPoint(edge - 1, middleY).id", "''");
85 shouldBe("document.elementFromPoint(edge, middleY).id", "'tr4-td4'");
86 shouldBe("document.elementFromPoint(edge + 1, middleY).id", "'tr4-td4'");
89 shouldBe("document.elementFromPoint(edge - 1, middleY).id", "'tr4-td4'");
90 shouldBe("document.elementFromPoint(edge, middleY).id", "''");
91 shouldBe("document.elementFromPoint(edge + 1, middleY).id", "''");
107 <body onload=
"test()">
108 <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>
109 <table cellspacing=
0>
111 <td id=
"tr1-td1">1</td>
112 <td id=
"tr1-td2">1</td>
113 <td id=
"tr1-td3"></td>
114 <td id=
"tr1-td4">1</td>
117 <td id=
"tr2-td1">1</td>
118 <td id=
"tr2-td2">1</td>
119 <td id=
"tr2-td3"></td>
120 <td id=
"tr2-td4">1</td>
123 <td id=
"tr3-td1"></td>
124 <td id=
"tr3-td2"></td>
125 <td id=
"tr3-td3"></td>
126 <td id=
"tr3-td4"></td>
129 <td id=
"tr4-td1">1</td>
130 <td id=
"tr4-td2">1</td>
131 <td id=
"tr4-td3"></td>
132 <td id=
"tr4-td4">1</td>
135 <p id=
"description"></p>
136 <div id=
"console"></div>