Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Treat javascript: URL results as UTF-8 bytes #6781

Merged
merged 1 commit into from
Jun 22, 2021
Merged

Treat javascript: URL results as UTF-8 bytes #6781

merged 1 commit into from
Jun 22, 2021

Conversation

domenic
Copy link
Member

@domenic domenic commented Jun 16, 2021

Closes #1129.

(See WHATWG Working Mode: Changes for more details.)


💥 Error: Wattsi server error 💥

PR Preview failed to build. (Last tried on Jun 22, 2021, 5:09 PM UTC).

More

PR Preview relies on a number of web services to run. There seems to be an issue with the following one:

🚨 Wattsi Server - Wattsi Server is the web service used to build the WHATWG HTML spec.

🔗 Related URL

<html>
<head><title>524 Origin Time-out</title></head>
<body bgcolor="white">
<center><h1>524 Origin Time-out</h1></center>
<hr><center>cloudflare-nginx</center>
</body>
</html>

If you don't have enough information above to solve the error by yourself (or to understand to which web service the error is related to, if any), please file an issue.

@domenic
Copy link
Member Author

domenic commented Jun 16, 2021

No, wait, this doesn't match Chrome I think... let's continue discussion in #1129.

domenic added a commit to web-platform-tests/wpt that referenced this pull request Jun 16, 2021
@rniwa
Copy link

rniwa commented Jun 17, 2021

@cdumez @achristensen07

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jun 17, 2021
Given a URL like javascript:String.fromCodePoint(0xDE0D), Chrome
currently displays three U+FFFD replacement characters rather than just
one, due to the incorrect UTF-8 conversion mode. We fix that by using
kStrictUTF8ConversionReplacingUnpairedSurrogatesWithFFFD.

This CL fully implements whatwg/html#6781.
Tests are partially taken from #29419.

Co-authored-by: Domenic Denicola <domenic@chromium.org>
Bug: 1221018
Change-Id: Ic1282d0a88eabb40b4d5d8d8c68e040e9a0a938d
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jun 18, 2021
Given a URL like javascript:String.fromCodePoint(0xDE0D), Chrome
currently displays three U+FFFD replacement characters rather than just
one, due to the incorrect UTF-8 conversion mode. We fix that by using
kStrictUTF8ConversionReplacingUnpairedSurrogatesWithFFFD.

This CL fully implements whatwg/html#6781.
Tests are partially taken from #29419.

Co-authored-by: Domenic Denicola <domenic@chromium.org>
Bug: 1221018
Change-Id: Ic1282d0a88eabb40b4d5d8d8c68e040e9a0a938d
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jun 18, 2021
Given a URL like javascript:String.fromCodePoint(0xDE0D), Chrome
currently displays three U+FFFD replacement characters rather than just
one, due to the incorrect UTF-8 conversion mode. We fix that by using
kStrictUTF8ConversionReplacingUnpairedSurrogatesWithFFFD.

This CL fully implements whatwg/html#6781.
Tests are partially taken from #29419.

Co-authored-by: Domenic Denicola <domenic@chromium.org>
Bug: 1221018
Change-Id: Ic1282d0a88eabb40b4d5d8d8c68e040e9a0a938d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2967353
Commit-Queue: Timothy Gu <timothygu@chromium.org>
Reviewed-by: Nate Chapin <japhet@chromium.org>
Cr-Commit-Position: refs/heads/master@{#893876}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jun 18, 2021
Given a URL like javascript:String.fromCodePoint(0xDE0D), Chrome
currently displays three U+FFFD replacement characters rather than just
one, due to the incorrect UTF-8 conversion mode. We fix that by using
kStrictUTF8ConversionReplacingUnpairedSurrogatesWithFFFD.

This CL fully implements whatwg/html#6781.
Tests are partially taken from #29419.

Co-authored-by: Domenic Denicola <domenic@chromium.org>
Bug: 1221018
Change-Id: Ic1282d0a88eabb40b4d5d8d8c68e040e9a0a938d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2967353
Commit-Queue: Timothy Gu <timothygu@chromium.org>
Reviewed-by: Nate Chapin <japhet@chromium.org>
Cr-Commit-Position: refs/heads/master@{#893876}
@TimothyGu
Copy link
Member

Chrome now matches this PR fully after https://crrev.com/c/2967353 (Chrome 93).

Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this still seems like a good idea.

@domenic domenic merged commit 66605d1 into main Jun 22, 2021
@domenic domenic deleted the javascript-body branch June 22, 2021 17:08
domenic added a commit to web-platform-tests/wpt that referenced this pull request Jun 22, 2021
domenic added a commit to web-platform-tests/wpt that referenced this pull request Jun 22, 2021
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Jun 27, 2021
…ting javascript URLs, a=testonly

Automatic update from web-platform-tests
Replace unpaired surrogates after evaluating javascript URLs

Given a URL like javascript:String.fromCodePoint(0xDE0D), Chrome
currently displays three U+FFFD replacement characters rather than just
one, due to the incorrect UTF-8 conversion mode. We fix that by using
kStrictUTF8ConversionReplacingUnpairedSurrogatesWithFFFD.

This CL fully implements whatwg/html#6781.
Tests are partially taken from web-platform-tests/wpt#29419.

Co-authored-by: Domenic Denicola <domenic@chromium.org>
Bug: 1221018
Change-Id: Ic1282d0a88eabb40b4d5d8d8c68e040e9a0a938d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2967353
Commit-Queue: Timothy Gu <timothygu@chromium.org>
Reviewed-by: Nate Chapin <japhet@chromium.org>
Cr-Commit-Position: refs/heads/master@{#893876}

--

wpt-commits: ad7af3947f19693e8ab8911663a41152e907ed0e
wpt-pr: 29422
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Jun 27, 2021
…rsion tests, a=testonly

Automatic update from web-platform-tests
Un-.tentative javascript: byte handling test

whatwg/html#6781 got merged.

--

wpt-commits: 4465a5d5ffb1b89a7f9960fb614da2317c63e860
wpt-pr: 29419
jamienicol pushed a commit to jamienicol/gecko that referenced this pull request Jul 16, 2021
…ting javascript URLs, a=testonly

Automatic update from web-platform-tests
Replace unpaired surrogates after evaluating javascript URLs

Given a URL like javascript:String.fromCodePoint(0xDE0D), Chrome
currently displays three U+FFFD replacement characters rather than just
one, due to the incorrect UTF-8 conversion mode. We fix that by using
kStrictUTF8ConversionReplacingUnpairedSurrogatesWithFFFD.

This CL fully implements whatwg/html#6781.
Tests are partially taken from web-platform-tests/wpt#29419.

Co-authored-by: Domenic Denicola <domenic@chromium.org>
Bug: 1221018
Change-Id: Ic1282d0a88eabb40b4d5d8d8c68e040e9a0a938d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2967353
Commit-Queue: Timothy Gu <timothygu@chromium.org>
Reviewed-by: Nate Chapin <japhet@chromium.org>
Cr-Commit-Position: refs/heads/master@{#893876}

--

wpt-commits: ad7af3947f19693e8ab8911663a41152e907ed0e
wpt-pr: 29422
jamienicol pushed a commit to jamienicol/gecko that referenced this pull request Jul 16, 2021
…rsion tests, a=testonly

Automatic update from web-platform-tests
Un-.tentative javascript: byte handling test

whatwg/html#6781 got merged.

--

wpt-commits: 4465a5d5ffb1b89a7f9960fb614da2317c63e860
wpt-pr: 29419
webkit-commit-queue pushed a commit to WebKit/WebKit that referenced this pull request Oct 27, 2021
https://bugs.webkit.org/show_bug.cgi?id=232380

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline WPT test now that more checks are passing. The remaining failures are due to the fact that we ignore the JavaScript URL result
when the URL is set as href on an anchor (as opposed to the src of an iframe). This will be addressed separately.

* web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-return-value-handling-dynamic-expected.txt:

Source/WebCore:

JavaScript URL result should be treated as UTF-8 bytes:
- whatwg/html#6781

No new tests, rebaselined existing test.

* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::replaceDocumentWithResultOfExecutingJavascriptURL):



Canonical link: https://commits.webkit.org/243604@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@284934 268f45cc-cd09-0410-ab3c-d52691b4dbfc
philn pushed a commit to philn/old-webkit that referenced this pull request Nov 3, 2021
https://bugs.webkit.org/show_bug.cgi?id=232380

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline WPT test now that more checks are passing. The remaining failures are due to the fact that we ignore the JavaScript URL result
when the URL is set as href on an anchor (as opposed to the src of an iframe). This will be addressed separately.

* web-platform-tests/html/browsers/browsing-the-web/navigating-across-documents/javascript-url-return-value-handling-dynamic-expected.txt:

Source/WebCore:

JavaScript URL result should be treated as UTF-8 bytes:
- whatwg/html#6781

No new tests, rebaselined existing test.

* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::replaceDocumentWithResultOfExecutingJavascriptURL):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@284934 268f45cc-cd09-0410-ab3c-d52691b4dbfc
mjfroman pushed a commit to mjfroman/moz-libwebrtc-third-party that referenced this pull request Oct 14, 2022
Given a URL like javascript:String.fromCodePoint(0xDE0D), Chrome
currently displays three U+FFFD replacement characters rather than just
one, due to the incorrect UTF-8 conversion mode. We fix that by using
kStrictUTF8ConversionReplacingUnpairedSurrogatesWithFFFD.

This CL fully implements whatwg/html#6781.
Tests are partially taken from web-platform-tests/wpt#29419.

Co-authored-by: Domenic Denicola <domenic@chromium.org>
Bug: 1221018
Change-Id: Ic1282d0a88eabb40b4d5d8d8c68e040e9a0a938d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2967353
Commit-Queue: Timothy Gu <timothygu@chromium.org>
Reviewed-by: Nate Chapin <japhet@chromium.org>
Cr-Commit-Position: refs/heads/master@{#893876}
NOKEYCHECK=True
GitOrigin-RevId: be9d85b1de10c87c8904ffcd650890e67d894119
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

javascript URL: define JS string-to-byte conversion better
4 participants