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

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

Issue 2320303002: Reset VisualViewport position after same page navigation (Closed)
Patch Set: remove unuse code 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..6ec3ee8f22d154bc8b4a8c5471662c5359a8798a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/scrolling/same-page-navigate.html
@@ -0,0 +1,235 @@
+<!DOCTYPE html>
+
+<style>
+
+body {
+ height: 800px;
+ width: 600px;
bokan 2016/09/14 21:38:11 Nit: unnecessary tab
+}
+</style>
+
+<pre>
+<a href="./same-page-navigate.html" id="same-page-0">link to self html</a>
+<a href="#1">goto 1</a> <a href="#2">goto 2</a> <a href="#3">goto 3</a> <a href="#4">goto 4</a> <a href="#5">goto 5</a> <a href="#6">goto 6</a>
+
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
bokan 2016/09/14 21:38:11 All this space and other links are just adding unn
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+<a name="1">1
+<a href="./same-page-navigate.html" id="same-page-1">link to self html</a>
+<a href="#1">goto 1</a> <a href="#2">goto 2</a> <a href="#3">goto 3</a> <a href="#4">goto 4</a> <a href="#5">goto 5</a> <a href="#6">goto 6</a>
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+<a name="2">2
+<a href="./same-page-navigate.html" id="same-page-2">link to self html</a>
+<a href="#1">goto 1</a> <a href="#2">goto 2</a> <a href="#3">goto 3</a> <a href="#4">goto 4</a> <a href="#5">goto 5</a> <a href="#6">goto 6</a>
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+<a name="3">3
+<a href="./same-page-navigate.html" id="same-page-3">link to self html</a>
+<a href="#1">goto 1</a> <a href="#2">goto 2</a> <a href="#3">goto 3</a> <a href="#4">goto 4</a> <a href="#5">goto 5</a> <a href="#6">goto 6</a>
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+<a name="4">4
+<a href="./same-page-navigate.html" id="same-page-4">link to self html</a>
+<a href="#1">goto 1</a> <a href="#2">goto 2</a> <a href="#3">goto 3</a> <a href="#4">goto 4</a> <a href="#5">goto 5</a> <a href="#6">goto 6</a>
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+<a name="5">5
+<a href="./same-page-navigate.html" id="same-page-5">link to self html</a>
+<a href="#1">goto 1</a> <a href="#2">goto 2</a> <a href="#3">goto 3</a> <a href="#4">goto 4</a> <a href="#5">goto 5</a> <a href="#6">goto 6</a>
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+.
+<a name="6">6
+<a href="./same-page-navigate.html" id="same-page-6">link to self html</a>
+<a href="#1">goto 1</a> <a href="#2">goto 2</a> <a href="#3">goto 3</a> <a href="#4">goto 4</a> <a href="#5">goto 5</a> <a href="#6">goto 6</a>
+
+
+
+
+<a href="./same-page-navigate.html" id="same-page-bottom">link to self html</a>
+</pre>
+
+<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() {
+
+ console.log(innerWidth);
+
+ // exit in second load, using innerWidth to detect scale
+ if (innerWidth < 800) {
+ assert_equals(scrollX, 0);
+ assert_equals(scrollY, 0);
+ return;
bokan 2016/09/14 21:38:11 Did the `waitUntilDone` and `notifyDone` methods n
chaopeng 2016/09/15 00:15:21 Yes, async test will give "missing actual" but I c
+ }
+
+ window.internals.setPageScaleFactor(2);
+ scrollTo(0, 10000);
+
+ var atag = document.getElementById('same-page-bottom');
+
+ var x = (atag.offsetLeft - scrollX + 1) * 2;
+ var y = (atag.offsetTop - scrollY + 1) * 2;
+ eventSender.mouseMoveTo(x, y);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+}, 'Ensure that the scroll position is correct when we navigate to same page after scale(zoom-in/zoom-out)');
+
+</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