Closed Bug 1938524 Opened 2 months ago Closed 29 days ago

Use counter for 5-to-8-character language subtags in Intl.Locale constructor

Categories

(Core :: JavaScript: Internationalization API, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
136 Branch
Tracking Status
firefox136 --- fixed

People

(Reporter: hsivonen, Assigned: hsivonen)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

See https://github.com/unicode-org/icu4x/issues/3989 and TG2 discussion of the issue in https://docs.google.com/document/d/1tfGW373MuTuI5AJuZOCCDlMhA8Qix_vrhYxva8RUjAw/edit?tab=t.0 .

Let's add a use counter for 5-to-8-character language subtags in the Intl.Locale constructor to see if it would be sufficiently Web-compatible to start treating them as language tag syntax errors.

The use counter should probably count usage more broadly than just in the Intl.Locale constructor. It seems to me the place for the use counter is between these two lines https://searchfox.org/mozilla-central/rev/cdfe21b20eacfaa6712dd9821d6383859ce386c6/intl/components/src/Locale.cpp#1108-1109 and to make it possible to update a use counter there, the JSContext needs to become one more argument that flows to that point from https://searchfox.org/mozilla-central/rev/cdfe21b20eacfaa6712dd9821d6383859ce386c6/js/src/builtin/intl/LanguageTag.cpp#27 .

Assignee: nobody → hsivonen
Status: NEW → ASSIGNED
Blocks: sm-telemetry
Severity: -- → N/A
Priority: -- → P2

(In reply to Henri Sivonen (:hsivonen) from comment #1)

The use counter should probably count usage more broadly than just in the Intl.Locale constructor.

Or not, rather, since the main point of this is finding the cases where we currently retain and return a 5-to-8-character language instead of it being invisible if such a language failed to parse or failed to match.

I don't know how to write a test for this, but the patch seemed to be doing thing when looking at it in a debugger.

Attachment #9446005 - Attachment description: WIP: Bug 1938524 - Use counter for 5-to-8-character language subtags. → Bug 1938524 - Use counter for 5-to-8-character language subtags.
See Also: → 1940331
Pushed by hsivonen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/bcea7f7aa7b1 Use counter for 5-to-8-character language subtags. r=dminor

The failure was due to a bad automerge with bug 1940109. Re-queued landing with a manual adjustment to the merged code.

Flags: needinfo?(hsivonen)
Pushed by hsivonen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1f315d26db4f Use counter for 5-to-8-character language subtags. r=dminor
Status: ASSIGNED → RESOLVED
Closed: 29 days ago
Resolution: --- → FIXED
Target Milestone: --- → 136 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: