Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / elementsFromPoint / elementsFromPoint-invalid-cases.html
blob925104ed3319d34be787cd390de6c718fcedb820
1 <!DOCTYPE HTML>
2 <script src="../../../resources/js-test.js"></script>
3 <script src="resources/elementsFromPoint.js"></script>
4 <style>
5 html {
6 overflow-y: scroll;
7 overflow-x: scroll;
9 html, body {
10 margin: 0;
11 padding: 0;
13 body {
14 width: 100%;
15 height: 100%;
17 #simpleDiv {
18 width: 200px;
19 height: 200px;
20 background-color: rgba(0,255,0,0.5);
22 #beyondTopLeft {
23 position: absolute;
24 transform: translate3d(-100px, -100px, 10px);
25 left: 0;
26 top: 0;
27 width: 100px;
28 height: 100px;
29 background-color: rgba(0,0,0,0.1);
31 </style>
32 <body>
33 <div id="beyondTopLeft"></div>
34 <div id="simpleDiv"></div>
35 <div id="console"></div>
36 <script>
37 window.jsTestIsAsync = true;
39 if (window.testRunner)
40 testRunner.dumpAsText();
42 if (window.internals)
43 internals.settings.setMockScrollbarsEnabled(true);
45 onload = function() {
46 // Verify the document root element is the last element returned for empty queries.
47 shouldBe('document.elementsFromPoint(300, 300)[0]', 'document.body.parentElement');
49 // Verify the document root element is the last element returned for valid queries.
50 var simpleDiv = document.getElementById('simpleDiv');
51 var simpleRect = simpleDiv.getBoundingClientRect();
52 var simpleCoords = (simpleRect.right - 1) + ', ' + (simpleRect.bottom - 1);
53 shouldBe('document.elementsFromPoint(' + simpleCoords + ')[0]', 'simpleDiv');
54 shouldBe('document.elementsFromPoint(' + simpleCoords + ')[1]', 'document.body');
55 shouldBe('document.elementsFromPoint(' + simpleCoords + ')[2]', 'document.body.parentElement');
57 // Verify an empty sequence is returned for queries outside the viewport.
58 var bodyRect = document.body.getBoundingClientRect();
59 var bodyScrollBar = (bodyRect.right + 1) + ', ' + (bodyRect.top + 1);
60 shouldBeEqualToNumber('document.elementsFromPoint(' + bodyScrollBar + ').length', 0);
61 var outsideBodyLeft = (bodyRect.left - 1) + ', ' + (bodyRect.top + 1);
62 shouldBeEqualToNumber('document.elementsFromPoint(' + outsideBodyLeft + ').length', 0);
63 var outsideBodyTopLeft = (bodyRect.left - 10) + ', ' + (bodyRect.top - 10);
64 shouldBeEqualToNumber('document.elementsFromPoint(' + outsideBodyTopLeft + ').length', 0);
66 finishJSTest();
68 </script>
69 </body>