summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/inspector/elements/highlight-node-scroll.html
blob: be26ef647467fed8dfca3e7f601391042ca9342a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<html>
<head>

<style>

body {
    width: 2000px;
    height: 2000px;
    background-color: grey;
}
.inspected {
    margin: 5px;
    border: solid 10px aqua;
    padding: 15px;
    width: 200px;
    height: 200px;
    background-color: blue;
    float: left;
}
#scrollingContainer {
    clear: both;
    width: 100px;
    height: 100px;
    overflow: auto;
}
#description {
    clear: both;
}

</style>

<script src="../../http/tests/inspector/inspector-test.js"></script>
<script src="../../http/tests/inspector/elements-test.js"></script>
<script>

function onload()
{
    window.scrollBy(50, 100);
    scrollingContainer = document.getElementById("scrollingContainer");
    scrollingContainer.scrollTop = 50;
    scrollingContainer.scrollLeft = 60;
    runTest();
}

function test()
{
    function nodeSelected2(node)
    {
        RuntimeAgent.evaluate("dumpInspectorHighlightRects()", InspectorTest.completeTest);
    }

    function testNode2()
    {
        InspectorTest.selectNodeWithId("inspectedElement2", nodeSelected2);
    }

    function nodeSelected1(node)
    {
        RuntimeAgent.evaluate("dumpInspectorHighlightRects()", testNode2);
    }

    InspectorTest.selectNodeWithId("inspectedElement1", nodeSelected1);
}

</script>
</head>

<body onload="onload()">

<div id="inspectedElement1" class="inspected"></div>

<div id="scrollingContainer">
    <div id="inspectedElement2" class="inspected"></div>
</div>

<p id="description">This test verifies the position and size of the highlight rectangles overlayed on an inspected div in the scrolled view.</p>

</body>
</html>