Automatic update from web-platform-tests Revert "Fix navigation-api tests for WebKit's synchronous onload firing (#54082)" (#54907) This reverts commit e0f710db1b047f97b0bdf0ec382da567b91546a3. Fixes https://github.com/web-platform-tests/interop/issues/985 -- wpt-commits: a1ecbd2950e6a24c6b256e3f96a4226941c07d96 wpt-pr: 54907
22 lines
854 B
HTML
22 lines
854 B
HTML
<!doctype html>
|
|
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1">
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<body>
|
|
<div style="height: 200vh; width: 200vw;"></div>
|
|
<div id="frag"></div>
|
|
<script>
|
|
promise_test(async t => {
|
|
// Wait for after the load event so that the navigation doesn't get converted
|
|
// into a replace navigation.
|
|
await new Promise(resolve => window.onload = () => t.step_timeout(resolve, 0));
|
|
assert_equals(window.scrollY, 0);
|
|
await navigation.navigate("#frag").finished;
|
|
assert_not_equals(window.scrollY, 0);
|
|
navigation.onnavigate = e => e.intercept({ scroll: "manual" });
|
|
await navigation.back().finished;
|
|
assert_not_equals(window.scrollY, 0);
|
|
}, "scroll: manual should prevent auto scroll on back.");
|
|
</script>
|
|
</body>
|