Implement can-have-its-url-rewritten for history api (#35864)

Implement the helper function to verify whether the document can have
its URL rewritten to a new URL.
https://html.spec.whatwg.org/multipage/nav-history-apis.html#can-have-its-url-rewritten

Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
This commit is contained in:
Kingsley Yung 2025-03-09 00:04:42 +08:00 committed by GitHub
parent aa76847502
commit d0a306729d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 51 additions and 62 deletions

View file

@ -1,6 +1,3 @@
[iframe-src-204-pushState-replaceState.html]
[history.pushState]
expected: FAIL
[history.replaceState]
expected: FAIL

View file

@ -1,6 +1,7 @@
[window-open-204-pushState-replaceState.html]
expected: TIMEOUT
[history.pushState]
expected: FAIL
expected: TIMEOUT
[history.replaceState]
expected: FAIL
expected: NOTRUN

View file

@ -1,27 +0,0 @@
[history_pushstate_url_rewriting.html]
[blob:(a blob URL for this origin) to blob:(a blob URL for this origin)?newsearch should not work]
expected: FAIL
[blob:(a blob URL for this origin) to blob:http://web-platform.test:8000/syntheticblob should not work]
expected: FAIL
[blob:(a blob URL for this origin) to blob:(another blob URL for this origin) should not work]
expected: FAIL
[about:blank to about:blank should work]
expected: FAIL
[about:blank to about:blank#newhash should work]
expected: FAIL
[about:srcdoc to about:srcdoc should work]
expected: FAIL
[about:srcdoc to about:srcdoc#newhash should work]
expected: FAIL
[data:(script to run this test) to data:(script to run this test) should work]
expected: FAIL
[data:(script to run this test) to data:(script to run this test)#newhash should work]
expected: FAIL

View file

@ -1,3 +0,0 @@
[iframe-loading-lazy-history-pushState.html]
[History state change for iframe loading='lazy' before it is loaded: history.pushState]
expected: FAIL

View file

@ -1,3 +0,0 @@
[iframe-loading-lazy-history-replaceState.html]
[History state change for iframe loading='lazy' before it is loaded: history.replaceState]
expected: FAIL