Граф коммитов

5138 Коммитов

Автор SHA1 Сообщение Дата
Tooru Fujisawa cc92ef732d Bug 1708448 - Move property and element functions into js/public/PropertyAndElement.h. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D119619
2021-07-13 11:52:42 +00:00
JMM 22f3732905 Bug 1672548 - Add weekday skeleton to DateTimeFormat::FormatDateTime(). r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D119545
2021-07-09 19:54:56 +00:00
Erik Nordin 0990d59463 Bug 1719758 - Test result values before unwrapping in TestPluralRules r=platform-i18n-reviewers,dminor
Modifies TestPluralRules.cpp to assert that all result values are okay
before unwrapping them. Previously the test suite would crash if an
error result was unwrapped. Now it will fail the test and report the
failure.

Differential Revision: https://phabricator.services.mozilla.com/D119465
2021-07-09 17:49:38 +00:00
Greg Tatum 8c72f6e6ae Bug 1715979 - Do not leak ICU objects in mozilla:intl component moves; r=nordzilla
Differential Revision: https://phabricator.services.mozilla.com/D117569
2021-06-29 15:25:44 +00:00
Erik Nordin ed5c7b4262 Bug 1718345 - Add PluralRules tests for three-letter langids r=platform-i18n-reviewers,dminor
Differential Revision: https://phabricator.services.mozilla.com/D118869
2021-06-28 16:24:03 +00:00
André Bargull 90a85eee9f Bug 1284868: Adjust field widths for hour/minute/second when the user requested 2-digit representation. r=dminor
Change `DateTimePatternGenerator::GetBestPattern()` to call `udatpg_getBestPatternWithOptions()`,
so we can adjust the computed pattern to use 2-digit representation when it was requested by the
user.

Differential Revision: https://phabricator.services.mozilla.com/D118728
2021-06-28 13:20:44 +00:00
Dan Minor 4e7bbb18ad Bug 1717060 - Create a micro benchmark for Intl.NumberFormat; r=nordzilla
Differential Revision: https://phabricator.services.mozilla.com/D118199
2021-06-24 13:06:26 +00:00
Nika Layzell 5731c1747c Bug 1717526 - String's implicit conversion operator causes COW relocations, r=xpcom-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D118430
2021-06-23 01:57:00 +00:00
Alexandru Michis e3d24b013a Backed out changeset 3beb01f5d643 (bug 1717526) for causing gtest failures in SpanTest.from_xpcom_collections
CLOSED TREE
2021-06-23 01:58:49 +03:00
Nika Layzell c14de7eabc Bug 1717526 - String's implicit conversion operator causes COW relocations, r=xpcom-reviewers,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D118430
2021-06-22 21:18:03 +00:00
Henri Sivonen 7df7939f77 Bug 1713627 - Remove code obsoleted by the replacing the Text Encoding menu with one item. r=jaws,emk
Differential Revision: https://phabricator.services.mozilla.com/D116391
2021-06-21 12:09:01 +00:00
Dorel Luca 2118316ba4 Backed out changeset 4891a17c55e2 (bug 1713627) for Browser-chrome failures in docshell/test/browser/browser_bug673087-1.js. CLOSED TREE 2021-06-21 12:10:54 +03:00
Henri Sivonen abbbf94915 Bug 1713627 - Remove code obsoleted by the replacing the Text Encoding menu with one item. r=jaws,emk
Differential Revision: https://phabricator.services.mozilla.com/D116391
2021-06-21 08:09:43 +00:00
André Bargull b0a94f02a6 Bug 1685075 - Part 2: Remove "en-US-posix" locale from ICU data file. r=zbraniecki
The filter file doesn't support exclusion lists for the "locales" filter type
(<https://github.com/unicode-org/icu/blob/main/docs/userguide/icu_data/buildtool.md#filtering-by-locale>),
therefore we have to manually exclude "en-US-posix" from the relevant resource
types: "en-US-posix" data is only present for collation, locales, and break
iteration. Break iteration is already completely stripped from the data file,
so we don't need to change anything on that front.

The string must be "en_US_POSIX" to match the resource file name, also see
<https://unicode-org.atlassian.net/browse/ICU-21400>.

Depends on D117975

Differential Revision: https://phabricator.services.mozilla.com/D117976
2021-06-18 09:22:06 +00:00
André Bargull 8b1839ebe0 Bug 1685075 - Part 1: Replace black/white-list in ICU data filter file. r=zbraniecki
Replace "whitelist" and "blacklist" with "includelist" resp. "excludelist", because
the latter is now the preferred name in ICU and the ICU docs/examples are all using
the new names.

Differential Revision: https://phabricator.services.mozilla.com/D117975
2021-06-18 09:22:06 +00:00
Dan Minor 3bfa67ab19 Bug 1717080 - Create a micro benchmark for Intl.PluralRules; r=nordzilla
Differential Revision: https://phabricator.services.mozilla.com/D118205
2021-06-17 19:33:34 +00:00
Dan Minor b7aab76ee1 Bug 1716805 - Create a micro benchmark for Intl.Locale; r=nordzilla
Differential Revision: https://phabricator.services.mozilla.com/D118035
2021-06-16 18:47:11 +00:00
André Bargull 3fe14705b6 Bug 1697729: Re-add alias and parent links in ICU filters. r=tcampbell
The `-/*` filter also removes the alias (`%%ALIAS`) and parent locale (`%%Parent`)
links, so we have to manually add them back when we're using `-/*`.

The ICU docs warn about this issue, but unfortunately that warning wasn't
present when we originally created our filter file, so this bug went unnoticed
for a long time.

Differential Revision: https://phabricator.services.mozilla.com/D116981
2021-06-16 06:49:45 +00:00
André Bargull e3d2b6377c Bug 1714933 - Part 2: Update in-tree ICU to release 69.1. r=tcampbell
Update to ICU 69.1 by running "update-icu.sh" with "maint/maint-69" as the target.

Differential Revision: https://phabricator.services.mozilla.com/D116968
2021-06-15 07:53:58 +00:00
André Bargull ffd5b23c02 Bug 1714933 - Part 1: Update ICU patches. r=tcampbell
Generate the WASI patch from bug 1706949 to apply cleanly on ICU 69.

Differential Revision: https://phabricator.services.mozilla.com/D116967
2021-06-15 07:53:57 +00:00
Noemi Erli ce2801c88f Backed out 8 changesets (bug 1714933) for causing build bustages in 1659595.js CLOSED TREE
Backed out changeset 2f72875b300f (bug 1714933)
Backed out changeset a42831b46643 (bug 1714933)
Backed out changeset c7ccabae5816 (bug 1714933)
Backed out changeset a4f4e4026174 (bug 1714933)
Backed out changeset fca960ad267b (bug 1714933)
Backed out changeset 62bdba475376 (bug 1714933)
Backed out changeset f168a2d1d391 (bug 1714933)
Backed out changeset 85af7c63b9c5 (bug 1714933)
2021-06-14 23:47:43 +03:00
André Bargull 0b804a59a3 Bug 1714933 - Part 2: Update in-tree ICU to release 69.1. r=tcampbell
Update to ICU 69.1 by running "update-icu.sh" with "maint/maint-69" as the target.

Differential Revision: https://phabricator.services.mozilla.com/D116968
2021-06-14 19:46:50 +00:00
André Bargull c701a829df Bug 1714933 - Part 1: Update ICU patches. r=tcampbell
Generate the WASI patch from bug 1706949 to apply cleanly on ICU 69.

Differential Revision: https://phabricator.services.mozilla.com/D116967
2021-06-14 19:46:50 +00:00
Butkovits Atila c9d6eddfc2 Backed out 7 changesets (bug 1714933) for causing failures on test_ManifestProcessor_lang.html
Backed out changeset 2b4a65b9c1ac (bug 1714933)
Backed out changeset 40c329123b7c (bug 1714933)
Backed out changeset 692101de3873 (bug 1714933)
Backed out changeset 695f3bd8e875 (bug 1714933)
Backed out changeset 30e9aacecf56 (bug 1714933)
Backed out changeset e9f2a0d262c2 (bug 1714933)
Backed out changeset 3de963fab6d6 (bug 1714933)
2021-06-14 19:46:45 +03:00
André Bargull d165d44525 Bug 1714933 - Part 2: Update in-tree ICU to release 69.1. r=tcampbell
Update to ICU 69.1 by running "update-icu.sh" with "maint/maint-69" as the target.

Differential Revision: https://phabricator.services.mozilla.com/D116968
2021-06-14 13:12:59 +00:00
André Bargull f440c76e64 Bug 1714933 - Part 1: Update ICU patches. r=tcampbell
Generate the WASI patch from bug 1706949 to apply cleanly on ICU 69.

Differential Revision: https://phabricator.services.mozilla.com/D116967
2021-06-14 13:12:58 +00:00
Dan Minor eeaf61de24 Bug 1715982 - Fix initial capacity of NumberPartVector; r=anba
Differential Revision: https://phabricator.services.mozilla.com/D117540
2021-06-11 21:22:15 +00:00
Greg Tatum 07cc89dd24 Bug 1711902 - Add Calendar::GetCanonicalTimeZoneID; r=dminor
This finishes the UCalendar unification in DateTimeFormat.cpp

Differential Revision: https://phabricator.services.mozilla.com/D116158
2021-06-10 20:14:17 +00:00
Greg Tatum db78fe91b5 Bug 1711902 - Unify most of UCalendar in SpiderMonkey; r=dminor,anba
This adds a bigger unification primitive of an Enumeration iterator over the
UEnumeration ICU type.

Differential Revision: https://phabricator.services.mozilla.com/D116157
2021-06-10 20:14:17 +00:00
Greg Tatum 23873163d1 Bug 1711902 - Unify the DateTimePatternGenerator in SpiderMonkey; r=dminor,anba
Differential Revision: https://phabricator.services.mozilla.com/D115731
2021-06-10 20:14:17 +00:00
Greg Tatum cb9860735f Bug 1711902 - Remove UDateFormat from SpiderMonkey; r=dminor,anba
This patch starts the work of unifying the DateTimeFormat. It removes the uses
of UDateFormat.

Differential Revision: https://phabricator.services.mozilla.com/D115730
2021-06-10 20:14:16 +00:00
Greg Tatum efe295fd94 Bug 1711902 - Add a FormatBuffer for use in SpiderMonkey; r=anba
Differential Revision: https://phabricator.services.mozilla.com/D116911
2021-06-10 20:14:16 +00:00
Erik Nordin 875656873e Bug 1704509 - Add Unified PuralRules Impl For SpiderMonkey r=anba,dminor
- Adds mozilla::intl::PluralRules
    - Modifies SpiderMonkey code to use PluralRules.
    - Adds gtest suite for PluralRules

Differential Revision: https://phabricator.services.mozilla.com/D115783
2021-06-09 19:04:54 +00:00
Greg Tatum a40da379a7 Bug 1714100 - Add an Intl.DateTimeFormat microbenchmark;r=dminor,nordzilla
Differential Revision: https://phabricator.services.mozilla.com/D116657
2021-06-08 20:27:16 +00:00
André Bargull 50a541b708 Bug 1686052 - Part 3: Update in-tree ICU to release 68.2. r=jwalden
Update to ICU 68.2 by running "update-icu.sh" with "maint/maint-68" as the target.

Differential Revision: https://phabricator.services.mozilla.com/D101389
2021-06-04 17:42:10 +00:00
André Bargull d4cc682ab8 Bug 1686052 - Part 2: Update ICU build script to use new "sources.txt" file. r=jwalden
<https://unicode-org.atlassian.net/browse/ICU-10879> added a separate
"sources.txt" file which lists all source files per directory.

Differential Revision: https://phabricator.services.mozilla.com/D101366
2021-06-04 17:42:09 +00:00
André Bargull 2a7fef007a Bug 1686052 - Part 1: Update or remove ICU patches. r=jwalden
Update the patch from bug 1614941, because CLDR 38 adds its own patterns for
"MMMMd" and "yMMMM", which both conflict with our customised patterns. The
customised patterns were updated per the discussion in
<https://bugzilla.mozilla.org/show_bug.cgi?id=1614941#c32>.

Remove the patches from bug 1433303 and bug 1534160. Both are no longer needed,
because they've been integrated into upstream.

Differential Revision: https://phabricator.services.mozilla.com/D101365
2021-06-04 17:42:09 +00:00
Francesco Lodolo (:flod) 3744595d7a Bug 1714293 - Add Scots (sco) to language names and accept languages locales, r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D116685
2021-06-03 08:25:52 +00:00
André Bargull 3d58656e00 Bug 1693575 - Part 3: Implement support for "calendar" option. r=tcampbell
This last part to support "calendar" requires a bit more code.

`GetCalendarDisplayName()` performs the following steps:
1. Validate the input matches the `type` nonterminal, per
   CanonicalCodeForDisplayNames, step 4.a.
2. Then convert it to lower case, because ICU expects lower case names and it
   needs to be in lower case for `LanguageTag::replaceUnicodeExtensionType()`.
3. Replace calendar name aliases with the preferred name, e.g. use "ethioaa"
   instead of "ethiopic-amete-alem".
4. Check the input isn't too large, just in case ICU somehow doesn't properly
   handle large string inputs.
5. Retrieve the old-style value of the calendar name, for example "gregorian"
   for the calendar name "gregory".
6. And finally call `uldn_keyValueDisplayName` to search for the localised name.

Our ICU data file doesn't yet include calendar names. To include calendar names
we need to enable them in "data_filter.json", rebuild the ICU data file, and
then reapply the update for tzdata 2021a. (Reapplying the tzdata changed
"intl/tzdata/GIT-INFO", but otherwise didn't change any time zone files.)

Adding the calendar names to the ICU data file results in a slight increase of
the overall data file size (79,184 bytes).

The existing "calendar.js" test file was renamed to "month-calendar.js", so
the test file for the new "calendar" type can be named "calendar.js".

Differential Revision: https://phabricator.services.mozilla.com/D116008
2021-06-01 07:45:44 +00:00
Greg Tatum bf5ee6077d Bug 1705156 - Add a unified DateTimeFormat component; r=dminor,anba
This patch adds a DateTimeFormat class for use in the unified
internationalization API. Currently it's only targeting the
ICU code in the Fluent API. The plan is to use it in the Fluent DOM
code, as well as in SpiderMonkey as a centralized API for performing
datetime formatting.

Differential Revision: https://phabricator.services.mozilla.com/D114114
2021-05-27 23:03:43 +00:00
Chris Fallin 9e6185bf59 Bug 1706949 part 13 - Fix icu and intl for wasi. r=anba,glandium
Differential Revision: https://phabricator.services.mozilla.com/D113218
2021-05-26 06:44:09 +00:00
Greg Tatum 743d375d30 Bug 1707733 - Backfill FluentBundle tests for DATETIME(); r=dminor
These tests are in preparation for Bug 1705156.

Differential Revision: https://phabricator.services.mozilla.com/D113419
2021-05-21 13:57:07 +00:00
Jonathan Kew 053057fece Bug 1711246 - Make OSPreferences refcounting thread-safe, because of potential OMT usage from gfxDWriteFontFamily. r=dminor
Differential Revision: https://phabricator.services.mozilla.com/D115140
2021-05-14 17:45:16 +00:00
Dan Minor 0452666d00 Bug 1701695 - Add NumberFormat::TryCreate; r=tcampbell
This adds a fallible factory method to create new NumberFormat instances. This
allows us to report initialization errors at time of initialization, rather than
when format is called, and remove internal checks in the implementation for
successful initialization.

The existing fluent code assumes that creating a NumberFormat instance always
succeeds. This patch updates that code to handle failures.

Differential Revision: https://phabricator.services.mozilla.com/D114593
2021-05-12 17:22:51 +00:00
Dan Minor 3b533cd007 Bug 1701695 - Add documentation to NumberFormat.h; r=gregtatum,nordzilla
Differential Revision: https://phabricator.services.mozilla.com/D113145
2021-05-12 17:22:51 +00:00
Dan Minor 5f755ac1ab Bug 1701695 - Use intl::NumberFormatterSkeleton in PluralRules r=tcampbell
This temporarily adds intl::NumberFormatterSkeleton to the public API so that
we can use it in PluralRules. This allows us to remove the SpiderMonkey
NumberFormatterSkeleton implementation when we convert SpiderMonkey to use
intl::NumberFormat.

We can remove intl::NumberFormatterSkeleton from the public API when we
implement intl::PluralRules in Bug 1704509.

Differential Revision: https://phabricator.services.mozilla.com/D111887
2021-05-12 17:22:50 +00:00
Dan Minor d5183e8bf1 Bug 1701695 - Add support for format to parts to intl::NumberFormat r=gregtatum,tcampbell,anba
Differential Revision: https://phabricator.services.mozilla.com/D111886
2021-05-12 17:22:49 +00:00
Dan Minor 4b3bf83c4b Bug 1701695 - Restore [[nodiscard]] annotations to NumberFormatterSkeleton; r=gregtatum
I foolishly dropped these when bringing the code over from SpiderMonkey.

Differential Revision: https://phabricator.services.mozilla.com/D113558
2021-05-12 17:22:49 +00:00
Dan Minor afc8a3b58a Bug 1701695 - Rename NumberFormatOptions::CurrencyDisplayStyle; r=gregtatum
This should be CurrencyDisplay to be consistent with ecma-402.

Differential Revision: https://phabricator.services.mozilla.com/D113557
2021-05-12 17:22:48 +00:00
Dan Minor 27dd93eb84 Bug 1701695 - Return std::u16string_view instead of char16_t* in intl::NumberFormat r=gregtatum
The SpiderMonkey call sites need both the pointer and the length when
copying/deflating the string, so this changes the API to expose the underlying
string_view.

While we're here, this updates the API to use mozilla::Result.

Differential Revision: https://phabricator.services.mozilla.com/D112801
2021-05-12 17:22:48 +00:00