2 <script src=
"../../../resources/js-test.js"></script>
3 <script src=
"resources/elementsFromPoint.js"></script>
15 background-color: rgba(
0,
0,
255,
0.5);
23 background-color: rgba(
255,
0,
0,
0.5);
25 #divWithPseudo::before {
32 background-color: rgba(
255,
0,
0,
0.5);
41 background-color: rgba(
0,
255,
0,
0.5);
47 background-color: rgba(
0,
0,
0,
0.5);
51 background-color: yellow;
61 background-color: rgba(
0,
0,
0,
0.1);
66 transform: translate3d(-
100px, -
100px,
10px);
71 background-color: rgba(
255,
255,
255,
0.5);
74 <div id=
"simpleDiv"></div>
75 <div id=
"divWithPseudo"></div>
76 <div id=
"divBetweenPseudo"></div>
77 <div id=
"withMargins"><span id=
"inlineSpan"></span></div>
78 <div id=
"noPointerEvents"></div>
79 <div id=
"threeD"></div>
80 <div id=
"console"></div>
82 window
.jsTestIsAsync
= true;
84 if (window
.testRunner
)
85 testRunner
.dumpAsText();
88 internals
.settings
.setMockScrollbarsEnabled(true);
91 // Iterate through each of the elements and verify that they are present in
92 // elementsFromPoint(x, y) where (x, y) is any of the four corners.
93 ['simpleDiv', 'divWithPseudo', 'divBetweenPseudo', 'withMargins', 'inlineSpan', 'noPointerEvents', 'threeD'].forEach(function(id
) {
94 checkElementsFromPointFourCorners('document', 'document.getElementById(\'' + id
+ '\')');
97 // Check ordering of results.
98 var divWithPseudoRect
= document
.getElementById('divWithPseudo').getBoundingClientRect();
99 assertElementsFromPoint(
100 'document.elementsFromPoint(' + (divWithPseudoRect
.left
+ 1) + ', ' + (divWithPseudoRect
.top
+ 1) + ')',
101 [threeD
, divWithPseudo
, simpleDiv
, document
.body
, document
.documentElement
]);
102 assertElementsFromPoint(
103 'document.elementsFromPoint(' + (divWithPseudoRect
.right
- 1) + ', ' + (divWithPseudoRect
.bottom
- 1) + ')',
104 [divWithPseudo
, divBetweenPseudo
, divWithPseudo
, simpleDiv
, document
.body
, document
.documentElement
]);