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

5500 Коммитов

Автор SHA1 Сообщение Дата
Nika Layzell b8279164db Bug 1732343 - Part 2: Migrate all uses of base::FileDescriptor to UniqueFileHandle, r=handyman
This is useful for the following parts, as UniqueFileHandle is a cross-platform
type which can also be used to support transferring HANDLEs between processes.

This change requires fairly sweeping changes to existing callsites, which
previously did not require owning access to the handle types when transferring.
For the most part these changes were straightforward, but manual.

Differential Revision: https://phabricator.services.mozilla.com/D126564
2021-11-04 19:20:17 +00:00
Dan Minor 2266940c0d Bug 1736017 - Remove MozLocale; r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D129213
2021-11-04 16:36:05 +00:00
Dan Minor 690f8a34f1 Bug 1736017 - Replace MozLocale with Locale in OSPreferences_win.cpp; r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D129212
2021-11-04 16:36:05 +00:00
Dan Minor b82d0c7706 Bug 1736017 - Replace MozLocale with Locale in nsLanguageAtomService.cpp; r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D129211
2021-11-04 16:36:04 +00:00
Dan Minor 45d66d673c Bug 1736017 - Replace MozLocale with Locale in Quotes.cpp; r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D129210
2021-11-04 16:36:04 +00:00
Dan Minor ef542a2f3b Bug 1736017 - Replace MozLocale with Locale in LocaleService.cpp; r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D129209
2021-11-04 16:36:04 +00:00
Jonathan Kew 0511cbc54e Bug 1738903 - Update locale-specific quotation-mark data to CLDR release 40.0. r=platform-i18n-reviewers,dminor
Differential Revision: https://phabricator.services.mozilla.com/D130304
2021-11-04 14:06:21 +00:00
Yoshi Cheng-Hao Huang b4c3f94c5f Bug 1737814 - Part 3: Simplify parts data structure. r=platform-i18n-reviewers,anba,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D129563
2021-11-01 14:23:23 +00:00
Yoshi Cheng-Hao Huang 2349231e66 Bug 1737814 - Part 2: ListFormat.FormatToParts doesn't take a callback. r=platform-i18n-reviewers,anba,gregtatum
The caller now will provide a buffer, which owns the memory pointed by the span.

Differential Revision: https://phabricator.services.mozilla.com/D129562
2021-11-01 14:23:22 +00:00
Yoshi Cheng-Hao Huang 24dcdf0726 Bug 1737814 - Part 1: Add a AutoFormatResult class. r=platform-i18n-reviewers,anba,gregtatum
This AutoFormatResult class could be shared later by ListFormat.

Differential Revision: https://phabricator.services.mozilla.com/D129561
2021-11-01 14:23:22 +00:00
Noemi Erli 25dd04d4c5 Backed out 9 changesets (bug 1736017) for causing bustages in nsLineBreaker.cpp
Backed out changeset d7b7427bb29e (bug 1736017)
Backed out changeset 7249dec70600 (bug 1736017)
Backed out changeset f16572806b0c (bug 1736017)
Backed out changeset a78125c71b3e (bug 1736017)
Backed out changeset 84ba2cbd596a (bug 1736017)
Backed out changeset f771265e0930 (bug 1736017)
Backed out changeset c0cef271022d (bug 1736017)
Backed out changeset 19be73147fcc (bug 1736017)
Backed out changeset 11721cc861b0 (bug 1736017)
2021-10-28 00:06:35 +03:00
Dan Minor 739d179b38 Bug 1736017 - Remove MozLocale; r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D129213
2021-10-27 20:35:58 +00:00
Dan Minor f00bcd8df5 Bug 1736017 - Replace MozLocale with Locale in OSPreferences_win.cpp; r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D129212
2021-10-27 20:35:57 +00:00
Dan Minor b686783787 Bug 1736017 - Replace MozLocale with Locale in nsLanguageAtomService.cpp; r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D129211
2021-10-27 20:35:57 +00:00
Dan Minor 48c258c5fe Bug 1736017 - Replace MozLocale with Locale in Quotes.cpp; r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D129210
2021-10-27 20:35:57 +00:00
Dan Minor 635033c165 Bug 1736017 - Replace MozLocale with Locale in LocaleService.cpp; r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D129209
2021-10-27 20:35:56 +00:00
Bob Owen b77c3841c1 Bug 1737914: Add missing MOZ_SANDBOX guards in nsUniscribeBreaker.cpp. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D129637
2021-10-27 14:42:12 +00:00
André Bargull 33694d390f Bug 1737765 - Part 1: Update tzdata in ICU data files to 2021a3. r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D129486
2021-10-26 13:50:53 +00:00
Bob Owen 93b7d525df Bug 1713973 p4: Test brokered complex breaker against Uniscribe in content. r=jfkthame
Depends on D129143

Differential Revision: https://phabricator.services.mozilla.com/D129144
2021-10-26 09:58:52 +00:00
Bob Owen 75ff7d4c1e Bug 1713973 p3: Use brokered complex line breaking when win32k lockdown is enabled. r=jfkthame,tkikuchi
Depends on D126809

Differential Revision: https://phabricator.services.mozilla.com/D129143
2021-10-26 09:58:52 +00:00
Bob Owen 25f1dc489f Bug 1713973 p1: Add caching for calls to NS_GetComplexLineBreaks. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D129125
2021-10-26 09:58:51 +00:00
André Bargull 4037b90f13 Bug 1736805: Register written normalised length. r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D129428
2021-10-26 07:21:13 +00:00
Ting-Yu Lin 8dddb69ae7 Bug 1736938 Part 5 - Convert LineBreaker and WordBreaker into utility classes. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D129363
2021-10-25 19:00:23 +00:00
Ting-Yu Lin c2f6ef7a09 Bug 1736938 Part 3 - Make all WordBreaker's methods static, and adapt the callers. r=jfkthame
The motivation is the same as the previous part.

Differential Revision: https://phabricator.services.mozilla.com/D129109
2021-10-25 19:00:22 +00:00
Ting-Yu Lin 427cc27771 Bug 1736938 Part 2 - Make all LineBreaker's methods static, and adapt the callers. r=jfkthame
LineBreaker has no member variables and acts like "namespaces" with
utility functions. Therefore, its methods can be static and called
directly without needing a LineBreaker instance.

Rename GetJISx4051Breaks() to ComputeBreakPositions() per review
feedbacks.

Differential Revision: https://phabricator.services.mozilla.com/D129107
2021-10-25 19:00:22 +00:00
Ting-Yu Lin db09924f17 Bug 1736938 Part 1 - Expand LineBreaker::WordMove() within Next(). r=jfkthame
After removing Prev() in Bug 1733009, WordMove()'s argument aDirection
now always equals to 1 passed from its remaining caller Next(). Thus, we
can expand WordMove() within Next(), and simply the logic.

Differential Revision: https://phabricator.services.mozilla.com/D129361
2021-10-25 19:00:21 +00:00
Yoshi Cheng-Hao Huang 4d0b49fcd3 Bug 1737107 - Add documentation for Collator::GetSortKey. r=platform-i18n-reviewers,anba,dminor
Differential Revision: https://phabricator.services.mozilla.com/D129177
2021-10-25 18:24:07 +00:00
Yoshi Cheng-Hao Huang 817bdf1566 Bug 1719542 - Part 4: Make calling nsTArray::SetCapacity fallible. r=platform-i18n-reviewers,dminor
Originally nsCollation::AllocateRawSortKey used an infallible nsTArray[1],
however, for IndexedDB it used a fallible nsTArray instead[2], so making
SetCapacity fallible.

[1]: https://hg.mozilla.org/mozilla-central/rev/1a74809df6b9#l3.150
[2]: https://searchfox.org/mozilla-central/rev/ff5309e67b20a9976ea762f9ec5f657da0801490/dom/indexedDB/Key.cpp#673

Differential Revision: https://phabricator.services.mozilla.com/D129378
2021-10-25 18:23:12 +00:00
Yoshi Cheng-Hao Huang ba3ef137f3 Bug 1719542 - Part 2: Add an overloading of FillBufferWithICUCall takes nsTArray. r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D128999
2021-10-25 18:23:11 +00:00
Yoshi Cheng-Hao Huang 2a45093834 Bug 1719542 - Part 1: Collator::GetSortKey calls FillBufferWithICUCall. r=platform-i18n-reviewers,anba,gregtatum
Make GetSortKey call FillBufferWithICUCall so we have the same behavior
when resizeing the buffer.

Differential Revision: https://phabricator.services.mozilla.com/D128998
2021-10-25 18:23:11 +00:00
André Bargull 71bb35d484 Bug 1737533 - Part 1: Update tzdata in ICU data files to 2021a2. r=platform-i18n-reviewers,dminor
Differential Revision: https://phabricator.services.mozilla.com/D129370
2021-10-25 13:13:06 +00:00
ssummar 51c0ff21e5 Bug 1626517 - Replaced mozilla::Unused with mozilla::Ignore in mozilla::Decoder/mozilla::Encoder calls. r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D129022
2021-10-25 12:31:41 +00:00
Francesco Lodolo (:flod) 557468ff99 Bug 1735338 - Fix obsolete references (people, repos) in l10n docs, r=eemeli
Differential Revision: https://phabricator.services.mozilla.com/D128209
2021-10-22 09:58:04 +00:00
André Bargull 1d976b3b13 Bug 1736834 - Part 9: Expose Locale::{variants_,extension_} as an iterable structure. r=platform-i18n-reviewers,dminor
Expose both members only as an iterable structure to hide implementation details
like the `UniqueChars` storage.

Differential Revision: https://phabricator.services.mozilla.com/D129045
2021-10-22 08:41:14 +00:00
André Bargull a701a254af Bug 1736834 - Part 8: Use direct member access for Locale::{variants_, extensions_}. r=platform-i18n-reviewers,dminor
Use direct member access in preparation for the next part.

Differential Revision: https://phabricator.services.mozilla.com/D129044
2021-10-22 08:41:14 +00:00
André Bargull dd199665f6 Bug 1736834 - Part 7: Use Maybe instead of nullptr to represent absent private-use subtags. r=platform-i18n-reviewers,dminor
Use `Maybe` and return `Span` instead of raw `const char*`.

Differential Revision: https://phabricator.services.mozilla.com/D129043
2021-10-22 08:41:13 +00:00
André Bargull 9e6104f1a2 Bug 1736834 - Part 6: Use Maybe instead of nullptr to represent absent Unicode extensions. r=platform-i18n-reviewers,dminor
Use `Maybe` and return `Span` instead of raw `const char*`.

Differential Revision: https://phabricator.services.mozilla.com/D129042
2021-10-22 08:41:13 +00:00
André Bargull d5261e082c Bug 1736834 - Part 5: Use the existing ICUResult typedef for Locale::toString(). r=platform-i18n-reviewers,dminor
Differential Revision: https://phabricator.services.mozilla.com/D129041
2021-10-22 08:41:13 +00:00
André Bargull 09e2d151a7 Bug 1736834 - Part 4: Change Locale::setUnicodeExtension() to accept a Span. r=platform-i18n-reviewers,dminor
This avoids unnecessary null-termination for the callers.

Differential Revision: https://phabricator.services.mozilla.com/D129040
2021-10-22 08:41:12 +00:00
André Bargull 9a63cb041d Bug 1736834 - Part 3: Resultify Locale::setUnicodeExtension(). r=platform-i18n-reviewers,dminor
Return `ICUResult` from `Locale::setUnicodeExtension()` instead of using `bool`.

Differential Revision: https://phabricator.services.mozilla.com/D129039
2021-10-22 08:41:12 +00:00
André Bargull 2853848369 Bug 1736834 - Part 2: Resultify Locale::{add,remove}LikelySubtags(). r=platform-i18n-reviewers,dminor
Return `ICUResult` from `Locale::{add,remove}LikelySubtags()` instead of using `bool`.

Depends on D129037

Differential Revision: https://phabricator.services.mozilla.com/D129038
2021-10-22 08:41:11 +00:00
André Bargull 7b21811d28 Bug 1736834 - Part 1: Replace manual string comparisons with Span comparisons. r=platform-i18n-reviewers,dminor
The original code was created before bug 1583953 and at that point of time, the
`Span` operators where still costly to call due to release-assertions overhead.

With the release assertions removed, the `Span` operators are now just as efficient
as manually calling `std::char_traits`. (Both will compile down to plain `memcmp`
calls.) But compared to using `std::char_traits`, the `Span` operators are more
ergonomic to use and result in less written code.

Depends on D129036

Differential Revision: https://phabricator.services.mozilla.com/D129037
2021-10-22 08:41:11 +00:00
André Bargull d1f12a9bd7 Bug 1734838: Remove null termination in CallLikelySubtags. r=platform-i18n-reviewers,dminor
We no longer need to null-terminate the result of `CallLikelySubtags`, because
the computed string isn't passed back to ICU anymore. Also update `AssignFromLocaleId`
now that the string isn't null-terminated anymore.

Differential Revision: https://phabricator.services.mozilla.com/D129036
2021-10-22 08:41:11 +00:00
Yoshi Cheng-Hao Huang a3c54356eb Bug 1719678 - Part 2: Unify FormatDateTimeToParts and FormatDateTimeRangeToParts. r=platform-i18n-reviewers,anba,gregtatum,tcampbell
Add DateTimeFormat::TryFormatToParts and
DateIntervalFormat::TryFormattedToParts methods.

Differential Revision: https://phabricator.services.mozilla.com/D126342
2021-10-21 06:55:57 +00:00
Yoshi Cheng-Hao Huang 166ac0c418 Bug 1719678 - Part 1: Add a mozilla::intl::DateIntervalFormat. r=platform-i18n-reviewers,anba,gregtatum,tcampbell
Add a mozilla::intl::DateIntervalFormat class, with two methods:
- TryFormatCalendar
- TryFormatDateTime

and a mozilla::intl::AutoFormattedDateInterval class, which is a RAII
class calling udtitvfmt_openResult and udtitvfmt_closeResult for
DateIntervalFormat operations.

Differential Revision: https://phabricator.services.mozilla.com/D125642
2021-10-21 06:55:57 +00:00
Greg Tatum ee2694c97d Bug 1719546 - Replace nsBidi with mozilla::intl::Bidi; r=platform-i18n-reviewers,dminor
Differential Revision: https://phabricator.services.mozilla.com/D128793
2021-10-20 14:01:21 +00:00
Greg Tatum e732101746 Bug 1719546 - Create a unified bidi component; r=platform-i18n-reviewers,dminor
Differential Revision: https://phabricator.services.mozilla.com/D128792
2021-10-20 14:01:21 +00:00
Butkovits Atila 01c5e2aed8 Backed out 3 changesets (bug 1719546) for causing SM bustages at Bidi.h. CLOSED TREE
Backed out changeset c4d6ffc7e445 (bug 1719546)
Backed out changeset a1f7ed6c4251 (bug 1719546)
Backed out changeset e69fc596f2c3 (bug 1719546)
2021-10-19 21:09:47 +03:00
Greg Tatum f250d90114 Bug 1719546 - Replace nsBidi with mozilla::intl::Bidi; r=platform-i18n-reviewers,dminor
Differential Revision: https://phabricator.services.mozilla.com/D128793
2021-10-19 16:55:36 +00:00
Greg Tatum 4411a88775 Bug 1719546 - Create a unified bidi component; r=platform-i18n-reviewers,dminor
Differential Revision: https://phabricator.services.mozilla.com/D128792
2021-10-19 16:55:36 +00:00
Jonathan Kew 9f67437d11 Bug 1736393 - Don't use ScriptBreak for Tibetan, just treat Tsheg character like a hyphen instead. r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D128756
2021-10-19 13:11:37 +00:00
Yoshi Cheng-Hao Huang ec665f1714 Bug 1719551 - Part 2: Unify Intl API in OSPreferences. r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D128461
2021-10-19 07:34:01 +00:00
Yoshi Cheng-Hao Huang e08bac2c1d Bug 1719551 - Part 1: Add DateTimePatternGenerator::GetPlaceholderPattern. r=platform-i18n-reviewers,anba,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D128460
2021-10-19 07:34:00 +00:00
Dan Minor a9e674d68d Bug 1719746 - Rename Locale to MozLocale; r=platform-i18n-reviewers,zbraniecki
There is also a mozilla::intl::Locale in intl/locale/MozLocale.h. This naming
collision was causing crashes in debug builds where the wrong destructor ended
up being called. This patch renames the intl/locale/MozLocale.h class to
MozLocale.

I've filed Bug 1736017 to move callers of the MozLocale version to the
unified intl/components/Locale version.

Differential Revision: https://phabricator.services.mozilla.com/D128593
2021-10-18 13:38:24 +00:00
Dan Minor 1c51720ed4 Bug 1719746 - Update make_intl_data.py to generate LocaleGenerated.cpp; r=anba,gregtatum
This updates the script to generate intl/components/LocaleGenerated.cpp. I've
also tried to make it better match clang-format's style in places where that
wasn't too challenging.

Differential Revision: https://phabricator.services.mozilla.com/D126989
2021-10-18 13:38:23 +00:00
Dan Minor 2aec3f881c Bug 1719746 - Add gtest for Locale; r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D126985
2021-10-18 13:38:21 +00:00
Dan Minor 19bec7878b Bug 1719746 - Rework SpiderMonkey specific code in unified Locale; r=platform-i18n-reviewers,gregtatum,anba
Differential Revision: https://phabricator.services.mozilla.com/D126984
2021-10-18 13:38:21 +00:00
Dan Minor 6de738dee6 Bug 1719746 - Add Locale to moz.build; r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D126983
2021-10-18 13:38:20 +00:00
Dan Minor 9c7bff2c25 Bug 1719746 - Copy LanguageTag to intl/components as Locale; r=platform-i18n-reviewers,gregtatum
This moves the LanguageTag implementation from js/src/builtin/intl to
intl/components and renames them to Locale. The next commit will add
them to the build system.

Differential Revision: https://phabricator.services.mozilla.com/D126982
2021-10-18 13:38:20 +00:00
André Bargull af633f0f36 Bug 1733352 - Part 2: Move IcuLocale calls from SpiderMonkey to mozilla::intl. r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D127097
2021-10-16 12:43:21 +00:00
André Bargull a500a53471 Bug 1733352 - Part 1: Fix IcuLocale to test exactly for the string "und". r=platform-i18n-reviewers,gregtatum
Inputs like `IcuLocale("undef")` were also incorrectly changed to `""`.

Differential Revision: https://phabricator.services.mozilla.com/D127096
2021-10-16 12:43:21 +00:00
André Bargull c473b3dcaf Bug 1733353 - Part 2: Remove additional ToICUError declaration. r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D127095
2021-10-16 12:43:20 +00:00
André Bargull 441a8fd850 Bug 1733353 - Part 1: Remove unused includes and using statements. r=platform-i18n-reviewers,gregtatum
Remove includes and `using` statements no longer used after the unified Intl
work.

Differential Revision: https://phabricator.services.mozilla.com/D127094
2021-10-16 12:43:20 +00:00
André Bargull a41fa71881 Bug 1733350: Return a Span from mozilla::intl::Calendar::GetBcp47Type(). r=platform-i18n-reviewers,gregtatum
Return a Span instead of `const char*` for consistency with the rest of the
unified Intl API.

Differential Revision: https://phabricator.services.mozilla.com/D127092
2021-10-16 12:43:19 +00:00
André Bargull 6297258cd3 Bug 1733349: Assert Spans are null-terminated when passed as `const char*` to ICU. r=platform-i18n-reviewers,gregtatum
Some functions are accepting `Span<const char>` and expect that the underlying
`const char*` is null-terminated. Add an assertion that the string is really
null-terminated before passing it to ICU.

And then fix-up any issues where the string span is including the null
terminator. Also see bug 1660161.

Differential Revision: https://phabricator.services.mozilla.com/D127091
2021-10-16 12:43:19 +00:00
Ting-Yu Lin 717c05c00c Bug 1733009 - Remove LineBreaker::Prev(). r=jfkthame,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D128559
2021-10-15 18:10:09 +00:00
Yoshi Cheng-Hao Huang 63e26820be Bug 1735341 : Rename FillVectorWithICUCall to FillBufferWithICUCall. r=platform-i18n-reviewers,anba,dminor
So with this patch FillVectorWithICUCall could become an overload of FillBufferWithICUCall,
with the buffer type is mozilla::Vector.

The callers of mozilla::intl could provide a mozilla::Vector as the
buffer, instead of creating some buffer adapter like nsTArrayU8Buffer,
TestBuffer, or FormatBuffer.

Differential Revision: https://phabricator.services.mozilla.com/D128240
2021-10-15 12:29:03 +00:00
Butkovits Atila 7495be3566 Backed out 9 changesets (bug 1719746, bug 1735341) as requested by dev. CLOSED TREE
Backed out changeset f1b3e7dec7e2 (bug 1735341)
Backed out changeset e7675e3524da (bug 1719746)
Backed out changeset 05109157a4b5 (bug 1719746)
Backed out changeset b98f10477f44 (bug 1719746)
Backed out changeset dce9c0d6c79c (bug 1719746)
Backed out changeset 472767f43cad (bug 1719746)
Backed out changeset 4fa55bded471 (bug 1719746)
Backed out changeset 391c305dce1f (bug 1719746)
Backed out changeset 5f20632de2be (bug 1719746)
2021-10-15 02:02:25 +03:00
Yoshi Cheng-Hao Huang e50fc2c267 Bug 1735341 : Rename FillVectorWithICUCall to FillBufferWithICUCall. r=platform-i18n-reviewers,anba,dminor
So with this patch FillVectorWithICUCall could become an overload of FillBufferWithICUCall,
with the buffer type is mozilla::Vector.

The callers of mozilla::intl could provide a mozilla::Vector as the
buffer, instead of creating some buffer adapter like nsTArrayU8Buffer,
TestBuffer, or FormatBuffer.

Differential Revision: https://phabricator.services.mozilla.com/D128240
2021-10-14 06:54:26 +00:00
criss cccc71399f Backed out changeset 517b566a350a (bug 1735341) for causing build bustages on Locale.cpp. CLOSED TREE 2021-10-13 23:48:18 +03:00
Yoshi Cheng-Hao Huang 1abdd0a388 Bug 1735341 : Rename FillVectorWithICUCall to FillBufferWithICUCall. r=platform-i18n-reviewers,anba,dminor
So with this patch FillVectorWithICUCall could become an overload of FillBufferWithICUCall,
with the buffer type is mozilla::Vector.

The callers of mozilla::intl could provide a mozilla::Vector as the
buffer, instead of creating some buffer adapter like nsTArrayU8Buffer,
TestBuffer, or FormatBuffer.

Differential Revision: https://phabricator.services.mozilla.com/D128240
2021-10-13 20:34:39 +00:00
Dan Minor 49de63ce42 Bug 1719746 - Update make_intl_data.py to generate LocaleGenerated.cpp; r=anba,gregtatum
This updates the script to generate intl/components/LocaleGenerated.cpp. I've
also tried to make it better match clang-format's style in places where that
wasn't too challenging.

Differential Revision: https://phabricator.services.mozilla.com/D126989
2021-10-13 12:07:03 +00:00
Dan Minor fb0eb1a018 Bug 1719746 - Add gtest for Locale; r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D126985
2021-10-13 12:07:02 +00:00
Dan Minor e2c6f7fdff Bug 1719746 - Rework SpiderMonkey specific code in unified Locale; r=platform-i18n-reviewers,gregtatum,anba
Differential Revision: https://phabricator.services.mozilla.com/D126984
2021-10-13 12:07:01 +00:00
Dan Minor bef53f7ede Bug 1719746 - Add Locale to moz.build; r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D126983
2021-10-13 12:07:01 +00:00
Dan Minor 3289f9681a Bug 1719746 - Copy LanguageTag to intl/components as Locale; r=platform-i18n-reviewers,gregtatum
This moves the LanguageTag implementation from js/src/builtin/intl to
intl/components and renames them to Locale. The next commit will add
them to the build system.

Differential Revision: https://phabricator.services.mozilla.com/D126982
2021-10-13 12:07:00 +00:00
André Bargull 2c8cb57da2 Bug 1735352 - Part 3: Add wrapper for ICU4C specific library functions. r=platform-i18n-reviewers,gregtatum
Adds abstractions for `u_init()`, `u_cleanup()`, and `u_setMemoryFunctions()`,
and additionally a method to retrieve `U_ICU_VERSION`.

Because these methods are unlikely to replaceable with ICU4X, the class was
named "ICU4CLibrary" to make clear that the functionality is specific to ICU4C.

Differential Revision: https://phabricator.services.mozilla.com/D128228
2021-10-12 17:09:04 +00:00
André Bargull e5bef00d2b Bug 1735352 - Part 2: Add String::GetUnicodeVersion(). r=platform-i18n-reviewers,gregtatum
Adds a method to retrieve `U_UNICODE_VERSION` to `mozilla::intl::String`.

Depends on D128226

Differential Revision: https://phabricator.services.mozilla.com/D128227
2021-10-12 17:09:04 +00:00
André Bargull d65723b692 Bug 1735352 - Part 1: Add TimeZone::GetTZDataVersion(). r=platform-i18n-reviewers,gregtatum
Adds a method for `ucal_getTZDataVersion()` to `mozilla::intl::TimeZone`.

Differential Revision: https://phabricator.services.mozilla.com/D128226
2021-10-12 17:09:03 +00:00
Jonathan Kew 74b10b85a0 Bug 1734590 - Remove the LineBreaker::DeprecatedNext method. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D127807
2021-10-11 12:20:42 +00:00
Greg Tatum 45bc20f472 Bug 1734679 - Fix regression for XSLT sorting with an invalid language tag; r=platform-i18n-reviewers,dminor
This includes an integration test as well as a unit test, so hopefully
this will not regress again in the future.

Differential Revision: https://phabricator.services.mozilla.com/D127983
2021-10-08 19:10:48 +00:00
Jonathan Kew a2361076d9 Bug 1310559 - Modernize (and simplify) GetUnicharWidth implementation. r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D127814
2021-10-08 13:14:45 +00:00
Csoregi Natalia e92f158606 Backed out 4 changesets (bug 1734590) for failures on test_xmlserializer.js. CLOSED TREE
Backed out changeset e492f8fd3d53 (bug 1734590)
Backed out changeset 0af985bb7569 (bug 1734590)
Backed out changeset 3751b93ae994 (bug 1734590)
Backed out changeset 45059121c015 (bug 1734590)
2021-10-08 14:41:06 +03:00
Jonathan Kew 6494d53d3f Bug 1734590 - Remove the LineBreaker::DeprecatedNext method. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D127807
2021-10-08 10:05:52 +00:00
Ting-Yu Lin e558c2cbd9 Bug 1733872 Part 2 - Add a new LineBreaker::Next(), and deprecate the old Next(). r=m_kato
This patch is similar to Bug 1728708 Part 4, but for line breaker. This
should make the future integration of ICU4X line segmenter easier. A
UAX14 compatible line breaker always breaks at the end of text
(rule LB3 [1]), and ICU4X line segmenter has this behavior, too.

Current LineBreaker::Next() doesn't treat the end of text as a line
break opportunity, so this patch deprecates it by renaming it, and add a
new Next() method.

TestASCIILB() has adopted the new Next(). All the other callers of the
DeprecatedNext (nsPlainTextSerializer, nsXMLContentSerializer,
InternetCiter) should be audited later, possibly with the removal of
Prev() because the all the usages are very close to Prev().

[1] https://www.unicode.org/reports/tr14/#LB3

Differential Revision: https://phabricator.services.mozilla.com/D127379
2021-10-07 07:39:13 +00:00
Ting-Yu Lin da1f64cd71 Bug 1733872 Part 1 - Modernize TestASCIILB and TestASCIIWB. r=m_kato
After Bug 1728708 Part 4 [1], WordBreaker always breaks at the end of
text. Therefore, we don't need to manually record the end of text as a
word break opportunity when we see NS_WORDBREAKER_NEED_MORE_TEXT.

Also, modernize the interface of each functions by using mozilla::Span
to remove the needs to pass array length as parameters.

[1] https://hg.mozilla.org/mozilla-central/rev/55efff2d5628

Differential Revision: https://phabricator.services.mozilla.com/D127378
2021-10-07 07:39:13 +00:00
Yoshi Cheng-Hao Huang a19f20891a Bug 1734108 - Fix typo in LocaleCanonicalizer. r=platform-i18n-reviewers,dminor
Differential Revision: https://phabricator.services.mozilla.com/D127530
2021-10-05 12:42:15 +00:00
Yoshi Cheng-Hao Huang 7d3aeae349 Bug 1734106 - include FloatPoint.h in NumberFormatFields. r=platform-i18n-reviewers,dminor
Differential Revision: https://phabricator.services.mozilla.com/D127529
2021-10-05 12:42:15 +00:00
André Bargull f785b509a3 Bug 1733053 - Part 1: Update tzdata in ICU data files to 2021a1. r=platform-i18n-reviewers,dminor
Differential Revision: https://phabricator.services.mozilla.com/D126882
2021-09-30 08:32:45 +00:00
André Bargull b6b8f02a94 Bug 1719748 - Part 8: Add mozilla::intl::Locale::GetDefaultLocale(). r=platform-i18n-reviewers,gregtatum
Add `GetDefaultLocale()` to replace the two calls to `uloc_getDefault()`.

Differential Revision: https://phabricator.services.mozilla.com/D126494
2021-09-24 10:22:47 +00:00
André Bargull 1994abfe54 Bug 1719748 - Part 6: Add an enumeration over the list of available locales. r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D126492
2021-09-24 10:22:46 +00:00
André Bargull 032bae8d79 Bug 1719748 - Part 4: Add TimeZone::GetAvailableTimeZones(). r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D126490
2021-09-24 10:22:45 +00:00
André Bargull 362e7b8fd6 Bug 1719748 - Part 2: Add Collator::GetFirstCase(). r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D126488
2021-09-24 10:22:44 +00:00
André Bargull db871aaa56 Bug 1719748 - Part 1: Add an enumeration over the list of available locales. r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D126487
2021-09-24 10:22:44 +00:00
André Bargull 975b298483 Bug 1731620 - Part 8: Add TimeZone::GetHostTimeZone(). r=platform-i18n-reviewers,gregtatum
Add a wrapper for `ucal_getHostTimeZone` to `mozilla::intl::TimeZone`. This
function is only used for the "testing" function framework.

Differential Revision: https://phabricator.services.mozilla.com/D126198
2021-09-23 10:51:59 +00:00
André Bargull f0ef6836c5 Bug 1731620 - Part 6: Add default time zone setters to mozila::intl::TimeZone. r=platform-i18n-reviewers,gregtatum
Add setters to change ICU's default time zone.
1. `SetDefaultTimeZone()` sets the default time zone from a time zone identifier.
2. `SetDefaultTimeZoneFromHostTimeZone()` synchronizes the default time zone with
   the host system's time zone.

The two new methods will be used in the next part to replace ICU calls in
`js::DateTimeInfo::internalResyncICUDefaultTimeZone()`.

Differential Revision: https://phabricator.services.mozilla.com/D126196
2021-09-23 10:51:58 +00:00
André Bargull 7c924a2057 Bug 1731620 - Part 2: Use ICU C++ TimeZone API if available. r=platform-i18n-reviewers,gregtatum
ICU doesn't provide a C-API for time zone functions, but instead requires to
use `UCalendar`. This adds a noticeable overhead, because whenever time zone
offsets are computed, it's first necessary to set the time on a `UCalendar`,
which triggers a recomputation of all calendar fields. And because time zone
offset computation is used for JavaScript's `Date`, which is widely used, we
should avoid performance regressions compared to the current code which is
using the ICU C++ API.

We can only safely use the ICU C++ API when we don't use the system ICU,
because C++ doesn't have a stable ABI, so the ICU C++ API code paths are only
taken when `MOZ_SYSTEM_ICU` is `false`.

Differential Revision: https://phabricator.services.mozilla.com/D126192
2021-09-23 10:51:56 +00:00
André Bargull 216714975c Bug 1731620 - Part 1: Add more time zone functions to mozilla::intl::TimeZone. r=platform-i18n-reviewers,gregtatum
Add four additional methods to `mozilla::intl::TimeZone`:

1. `GetDSTOffsetMs()` to return the daylight saving offset at a specific UTC time.
2. `GetOffsetMs()` to return the time zone offset at a specific UTC time.
3. `GetUTCOffsetMs()` to return the UTC offset at a specific local time.
4. `GetDisplayName()` to return the display name of a time zone.

All four methods will be used to replace ICU calls in "js/src/vm/DateTime.cpp".

Differential Revision: https://phabricator.services.mozilla.com/D126191
2021-09-23 10:51:56 +00:00
André Bargull a3e91cb71a Bug 1728180 - Part 2: Call mozilla::intl::Calendar methods in intl_GetCalendarInfo. r=platform-i18n-reviewers,dminor
Use `mozilla::intl::Calendar` instead of directly calling ICU in
`intl_GetCalendarInfo`. This implies that the days of the week are now ordered
the same way as in the "Intl Locale Info API" and the "Temporal" proposal, i.e.
starting from Monday=1 to Sunday=7.

Differential Revision: https://phabricator.services.mozilla.com/D126228
2021-09-23 07:43:51 +00:00
André Bargull aae4fba66e Bug 1728180 - Part 1: Change "Intl.getCalendarInfo" to return an array of weekend days. r=platform-i18n-reviewers,dminor
Returning an array matches the current "Intl Locale Info API" proposal and
actually also simplifies the single user of this function.

Differential Revision: https://phabricator.services.mozilla.com/D126227
2021-09-23 07:43:51 +00:00
Jonathan Kew 08373ecf28 Bug 1719544 - part 1 - Add low-level normalization-data accessors ComposePairNFC and DecomposeRawNFD to mozilla::intl::String. r=platform-i18n-reviewers,dminor
Differential Revision: https://phabricator.services.mozilla.com/D126259
2021-09-22 21:27:53 +00:00
criss 6685fa570d Backed out 2 changesets (bug 1719544) for causing bustages on gtest.h:1445:11. CLOSED TREE
Backed out changeset 4ab330369412 (bug 1719544)
Backed out changeset b5d8d32d8326 (bug 1719544)
2021-09-22 23:33:48 +03:00
Jonathan Kew 2cfc8b9513 Bug 1719544 - part 1 - Add low-level normalization-data accessors ComposePairNFC and DecomposeRawNFD to mozilla::intl::String. r=platform-i18n-reviewers,dminor
Differential Revision: https://phabricator.services.mozilla.com/D126259
2021-09-22 18:48:53 +00:00
Dan Minor f62d42b1d9 Bug 1642415 - Add metasource to L10nFileSourceDescriptor; r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D125242
2021-09-22 18:16:08 +00:00
Dan Minor 451b4ef52f Bug 1642415 - Add unit tests for metasources; r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D125241
2021-09-22 18:16:08 +00:00
Dan Minor 2228681a5b Bug 1642415 - Update existing tests to pass metasource into createMock; r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D125240
2021-09-22 18:16:07 +00:00
Dan Minor 7e6caf3eeb Bug 1642415 - Use metasource in FileSource; r=platform-i18n-reviewers,extension-reviewers,gregtatum,zombie
Differential Revision: https://phabricator.services.mozilla.com/D125239
2021-09-22 18:16:07 +00:00
Dan Minor c5d2261220 Bug 1642415 - Remove unused L10nFileSource::Create method; r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D125238
2021-09-22 18:16:06 +00:00
Dan Minor 6e6201d36c Bug 1642415 - Use metasource in l10nregistry-ffi; r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D125237
2021-09-22 18:16:06 +00:00
Dan Minor 89a5ba9d69 Bug 1642415 - Update to l10nregistry to 0.3.0; r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D125235
2021-09-22 18:16:05 +00:00
André Bargull c495c4e12f Bug 1731080 - Part 5: Add string normalization methods to intl::String. r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D125842
2021-09-21 15:42:18 +00:00
André Bargull b0ea03793a Bug 1731080 - Part 3: Add methods to test if a code point has the properties "Cased" or "Case_Ignorable". r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D125840
2021-09-21 15:42:17 +00:00
André Bargull c6c4656477 Bug 1731080 - Part 1: Add a String class to the unified Intl API. r=platform-i18n-reviewers,gregtatum
The default constructor was deleted because all methods are static.

Differential Revision: https://phabricator.services.mozilla.com/D125838
2021-09-21 15:42:16 +00:00
André Bargull 27cd54a779 Bug 1693576 - Part 8: Add a method to retrieve week day information to Calendar. r=platform-i18n-reviewers,gregtatum
The last addition for the "Intl Locale Info API" proposal.

Differential Revision: https://phabricator.services.mozilla.com/D125578
2021-09-21 08:51:22 +00:00
André Bargull ea30633946 Bug 1693576 - Part 7: Add method to enumerate over all time zones used in a region. r=platform-i18n-reviewers,gregtatum
The filter type is `UCAL_ZONE_TYPE_ANY` to ensure all possible time zones are
returned, and not just CLDR canonical time zones. (CLDR canonical time zones
are different from IANA canonical time zones.)

Differential Revision: https://phabricator.services.mozilla.com/D125576
2021-09-21 08:51:22 +00:00
André Bargull 17e8b2c855 Bug 1693576 - Part 6: Rename GetDefaultTimeZoneOffsetMs() to GetRawOffsetMs(). r=platform-i18n-reviewers,gregtatum
- `TimeZone` objects can be created with any time zone identifier, so the "Default"
  part in the name isn't correct.
- The "TimeZone" part is no longer needed, now that there's a distinct class for
  `TimeZone` objects.

Therefore let's rename `GetDefaultTimeZoneOffsetMs()` to `GetRawOffsetMs()`.

Differential Revision: https://phabricator.services.mozilla.com/D125575
2021-09-21 08:51:21 +00:00
André Bargull 5638c044f2 Bug 1693576 - Part 5: Move time zone functions from mozilla::Calendar into mozilla::TimeZone. r=platform-i18n-reviewers,gregtatum
Time zone functions being part of `UCalendar` is an internal implementation
detail of ICU4C. For the public unified Intl API we should rather follow
Temporal (or ICU4C's C++ API) and have a separate `TimeZone` class.

The files were moved using `hg cp` to preserve the file history.

Differential Revision: https://phabricator.services.mozilla.com/D125574
2021-09-21 08:51:21 +00:00
André Bargull 67b7d804e6 Bug 1693576 - Part 3: Add NumberingSystem class to the unified Intl API component. r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D125572
2021-09-21 08:51:20 +00:00
André Bargull 1919267c6d Bug 1693576 - Part 2: Add DateTimeFormat::GetAllowedHourCycles(). r=platform-i18n-reviewers,gregtatum
ICU's public API only provides a function to return the preferred hour cycle
(`udatpg_getDefaultHourCycle()`), whereas for `Intl.Locale` we want to be able
to determine all allowed hour cycles. So we have to do it the hard way and
directly read ICU resource bundles to get the data we need for this feature.

Differential Revision: https://phabricator.services.mozilla.com/D125571
2021-09-21 08:51:20 +00:00
André Bargull ed57b49cb4 Bug 1693576 - Part 1: Add "commonlyUsed" to Calendar and Collator. r=platform-i18n-reviewers,gregtatum
Pass through the "commonlyUsed" parameter to ICU to be able to filter any
uncommon keyword values.

Differential Revision: https://phabricator.services.mozilla.com/D125570
2021-09-21 08:51:19 +00:00
Mike Kaply 0bb7a057b2 Bug 1726214 - For MSIX, install the addons in the corresponding language directory. r=mixedpuppy,nalexander,platform-i18n-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D123673
2021-09-20 22:55:35 +00:00
André Bargull ee78515033 Bug 1719733 - Part 1: Add a MeasureUnit class to the unified Intl API. r=platform-i18n-reviewers,dminor
Currently only provides a single method to retrieve all available measurement units.

`MeasureUnit::GetAvailable()` returns an enumeration similar to the other Intl
classes which use `intl::Enumeration`. This approach gives us a more consistent
API, because it abstracts away the internal ICU implementation, which looks up
the measurement units through `UResourceBundle`. But it also means the
implementation is slightly more complicated due to this additional abstraction.

The default constructor was deleted because all methods are static.

Differential Revision: https://phabricator.services.mozilla.com/D125966
2021-09-20 20:04:17 +00:00
André Bargull a5116d4ff5 Bug 1728184 - Part 1: Add a Currency class to the unified Intl API. r=platform-i18n-reviewers,dminor
Currently only provides a single method to retrieve all ISO currency codes.

The default constructor was deleted because all methods are static.

Depends on D125674

Differential Revision: https://phabricator.services.mozilla.com/D125675
2021-09-17 10:15:36 +00:00
André Bargull e50c440591 Bug 1728183 - Part 2: Add Collator::GetBcp47KeywordValues() method to retrieve all possible collations. r=platform-i18n-reviewers,dminor
In contrast to the existing `GetBcp47KeywordValuesForLocale()` method, this
method returns all possible collation types, even the ones which aren't supported
by a specific locale.

Depends on D125672

Differential Revision: https://phabricator.services.mozilla.com/D125673
2021-09-17 10:15:35 +00:00
Yoshi Cheng-Hao Huang 7ded87e9a4 Bug 1728104 - Part 4: Merge NumberFormatFieldsUtil.[cpp|h] into NumberFormatFields.[cpp|h]. r=platform-i18n-reviewers,anba,dminor
Differential Revision: https://phabricator.services.mozilla.com/D125758
2021-09-16 14:47:03 +00:00
Yoshi Cheng-Hao Huang 70b53c7640 Bug 1728104 - Part 3: Remove NumberFormatFields.h from exported headers. r=platform-i18n-reviewers,anba,dminor
Differential Revision: https://phabricator.services.mozilla.com/D125757
2021-09-16 14:47:03 +00:00
Yoshi Cheng-Hao Huang 0b48e561d6 Bug 1728104 - Part 2: Add NumberPart.h. r=platform-i18n-reviewers,anba,dminor
Differential Revision: https://phabricator.services.mozilla.com/D125684
2021-09-16 14:47:02 +00:00
Yoshi Cheng-Hao Huang 234cb720ff Bug 1728104 - Part 1: Fix non-unified build error on ListFormat.cpp. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D125683
2021-09-16 14:47:02 +00:00
Jonathan Kew da9c992100 Bug 1729642 - patch 1 - Make shutdown of nsLanguageAtomService explicit instead of relying on ClearOnShutdown. r=platform-i18n-reviewers,dminor
Differential Revision: https://phabricator.services.mozilla.com/D125587
2021-09-14 18:51:49 +00:00
André Bargull b8019db021 Bug 1730508 - Part 3: Enable UnusedZero and HasFreeLSB Result optimisations. r=platform-i18n-reviewers,gregtatum,dminor
Differential Revision: https://phabricator.services.mozilla.com/D125410
2021-09-14 16:10:10 +00:00
André Bargull 2ffa3169a5 Bug 1730508 - Part 2: Remove unused function NullTerminatedMapper. r=platform-i18n-reviewers,gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D125409
2021-09-14 16:10:09 +00:00
André Bargull b1647a4555 Bug 1730508 - Part 1: Propagate ICUError where possible. r=platform-i18n-reviewers,gregtatum
Fully propagate `ICUError` instead of using `InternalError`.

Differential Revision: https://phabricator.services.mozilla.com/D125408
2021-09-14 16:10:09 +00:00
André Bargull 82ecb29b4c Bug 1639515 - Part 4: Update docs to point to Intl.DisplayNames. r=platform-i18n-reviewers,gregtatum
Update the documention to mention `Intl.DisplayNames` instead of
`Intl.getDisplayNames`.

Differential Revision: https://phabricator.services.mozilla.com/D76116
2021-09-14 09:20:32 +00:00
criss 59cdd2a63e Backed out 6 changesets (bug 1639515) for causing failures on test_intlUtils_getDisplayNames.html. CLOSED TREE
Backed out changeset eaff696ed6a6 (bug 1639515)
Backed out changeset 6d361f92b27e (bug 1639515)
Backed out changeset 6919213b03f7 (bug 1639515)
Backed out changeset 5a08d3b17fa7 (bug 1639515)
Backed out changeset 3681111b7ed3 (bug 1639515)
Backed out changeset 970826244d07 (bug 1639515)
2021-09-14 10:45:35 +03:00
André Bargull 252e2973ec Bug 1639515 - Part 4: Update docs to point to Intl.DisplayNames. r=platform-i18n-reviewers,gregtatum
Update the documention to mention `Intl.DisplayNames` instead of
`Intl.getDisplayNames`.

Differential Revision: https://phabricator.services.mozilla.com/D76116
2021-09-14 06:52:33 +00:00
Jonathan Kew 2535a4390c Bug 1730084 Part 6 - Add some empty fragments to the word-breaker test data. r=TYLin
Differential Revision: https://phabricator.services.mozilla.com/D125180
2021-09-13 23:55:34 +00:00
Ting-Yu Lin f8152b2b24 Bug 1730084 Part 5 - Remove WordBreaker::BreakInBetween(). r=jfkthame
The motivation of this patch is to remove rarely used API in
WordBreaker. WordBreaker::BreakInBetween() is used only in
nsFind::BreakInBetween() in production, and it can be replaced by
Next().

If the user wants to know whether there is a word break between two
strings such as the use cases in gtest, joining the two strings and
passing the result to Next() is the preferred way.

Note: I delete the buggy forward word search algorithm in
TestFindWordBreakFromPosition() because from the test expectations, it
doesn't expect to continue the search in previous fragments. Also, the
buggy part comes from the following code, which had undefined behavior
before Part 4, and does nothing after Part 4.

```
wbk->FindWord(prevFragText.get(), prevFragText.Length(), prevFragText.Length());
```

Differential Revision: https://phabricator.services.mozilla.com/D125151
2021-09-13 23:55:33 +00:00
Ting-Yu Lin bd25bca479 Bug 1730084 Part 4 - Clean up and fix an edge case of FindWord(). r=jfkthame
* Rename arguments so that their names are consistent with Next().
* Make the function not assert on an empty string, i.e. aLen == 0, like
Next().
* Fix an undefined behavior when the user passes aTextLen == aOffset.
The methods used to access `aText[aOffset]` that is clearly out of range
because the string may not be null-terminated. After this patch, it
returns a sentinel WordRange when aLen == aPos.
* Add document and gtest TestFindWordWithEmptyString().
* Change the sentinel return value to {aLen,aLen} for FindWord(), and
adapt one caller.

Differential Revision: https://phabricator.services.mozilla.com/D125434
2021-09-13 23:55:33 +00:00
Ting-Yu Lin b94f1b97c5 Bug 1730084 Part 1 - Run TestNextWordBreakWithEmptyString as a test. r=jfkthame
The function is added in Bug 1728708 Part 4, but it never get called, so
this patch transforms it into a test in WordBreak test suite to make it
run.

While I'm here, other individual functions are also transformed into
tests so that we can have more granular results if some of them failed.

Differential Revision: https://phabricator.services.mozilla.com/D125148
2021-09-13 23:55:32 +00:00
Greg Tatum b0d6525aca Bug 1719696 - Cache the original skeleton, and use it in DateIntervalFormat; r=anba,platform-i18n-reviewers,dminor
Differential Revision: https://phabricator.services.mozilla.com/D125254
2021-09-13 20:53:01 +00:00
Greg Tatum 21e515adad Bug 1719696 - Rework FillUTF8Buffer to FillBuffer; r=platform-i18n-reviewers,dminor
Differential Revision: https://phabricator.services.mozilla.com/D125252
2021-09-13 20:53:00 +00:00
Greg Tatum 8c790b7cb7 Bug 1719696 - Add ICUPointer to DateTimePatternGenerator; r=platform-i18n-reviewers,dminor
Differential Revision: https://phabricator.services.mozilla.com/D124498
2021-09-13 20:53:00 +00:00
Greg Tatum 129339b6b8 Bug 1719696 - Create a components bag abstraction for mozilla::intl::DateTimeFormat; r=anba,platform-i18n-reviewers,dminor
This patch will probably not compile on its own, but requires the SpiderMonkey
side as well. It aims at building a components bag interface that can be
then used in SpiderMonkey to back the ECMA 402 API.

Differential Revision: https://phabricator.services.mozilla.com/D123822
2021-09-13 20:52:59 +00:00
Greg Tatum b2eb7b49ba Bug 1719696 - Naively move the hour cycle computations; r=anba,platform-i18n-reviewers,dminor
This patch will not compile. It naively copies over the hour cycle code
from SpiderMonkey into the unified components. In a following patch,
these will be modified to use only the unified types.

Differential Revision: https://phabricator.services.mozilla.com/D123821
2021-09-13 20:52:59 +00:00
Greg Tatum 3971654d9f Bug 1719696 - Add a nicer assertion for checking the buffer contents; r=platform-i18n-reviewers,dminor
Differential Revision: https://phabricator.services.mozilla.com/D123820
2021-09-13 20:52:58 +00:00
Greg Tatum 7eeb5c0b59 Bug 1719696 - Use ICUError in mozilla::intl::DateTimeFormat; r=platform-i18n-reviewers,dminor
This is part of the work for Bug 1713206

Differential Revision: https://phabricator.services.mozilla.com/D123819
2021-09-13 20:52:58 +00:00
André Bargull 067c27c5ab Bug 1728182 - Part 2: Remove getLocaleInfo from toolkit. r=platform-i18n-reviewers,dminor
Depends on D125160

Differential Revision: https://phabricator.services.mozilla.com/D125163
2021-09-12 13:45:21 +00:00
Greg Tatum 238d8b17c7 Bug 1715980 - Fix the calendar keyword in Calendar::GetBcp47Type docs; r=platform-i18n-reviewers,dminor DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D124982
2021-09-09 14:57:37 +00:00
Yoshi Cheng-Hao Huang d92ecbcd8b Bug 1719747 - Part 3: ListFormat::FormatToParts takes a callback. r=gregtatum,tcampbell
As discussed in https://bugzilla.mozilla.org/show_bug.cgi?id=1719747#c6,
In Part 1, the ownership of the Span in PartsVector is maintained by
ICU. This method adds a callback so js::intl::ListFormat could copy the
content of the Span to Spidermonkey, and mozilla::intl::ListFormat could
use ScopedICUObject to release the string owned by ICU earlier.

Differential Revision: https://phabricator.services.mozilla.com/D123166
2021-09-09 12:02:22 +00:00
Yoshi Cheng-Hao Huang 39cadacc67 Bug 1719747 - Part 1: Unify ListFormat in SM. r=gregtatum,anba,platform-i18n-reviewers,tcampbell
Move implementations to mozilla::intl::ListFormat

Differential Revision: https://phabricator.services.mozilla.com/D122334
2021-09-09 12:02:21 +00:00