Bug 227259 - (later) Treat javascript: URL return values as UTF-8 bytes
Summary: (later) Treat javascript: URL return values as UTF-8 bytes
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alex Christensen
Keywords: InRadar
Depends on:
Reported: 2021-06-22 10:27 PDT by Domenic Denicola
Modified: 2021-06-29 10:28 PDT (History)
7 users (show)

See Also:

Patch (13.54 KB, patch)
2021-06-22 23:38 PDT, Alex Christensen
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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]
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]

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