| Index: third_party/WebKit/LayoutTests/fast/history/change-viewport-height-in-onpopstate.html
|
| diff --git a/third_party/WebKit/LayoutTests/fast/history/change-viewport-height-in-onpopstate.html b/third_party/WebKit/LayoutTests/fast/history/change-viewport-height-in-onpopstate.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..90e89806a8d71c42a92513a1037d33ff0f3f831f
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/fast/history/change-viewport-height-in-onpopstate.html
|
| @@ -0,0 +1,49 @@
|
| +<html>
|
| +<head>
|
| +<style type="text/css">
|
| +div {
|
| + height: 2000px;
|
| +}
|
| +</style>
|
| +</head>
|
| +<body>
|
| +<script>
|
| +if (window.testRunner) {
|
| + testRunner.dumpAsText();
|
| + testRunner.waitUntilDone();
|
| +}
|
| +
|
| +window.onpopstate = () => {
|
| + if (window.location.hash == '') {
|
| + // Step 4: While handling same-document back navigation, change the height
|
| + // of the document. This shouldn't interfere with restoring scroll state.
|
| + document.getElementById("d").remove();
|
| + // Force layout
|
| + window.scrollY;
|
| + setTimeout(function() {
|
| + // Step 5: Verify scrollY was reset to 0 as part of back navigation.
|
| + console.log("scrollY is: " + window.scrollY);
|
| + if (window.testRunner)
|
| + testRunner.notifyDone();
|
| + }, 0);
|
| + }
|
| +}
|
| +
|
| +window.onload = () => {
|
| + setTimeout(function() {
|
| + // Step 1: Add history entry.
|
| + location = "#hash";
|
| + setTimeout(function() {
|
| + // Step 2: Scroll to the bottom.
|
| + window.scrollBy(0, 4000);
|
| + // Step 3: Go back.
|
| + history.back();
|
| + }, 0);
|
| + }, 0);
|
| +}
|
| +</script>
|
| +<div></div>
|
| +<div id="d"></div>
|
| +</body>
|
| +</html>
|
| +
|
|
|