4 <title>Document::nodesFromRect : Rect-based hit-testing on tables - bug
86605</title>
5 <style type=
"text/css">
22 -webkit-writing-mode: vertical-lr
;
25 <script src=
"../../../resources/js-test.js"></script>
26 <script src=
"resources/nodesFromRect.js"></script>
58 description(document
.title
);
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
);
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
]);
116 <p id='description'
></p>
117 <span id=
"console"></span>