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

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

Issue 2320303002: Reset VisualViewport position after same page navigation (Closed)
Patch Set: change test to async 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/fast/scrolling/same-page-navigate.html
diff --git a/third_party/WebKit/LayoutTests/fast/scrolling/same-page-navigate.html b/third_party/WebKit/LayoutTests/fast/scrolling/same-page-navigate.html
new file mode 100644
index 0000000000000000000000000000000000000000..47d504febe0ec20dd89ffe176f51f782ce3f26d1
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/scrolling/same-page-navigate.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+
+<style>
+body {
+ height: 800px;
bokan 2016/09/15 15:03:47 No need for this style, these are the defaults.
+ width: 600px;
+}
+</style>
+
+<a href="./same-page-navigate.html" id="same-page" style="position: absolute; top: 2000px">link to self</a>
+
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+
+<script>
+
+// Ensure that the scroll position is correct when we navigate to same page after scale(zoom-in/zoom-out)
+// crbug.com/642279
+test(function() {
+
+ testRunner.waitUntilDone();
bokan 2016/09/15 15:03:47 Wrap this and notifyDone in `if(testRunner) ...`
+
+ // exit in second load, using innerWidth to detect scale
+ if (innerWidth < 800) {
bokan 2016/09/15 15:03:47 Lets be more explicit, use internals.pageScaleFact
+ console.log("scrollX=" + scrollX);
+ console.log("scrollY=" + scrollY);
bokan 2016/09/15 15:03:47 Remove console messages, use asserts instead.
+ testRunner.notifyDone();
+ return;
+ }
+
+ window.internals.setPageScaleFactor(2);
+ scrollTo(0, 10000);
+
+ var atag = document.getElementById('same-page');
+
+ var x = (atag.offsetLeft - scrollX + 1) * 2;
+ var y = (atag.offsetTop - scrollY + 1) * 2;
+ eventSender.mouseMoveTo(x, y);
bokan 2016/09/15 15:03:47 Add a comment here that this clicks on the link wh
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+}, 'Ensure that the scroll position is correct when we navigate to same page after scale(zoom-in/zoom-out)');
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698