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
33 lines
1.1 KiB
HTML
33 lines
1.1 KiB
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);
|
|
|
|
let intercept_resolve;
|
|
let navigate_event;
|
|
navigation.onnavigate = e => {
|
|
navigate_event = e;
|
|
e.intercept({ handler: () => new Promise(r => intercept_resolve = r),
|
|
scroll: "manual" });
|
|
};
|
|
let promises = navigation.navigate("#frag", { history: "replace" });
|
|
await promises.committed;
|
|
assert_equals(window.scrollY, 0);
|
|
navigate_event.scroll();
|
|
assert_not_equals(window.scrollY, 0);
|
|
intercept_resolve();
|
|
await promises.finished;
|
|
assert_not_equals(window.scrollY, 0);
|
|
}, "scroll: scroll() should work on a replace navigation");
|
|
</script>
|
|
</body>
|