Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Navigation] Track in-progress navigations
https://bugs.webkit.org/show_bug.cgi?id=272459 Reviewed by Alex Christensen. This makes use of the NavigationAPITracker to correctly complete the Navigation::Result when events happen. * LayoutTests/TestExpectations: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/commit-behavior/after-transition-uncancelable-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/currententrychange-event/navigate-from-initial-about-blank-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/cross-window/click-samedocument-crossorigin-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/cross-window/click-samedocument-crossorigin-sameorigindomain.sub-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/cross-window/click-samedocument-sameorigin-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/navigate-history-back-noop-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/navigate-navigation-back-same-document-in-iframe-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/same-url-replace-cross-document-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigate-event/same-url-replace-same-document-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigation-methods/navigate-base-url-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigation-methods/navigate-from-initial-about-blank-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigation-methods/navigate-from-initial-about-blank-gc-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigation-methods/navigate-from-initial-about-blank-src-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigation-methods/navigate-replace-same-document-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigation-methods/return-value/reload-already-detached-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigation-methods/return-value/reload-detach-in-serialization-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigation-methods/return-value/traverseTo-already-detached-expected.txt: * Source/WebCore/bindings/js/JSDOMPromiseDeferred.h: (WebCore::callPromisePairFunction): The JSPromise needs to not be cleared because we create a DOMPromise with it later. * Source/WebCore/page/Navigation.cpp: (WebCore::Navigation::createDOMPromise): (WebCore::Navigation::createErrorResult): (WebCore::Navigation::maybeSetUpcomingNonTraversalTracker): (WebCore::Navigation::addUpcomingTrarveseAPIMethodTracker): (WebCore::Navigation::apiMethodTrackerDerivedResult): (WebCore::Navigation::reload): (WebCore::Navigation::navigate): (WebCore::Navigation::performTraversal): (WebCore::Navigation::traverseTo): (WebCore::Navigation::back): (WebCore::Navigation::forward): (WebCore::Navigation::updateCurrentEntry): (WebCore::Navigation::hasEntriesAndEventsDisabled const): (WebCore::Navigation::resolveFinishedPromise): (WebCore::notifyCommittedToEntry): (WebCore::Navigation::updateForNavigation): (WebCore::Navigation::promoteUpcomingAPIMethodTracker): (WebCore::Navigation::cleanupAPIMethodTracker): (WebCore::Navigation::innerDispatchNavigateEvent): (WebCore::createErrorResult): Deleted. * Source/WebCore/page/Navigation.h: (WebCore::NavigationAPIMethodTracker::NavigationAPIMethodTracker): Canonical link: https://commits.webkit.org/277688@main
- Loading branch information
Showing
18 changed files
with
222 additions
and
139 deletions.
There are no files selected for viewing
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: 0 additions & 2 deletions
2
...ts/navigation-api/currententrychange-event/navigate-from-initial-about-blank-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
2 changes: 1 addition & 1 deletion
2
...ts/navigation-api/navigate-event/cross-window/click-samedocument-crossorigin-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 @@ | ||
|
||
|
||
FAIL clicking on an <a> element that navigates same-document targeting a cross-origin window assert_true: destination.sameDocument expected true got false | ||
PASS clicking on an <a> element that navigates same-document targeting a cross-origin window | ||
|
2 changes: 1 addition & 1 deletion
2
...igate-event/cross-window/click-samedocument-crossorigin-sameorigindomain.sub-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 @@ | ||
|
||
|
||
FAIL clicking on an <a> element that navigates same-document targeting a same-origin-domain (but cross-origin) window assert_true: destination.sameDocument expected true got false | ||
PASS clicking on an <a> element that navigates same-document targeting a same-origin-domain (but cross-origin) window | ||
|
2 changes: 1 addition & 1 deletion
2
...sts/navigation-api/navigate-event/cross-window/click-samedocument-sameorigin-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 clicking on an <a> element that navigates same-document targeting a same-origin window assert_true: destination.sameDocument expected true got false | ||
PASS clicking on an <a> element that navigates same-document targeting a same-origin window | ||
|
4 changes: 1 addition & 3 deletions
4
...d/w3c/web-platform-tests/navigation-api/navigation-methods/navigate-base-url-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,6 +1,4 @@ | ||
|
||
|
||
Harness Error (TIMEOUT), message = null | ||
|
||
TIMEOUT navigate() must resolve URLs relative to navigation object's base URL Test timed out | ||
PASS navigate() must resolve URLs relative to navigation object's base URL | ||
|
6 changes: 1 addition & 5 deletions
6
...rm-tests/navigation-api/navigation-methods/navigate-from-initial-about-blank-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,8 +1,4 @@ | ||
CONSOLE MESSAGE: Unhandled Promise Rejection: SyntaxError: Invalid URL | ||
CONSOLE MESSAGE: Unhandled Promise Rejection: SyntaxError: Invalid URL | ||
|
||
|
||
Harness Error (TIMEOUT), message = null | ||
|
||
TIMEOUT navigate() from <iframe> still on initial about:blank works Test timed out | ||
PASS navigate() from <iframe> still on initial about:blank works | ||
|
2 changes: 0 additions & 2 deletions
2
...tests/navigation-api/navigation-methods/navigate-from-initial-about-blank-gc-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
4 changes: 1 addition & 3 deletions
4
...ests/navigation-api/navigation-methods/navigate-from-initial-about-blank-src-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,6 +1,4 @@ | ||
CONSOLE MESSAGE: Unhandled Promise Rejection: SyntaxError: Invalid URL | ||
CONSOLE MESSAGE: Unhandled Promise Rejection: SyntaxError: Invalid URL | ||
|
||
|
||
FAIL navigate() from <iframe> with src="" but still on initial about:blank works assert_equals: expected "/common/blank.html" but got "/navigation-api/navigation-methods/navigate-from-initial-about-blank-src.html" | ||
PASS navigate() from <iframe> with src="" but still on initial about:blank works | ||
|
1 change: 0 additions & 1 deletion
1
...tform-tests/navigation-api/navigation-methods/navigate-replace-same-document-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,3 @@ | ||
CONSOLE MESSAGE: Unhandled Promise Rejection: TypeError: null is not an object (evaluating 'navigation.currentEntry.key') | ||
|
||
PASS navigate() with history: 'replace' option | ||
|
2 changes: 1 addition & 1 deletion
2
...ion-methods/return-value/reload-rejection-order-detached-unserializablestate-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 reload() with unserializable state in a detached iframe throws "DataCloneError", not "InvalidStateError" assert_array_equals: lengths differ, expected array ["committed", "finished"] length 2, got ["todo"] length 1 | ||
PASS reload() with unserializable state in a detached iframe throws "DataCloneError", not "InvalidStateError" | ||
|
4 changes: 2 additions & 2 deletions
4
...s/navigation-api/navigation-methods/return-value/reload-unserializable-state-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 @@ | ||
|
||
FAIL reload() with an unserializable state (WritableStream) assert_array_equals: lengths differ, expected array ["committed", "finished"] length 2, got ["todo"] length 1 | ||
FAIL reload() with an unserializable state (SharedArrayBuffer) assert_array_equals: lengths differ, expected array ["committed", "finished"] length 2, got ["todo"] length 1 | ||
PASS reload() with an unserializable state (WritableStream) | ||
FAIL reload() with an unserializable state (SharedArrayBuffer) assert_unreached: finished must not fulfill Reached unreachable code | ||
|
9 changes: 1 addition & 8 deletions
9
...ation-api/updateCurrentEntry-method/same-document-away-and-back-location-api-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,10 +1,3 @@ | ||
CONSOLE MESSAGE: Unhandled Promise Rejection: Error: assert_equals: expected 3 but got 2 | ||
|
||
Harness Error (FAIL), message = Unhandled rejection: assert_equals: expected 3 but got 2 | ||
|
||
TIMEOUT entry.getState() behavior after navigating away using the location API, then back Test timed out | ||
|
||
Harness Error (FAIL), message = Unhandled rejection: assert_equals: expected 3 but got 2 | ||
|
||
TIMEOUT entry.getState() behavior after navigating away using the location API, then back Test timed out | ||
FAIL entry.getState() behavior after navigating away using the location API, then back assert_equals: expected 3 but got 4 | ||
|
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
Oops, something went wrong.