Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / nodesFromRect / nodesFromRect-table.html
blob689c3d82998f1b62c03a08b4e79341ae79400e1a
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>Document::nodesFromRect : Rect-based hit-testing on tables - bug 86605</title>
5 <style type="text/css">
6 #sandbox {
7 position: absolute;
8 left: 0px;
9 top: 0px;
10 width: 600px;
11 height: 800px;
13 #testtable {
14 margin: 100px;
15 width: 200px;
16 height: 200px;
18 .rtl {
19 direction: rtl;
21 .tblr {
22 -webkit-writing-mode: vertical-lr;
24 </style>
25 <script src="../../../resources/js-test.js"></script>
26 <script src="resources/nodesFromRect.js"></script>
27 </head>
29 <body>
30 <div id=sandbox>
31 <table id=testtable>
32 <tr id=tr1>
33 <td id=td11>
34 <td id=td12>
35 <td id=td13>
36 <td id=td14>
37 <tr id=tr2>
38 <td id=td21>
39 <td id=td22>
40 <td id=td23>
41 <td id=td24>
42 <tr id=tr3>
43 <td id=td31>
44 <td id=td32>
45 <td id=td33>
46 <td id=td34>
47 <tr id=tr4>
48 <td id=td41>
49 <td id=td42>
50 <td id=td43>
51 <td id=td44>
52 </table>
53 </div>
55 <script>
56 function runTest()
58 description(document.title);
59 var e = {};
61 // Set up shortcut access to elements
62 ['sandbox', 'testtable', 'tr1', 'tr2', 'tr3', 'tr4',
63 'td11', 'td12', 'td13', 'td14',
64 'td21', 'td22', 'td23', 'td24',
65 'td31', 'td32', 'td33', 'td34',
66 'td41', 'td42', 'td43', 'td44'].forEach(function(a) {
67 e[a] = document.getElementById(a);
68 });
70 window.scrollTo(0, 0);
71 debug('Check area hits fully inside table cells');
72 check(125, 125, 10, 10, 10, 10, [e.td11]);
73 check(275, 125, 10, 10, 10, 10, [e.td14]);
74 check(175, 175, 10, 10, 10, 10, [e.td22]);
75 check(125, 275, 10, 10, 10, 10, [e.td41]);
77 debug('Check area hits across table border');
78 check(90, 125, 10, 20, 10, 20, [e.td11, e.testtable, e.sandbox]);
79 check(275, 90, 20, 10, 20, 10, [e.td14, e.testtable, e.sandbox]);
80 check(310, 310, 20, 20, 20, 20, [e.td44, e.testtable, e.sandbox]);
82 debug('Check area hits crossing neighbouring table cells');
83 check(190, 175, 10, 20, 10, 20, [e.td22, e.td23, e.testtable]);
84 check(260, 275, 10, 20, 10, 20, [e.td43, e.td44, e.testtable]);
85 check(175, 190, 20, 10, 20, 10, [e.td22, e.td32, e.testtable]);
86 check(275, 260, 20, 10, 20, 10, [e.td34, e.td44, e.testtable]);
87 check(190, 190, 20, 20, 20, 20, [e.td22, e.td23, e.td32, e.td33, e.testtable]);
89 debug('Check area hits crossing entire table cells');
90 check(200, 175, 10, 90, 10, 90, [e.td21, e.td22, e.td23, e.td24, e.testtable]);
91 check(175, 200, 90, 10, 90, 10, [e.td12, e.td22, e.td32, e.td42, e.testtable]);
92 check(150, 150, 60, 60, 60, 60, [e.td11, e.td12, e.td13,
93 e.td21, e.td22, e.td23,
94 e.td31, e.td32, e.td33,
95 e.testtable, e.sandbox]);
96 check(125, 350, 120, 10, 10, 10, [e.td31, e.td41, e.testtable, e.sandbox]);
97 check(350, 150, 10, 10, 10, 120, [e.td13, e.td14, e.td23, e.td24, e.testtable, e.sandbox]);
99 debug('Check area hits on right-to-left table');
100 e['testtable'].setAttribute('class', 'rtl');
101 check(275, 125, 10, 10, 10, 10, [e.td11]);
102 check(175, 175, 10, 10, 10, 10, [e.td23]);
103 check(175, 190, 20, 10, 20, 10, [e.td23, e.td33, e.testtable]);
105 debug('Check area hits on flipped (tb-lr) table');
106 e['testtable'].setAttribute('class', 'tblr');
107 check(275, 125, 10, 10, 10, 10, [e.td41]);
108 check(125, 275, 10, 10, 10, 10, [e.td14]);
109 check(200, 175, 10, 90, 10, 90, [e.td12, e.td22, e.td32, e.td42, e.testtable]);
113 runTest();
114 </script>
116 <p id='description'></p>
117 <span id="console"></span>
118 </body>
119 </html>