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

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

Issue 2320303002: Reset VisualViewport position after same page navigation (Closed)
Patch Set: update comment 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/page/Page.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..4904d8df4922f1d792be705cbfc305e3b422901e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/scrolling/same-page-navigate.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+
+<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>
+var same_page_navigate_test = async_test("Ensure that the scroll position is correct when we navigate to same page after scale(zoom-in/zoom-out)");
+
+same_page_navigate_test.step(function(){
+ // exit in second load, using scale to detect
+ if (internals.pageScaleFactor() == 2) {
+ assert_equals(scrollX, 0);
+ assert_equals(scrollY, 0);
+ same_page_navigate_test.done();
+ return;
+ }
+
+ 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;
+
+ // this clicks on the link which causes a reload of this page.
+ eventSender.mouseMoveTo(x, y);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+});
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/page/Page.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698