3 if (!sessionStorage
.in_document_with_fragment_url_2
)
4 sessionStorage
.in_document_with_fragment_url_2
= true;
6 delete sessionStorage
.in_document_with_fragment_url_2
;
8 function documentURLHash()
10 var index
= document
.URL
.lastIndexOf("#");
13 return document
.URL
.substring(index
);
16 function hashChanged()
18 alert("hashChanged to " + documentURLHash() + " which is interesting because this particular test shouldn't generated a hashchange event");
23 if (sessionStorage
.in_document_with_fragment_url_2
) {
24 alert("First load complete. URL's current hash is " + documentURLHash());
25 var rect
= document
.getElementById("clickElement").getBoundingClientRect();
26 eventSender
.mouseMoveTo(rect
.left
+ rect
.width
/ 2, rect
.top
+ rect
.height
/ 2);
27 eventSender
.mouseDown();
28 eventSender
.mouseUp();
30 alert("Second load complete. URL's current hash is " + documentURLHash());
31 if (window
.testRunner
)
32 testRunner
.notifyDone();
37 <body onhashchange=
"hashChanged();" onload=
"loaded();">
38 <div id=
"foo"><a id=
"clickElement" href=
"">Click here to go to the top of the page
</a></div><br>
39 This page should manually be loaded with
"#foo" appended to the URL. When you then click the link, the page should navigate to the url without #foo.