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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/scrolling/same-page-navigate.html

Issue 2320303002: Reset VisualViewport position after same page navigation (Closed)
Patch Set: update comments and test Created 4 years, 3 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
(Empty)
1 <!DOCTYPE html>
2
3 <a href="./same-page-navigate.html" id="same-page" style="position: absolute; to p: 2000px">link to self</a>
4
5 <script src="../../resources/testharness.js"></script>
6 <script src="../../resources/testharnessreport.js"></script>
7
8 <script>
9
10 // Ensure that the scroll position is correct when we navigate to same page afte r scale(zoom-in/zoom-out)
11 // crbug.com/642279
12 test(function() {
13
14 if(testRunner) {
15 testRunner.waitUntilDone();
16 }
17
18 // exit in second load, using scale to detect
19 if (internals.pageScaleFactor() == 2) {
20 assert_equals(scrollX, 0);
21 assert_equals(scrollY, 0);
22
23 if(testRunner) {
24 testRunner.notifyDone();
25 }
26 return;
27 }
28
29 window.internals.setPageScaleFactor(2);
30 scrollTo(0, 10000);
31
32 var atag = document.getElementById('same-page');
33
34 var x = (atag.offsetLeft - scrollX + 1) * 2;
35 var y = (atag.offsetTop - scrollY + 1) * 2;
36
37 // this clicks on the link which causes a reload of this page.
38 eventSender.mouseMoveTo(x, y);
39 eventSender.mouseDown();
40 eventSender.mouseUp();
41 }, 'Ensure that the scroll position is correct when we navigate to same page aft er scale(zoom-in/zoom-out)');
42
43 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698