-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
https://bugs.webkit.org/show_bug.cgi?id=273815 Reviewed by Tim Nguyen. Based on WPT SHA f409c99393. * LayoutTests/imported/w3c/web-platform-tests/navigation-api/WEB_FEATURES.yml: Added. * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/cross-origin-traversal-redirect.html: Added. * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/event-constructor.html: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/navigate-anchor-cross-origin.html: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/navigate-anchor-download-userInitiated.html: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/navigate-anchor-download.html: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/navigate-anchor-fragment-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/navigate-anchor-fragment.html: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/navigate-anchor-same-origin-cross-document.html: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/navigate-anchor-userInitiated-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/navigate-anchor-userInitiated.html: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/navigate-anchor-with-target.html: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/navigate-destination-getState-back-forward.html: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/navigate-destination-getState-navigate.html: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/navigate-destination-getState-reload.html: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/navigate-form-get.html: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/navigate-form-reload.html: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/navigate-form-traverse.html: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/navigate-form-userInitiated.html: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/navigate-form-with-target.html: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/navigate-form.html: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/navigate-history-back-after-fragment.html: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/navigate-history-back-after-pushState.html: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/navigate-history-back-bfcache.html: Added. * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/navigate-history-back-cross-document.html: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/navigate-history-go-0.html: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/navigate-history-pushState.html: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/navigate-history-replaceState.html: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/navigate-iframe-location.html: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/navigate-location.html: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/navigate-meta-refresh.html: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/navigate-navigation-back-cross-document.html: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/navigate-navigation-back-same-document-in-iframe.html: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/navigate-navigation-back-same-document.html: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/navigate-navigation-navigate.html: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/navigate-svg-anchor-fragment-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/navigate-svg-anchor-fragment.html: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/navigate-to-srcdoc.html: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/navigate-window-open-self.html: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/navigate-window-open.html: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/resources/cross-origin-redirect-on-second-visit.py: Added. (redirect_response): (ok_response): (main): * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/resources/w3c-import.log: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/w3c-import.log: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigation-methods/return-value/back-204-205-download.html: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigation-methods/return-value/navigate-pagehide.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigation-methods/return-value/navigate-unload.html. * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigation-methods/return-value/navigate-rejection-order-invalidurl-pagehide.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigation-methods/return-value/navigate-rejection-order-invalidurl-unload.html. * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigation-methods/return-value/navigate-rejection-order-invalidurl-unload-expected.txt: Removed. * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigation-methods/return-value/navigate-rejection-order-pagehide-unserializablestate.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigation-methods/return-value/navigate-rejection-order-unload-unserializablestate.html. * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigation-methods/return-value/navigate-rejection-order-unload-unserializablestate-expected.txt: Removed. * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigation-methods/return-value/navigate-unload-expected.txt: Removed. * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigation-methods/return-value/reload-pagehide.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigation-methods/return-value/reload-unload.html. * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigation-methods/return-value/reload-rejection-order-pagehide-unserializablestate.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigation-methods/return-value/reload-rejection-order-unload-unserializablestate.html. * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigation-methods/return-value/reload-rejection-order-unload-unserializablestate-expected.txt: Removed. * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigation-methods/return-value/reload-unload-expected.txt: Removed. * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigation-methods/return-value/w3c-import.log: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/ordering-and-transition/back-cross-document-event-order.html: Added. * LayoutTests/imported/w3c/web-platform-tests/navigation-api/ordering-and-transition/navigate-cross-document-event-order.html: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/ordering-and-transition/w3c-import.log: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/scroll-behavior/after-transition-intercept-handler-modifies.html: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/w3c-import.log: Canonical link: https://commits.webkit.org/278449@main
- Loading branch information
Showing
60 changed files
with
232 additions
and
91 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
LayoutTests/imported/w3c/web-platform-tests/navigation-api/WEB_FEATURES.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
features: | ||
- name: navigation | ||
files: "**" |
33 changes: 33 additions & 0 deletions
33
...w3c/web-platform-tests/navigation-api/navigate-event/cross-origin-traversal-redirect.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<!doctype html> | ||
<body> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="/common/utils.js"></script> | ||
<script> | ||
promise_test(async t => { | ||
let i = document.createElement("iframe"); | ||
i.src = "resources/cross-origin-redirect-on-second-visit.py?key=" + token(); | ||
document.body.appendChild(i); | ||
|
||
// 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)); | ||
|
||
let original_iframe_url = i.contentWindow.location.href; | ||
|
||
// Do a cross-document push navigation in the iframe. | ||
i.contentWindow.navigation.navigate("/common/blank.html"); | ||
await new Promise(resolve => i.onload = resolve); | ||
|
||
// Go back. This will trigger a cross-origin redirect, but the navigate event | ||
// should still fire, and the event url should be the pre-redirect url (which | ||
// is same-origin). | ||
history.back(); | ||
let navigate_event_url = await new Promise(resolve => i.contentWindow.navigation.onnavigate = e => { | ||
resolve(e.destination.url); | ||
}); | ||
await new Promise(resolve => i.onload = resolve); | ||
assert_equals(navigate_event_url, original_iframe_url); | ||
}, "A traversal that redirects from same-origin to cross-origin fires the navigate event"); | ||
</script> | ||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...3c/web-platform-tests/navigation-api/navigate-event/navigate-anchor-fragment-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
|
||
FAIL Fragment <a> click fires navigate event assert_equals: expected (object) Element node <a id="a" href="#1"></a> but got (undefined) undefined | ||
PASS Fragment <a> click fires navigate event | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...b-platform-tests/navigation-api/navigate-event/navigate-anchor-userInitiated-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Click me | ||
|
||
FAIL Fragment <a> click fires navigate event assert_equals: expected (object) Element node <a id="a" href="#1">Click me</a> but got (undefined) undefined | ||
PASS Fragment <a> click fires navigate event | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...d/w3c/web-platform-tests/navigation-api/navigate-event/navigate-history-back-bfcache.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<!doctype html> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="/common/utils.js"></script> | ||
<script src="/common/dispatcher/dispatcher.js"></script> | ||
<script src="/html/browsers/browsing-the-web/back-forward-cache/resources/helper.sub.js"></script> | ||
|
||
<script> | ||
runBfcacheTest({ | ||
targetOrigin: originSameOrigin, | ||
funcBeforeBackNavigation: () => { | ||
window.did_navigate = false; | ||
navigation.onnavigate = () => window.did_navigate = true; | ||
}, | ||
async funcAfterAssertion(pageA, pageB) { | ||
// When `funcAfterAssertion` is called, we've already navigated to pageB, | ||
// then gone back to pageA with bfcache. Now go forward to pageB so we can | ||
// observe whether the navigate event fired. | ||
await pageA.execute_script(() => history.forward()); | ||
await pageB.execute_script(waitForPageShow); | ||
assert_true(await pageB.execute_script(() => window.did_navigate)); | ||
} | ||
}, "navigate event should fire when traversing to a bfcache hit"); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...eb-platform-tests/navigation-api/navigate-event/navigate-svg-anchor-fragment-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
|
||
FAIL <svg:a> click fires navigate event assert_equals: expected (object) Element node <a id="a" href="#1"></a> but got (undefined) undefined | ||
PASS <svg:a> click fires navigate event | ||
|
Oops, something went wrong.