2 <script src=
"../../../resources/js-test.js"></script>
3 <script src=
"resources/elementsFromPoint.js"></script>
13 background-color: rgba(
0,
180,
0,
0.2);
16 background-color: rgba(
180,
0,
0,
0.2);
19 background-color: rgba(
0,
0,
180,
0.2);
25 -webkit-writing-mode: vertical-lr;
29 <table id='testtable'
>
56 <div id=
"console"></div>
58 window
.jsTestIsAsync
= true;
60 if (window
.testRunner
)
61 testRunner
.dumpAsText();
64 internals
.settings
.setMockScrollbarsEnabled(true);
67 // Check area hits fully inside table cells.
68 assertElementsFromPoint('document.elementsFromPoint(125, 125)', [td11
, testtable
, sandbox
, document
.body
, document
.documentElement
]);
69 assertElementsFromPoint('document.elementsFromPoint(275, 125)', [td14
, testtable
, sandbox
, document
.body
, document
.documentElement
]);
70 assertElementsFromPoint('document.elementsFromPoint(175, 175)', [td22
, testtable
, sandbox
, document
.body
, document
.documentElement
]);
71 assertElementsFromPoint('document.elementsFromPoint(125, 275)', [td41
, testtable
, sandbox
, document
.body
, document
.documentElement
]);
73 // Check area hits between cells.
74 assertElementsFromPoint('document.elementsFromPoint(100, 100)', [testtable
, sandbox
, document
.body
, document
.documentElement
]);
75 assertElementsFromPoint('document.elementsFromPoint(199, 199)', [testtable
, sandbox
, document
.body
, document
.documentElement
]);
77 // Check hit tests on right-to-left table.
78 testtable
.setAttribute('class', 'rtl');
79 assertElementsFromPoint('document.elementsFromPoint(125, 125)', [td14
, testtable
, sandbox
, document
.body
, document
.documentElement
]);
80 assertElementsFromPoint('document.elementsFromPoint(275, 125)', [td11
, testtable
, sandbox
, document
.body
, document
.documentElement
]);
81 assertElementsFromPoint('document.elementsFromPoint(100, 100)', [testtable
, sandbox
, document
.body
, document
.documentElement
]);
82 assertElementsFromPoint('document.elementsFromPoint(199, 199)', [testtable
, sandbox
, document
.body
, document
.documentElement
]);
84 // Check hit tests on a flipped (tb-lr) table.
85 testtable
.setAttribute('class', 'tblr');
86 assertElementsFromPoint('document.elementsFromPoint(125, 275)', [td14
, testtable
, sandbox
, document
.body
, document
.documentElement
]);
87 assertElementsFromPoint('document.elementsFromPoint(275, 125)', [td41
, testtable
, sandbox
, document
.body
, document
.documentElement
]);
88 assertElementsFromPoint('document.elementsFromPoint(100, 100)', [testtable
, sandbox
, document
.body
, document
.documentElement
]);
89 assertElementsFromPoint('document.elementsFromPoint(199, 199)', [testtable
, sandbox
, document
.body
, document
.documentElement
]);