Closed Bug 2085452 Opened 1 month ago Closed 24 days ago

[wpt-sync] Sync PR 64035 - WebKit export of https://bugs.webkit.org/show_bug.cgi?id=328468

Categories

(Core :: DOM: Networking, task, P4)

task

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox162 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 64035 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/64035
Details from upstream follow.

Anne van Kesteren <annevk@annevk.nl> wrote:

WebKit export of https://bugs.webkit.org/show_bug.cgi?id=328468

WebKit export from bug: XMLHttpRequest JSON responses should always be decoded as UTF-<!---->8

<pre>
XMLHttpRequest JSON responses should always be decoded as UTF-8

XMLHttpRequest parses a JSON response with parse JSON from bytes, which decodes the bytes as UTF-8
whatever charset the response or overrideMimeType() declares. XMLHttpRequest::createDecoder()
checked for a charset before looking at the response type, so a JSON response with, say,
charset=windows-1252 was decoded as windows-1252. Text responses are unchanged: they do use that
charset, with UTF-8 as the fallback.

To make UTF-8 decode easier to ask for, add TextResourceDecoder::createUTF8(), which creates a
plain-text decoder that always uses UTF-8, and remove setAlwaysUseUTF8(). Its callers created a
decoder with a MIME type and UTF-8 as the fallback encoding, and then called setAlwaysUseUTF8().
Once the decoder always uses UTF-8, the MIME type and fallback make no difference: it only strips a
UTF-8 byte order mark, and a CSS @charset rule can no longer change the encoding. Callers that
decode all their data at once now use TextResourceDecoder::textFromUTF8() instead. Apart from
XMLHttpRequest, this does not change behavior. Also use PAL::UTF8Encoding() for the remaining UTF-8
fallbacks in XMLHttpRequest::createDecoder().

WebKit-Bug: <a href="https://bugs.webkit.org/show_bug.cgi?id=328468">https://bugs.webkit.org/show_bug.cgi?id=328468</a>
</pre>

Component: web-platform-tests → DOM: Networking
Product: Testing → Core
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]

CI Results

Ran 9 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 437 tests and 1 subtests

Status Summary

Firefox

OK : 2[GitHub] 433[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-windows11-64-25h2-debug] 434[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-opt] 435[Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug] 436[Gecko-linux2404-64-opt]
PASS: 12[GitHub] 2279[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-windows11-64-25h2-debug] 2282[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-opt] 2283[Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview] 2284[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt]
FAIL: 36

Chrome

OK : 2
PASS: 12

Safari

OK : 2
PASS: 4
FAIL: 8

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

  • /xhr/open-url-multi-window-4.htm [wpt.fyi]: SKIP
  • /xhr/send-response-event-order.htm [wpt.fyi]: OK [Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt], SKIP [Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
  • /xhr/send-response-upload-event-progress.htm [wpt.fyi]: OK [Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt], SKIP [Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
  • /xhr/access-control-preflight-credential-async.htm [wpt.fyi]
    • CORS async request with URL credentials: FAIL
  • /xhr/access-control-preflight-credential-sync.htm [wpt.fyi]
    • CORS sync request with URL credentials: FAIL
  • /xhr/event-timeout.any.worker.html [wpt.fyi]: OK [Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt], SKIP [Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview]
  • /xhr/getallresponseheaders-after-reuse.html [wpt.fyi]
    • getAllResponseHeaders() must not return the previous response's headers: FAIL
  • /xhr/getallresponseheaders.htm [wpt.fyi]
    • XMLHttpRequest: getAllResponseHeaders() 2: FAIL
    • XMLHttpRequest: getAllResponseHeaders() 3: FAIL
    • XMLHttpRequest: getAllResponseHeaders() 5: FAIL
    • XMLHttpRequest: getAllResponseHeaders() 6: FAIL
  • /xhr/getresponseheader.any.worker.html [wpt.fyi]
    • getResponseHeader('content-length') expects 0, 0: FAIL
    • getResponseHeader('double-trouble') expects , : FAIL
    • getResponseHeader('heya') expects , , 1, , , 2: FAIL
    • getResponseHeader('www-authenticate') expects 1, 2, 3, 4: FAIL
  • /xhr/getresponseheader.any.html [wpt.fyi]
    • getResponseHeader('content-length') expects 0, 0: FAIL
    • getResponseHeader('double-trouble') expects , : FAIL
    • getResponseHeader('heya') expects , , 1, , , 2: FAIL
    • getResponseHeader('www-authenticate') expects 1, 2, 3, 4: FAIL
  • /xhr/open-url-multi-window-6.htm [wpt.fyi]
    • XMLHttpRequest: open() in document that is not fully active (but may be active) should throw: FAIL
  • /xhr/overridemimetype-blob.html [wpt.fyi]
      1. MIME types need to be parsed and serialized: TEXT/HTML;CHARSET=GBK: FAIL
      1. MIME types need to be parsed and serialized: text/html;charset= ";charset=GBK: FAIL
      1. MIME types need to be parsed and serialized: text/html;charset=";charset=foo";charset=GBK: FAIL
      1. MIME types need to be parsed and serialized: text/html;charset=";charset=GBK: FAIL
      1. MIME types need to be parsed and serialized: !#$%&'+-.^_|~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz/!#$%&'*+-.^_|~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz;!#$%&'+-.^_|~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz=!#$%&'*+-.^_|~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz: FAIL
      1. MIME types need to be parsed and serialized: x/x;x=" !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ": FAIL`
      1. MIME types need to be parsed and serialized: text/html;test=ÿ;charset=gbk: FAIL
  • /xhr/responseurl-after-abort.any.worker.html [wpt.fyi]
    • abort() during HEADERS_RECEIVED clears responseURL: FAIL
    • abort() during LOADING clears responseURL: FAIL
    • abort() during DONE clears responseURL (async): FAIL
    • abort() during DONE clears responseURL (sync): FAIL
    • responseURL reflects the new response after abort() and reuse: FAIL
  • /xhr/responseurl-after-abort.any.html [wpt.fyi]
    • abort() during HEADERS_RECEIVED clears responseURL: FAIL
    • abort() during LOADING clears responseURL: FAIL
  • /xhr/send-usp.any.worker.html [wpt.fyi]
    • XMLHttpRequest.send(URLSearchParams): POST uses the URLSearchParams MIME type when no Content-Type was set: FAIL
    • XMLHttpRequest.send(URLSearchParams): POST replaces the charset parameter of an author-set Content-Type: FAIL
  • /xhr/sync-xhr-and-window-onload.html [wpt.fyi]: OK [Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt], SKIP [Gecko-android-em-14-x86_64-debug-geckoview, Gecko-linux2404-64-debug]
  • /xhr/sync-xhr-supported-by-permissions-policy.tentative.html [wpt.fyi]
    • document.permissionsPolicy.features should advertise sync-xhr.: FAIL
  • /xhr/xhr-authorization-redirect.any.html [wpt.fyi]: OK [Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-opt], SKIP [Gecko-android-em-14-x86_64-debug-geckoview, Gecko-windows11-64-25h2-debug]
  • /xhr/xhr-timeout-longtask.any.html [wpt.fyi]
    • Long tasks should not trigger load timeout: FAIL
  • /xhr/xmlhttprequest-sync-default-permissions-policy.tentative.sub.html [wpt.fyi]
    • permissions policy "sync-xhr" can be disabled in cross-origin iframes using "allow" attribute.: FAIL
    • permissions policy "sync-xhr" can be disabled in same-origin iframes using "allow" attribute.: FAIL

Tests Disabled in Gecko Infrastructure

  • /xhr/open-url-multi-window-4.htm [wpt.fyi]: SKIP linked bug:Bug 1366966
  • /xhr/send-response-event-order.htm [wpt.fyi]: OK [Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt], SKIP [Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
  • /xhr/send-response-upload-event-progress.htm [wpt.fyi]: OK [Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt], SKIP [Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
  • /xhr/event-timeout.any.worker.html [wpt.fyi]: OK [Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt], SKIP [Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview]
  • /xhr/sync-xhr-and-window-onload.html [wpt.fyi]: OK [Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt], SKIP [Gecko-android-em-14-x86_64-debug-geckoview, Gecko-linux2404-64-debug]
  • /xhr/xhr-authorization-redirect.any.html [wpt.fyi]: OK [Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-opt], SKIP [Gecko-android-em-14-x86_64-debug-geckoview, Gecko-windows11-64-25h2-debug]
Status: NEW → RESOLVED
Closed: 24 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.