When navigating to javascript:'foo', the string 'foo' is used as the "response body" for the navigation. Previously the spec was not clear what it meant for a string to become a response body (which is usually bytes). In https://github.com/whatwg/html/pull/6781 it was updated to be clear the response body is encoded into UTF-8 bytes, which are then later decoded back into a string by the HTML parser. In particular, this means that lone surrogates do not round-trip. Also, the encoding for the resulting document is forced to UTF-8. See tests at https://wpt.fyi/results/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-return-value-handling-dynamic.html?label=master&label=experimental&product=chrome&product=firefox&product=safari&aligned
Created attachment 432023 [details] Patch
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Comment on attachment 432023 [details] Patch This is what it would take to make all those tests pass. Given where we are in our release cycle and that most of this code hasn't been changed in over a decade, I think now is not the right time to make this change.
<rdar://problem/79922373>