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

5100 Коммитов

Автор SHA1 Сообщение Дата
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
Brindusan Cristian efd8dfd0cf Backed out 9 changesets (bug 1701695) for causing xpcshell failures in test_messagecontext.js. CLOSED TREE
Backed out changeset e88dd41c0a90 (bug 1701695)
Backed out changeset 823ed70ef5fe (bug 1701695)
Backed out changeset 11f97bc74622 (bug 1701695)
Backed out changeset fdf12ac55593 (bug 1701695)
Backed out changeset abcf774d3b58 (bug 1701695)
Backed out changeset 4239fe67d69f (bug 1701695)
Backed out changeset 216472b634b9 (bug 1701695)
Backed out changeset 89ff5f91d8e9 (bug 1701695)
Backed out changeset 9c0dbc73dad2 (bug 1701695)
2021-05-11 15:25:46 +03:00
Dan Minor 7a648a32c3 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-11 11:37:40 +00:00
Dan Minor 6eaea879f1 Bug 1701695 - Add documentation to NumberFormat.h; r=gregtatum,nordzilla
Differential Revision: https://phabricator.services.mozilla.com/D113145
2021-05-11 11:37:40 +00:00
Dan Minor 3322d3ceb6 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-11 11:37:38 +00:00
Dan Minor c6f5bbceb4 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-11 11:37:38 +00:00
Dan Minor 8cf0f1089a 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-11 11:37:38 +00:00
Dan Minor 72adfe7239 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-11 11:37:37 +00:00
Dan Minor 089ad0d14c 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-11 11:37:37 +00:00
Dan Minor db62540452 Bug 1706318 - Rename connector pattern override preference; r=zbraniecki
Differential Revision: https://phabricator.services.mozilla.com/D112815
2021-04-26 18:11:59 +00:00
Dan Minor 28196b0645 Bug 1705363 - Fixes to intl::NumberFormatterSkeleton; r=gregtatum
These are fixes for issues noticed with NumberFormatterSkeleton while testing
this code in SpiderMonkey against the full set of intl tests there. I've added
minimal test cases for the issues encountered as part of this patch.

Differential Revision: https://phabricator.services.mozilla.com/D112240
2021-04-20 18:16:24 +00:00
Dan Minor 726e11903f Bug 1695937 - Switch FluentBundle to use intl::NumberFormat; r=zbraniecki,hsivonen,jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D107224
2021-04-08 14:56:33 +00:00
Dan Minor 96711bfb68 Bug 1695937 - Add intl::NumberFormat to components; r=zbraniecki,tcampbell,jandem
This adds an initial version of NumberFormat that is suitable for use by
Fluent.

The options formatting code is taken from SpiderMonkey and modified to use the
standard c++ library rather than SpiderMonkey specific code. The code
generated MeasureUnitGenerated.h is duplicated here temporarily. Once we can
move SpiderMonkey to using this code, we can update the code generation to
avoid this duplication.

Some simple gtests have been written to make development easier. Full test
coverage is not a goal here, as this code will eventually be covered by running
test262 in SpiderMonkey.

Differential Revision: https://phabricator.services.mozilla.com/D107223
2021-04-08 14:56:33 +00:00
Jonathan Kew fd668cd57a Bug 1703213 - Disallow soft line break between adjacent IDEOGRAPHIC SPACE characters. r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D111065
2021-04-08 09:41:48 +00:00
Butkovits Atila 15db4c5343 Backed out 2 changesets (bug 1695937) for causing bustages on FluentBundle.cpp.
Backed out changeset d17059c999a6 (bug 1695937)
Backed out changeset 232a570d6739 (bug 1695937)
2021-04-08 04:21:27 +03:00
Dan Minor 195f474c94 Bug 1695937 - Switch FluentBundle to use intl::NumberFormat; r=zbraniecki,hsivonen,jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D107224
2021-04-07 20:03:22 +00:00
Dan Minor 91e357191b Bug 1695937 - Add intl::NumberFormat to components; r=zbraniecki,tcampbell,jandem
This adds an initial version of NumberFormat that is suitable for use by
Fluent.

The options formatting code is taken from SpiderMonkey and modified to use the
standard c++ library rather than SpiderMonkey specific code. The code
generated MeasureUnitGenerated.h is duplicated here temporarily. Once we can
move SpiderMonkey to using this code, we can update the code generation to
avoid this duplication.

Some simple gtests have been written to make development easier. Full test
coverage is not a goal here, as this code will eventually be covered by running
test262 in SpiderMonkey.

Differential Revision: https://phabricator.services.mozilla.com/D107223
2021-04-07 20:03:22 +00:00
Dan Minor 05acd763f8 Bug 1676137 - Remove intl.uidirection pref; r=zbraniecki
Differential Revision: https://phabricator.services.mozilla.com/D108789
2021-03-29 14:22:52 +00:00
Simon Giesecke 613e20d136 Bug 1184468 - Use nsBaseHashtable::Values. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D108587
2021-03-24 17:56:49 +00:00
Henri Sivonen b98488aa92 Bug 673087 - Honor encoding declared via XML declaration in text/html. r=emk
Differential Revision: https://phabricator.services.mozilla.com/D107806
2021-03-23 09:52:04 +00:00
Dan Minor 4d45674d06 Bug 1696206 - Update documentation for legacy migrations; r=flod
Differential Revision: https://phabricator.services.mozilla.com/D108762
2021-03-17 18:51:01 +00:00
Greg Tatum d953c6cc53 Bug 1697207 - Add docs for using access keys in Fluent; r=flod
Differential Revision: https://phabricator.services.mozilla.com/D107662
2021-03-15 14:39:56 +00:00
Alex Henrie b24e5f0f51 Bug 1697076 - Drop assertion from mozilla::unicode::GetNaked. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D107942
2021-03-11 09:42:18 +00:00
Bob Owen 2e99a1b7b3 Bug 1696940: Use nsRuleBreaker code in nsUniscribeBreaker when win32k lockdown is enabled. r=jfkthame
This is only intended for testing, because win32k lockdown is disabled by
default for content.

Differential Revision: https://phabricator.services.mozilla.com/D107495
2021-03-10 15:45:41 +00:00
Alex Henrie f8f015b22e Bug 1649187 - Fix diacritic stripping for characters outside the BMP. r=jfkthame
Due to an unfortunate typo I made in base_chars.py, I thought that there
were no mappings we care about outside of the basic multilingual plane.
This patch adds back the non-BMP mappings that we do care about.

Differential Revision: https://phabricator.services.mozilla.com/D107404
2021-03-10 12:08:49 +00:00
Simon Giesecke ad01a10a3b Bug 1634281 - Use nsTHashMap instead of nsDataHashtable. r=xpcom-reviewers,necko-reviewers,jgilbert,nika,valentin
Note that this patch only transforms the use of the nsDataHashtable type alias
to a directly equivalent use of nsTHashMap. It does not change the specification
of the hash key type to make use of the key class deduction that nsTHashMap
allows for in some cases. That can be done in a separate step, but requires more
attention.

Differential Revision: https://phabricator.services.mozilla.com/D106008
2021-03-10 10:47:47 +00:00
Alex Henrie 0686831376 Bug 1649187 - Use a fallback table to strip diacritics from non-decomposable characters. r=jfkthame
Implement the design suggested at
https://bugzilla.mozilla.org/show_bug.cgi?id=1652910#c5

Differential Revision: https://phabricator.services.mozilla.com/D106674
2021-03-07 16:17:41 +00:00
Simon Giesecke 8ecfb38a41 Bug 1691913 - Remove uses of nsDataHashtable::GetValue. r=xpcom-reviewers,necko-reviewers,dragana,nika
GetValue is going to be removed in a subsequent patch. It is no longer needed,
because it can be replaced by functions already provided by nsBaseHashtable,
in particular Lookup and Contains.

Also, its name was confusing, since it specifically returns a pointer that
allows and is intended for modifying the entry within the hashtable, rather
than returning by-value. According to the naming rules to be set on
nsBaseHashtable, it would also needed to be renamed to "Lookup*. Removing
its uses saves this effort.

Differential Revision: https://phabricator.services.mozilla.com/D105476
2021-03-01 09:59:30 +00:00
Jens Stutte 1e19379853 Bug 1689953: Harmonize shutdown phase definitions across nsTerminator and AppShutdown r=dthayer,chutten
This patch wants to solve several quirks around the shutdown terminator.

 - Use the same shutdown phase definitions in AppShutdown and nsTerminator. This touches quite a few files.
 - Ensure that the terminator phase shift is handled before any shutdown observer notifications are sent and reduce its heartbeat duration.
 - Add missing phases to the shutdown telemetry.

Please note that this changes the unit of "tick" to 100ms rather than 1s.
As a side effect, we also remove the obsolete "shutdown-persist" context.

While the existing test coverage continues to prove the most important functions, we acknowledge the wish for better test coverage with [[ https://bugzilla.mozilla.org/show_bug.cgi?id=1693966 | bug 1693966 ]].

Differential Revision: https://phabricator.services.mozilla.com/D103626
2021-02-27 14:38:14 +00:00
Butkovits Atila bb3fe218a4 Backed out changeset be43a81b35f9 (bug 1689953) for causing failure at test_terminator_record.js. CLOSED TREE 2021-02-27 05:03:11 +02:00
Jens Stutte f6d52040b9 Bug 1689953: Harmonize shutdown phase definitions across nsTerminator and AppShutdown r=dthayer,chutten
This patch wants to solve several quirks around the shutdown terminator.

 - Use the same shutdown phase definitions in AppShutdown and nsTerminator. This touches quite a few files.
 - Ensure that the terminator phase shift is handled before any shutdown observer notifications are sent and reduce its heartbeat duration.
 - Add missing phases to the shutdown telemetry.

Please note that this changes the unit of "tick" to 100ms rather than 1s.
As a side effect, we also remove the obsolete "shutdown-persist" context.

While the existing test coverage continues to prove the most important functions, we acknowledge the wish for better test coverage with [[ https://bugzilla.mozilla.org/show_bug.cgi?id=1693966 | bug 1693966 ]].

Differential Revision: https://phabricator.services.mozilla.com/D103626
2021-02-26 21:33:29 +00:00
Simon Giesecke 43bacaa3f9 Bug 1693541 - Improve uses of nsBaseHashtable and descendants and avoid multiple subsequent lookups in intl/locale. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D106117
2021-02-26 11:36:39 +00:00
Simon Giesecke 9af107a839 Bug 1691913 - Rename nsBaseHashtable::Put to InsertOrUpdate. r=xpcom-reviewers,necko-reviewers,jgilbert,dragana,nika
This makes the naming more consistent with other functions called
Insert and/or Update. Also, it removes the ambiguity whether
Put expects that an entry already exists or not, in particular because
it differed from nsTHashtable::PutEntry in that regard.

Differential Revision: https://phabricator.services.mozilla.com/D105473
2021-02-26 09:11:46 +00:00
Simon Giesecke 4f75368dcb Bug 1691913 - Rename nsBaseHashtable::GetOrInsert(With) to LookupOrInsert(With). r=xpcom-reviewers,necko-reviewers,jgilbert,dragana,nika
The functions should be called "Lookup" rather than "Get" because they return
a DataType& (rather than UserDataType).

Differential Revision: https://phabricator.services.mozilla.com/D105472
2021-02-26 09:11:45 +00:00
Alexis Beingessner 92afde7986 Bug 1686616 - register all Services.py services with components.conf. r=kmag,necko-reviewers,valentin
These services had their name added to components.conf:

* GfxInfo
* ThirdPartyUtil
* History
* HttpActivityDistributor
* UUIDGenerator
* ServiceWorkerManager
* PermissionManager

These services were added to componenets.conf under a different name:

* DirectoryService => Directory
* IOService => IO
* StringBundleService => StringBundle
* CacheStorageService => CacheStorage
* StreamTransportService => StreamTransport
* SocketTransportService => SocketTransport

These services weren't migrated to components.conf because only Rust
code uses them:

* RemoteAgent
* XULRuntime
* PrefService

These services weren't migrated to components.conf because they're unused:

* ToolkitChromeRegistry (used as ChromeRegistry)
* XULChromeRegistry (used as ChromeRegistry)
* Bits (completely unused)

These services were already available in components.conf but are still
used by rust code:

* URIFixup

These services weren't migrated because they will be handled in
subsequent patchsets:

* ObserverService

For the record, the following Services are being used by Rust code
and must remain until a Rust version of Components.h is written:

* RemoteAgent
* XULRuntime
* PrefService
* URIFixup
* ObserverService
* DirectoryService
* ThirdPartyUtil

Also the cocoa GfxInfo service was changed to use components.conf instead
of registering it at runtime, as all the other widgets were already doing
it this way.

Differential Revision: https://phabricator.services.mozilla.com/D105521
2021-02-18 13:26:28 +00:00
Francesco Lodolo (:flod) fbba0e121c Bug 1692135 - Add Silesian (szl) to allowed accept-languages locales, r=zbraniecki
Differential Revision: https://phabricator.services.mozilla.com/D104792
2021-02-11 17:41:56 +00:00
Petr Sumbera 7d307fafee Bug 1497581 - Avoid debug assertion with --disable-updater r=zbraniecki DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D104655
2021-02-11 08:57:19 +00:00
André Bargull 6ae41c9162 Bug 1689294: Update tzdata in ICU data files to 2021a. r=tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D103281
2021-01-29 14:25:21 +00:00
Henri Sivonen 9b210c311e Bug 1686463 - Gather telemetry about automatic encoding detection outcomes. r=chutten,emk
Differential Revision: https://phabricator.services.mozilla.com/D102397
2021-01-24 00:11:07 +00:00