mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 21:29:06 +00:00
LibJS+LibLocale: Begin replacing number formatting with ICU
This uses ICU for the Intl.NumberFormat `format` and `formatToParts` prototypes. It does not yet port the range formatter prototypes. Most of the new code in LibLocale/NumberFormat is simply mapping from ECMA-402 types to ICU types. Beyond that, the only algorithmic change is that we have to mutate the output from ICU for `formatToParts` to match what is expected by ECMA-402. This is explained in NumberFormat.cpp in `flatten_partitions`. This lets us remove most data from our number format generator. All that remains are numbering system digits and symbols, which are relied upon still for other interfaces (e.g. Intl.DateTimeFormat). So they will be removed in a future patch. Note: All of the changes to the test files in this patch are now aligned with both Chrome and Safari.
This commit is contained in:
parent
cbd566a354
commit
67f3de2320
Notes:
sideshowbarker
2024-07-17 08:45:34 +09:00
Author: https://github.com/trflynn89
Commit: 67f3de2320
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/124
24 changed files with 1168 additions and 2966 deletions
|
@ -56,7 +56,8 @@ struct PatternPartition {
|
|||
};
|
||||
|
||||
struct PatternPartitionWithSource : public PatternPartition {
|
||||
static Vector<PatternPartitionWithSource> create_from_parent_list(Vector<PatternPartition> partitions)
|
||||
template<typename ParentList>
|
||||
static Vector<PatternPartitionWithSource> create_from_parent_list(ParentList partitions)
|
||||
{
|
||||
Vector<PatternPartitionWithSource> result;
|
||||
result.ensure_capacity(partitions.size());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue