summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/css/target-fragment-match.html
blob: a2b697f814cbf3214e4a90b09fea2ace3d92b234 (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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<style type="text/css">
div:target {
    background-color: #66CCFF;
}
</style>
<script>
function test()
{
    if (window.layoutTestController)
        layoutTestController.waitUntilDone();

    // Location changes need to happen outside the onload handler to generate history entries.
    setTimeout(runTest, 0);
}

function runTest() {
    window.location.hash ='#target-01';
    document.body.offsetTop;
    window.history.back(); // This queues up a navigation, so we need to delay the call to notifyDone.
    if (window.layoutTestController)
        setTimeout(function() { layoutTestController.notifyDone() }, 0);
}
</script>
</head>
<body onload="test()">

<div id="target-01">
  <p>I should be highlighted first because of the anchor, and de-highlighted when there is no fragment.</p>
</div>

</body></html>