The currency display name for multiple locales is now only defined in the "root" locale,
which triggers the `U_USING_DEFAULT_WARNING` case, so we have to change our detection
when no localisation was found.
Depends on D192734
Differential Revision: https://phabricator.services.mozilla.com/D192735
Use `CLASS_CHARACTER` because that matches the previous character class for most
characters which are now part of the new character classes.
Depends on D192733
Differential Revision: https://phabricator.services.mozilla.com/D192734
Add various workarounds for ICU-20548 to improve the output of the "timeZoneName"
option when formatting date-time ranges.
Changes to "intl/icu/source/i18n/dtitvinf.cpp":
The existing ICU code was already changing `LOW_Z` to `LOW_V` when searching
for the best-fit pattern, but it was missing support for `CAP_O`. (The other
time zone name skeleton characters aren't currently supported in ECMA-402, so
I didn't handle them here.)
Changes to "intl/icu/source/i18n/dtitvfmt.cpp":
In `DateIntervalFormat::getDateTimeSkeleton()`, handle `CAP_O` similar to the
existing code for `LOW_Z` and `LOW_V`. And also keep the original number of
skeleton characters in `normalizedTimeSkeleton`.
In `DateIntervalFormat::adjustFieldWidth()`, copy the field width information
for `LOW_V` into `LOW_Z` resp. `CAP_O` because `LOW_V` is replaced in the
resolved pattern with `LOW_Z` resp. `CAP_O`.
Differential Revision: https://phabricator.services.mozilla.com/D189743
The default value for `GetOption` in `InitializeCollator` is changed from `false`
to `undefined` to avoid having to `intl_isIgnorePunctuation` in the constructor
function.
The corresponding spec PR is <https://github.com/tc39/ecma402/pull/833>, but
our behaviour is already not strictly spec-compliant as described in
<https://github.com/tc39/ecma402/issues/832>, so it seems reasonable to simply
implement the spec PR ahead of time. (We don't want to "fix" our implementation
to strictly follow the spec without the PR, because that could be web-incompatible
resp. at least disruptive for Thai users, which currently already get the expected
behaviour where punctuation characters are ignored in Thai.)
Differential Revision: https://phabricator.services.mozilla.com/D189545
Add `Collator::GetIgnorePunctuation()` similar to the existing
`Collator::GetCaseFirst()` function.
Drive-by change:
- Remove unnecessary macro with an inline function.
Differential Revision: https://phabricator.services.mozilla.com/D189543
Map both "r" (related Gregorian year) and "U" (cyclic year name) to a resolved numeric year.
From <https://github.com/tc39/ecma402/issues/816#issuecomment-1667481214>:
> Per 11.2.3 Internal slots, "{relatedYear}" can only appear in a pattern string
> when the format record has a [[year]] field. And if a [[year]] field is present,
> CreateDateTimeFormat will set the Intl.DateTimeFormat's [[Year]] field to the
> format records [[year]] value. Intl.DateTimeFormat.prototype.resolvedOptions
> should then return the value of the [[Year]] internal slot.
Fixes <https://github.com/tc39/ecma402/issues/816>.
Differential Revision: https://phabricator.services.mozilla.com/D189542
Updates the ICU patch "double-conversion.diff" to only use the in-tree copy of
double-conversion when building Firefox/SpiderMonkey. Standalone ICU builds
instead use the ICU copy of double-conversion. Standalone ICU builds happen
when running "intl/icu_sources_data.py" and when converting the in-tree
little-endian ICU data file to the big-endian format.
`JS_HAS_INTL_API` is used to detect how ICU is built: When building ICU as part
of Firefox/SpiderMonkey, `JS_HAS_INTL_API` is guaranteed to be set, whereas in
standalone ICU builds `JS_HAS_INTL_API` isn't defined.
After applying the updated "double-conversion.diff" patch, ICU was reimported
to restore the previously deleted double-conversion sources files from ICU.
Depends on D190791
Differential Revision: https://phabricator.services.mozilla.com/D190792
This makes number localization cheaper / halves the time in the
microbenchmark.
Change the content-language handling to use atoms. This exposes some
interesting inconsistencies but I tried not to change behavior there.
Differential Revision: https://phabricator.services.mozilla.com/D191174
Since `CountGraphemeClusters` is called from PresShell::DoFlushLayout when
using counter style. To optimize this, I would like to cache
`ICU4XGraphemeClusterSegmenter`.
Differential Revision: https://phabricator.services.mozilla.com/D190750
Since `CountGraphemeClusters` is called from PresShell::DoFlushLayout when
using counter style. To optimize this, I would like to cache
`ICU4XGraphemeClusterSegmenter`.
Differential Revision: https://phabricator.services.mozilla.com/D190750
This fix adds stop at punctuation mode for FindWord for a11y.
Also, IS_ASCII is conflict with nsUnicharUtils.h's, so I rename it.
Differential Revision: https://phabricator.services.mozilla.com/D188785
This fix adds stop at punctuation mode for FindWord for a11y.
Also, IS_ASCII is conflict with nsUnicharUtils.h's, so I rename it.
Differential Revision: https://phabricator.services.mozilla.com/D188785
When I try to compile mozilla-central as C++20, clang reports the following compilation error in code added in bug 1851105:
intl/lwbrk/WordBreaker.cpp:123:9: error: alias template 'span' requires template arguments; argument deduction only allowed for class templates
diplomat::span((const uint16_t*)aText.BeginReading(), aText.Length()));
^
third_party/rust/icu_capi/cpp/include/diplomat_runtime.hpp:131:19: note: template is declared here
template<class T> using span = std::span<T>;
^
Differential Revision: https://phabricator.services.mozilla.com/D188428
The original sources were compiled... three times.
We got rid of the chromium duplicate in Bug 1850328 and we remove the
last duplicate with this patch.
Differential Revision: https://phabricator.services.mozilla.com/D187753
The original sources were compiled... three times.
We got rid of the chromium duplicate in Bug 1850328 and we remove the
last duplicate with this patch.
Differential Revision: https://phabricator.services.mozilla.com/D187753
Since some issues such as bug 1851323 are fixed by ICU4X 1.3's data rule file,
I would like to apply it to get feedback in Gecko.
Differential Revision: https://phabricator.services.mozilla.com/D187980
This change gives us 46 new passes on the IdnaTestV2 test collection, with just 6 failures remaining
(to be resolved by the next patch).
Differential Revision: https://phabricator.services.mozilla.com/D186866