[WK2] selection does not disappear after coping the text
[framework/web/webkit-efl.git] / LayoutTests / fast / loader / document-with-fragment-url-1.html
1 <script>
2
3 if (!sessionStorage.in_document_with_fragment_url_1)
4     sessionStorage.in_document_with_fragment_url_1 = true;
5 else
6     delete sessionStorage.in_document_with_fragment_url_1;
7
8 if (window.layoutTestController) {
9     layoutTestController.dumpAsText();
10     layoutTestController.waitUntilDone();
11 }
12
13 function documentURLHash()
14 {
15     var index = document.URL.lastIndexOf("#");
16     if (index == -1)
17         return "";
18     return document.URL.substring(index);
19 }
20
21 function hashChanged()
22 {
23     alert("Hash changed to " + documentURLHash());
24     setTimeout("clickSecondAnchor();", 0);
25 }
26
27 function clickSecondAnchor()
28 {
29     var rect = document.getElementById("secondanchor").getBoundingClientRect();
30     eventSender.mouseMoveTo(rect.left + rect.width / 2, rect.top + rect.height / 2);
31     eventSender.mouseDown();
32     eventSender.mouseUp();
33 }
34
35 function loaded()
36 {
37     if (sessionStorage.in_document_with_fragment_url_1) {
38         alert("First load complete.  URL's current hash is " + documentURLHash());
39         var rect = document.getElementById("firstanchor").getBoundingClientRect();
40         eventSender.mouseMoveTo(rect.left + rect.width / 2, rect.top + rect.height / 2);
41         eventSender.mouseDown();
42         eventSender.mouseUp();
43     } else {
44         alert("Second load complete.  URL's current hash is " + documentURLHash());
45         if (window.layoutTestController)
46             layoutTestController.notifyDone();
47     }
48 }
49
50 </script>
51 <body onhashchange="hashChanged();" onload="loaded();">
52 Click the following link to navigate to #foo on this page.  Then click the second link, which has an empty href and should take you back to the original URL without the #foo.<br>
53 <a id="firstanchor" href="#foo">Click here to go to #foo</a><br>
54 <div id="foo"><a id="secondanchor" href="">Click here to return to the original page with the original url</a></div>
55 </body>