New issue
Advanced search Search tips

Issue 595351 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Closed: Jul 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

Remove UTF-16 support from TextEncoder API

Project Member Reported by jsb...@chromium.org, Mar 16 2016

Issue description

Per https://github.com/whatwg/encoding/issues/18 and analysis - see UMA stat WebCore.FeatureObserver for TextEncoderUTF16 - Stable, 7-day aggregation - it's probably safe to remove support for encoding to UTF-16.


 

Comment 1 by jsb...@chromium.org, Mar 16 2016

Labels: Hotlist-GoodFirstBug
Since this is just deleting code, it's a "GoodFirstBug" if someone wants to beat me to it.

Comment 2 by jsb...@chromium.org, Mar 16 2016

Components: -Blink>EncodingAPI Blink>TextEncoding

Comment 3 by l.pan...@gmail.com, Mar 31 2016

I see it's already assigned (?), but I'd like to tackle this as a "goodfirstbug".

Comment 4 Deleted

Comment 5 by jsb...@chromium.org, Mar 31 2016

Please take it! 

FYI, tests to run/update are under third_party/WebKit/LayoutTests/fast/encoding/api and also third_party/WebKit/LayoutTests/imported/web-platform-tests/encoding (but you can't update those tests as they are imported, just add failing expectations for now) - bug to update the upstream tests is https://github.com/w3c/web-platform-tests/issues/2706

Comment 6 by l.pan...@gmail.com, Apr 1 2016

Thanks. I've located what appears to be the relevant code at "../third_party/WebKit/Source/modules/encoding/TextEncoder.cpp". I assume it's just a simple case of removing all references to utf-16?

As for testing the change, do I need to add some JS test functions for utf-16 (since there's only utf-8 in utf-round-trip.html) under third_party/WebKit/LayoutTests/fast/encoding/api? Lastly, by "add failing expectations", do you mean tests that are expected to fail?
> I assume it's just a simple case of removing all references to utf-16?

Also, update the IDL, remove the optional argument, and hard-code it to use "utf-8" internally.

> do I need to add some JS test functions for utf-16

If nothing in fast/encoding/api fails, you don't need to make changes - that means we think everything is covered by the imported tests.

> tests that are expected to fail?

Yes. Some of the tests in imported/web-platform-tests/encoding will assume that utf-16 is supported. For now those tests will fail, so they'll need XXX-expected.txt files that capture the "FAIL" output from failing test cases, which tells our test system that they had the expected output.

We should submit updates to web-platform-tests that fix the tests upstream, then re-import the tests. Order doesn't matter, really, as there's cleanup either way.

Comment 8 by l.pan...@gmail.com, Apr 4 2016

Ok, I've updated TextEncoder.idl and hardcoded the optional (lowercase) arg in the c++ source. Removed references to "utf-16" and its variants.

Added failing expectations for:
utf-round-trip (../fast/encoding/api)
textencoder-labels (../fast/encoding/api)
textencoder-constructor-non-utf (../imported/web-platform-tests/encoding)

Tests that rely on UTF-16 support fail as expected.

Just a few things I'm not sure about.

1. "idlharness.html" still uses the old IDL definition (optional DOMString arg), so there are some tests that fail because of that. Not sure if this is an issue - I'm new to web/blink IDL. 

2. Fixing the tests upstream - why can't we update the imported tests? Are they part of a suite of w3c tests?
Have you uploaded a CL to codereview.chromium.org yet? That's the easiest way to get feedback.

> 1. "idlharness.html" still uses the old IDL definition (optional DOMString arg), so there are some tests that fail because of that. Not sure if this is an issue - I'm new to web/blink IDL. 

Right, that will need to change in https://github.com/w3c/web-platform-tests then be re-imported

> 2. Fixing the tests upstream - why can't we update the imported tests? Are they part of a suite of w3c tests?

Exactly. We have an import process and don't make local changes. Fixes should get submitted to https://github.com/w3c/web-platform-tests and one accepted we can re-do the import.

Not sure if I did this right but here it is: https://codereview.chromium.org/1862453003/
Can someone versed in the details of this please create a Chrome status entry?

https://www.chromestatus.com/admin/features/new
jmedley@ - Will do, once we're closer to landing. I'll handle the "Intent..." as well.
Project Member

Comment 13 by bugdroid1@chromium.org, Jul 8 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4e0d49e0a7223958ebad85a98172ec1a8090c635

commit 4e0d49e0a7223958ebad85a98172ec1a8090c635
Author: l.panpax <l.panpax@gmail.com>
Date: Fri Jul 08 16:44:42 2016

[Blink>TextEncoder] Removed UTF-16 support from TextEncoder API.

Removal of UTF-16 support due to lack of use cases (see https://github.com/w3c/i18n-activity/issues/116 for more details). References to UTF-16 have been removed, and failing expectations added to the tests.

Intent to Deprecate and Remove: https://groups.google.com/a/chromium.org/d/msg/blink-dev/13uMPjRqY94/lhPLKRJnAwAJ
BUG= 595351 

TEST=Start chrome and run tests in third_party/WebKit/LayoutTests/fast/encoding/api and third_party/WebKit/LayoutTests/imported/web-platform-tests/encoding. Tests that relied on UTF-16 support should fail as expected.

Review-Url: https://codereview.chromium.org/1862453003
Cr-Commit-Position: refs/heads/master@{#404410}

[modify] https://crrev.com/4e0d49e0a7223958ebad85a98172ec1a8090c635/AUTHORS
[delete] https://crrev.com/a53cd10e4514d39102713e77bd9fa56ed2c9d15b/third_party/WebKit/LayoutTests/fast/encoding/api/textencoder-labels.html
[modify] https://crrev.com/4e0d49e0a7223958ebad85a98172ec1a8090c635/third_party/WebKit/LayoutTests/fast/encoding/api/utf-round-trip.html
[delete] https://crrev.com/a53cd10e4514d39102713e77bd9fa56ed2c9d15b/third_party/WebKit/LayoutTests/imported/wpt/encoding/textencoder-constructor-non-utf-expected.txt
[modify] https://crrev.com/4e0d49e0a7223958ebad85a98172ec1a8090c635/third_party/WebKit/LayoutTests/virtual/threaded/fast/compositorworker/compositor-proxy-supports.html
[modify] https://crrev.com/4e0d49e0a7223958ebad85a98172ec1a8090c635/third_party/WebKit/Source/modules/encoding/TextEncoder.cpp
[modify] https://crrev.com/4e0d49e0a7223958ebad85a98172ec1a8090c635/third_party/WebKit/Source/modules/encoding/TextEncoder.h
[modify] https://crrev.com/4e0d49e0a7223958ebad85a98172ec1a8090c635/third_party/WebKit/Source/modules/encoding/TextEncoder.idl

Status: Fixed (was: Assigned)
Thanks for following this through, l.panpax@ !

Chrome status entry: https://www.chromestatus.com/feature/5630760492990464

Assuming this sticks we'll need to update MDN docs.

Sign in to add a comment