Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/loader/repeat-same-document-navigation.html

Issue 2011653003: Only allow link clicks on single click. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test and adjust comment Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script> 3 <script>
4 if (window.testRunner) { 4 if (window.testRunner) {
5 testRunner.dumpAsText(); 5 testRunner.dumpAsText();
6 testRunner.waitUntilDone(); 6 testRunner.waitUntilDone();
7 } 7 }
8 8
9 function clickLink() { 9 function clickLink() {
10 var link = document.getElementById("anchorLink"); 10 var link = document.getElementById("anchorLink");
11 eventSender.mouseMoveTo(link.offsetLeft + 2, link.offsetTop + 2); 11 link.click();
12 eventSender.mouseDown();
13 eventSender.mouseUp();
esprehn 2016/05/26 05:40:09 why did you change this? ::click() is different th
14 } 12 }
15 13
16 function run() { 14 function run() {
17 clickLink(); 15 clickLink();
18 window.scroll(0, 0); 16 window.scroll(0, 0);
19 clickLink(); 17 clickLink();
20 var scrollY = window.scrollY; 18 var scrollY = window.scrollY;
21 var line = document.createElement('div'); 19 var line = document.createElement('div');
22 line.appendChild(document.createTextNode("Scroll position is " + scrollY + " px")); 20 line.appendChild(document.createTextNode("Scroll position is " + scrollY + " px"));
23 document.getElementById('anchor').appendChild(line); 21 document.getElementById('anchor').appendChild(line);
24 testRunner.notifyDone(); 22 testRunner.notifyDone();
25 } 23 }
26 24
27 </script> 25 </script>
28 </head> 26 </head>
29 <body onload="run();"> 27 <body onload="run();">
30 <div style="height: 600px"> 28 <div style="height: 600px">
31 <a id="anchorLink" href="#anchor">Anchor link</a> 29 <a id="anchorLink" href="#anchor">Anchor link</a>
32 </div> 30 </div>
33 <div id="anchor" style="height: 600px"></div> 31 <div id="anchor" style="height: 600px"></div>
34 </body> 32 </body>
35 </html> 33 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698