Bug 227259

Summary: (later) Treat javascript: URL return values as UTF-8 bytes
Product: WebKit Reporter: Domenic Denicola <d>
Component: WebCore Misc.Assignee: Alex Christensen <achristensen>
Status: NEW ---    
Severity: Normal CC: achristensen, cdumez, clopez, ews-watchlist, japhet, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch ews-feeder: commit-queue-

Description Domenic Denicola 2021-06-22 10:27:52 PDT
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
Comment 1 Alex Christensen 2021-06-22 23:38:05 PDT
Created attachment 432023 [details]
Patch
Comment 2 EWS Watchlist 2021-06-22 23:38:58 PDT
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 3 Alex Christensen 2021-06-22 23:40:41 PDT
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.
Comment 4 Radar WebKit Bug Importer 2021-06-29 10:28:16 PDT
<rdar://problem/79922373>