-
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.
[Navigation] Implement navigation.updateCurrentEntry()
https://bugs.webkit.org/show_bug.cgi?id=268261 Reviewed by Alex Christensen. This implements `navigation.UpdateCurrentEntry()`, both the method storing state, and emitting the currententryupdated event. https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigation-updatecurrententry * LayoutTests/TestExpectations: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/currententrychange-event/anchor-click-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/currententrychange-event/constructor-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/currententrychange-event/history-back-same-doc-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/currententrychange-event/history-pushState-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/currententrychange-event/history-replaceState-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/currententrychange-event/location-api-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/currententrychange-event/navigation-back-forward-same-doc-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/currententrychange-event/navigation-navigate-preventDefault-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/currententrychange-event/navigation-navigate-replace-same-doc-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/currententrychange-event/navigation-navigate-same-doc-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/currententrychange-event/navigation-updateCurrentEntry-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/updateCurrentEntry-method/basic-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/updateCurrentEntry-method/cross-document-away-and-back-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/updateCurrentEntry-method/cross-document-location-api-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/updateCurrentEntry-method/exception-order-initial-about-blank-unserializablestate-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/updateCurrentEntry-method/exception-order-not-fully-active-unserializablestate-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/updateCurrentEntry-method/history-pushState-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/updateCurrentEntry-method/history-replaceState-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/updateCurrentEntry-method/location-reload-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/updateCurrentEntry-method/not-fully-active-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/updateCurrentEntry-method/opaque-origin-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/updateCurrentEntry-method/same-document-away-and-back-location-api-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/navigation-api/updateCurrentEntry-method/unserializable-expected.txt: * Source/WebCore/page/Navigation.cpp: (WebCore::Navigation::updateCurrentEntry): * Source/WebCore/page/Navigation.h: * Source/WebCore/page/Navigation.idl: * Source/WebCore/page/NavigationHistoryEntry.cpp: (WebCore::NavigationHistoryEntry::getState const): * Source/WebCore/page/NavigationHistoryEntry.h: * Source/WebCore/page/NavigationHistoryEntry.idl: Canonical link: https://commits.webkit.org/274321@main
- Loading branch information
Showing
32 changed files
with
122 additions
and
48 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: 1 addition & 1 deletion
2
.../w3c/web-platform-tests/navigation-api/currententrychange-event/anchor-click-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 currententrychange fires for link click null is not an object (evaluating 'navigation.currentEntry.index') | ||
FAIL currententrychange fires for link click assert_true: expected true got false | ||
|
4 changes: 2 additions & 2 deletions
4
...d/w3c/web-platform-tests/navigation-api/currententrychange-event/constructor-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,6 @@ | ||
|
||
PASS can't bypass required members by omitting the dictionary entirely | ||
PASS from is required | ||
FAIL all properties are reflected back Type error | ||
FAIL defaults are as expected Type error | ||
PASS all properties are reflected back | ||
PASS defaults are as expected | ||
|
2 changes: 1 addition & 1 deletion
2
...platform-tests/navigation-api/currententrychange-event/history-back-same-doc-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 currententrychange fires for history.back() promise_test: Unhandled rejection with value: object "TypeError: null is not an object (evaluating 'navigation.currentEntry.index')" | ||
FAIL currententrychange fires for history.back() assert_equals: expected 3 but got 2 | ||
|
2 changes: 1 addition & 1 deletion
2
...web-platform-tests/navigation-api/currententrychange-event/history-pushState-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 currententrychange fires for history.pushState() null is not an object (evaluating 'navigation.currentEntry.index') | ||
FAIL currententrychange fires for history.pushState() assert_true: expected true got false | ||
|
2 changes: 1 addition & 1 deletion
2
...-platform-tests/navigation-api/currententrychange-event/history-replaceState-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 currententrychange fires for history.replaceState() null is not an object (evaluating 'navigation.currentEntry.index') | ||
FAIL currententrychange fires for history.replaceState() assert_true: expected true got false | ||
|
2 changes: 1 addition & 1 deletion
2
.../w3c/web-platform-tests/navigation-api/currententrychange-event/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,3 +1,3 @@ | ||
|
||
FAIL currententrychange fires for location API navigations null is not an object (evaluating 'navigation.currentEntry.index') | ||
FAIL currententrychange fires for location API navigations assert_true: expected true got false | ||
|
2 changes: 1 addition & 1 deletion
2
...sts/navigation-api/currententrychange-event/navigation-back-forward-same-doc-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 currententrychange fires for same-document navigation.back() and navigation.forward() promise_test: Unhandled rejection with value: object "TypeError: null is not an object (evaluating 'navigation.currentEntry.index')" | ||
FAIL currententrychange fires for same-document navigation.back() and navigation.forward() assert_equals: expected 3 but got 2 | ||
|
2 changes: 1 addition & 1 deletion
2
...s/navigation-api/currententrychange-event/navigation-navigate-preventDefault-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 currententrychange does not fire when onnavigate preventDefault() is called promise_test: Unhandled rejection with value: object "TypeError: undefined is not an object (evaluating 'promise.then')" | ||
FAIL currententrychange does not fire when onnavigate preventDefault() is called assert_unreached: Should have rejected: undefined Reached unreachable code | ||
|
2 changes: 1 addition & 1 deletion
2
...navigation-api/currententrychange-event/navigation-navigate-replace-same-doc-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 currententrychange fires for navigation.navigate() with replace promise_test: Unhandled rejection with value: object "TypeError: null is not an object (evaluating 'navigation.currentEntry.index')" | ||
FAIL currententrychange fires for navigation.navigate() with replace assert_true: expected true got false | ||
|
2 changes: 1 addition & 1 deletion
2
...m-tests/navigation-api/currententrychange-event/navigation-navigate-same-doc-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 currententrychange fires for navigation.navigate() promise_test: Unhandled rejection with value: object "TypeError: null is not an object (evaluating 'navigation.currentEntry.index')" | ||
FAIL currententrychange fires for navigation.navigate() assert_true: expected true got false | ||
|
2 changes: 1 addition & 1 deletion
2
...-tests/navigation-api/currententrychange-event/navigation-updateCurrentEntry-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 currententrychange fires for navigation.updateCurrentEntry() assert_equals: expected 1 but got 0 | ||
PASS currententrychange fires for navigation.updateCurrentEntry() | ||
|
2 changes: 1 addition & 1 deletion
2
...ported/w3c/web-platform-tests/navigation-api/updateCurrentEntry-method/basic-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 updateCurrentEntry() works as expected null is not an object (evaluating 'navigation.currentEntry.getState') | ||
PASS updateCurrentEntry() works as expected | ||
|
2 changes: 1 addition & 1 deletion
2
...-tests/navigation-api/updateCurrentEntry-method/cross-document-away-and-back-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 entry.getState() behavior after navigating away and back assert_equals: expected 1 but got 0 | ||
FAIL entry.getState() behavior after navigating away and back assert_equals: expected 1 but got 4 | ||
|
2 changes: 1 addition & 1 deletion
2
...m-tests/navigation-api/updateCurrentEntry-method/cross-document-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,4 +1,4 @@ | ||
|
||
|
||
FAIL entry.getState() behavior after cross-document location API navigation assert_equals: expected 1 but got 0 | ||
FAIL entry.getState() behavior after cross-document location API navigation assert_equals: expected 1 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
4 changes: 1 addition & 3 deletions
4
...dateCurrentEntry-method/exception-order-not-fully-active-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,5 +1,3 @@ | ||
|
||
FAIL updateCurrentEntry() with unserializable state while not fully active must throw an "InvalidStateError", not a "DataCloneError" assert_throws_dom: function "() => { | ||
wNavigation.updateCurrentEntry({ state: document.body }); | ||
}" did not throw | ||
PASS updateCurrentEntry() with unserializable state while not fully active must throw an "InvalidStateError", not a "DataCloneError" | ||
|
2 changes: 1 addition & 1 deletion
2
...eb-platform-tests/navigation-api/updateCurrentEntry-method/history-pushState-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 entry.getState() after history.pushState() null is not an object (evaluating 'navigation.currentEntry.getState') | ||
FAIL entry.getState() after history.pushState() assert_equals: expected (undefined) undefined but got (object) object "[object Object]" | ||
|
2 changes: 1 addition & 1 deletion
2
...platform-tests/navigation-api/updateCurrentEntry-method/history-replaceState-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 entry.getState() after history.replaceState() null is not an object (evaluating 'navigation.currentEntry.getState') | ||
FAIL entry.getState() after history.replaceState() assert_equals: expected (undefined) undefined but got (object) object "[object Object]" | ||
|
2 changes: 1 addition & 1 deletion
2
.../web-platform-tests/navigation-api/updateCurrentEntry-method/location-reload-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 entry.getState() after location.reload() assert_equals: expected 1 but got 0 | ||
FAIL entry.getState() after location.reload() assert_equals: expected 1 but got 4 | ||
|
4 changes: 1 addition & 3 deletions
4
...web-platform-tests/navigation-api/updateCurrentEntry-method/not-fully-active-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,5 +1,3 @@ | ||
|
||
FAIL updateCurrentEntry() must throw if the document is not fully active assert_throws_dom: function "() => { | ||
wNavigation.updateCurrentEntry({ state: 1 }); | ||
}" did not throw | ||
PASS updateCurrentEntry() must throw if the document is not fully active | ||
|
4 changes: 1 addition & 3 deletions
4
...3c/web-platform-tests/navigation-api/updateCurrentEntry-method/opaque-origin-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 @@ | ||
|
||
|
||
FAIL navigation.updateCurrentEntry() in an opaque origin iframe assert_throws_dom: function "() => { | ||
navigation.updateCurrentEntry({ state: 1 }); | ||
}" did not throw | ||
PASS navigation.updateCurrentEntry() in an opaque origin iframe | ||
|
6 changes: 3 additions & 3 deletions
6
...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,10 @@ | ||
CONSOLE MESSAGE: Unhandled Promise Rejection: TypeError: null is not an object (evaluating 'entry0.index') | ||
CONSOLE MESSAGE: Unhandled Promise Rejection: Error: assert_equals: expected 3 but got 2 | ||
|
||
Harness Error (FAIL), message = Unhandled rejection: null is not an object (evaluating 'entry0.index') | ||
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: null is not an object (evaluating 'entry0.index') | ||
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 | ||
|
4 changes: 1 addition & 3 deletions
4
...c/web-platform-tests/navigation-api/updateCurrentEntry-method/unserializable-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
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
Oops, something went wrong.