Index: LayoutTests/http/tests/navigation/same-document-scroll-position-restore-pushstate.html |
diff --git a/LayoutTests/http/tests/navigation/same-document-scroll-position-restore-pushstate.html b/LayoutTests/http/tests/navigation/same-document-scroll-position-restore-pushstate.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..0e9480c6a4c4795b29eb65da56b4adbb224c1896 |
--- /dev/null |
+++ b/LayoutTests/http/tests/navigation/same-document-scroll-position-restore-pushstate.html |
@@ -0,0 +1,21 @@ |
+<!DOCTYPE html> |
+<body> |
+<script src="../../../resources/js-test.js"></script> |
+<div style="height: 1100px">scroll down...</div> |
+<button id="a">Push State</button> |
+<button id="b">Back</button> |
Nate Chapin
2015/04/07 18:17:09
Nit: I don't think these buttons are needed any mo
Abhijeet Kandalkar Slow
2015/04/10 06:49:22
Done.
|
+<div id="log"></div> |
+<script> |
+if (window.testRunner) |
+ testRunner.dumpAsText(); |
+ |
+window.onload = function() { |
+ window.scrollBy(0, 1000); |
+ history.pushState({}, '', window.location.href.split("#")[0] + "#a"); |
Nate Chapin
2015/04/07 18:17:09
Nit: You shouldn't need to parse the url, setting
Abhijeet Kandalkar Slow
2015/04/10 06:49:22
Done.
|
+ history.pushState({}, '', window.location.href.split("#")[0] + "#a"); |
+ scrollOffsetY = window.scrollY; |
+ history.back(); |
+ document.getElementById('log').innerHTML = 'scrollY should be ' + scrollOffsetY + ': ' + (window.scrollY==scrollOffsetY ? "PASS" : "FAIL"); |
Nate Chapin
2015/04/07 18:17:09
Does this fail without your fix? I would expect th
Abhijeet Kandalkar Slow
2015/04/10 06:49:22
On windows sometime it fails while manual testing.
|
+}; |
+</script> |
+</body> |