Skip to content

Commit 5a1006a

Browse files
committed
Bug 1930466 - Part 1: Use zone.tab to guide time zone canonicalisation. r=dminor
Implement the changes from <tc39/ecma402#877> to reduce differences in time zone canonicalisation when compared to V8 and JSC (which both use CLDR time zone data instead of IANA time zone data). Implementing the `AvailableNamedTimeZoneIdentifiers` spec operation requires to link time zone identifiers to region codes. When the time zone is listed in the "zone.tab" file, we can get the region code from "zone.tab". In all other cases we need to manually map the time zone to a matching region, because CLDR doesn't have "public" data for this [1]. This is implemented using the new file "intl/TimeZoneMapping.yaml". ICU 74 added `ucal_getIanaTimeZoneID` to get the canonical IANA time zone id. Internally `ucal_getIanaTimeZoneID` first calls `ucal_getCanonicalTimeZoneID` and then loads a resource bundle to check if there are any time zone ids which need to be replaced with other ids for compatibility with IANA data. Unfortunately the resource bundle is not cached, so calling `ucal_getIanaTimeZoneID` instead of `ucal_getIanaTimeZoneID` adds a considerable performance overhead. To avoid any performance regressions, we keep our own time zone rewriting code for the time being. Using our own code also means we don't have to add a workaround for this CLDR bug: <https://unicode-org.atlassian.net/browse/CLDR-16439>. Also remove "Factory" from the list of supported time zone identifiers, because supporting it was always a bit questionable and latest V8 also doesn't support it anymore, so we shouldn't run into web-compat issues. Remove the old generated tests and add "timeZone_links.js" to ensure time zone links are correctly resolved. [1] Neither of these two files look like "public" data to me: - https://github.com/unicode-org/cldr/blob/main/tools/cldr-code/src/main/resources/org/unicode/cldr/util/data/TZID.txt - https://github.com/unicode-org/cldr/blob/main/tools/cldr-code/src/main/resources/org/unicode/cldr/icu/idList.txt Differential Revision: https://phabricator.services.mozilla.com/D228584 UltraBlame original commit: a33fb69abc60581a92b8ebba42fc9cbf193df2e9
1 parent 416cf1b commit 5a1006a

File tree

11 files changed

+3176
-5126
lines changed

11 files changed

+3176
-5126
lines changed

browser/components/resistfingerprinting/test/browser/browser_timezone.js

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ resolvedOptions
9797
.
9898
timeZone
9999
"
100-
PST8PDT
100+
America
101+
/
102+
Los_Angeles
101103
"
102104
"
103105
Default
@@ -859,7 +861,9 @@ resolvedOptions
859861
.
860862
timeZone
861863
"
862-
PST8PDT
864+
America
865+
/
866+
Los_Angeles
863867
"
864868
"
865869
Default
@@ -935,7 +939,9 @@ resolvedOptions
935939
.
936940
timeZone
937941
"
938-
PST8PDT
942+
America
943+
/
944+
Los_Angeles
939945
"
940946
"
941947
Content
@@ -1190,7 +1196,9 @@ resolvedOptions
11901196
.
11911197
timeZone
11921198
"
1193-
PST8PDT
1199+
America
1200+
/
1201+
Los_Angeles
11941202
"
11951203
"
11961204
Default
@@ -1242,7 +1250,9 @@ resolvedOptions
12421250
.
12431251
timeZone
12441252
"
1245-
PST8PDT
1253+
America
1254+
/
1255+
Los_Angeles
12461256
"
12471257
"
12481258
Timezone
@@ -1303,7 +1313,9 @@ resolvedOptions
13031313
.
13041314
timeZone
13051315
"
1306-
PST8PDT
1316+
America
1317+
/
1318+
Los_Angeles
13071319
"
13081320
"
13091321
Timezone

0 commit comments

Comments
 (0)