Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 22a13eb9ee2fc782b1836cc15a906cabf3943ed6
https://github.com/WebKit/WebKit/commit/22a13eb9ee2fc782b1836cc15a906cabf3943ed6
Author: Yijia Huang <[email protected]>
Date: 2026-08-06 (Thu, 06 Aug 2026)
Changed paths:
M JSTests/stress/temporal-plaindate.js
M JSTests/stress/temporal-plaindatetime.js
M JSTests/stress/temporal-plaintime.js
M JSTests/stress/temporal-timezone.js
M Source/JavaScriptCore/API/tests/TemporalCoreTest.cpp
M Source/JavaScriptCore/runtime/ISO8601.cpp
M Source/JavaScriptCore/runtime/ISO8601.h
M Source/JavaScriptCore/runtime/TemporalDuration.cpp
M Source/JavaScriptCore/runtime/TemporalObject.cpp
M Source/JavaScriptCore/runtime/TemporalObject.h
M Source/JavaScriptCore/runtime/TemporalZonedDateTime.cpp
M Source/JavaScriptCore/runtime/TemporalZonedDateTime.h
M Source/JavaScriptCore/runtime/TemporalZonedDateTimeConstructor.cpp
M Source/JavaScriptCore/runtime/TemporalZonedDateTimePrototype.cpp
M Source/JavaScriptCore/runtime/temporal/core/TimeZoneICUBridge.cpp
M Source/JavaScriptCore/runtime/temporal/core/TimeZoneICUBridge.h
M Source/JavaScriptCore/runtime/temporal/core/ZonedDateTimeCore.cpp
M Source/JavaScriptCore/runtime/temporal/core/ZonedDateTimeCore.h
Log Message:
-----------
[JSC][Temporal] Align time zone identifier parsing with the spec's parse
records
https://bugs.webkit.org/show_bug.cgi?id=321136
rdar://184169471
Reviewed by Yusuke Suzuki.
Introduce ISO8601::TimeZoneIdentifierParseRecord, the spec's Time Zone
Identifier Parse Record { [[Name]], [[OffsetMinutes]] }, and return it from
parseTimeZoneIdentifier and parseTemporalTimeZoneString. Both previously
returned a resolved TimeZone, which fused ParseTimeZoneIdentifier step 3's
syntactic check with the caller's availability check.
ParseTemporalTimeZoneString step 3 accepts the bracket annotation on six
productions; only TemporalDateTimeString[+Zoned] and TemporalInstantString
were tried, so "2024-12[Europe/Berlin]", "--12-25[Europe/Berlin]" and
"12:00[Europe/Berlin]" were rejected. Widening that list is also what makes
step 2's split load-bearing: "T12+01" is simultaneously a TimeZoneIANAName
and a TemporalTimeString with a UTCOffset, so once TemporalTimeString is in
the list, step 2 must commit to the named-zone reading on syntax alone and
reject it as unavailable, rather than resolving eagerly and letting step 3
yield "+01:00".
Follow ISO8601.cpp's scanning idiom for the time zone productions: each parser
takes a StringParsingBuffer, consumes only on success, and returns the matched
text, leaving StringView at the entrypoints. parseTimeZoneIANAName replaces the
isTimeZoneIANAName predicate, so the annotation parser no longer pre-scans for
']' to find the token boundary; ']' is not a TZChar, so the name parse now
finds its own end. parseTimeZoneAnnotation delegates to
parseTimeZoneIdentifier rather than re-implementing its two alternatives, and
the file reads in grammar order: TZLeadingChar/TZChar, TimeZoneIANAName,
TimeZoneIdentifier, TimeZoneAnnotation. The parsed annotation name stays an
owned Vector<Latin1Character> so a returned record never outlives a view of the
string it was parsed from.
Restructure GetTemporalRelativeToOption to match the AO's control flow. Its
steps 5 and 6 do not return, they assign and fall through to a shared tail in
steps 7-12, which had been inlined into both branches with silently differing
arguments. The branches now only assign, and the tail runs once.
Replace InterpretISODateTimeOffset's offsetHasSubMinutePrecision and
useStartOfDay bool parameters with MatchBehaviour and UseStartOfDay enums, and
extract timeZoneFromIdentifierParseRecord for the tail shared by
ToTemporalTimeZoneIdentifier steps 4-9 and the Temporal.ZonedDateTime
constructor steps 6-7.
The annotations "[..]", "[.]", "[./.]", "[../..]" and
"[CocoaCappuccinoMatcha]" move from the rejected set to the accepted one:
proposal-temporal a8f6b0d3 ("Editorial: Align time zone name syntax with
IXDTF") removed TimeZoneIANANameComponent's 14-character limit and its
exclusion of "." and "..".
Test:
* Source/JavaScriptCore/API/tests/TemporalCoreTest.cpp:
* JSTests/stress/temporal-plaindate.js:
* JSTests/stress/temporal-plaindatetime.js:
* JSTests/stress/temporal-plaintime.js:
* JSTests/stress/temporal-timezone.js:
Canonical link: https://commits.webkit.org/318741@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications