Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / table / hittest-tablecell-with-borders-right-edge.html
blob08e1222f51535c7d86a2f1fd2818f401643c09e0
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 <script>
6 function test()
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 (with borders) returns the proper underlying element.");
10 var ele = {};
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);
16 hittest(ele[a], a);
17 ele[a].innerHTML = '';
18 });
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:');
28 switch (orgElement) {
29 case ('tr1-td1'):
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'");
33 break;
34 case ('tr1-td2'):
35 shouldBe("document.elementFromPoint(edge - 1, middleY).id", "'tr1-td2'");
36 shouldBe("document.elementFromPoint(edge, middleY).id", "'tr1-td3'");
37 shouldBe("document.elementFromPoint(edge + 1, middleY).id", "'tr1-td3'");
38 break;
39 case ('tr1-td3'):
40 shouldBe("document.elementFromPoint(edge - 1, middleY).id", "'tr1-td3'");
41 shouldBe("document.elementFromPoint(edge, middleY).id", "'tr1-td4'");
42 shouldBe("document.elementFromPoint(edge + 1, middleY).id", "'tr1-td4'");
43 break;
44 case ('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", "''");
48 break;
49 case ('tr2-td1'):
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'");
53 break;
54 case ('tr2-td2'):
55 shouldBe("document.elementFromPoint(edge - 1, middleY).id", "'tr2-td2'");
56 shouldBe("document.elementFromPoint(edge, middleY).id", "'tr2-td3'");
57 shouldBe("document.elementFromPoint(edge + 1, middleY).id", "'tr2-td3'");
58 break;
59 case ('tr2-td3'):
60 shouldBe("document.elementFromPoint(edge - 1, middleY).id", "'tr2-td3'");
61 shouldBe("document.elementFromPoint(edge, middleY).id", "'tr2-td4'");
62 shouldBe("document.elementFromPoint(edge + 1, middleY).id", "'tr2-td4'");
63 break;
64 case ('tr2-td4'):
65 shouldBe("document.elementFromPoint(edge - 1, middleY).id", "'tr2-td4'");
66 shouldBe("document.elementFromPoint(edge, middleY).id", "''");
67 shouldBe("document.elementFromPoint(edge + 1, middleY).id", "''");
68 break;
69 case ('tr3-td1'):
70 shouldBe("document.elementFromPoint(edge - 1, middleY).id", "''");
71 shouldBe("document.elementFromPoint(edge, middleY).id", "''");
72 shouldBe("document.elementFromPoint(edge + 1, middleY).id", "''");
73 break;
74 case ('tr3-td2'):
75 case ('tr3-td3'):
76 shouldBe("document.elementFromPoint(edge - 1, middleY).id", "''");
77 shouldBe("document.elementFromPoint(edge, middleY).id", "''");
78 shouldBe("document.elementFromPoint(edge + 1, middleY).id", "''");
79 break;
80 case ('tr3-td4'):
81 shouldBe("document.elementFromPoint(edge - 1, middleY).id", "''");
82 shouldBe("document.elementFromPoint(edge, middleY).id", "''");
83 shouldBe("document.elementFromPoint(edge + 1, middleY).id", "''");
84 break;
85 case ('tr4-td1'):
86 shouldBe("document.elementFromPoint(edge - 1, middleY).id", "'tr4-td1'");
87 shouldBe("document.elementFromPoint(edge, middleY).id", "'tr4-td2'");
88 shouldBe("document.elementFromPoint(edge + 1, middleY).id", "'tr4-td2'");
89 break;
90 case ('tr4-td2'):
91 shouldBe("document.elementFromPoint(edge - 1, middleY).id", "'tr4-td2'");
92 shouldBe("document.elementFromPoint(edge, middleY).id", "'tr4-td3'");
93 shouldBe("document.elementFromPoint(edge + 1, middleY).id", "'tr4-td3'");
94 break;
95 case ('tr4-td3'):
96 shouldBe("document.elementFromPoint(edge - 1, middleY).id", "'tr4-td3'");
97 shouldBe("document.elementFromPoint(edge, middleY).id", "'tr4-td4'");
98 shouldBe("document.elementFromPoint(edge + 1, middleY).id", "'tr4-td4'");
99 break;
100 case ('tr4-td4'):
101 shouldBe("document.elementFromPoint(edge - 1, middleY).id", "'tr4-td4'");
102 shouldBe("document.elementFromPoint(edge, middleY).id", "''");
103 shouldBe("document.elementFromPoint(edge + 1, middleY).id", "''");
104 break;
105 default:
106 break;
109 </script>
110 <style>
111 table
113 border-spacing: 0px;
114 font-size: 1000%;
118 padding: 0px;
119 border: 1px solid black;
121 </style>
122 </head>
123 <body onload="test()">
124 <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>
125 <table cellspacing=0>
126 <tr id="tr1">
127 <td id="tr1-td1">1</td>
128 <td id="tr1-td2">1</td>
129 <td id="tr1-td3"></td>
130 <td id="tr1-td4">1</td>
131 </tr>
132 <tr id="tr2">
133 <td id="tr2-td1">1</td>
134 <td id="tr2-td2">1</td>
135 <td id="tr2-td3"></td>
136 <td id="tr2-td4">1</td>
137 </tr>
138 <tr id="tr3">
139 <td id="tr3-td1"></td>
140 <td id="tr3-td2"></td>
141 <td id="tr3-td3"></td>
142 <td id="tr3-td4"></td>
143 </tr>
144 <tr id="tr4">
145 <td id="tr4-td1">1</td>
146 <td id="tr4-td2">1</td>
147 <td id="tr4-td3"></td>
148 <td id="tr4-td4">1</td>
149 </tr>
150 </table>
151 <p id="description"></p>
152 <div id="console"></div>
153 </body>
154 </html>