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 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'");
48 shouldBe("document.elementFromPoint(middleX, edge - 1).id", "'tr2-td1'");
49 shouldBe("document.elementFromPoint(middleX, edge).id", "'tr4-td1'");
50 shouldBe("document.elementFromPoint(middleX, edge + 1).id", "'tr4-td1'");
53 shouldBe("document.elementFromPoint(middleX, edge - 1).id", "'tr2-td2'");
54 shouldBe("document.elementFromPoint(middleX, edge).id", "'tr4-td2'");
55 shouldBe("document.elementFromPoint(middleX, edge + 1).id", "'tr4-td2'");
60 shouldBe("document.elementFromPoint(middleX, edge - 1).id", "''");
61 shouldBe("document.elementFromPoint(middleX, edge).id", "'tr4-td1'");
62 shouldBe("document.elementFromPoint(middleX, edge + 1).id", "'tr4-td1'");
65 shouldBe("document.elementFromPoint(middleX, edge - 1).id", "''");
66 shouldBe("document.elementFromPoint(middleX, edge).id", "'tr4-td2'");
67 shouldBe("document.elementFromPoint(middleX, edge + 1).id", "'tr4-td2'");
70 shouldBe("document.elementFromPoint(middleX, edge - 1).id", "'tr4-td1'");
71 shouldBe("document.elementFromPoint(middleX, edge).id", "''");
72 shouldBe("document.elementFromPoint(middleX, edge + 1).id", "''");
75 shouldBe("document.elementFromPoint(middleX, edge - 1).id", "'tr4-td2'");
76 shouldBe("document.elementFromPoint(middleX, edge).id", "''");
77 shouldBe("document.elementFromPoint(middleX, edge + 1).id", "''");
80 shouldBe("document.elementFromPoint(middleX, edge - 1).id", "''");
81 shouldBe("document.elementFromPoint(middleX, edge).id", "''");
82 shouldBe("document.elementFromPoint(middleX, edge + 1).id", "''");
85 shouldBe("document.elementFromPoint(middleX, edge - 1).id", "'tr4-td4'");
86 shouldBe("document.elementFromPoint(middleX, edge).id", "''");
87 shouldBe("document.elementFromPoint(middleX, edge + 1).id", "''");
103 <body onload=
"test()">
104 <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>
105 <table cellspacing=
0>
107 <td id=
"tr1-td1">1</td>
108 <td id=
"tr1-td2">1</td>
109 <td id=
"tr1-td3"></td>
110 <td id=
"tr1-td4">1</td>
113 <td id=
"tr2-td1">1</td>
114 <td id=
"tr2-td2">1</td>
115 <td id=
"tr2-td3"></td>
116 <td id=
"tr2-td4">1</td>
119 <td id=
"tr3-td1"></td>
120 <td id=
"tr3-td2"></td>
121 <td id=
"tr3-td3"></td>
122 <td id=
"tr3-td4"></td>
125 <td id=
"tr4-td1">1</td>
126 <td id=
"tr4-td2">1</td>
127 <td id=
"tr4-td3"></td>
128 <td id=
"tr4-td4">1</td>
131 <p id=
"description"></p>
132 <div id=
"console"></div>