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

Unified Diff: LayoutTests/editing/input/reveal-selection-having-stored-scroll-position.html

Issue 914573004: Discard scrolling to the saved scroll points if there is any selection done by user. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 5 years, 9 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: LayoutTests/editing/input/reveal-selection-having-stored-scroll-position.html
diff --git a/LayoutTests/editing/input/reveal-selection-having-stored-scroll-position.html b/LayoutTests/editing/input/reveal-selection-having-stored-scroll-position.html
new file mode 100644
index 0000000000000000000000000000000000000000..90cbde1917f654d6ca8e60734a604a2b96a87f75
--- /dev/null
+++ b/LayoutTests/editing/input/reveal-selection-having-stored-scroll-position.html
@@ -0,0 +1,40 @@
+<html>
+<head>
+<script>
+
+function navigate()
+{
+ if (location.hash == "") {
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ }
+
+ scrollTo(0,100);
+ history.pushState({ }, "", window.location + "#1");
+ setTimeout("window.location.href = 'resources/empty-document-goes-back.html'", 0);
+ return;
+ }
+ var input = document.getElementById("text-input");
+ input.focus();
+ if (window.eventSender)
+ eventSender.keyDown("a");
+
+ setTimeout(function () {
+ var scrollPosition = document.body.scrollTop;
+ var result = document.getElementById("result");
+ if (scrollPosition != 100)
+ result.innerHTML = "Success! The scroll position in history was not restored after navigation as input field is revealed on selection."
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }, 0);
+}
+
+</script>
+</head>
+<body style="width:800px" onpageshow="navigate();">
+ <input id="text-input" type="text"/>
+ <div id="result">Fail. The scroll position in history was restored after navigation.</div><br/><br/>
+ <div style="width:600; height:1200; background-color:purple;"></div>
+</body>
+</htmL>

Powered by Google App Engine
This is Rietveld 408576698