Skip to content

SystemTimeZoneIdentifier should continue returning a primary time zone identifier #990

@anba

Description

@anba

From https://w3c.github.io/webdriver-bidi/#command-emulation-setTimezoneOverride:

If IsTimeZoneOffsetString(emulated timezone) returns false and AvailableNamedTimeZoneIdentifiers does not contain emulated timezone, return error with error code invalid argument.

Two issues:

  1. AvailableNamedTimeZoneIdentifiers returns a List of Records, so it's not clear that contain is correctly used.
  2. ECMA-262 SystemTimeZoneIdentifier is specified to return a primary time zone identifier. The WebDriver BiDi override shouldn't violate this requirement.

See also ECMA-402's GetAvailableNamedTimeZoneIdentifier and AvailablePrimaryTimeZoneIdentifiers.

  • If the time zone override is expected to be called with a primary time zone identifier (in the correct case), then AvailablePrimaryTimeZoneIdentifiers can be used. For example "America/New_York" will get accepted, but not "america/NEW_YORK" (wrong case) or "EST5EDT" (time zone link to "America/New_York".)
  • If "america/NEW_YORK" and "EST5EDT" should be accepted as time zone overrides, then GetAvailableNamedTimeZoneIdentifier can be used. For example:
  1. If IsTimeZoneOffsetString(emulated timezone) returns false:
    1. Let timeZoneIdentifierRecord be GetAvailableNamedTimeZoneIdentifier(emulated timezone).
    2. If timeZoneIdentifierRecord is empty, return error with error code invalid argument.
    3. Set emulated timezone to timeZoneIdentifierRecord.[[PrimaryIdentifier]].

(Not sure if that's the correct syntax for W3C specs, but should be close enough.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions