Intent to Deprecate and Remove: Text encoding detection for XHR JSON response

68 views
Skip to first unread message

Yutaka Hirano

unread,
Jun 17, 2021, 7:24:23 AM6/17/21
to blink-dev

Contact emails

yhi...@chromium.org

Explainer

None

Specification

https://xhr.spec.whatwg.org/

Summary

XHR runs encoding detection on the response body if - The response type is "json", and - The response body has BOM. This is a spec violation. The spec requires us to always use UTF8 when the response type is "json" in https://xhr.spec.whatwg.org/#dom-xmlhttprequest-response.



Blink component

Blink>Network>XHR

TAG review

None - This is a very small fix.

TAG review status

Not applicable

Risks



Interoperability and Compatibility


WebKit matches with our current behavior and Firefox matches with the spec,  but the compatibility risk is low, given the low count.

Gecko: Matching with the spec (https://wpt.fyi/xhr/json.any.html)

WebKit: No signal (https://bugs.webkit.org/show_bug.cgi?id=223441)
Matching with our current behavior.

Web developers: No signals See the following for the existing usage. https://www.chromestatus.com/metrics/feature/timeline/popularity/3858


Is this feature fully tested by web-platform-tests?

Yes

Flag name



Tracking bug

https://bugs.chromium.org/p/chromium/issues/detail?id=1189627

Link to entry on the Chrome Platform Status

https://www.chromestatus.com/feature/5686951464140800

This intent message was generated by Chrome Platform Status.

Yoav Weiss

unread,
Jun 17, 2021, 9:39:22 AM6/17/21
to Yutaka Hirano, blink-dev
What's the planned deprecation period?

On Thu, Jun 17, 2021 at 1:24 PM Yutaka Hirano <yhi...@chromium.org> wrote:

Contact emails

yhi...@chromium.org

Explainer

None

Specification

https://xhr.spec.whatwg.org/

Summary

XHR runs encoding detection on the response body if - The response type is "json", and - The response body has BOM. This is a spec violation. The spec requires us to always use UTF8 when the response type is "json" in https://xhr.spec.whatwg.org/#dom-xmlhttprequest-response.



Blink component

Blink>Network>XHR

TAG review

None - This is a very small fix.

TAG review status

Not applicable

Risks



Interoperability and Compatibility


WebKit matches with our current behavior and Firefox matches with the spec,  but the compatibility risk is low, given the low count.

Gecko: Matching with the spec (https://wpt.fyi/xhr/json.any.html)

WebKit: No signal (https://bugs.webkit.org/show_bug.cgi?id=223441)

I think this is too small to spam webkit-dev with a position, but it would be good to let them know on the issue that we're planning to follow Firefox.
 
Matching with our current behavior.

Web developers: No signals See the following for the existing usage. https://www.chromestatus.com/metrics/feature/timeline/popularity/3858


Is this feature fully tested by web-platform-tests?

Yes

Can you link to the existing tests that we're failing?
 


Flag name



Tracking bug

https://bugs.chromium.org/p/chromium/issues/detail?id=1189627

Link to entry on the Chrome Platform Status

https://www.chromestatus.com/feature/5686951464140800

This intent message was generated by Chrome Platform Status.

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CABihn6ERcKBsEKvrxKUX%2BntVDLfgdLduC8FUN%2BTHSiFNQigzZA%40mail.gmail.com.

Yutaka Hirano

unread,
Jun 21, 2021, 2:50:27 AM6/21/21
to Yoav Weiss, blink-dev
On Thu, Jun 17, 2021 at 10:39 PM Yoav Weiss <yoav...@chromium.org> wrote:
What's the planned deprecation period?

I would like to change the behavior immediately, given the low use-counter number.
 
On Thu, Jun 17, 2021 at 1:24 PM Yutaka Hirano <yhi...@chromium.org> wrote:

Contact emails

yhi...@chromium.org

Explainer

None

Specification

https://xhr.spec.whatwg.org/

Summary

XHR runs encoding detection on the response body if - The response type is "json", and - The response body has BOM. This is a spec violation. The spec requires us to always use UTF8 when the response type is "json" in https://xhr.spec.whatwg.org/#dom-xmlhttprequest-response.



Blink component

Blink>Network>XHR

TAG review

None - This is a very small fix.

TAG review status

Not applicable

Risks



Interoperability and Compatibility


WebKit matches with our current behavior and Firefox matches with the spec,  but the compatibility risk is low, given the low count.

Gecko: Matching with the spec (https://wpt.fyi/xhr/json.any.html)

WebKit: No signal (https://bugs.webkit.org/show_bug.cgi?id=223441)

I think this is too small to spam webkit-dev with a position, but it would be good to let them know on the issue that we're planning to follow Firefox.
 
Will do!

 
Matching with our current behavior.

Web developers: No signals See the following for the existing usage. https://www.chromestatus.com/metrics/feature/timeline/popularity/3858


Is this feature fully tested by web-platform-tests?

Yes

Can you link to the existing tests that we're failing?
 

Yoav Weiss

unread,
Jun 21, 2021, 2:58:32 AM6/21/21
to Yutaka Hirano, blink-dev
LGTM1 to remove given low usage. Please provide a console warning telling folks that their use of the API was removed and point them in the right direction.

On Mon, Jun 21, 2021 at 8:50 AM Yutaka Hirano <yhi...@chromium.org> wrote:


On Thu, Jun 17, 2021 at 10:39 PM Yoav Weiss <yoav...@chromium.org> wrote:
What's the planned deprecation period?

I would like to change the behavior immediately, given the low use-counter number.

OK, the title made me think you want to deprecate first.

Rick Byers

unread,
Jun 21, 2021, 11:37:33 AM6/21/21
to Yoav Weiss, Yutaka Hirano, blink-dev
LGTM2
The UseCounter is tiny and behavior aligns with other browser vendors. Personally I'd be fine considering this a "bug fix", not something requiring formal breaking change approval. But the extra visibility never hurts!

Rick

Manuel Rego Casasnovas

unread,
Jun 23, 2021, 4:27:40 AM6/23/21
to Rick Byers, Yoav Weiss, Yutaka Hirano, blink-dev
LGTM3

On 21/06/2021 17:37, Rick Byers wrote:
> LGTM2
> The UseCounter is tiny and behavior aligns with other browser vendors.
> Personally I'd be fine considering this a "bug fix", not something
> requiring formal breaking change approval. But the extra visibility
> never hurts!
>
> Rick
>
> On Mon, Jun 21, 2021 at 2:58 AM Yoav Weiss <yoav...@chromium.org
> <mailto:yoav...@chromium.org>> wrote:
>
> LGTM1 to remove given low usage. Please provide a console warning
> telling folks that their use of the API was removed and point them
> in the right direction.
>
> On Mon, Jun 21, 2021 at 8:50 AM Yutaka Hirano <yhi...@chromium.org
> <mailto:yhi...@chromium.org>> wrote:
>
>
>
> On Thu, Jun 17, 2021 at 10:39 PM Yoav Weiss
> <yoav...@chromium.org <mailto:yoav...@chromium.org>> wrote:
>
> What's the planned deprecation period?
>
> I would like to change the behavior immediately, given the low
> use-counter number.
>
>
> OK, the title made me think you want to deprecate first.
>  
>
>  
>
> On Thu, Jun 17, 2021 at 1:24 PM Yutaka Hirano
> <yhi...@chromium.org <mailto:yhi...@chromium.org>> wrote:
>
>
> Contact emails
>
> yhi...@chromium.org <mailto:yhi...@chromium.org>
>
>
> Explainer
>
> None
>
>
> Specification
>
> https://xhr.spec.whatwg.org/ <https://xhr.spec.whatwg.org/>
>
>
> Summary
>
> XHR runs encoding detection on the response body if -
> The response type is "json", and - The response body has
> BOM. This is a spec violation. The spec requires us to
> always use UTF8 when the response type is "json" in
> https://xhr.spec.whatwg.org/#dom-xmlhttprequest-response
> <https://xhr.spec.whatwg.org/#dom-xmlhttprequest-response>.
>
>
>
> Blink component
>
> Blink>Network>XHR
> <https://bugs.chromium.org/p/chromium/issues/list?q=component:Blink%3ENetwork%3EXHR>
>
>
> TAG review
>
> None - This is a very small fix.
>
>
> TAG review status
>
> Not applicable
>
>
> Risks
>
>
>
> Interoperability and Compatibility
>
>
> WebKit matches with our current behavior and Firefox
> matches with the spec,  but the compatibility risk is
> low, given the low count
> <https://www.chromestatus.com/metrics/feature/timeline/popularity/3858>.
>
>
> Gecko: Matching with the spec
> (https://wpt.fyi/xhr/json.any.html
> <https://wpt.fyi/xhr/json.any.html>)
>
> WebKit: No signal
> (https://bugs.webkit.org/show_bug.cgi?id=223441
> <https://bugs.webkit.org/show_bug.cgi?id=223441>)
>
>
> I think this is too small to spam webkit-dev with a
> position, but it would be good to let them know on the issue
> that we're planning to follow Firefox.
>  
>
> Will do!
>
>  
>
> Matching with our current behavior.
>
> Web developers: No signals See the following for the
> existing
> usage. https://www.chromestatus.com/metrics/feature/timeline/popularity/3858
> <https://www.chromestatus.com/metrics/feature/timeline/popularity/3858>
>
>
> Is this feature fully tested
> by web-platform-tests
> <https://chromium.googlesource.com/chromium/src/+/master/docs/testing/web_platform_tests.md>?
>
> Yes
>
>
> Can you link to the existing tests that we're failing?
>  
>
> https://wpt.fyi/xhr/json.any.html
> <https://wpt.fyi/xhr/json.any.html>
>
>  
>
>
>
> Flag name
>
>
>
> Tracking bug
>
> https://bugs.chromium.org/p/chromium/issues/detail?id=1189627
> <https://bugs.chromium.org/p/chromium/issues/detail?id=1189627>
>
>
> Link to entry on the Chrome Platform Status
>
> https://www.chromestatus.com/feature/5686951464140800
> <https://www.chromestatus.com/feature/5686951464140800>
>
> This intent message was generated by Chrome Platform
> Status <https://www.chromestatus.com/>.
>
> --
> You received this message because you are subscribed to
> the Google Groups "blink-dev" group.
> To unsubscribe from this group and stop receiving emails
> from it, send an email to
> blink-dev+...@chromium.org
> <mailto:blink-dev+...@chromium.org>.
> <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CABihn6ERcKBsEKvrxKUX%2BntVDLfgdLduC8FUN%2BTHSiFNQigzZA%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "blink-dev" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to blink-dev+...@chromium.org
> <mailto:blink-dev+...@chromium.org>.
> To view this discussion on the web visit
> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAL5BFfULnUov0O_L4kxeasBXQUoWzAkxX6v9yvdbppzYC%3DnDKA%40mail.gmail.com
> <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAL5BFfULnUov0O_L4kxeasBXQUoWzAkxX6v9yvdbppzYC%3DnDKA%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
> --
> You received this message because you are subscribed to the Google
> Groups "blink-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to blink-dev+...@chromium.org
> <mailto:blink-dev+...@chromium.org>.
> To view this discussion on the web visit
> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAFUtAY-KTX6OS%3D5svmM2DEY6Q4Hxi%2BR6CrNqJZFHcLxiXOKd_w%40mail.gmail.com
> <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAFUtAY-KTX6OS%3D5svmM2DEY6Q4Hxi%2BR6CrNqJZFHcLxiXOKd_w%40mail.gmail.com?utm_medium=email&utm_source=footer>.
Reply all
Reply to author
Forward
0 new messages