Closed Bug 1300110 Opened 9 years ago Closed 1 year ago

DateTime doesn't clear cache for different time zones with same tz-adjustment

Categories

(Core :: JavaScript Engine, defect, P3)

defect

Tracking

()

RESOLVED INCOMPLETE
Tracking Status
firefox51 --- affected

People

(Reporter: anba, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

Attached file testDateTime.cpp (obsolete) —
This optimization [1] isn't correct. Two time zones may use the same offset, but still have different time zone rules, e.g. America/Denver and America/Phoenix. The attached test case is currently failing for America/Los_Angeles and America/Phoenix, but that's caused by bug 830304. [1] http://hg.mozilla.org/mozilla-central/file/d5f20820c805/js/src/vm/DateTime.cpp#l158
Attached file testDateTime.cpp
There is a similar issue in DateObject::fillLocalTimeSlots(), updated the test case accordingly. [1] http://hg.mozilla.org/mozilla-central/file/d5f20820c805/js/src/jsdate.cpp#l1253
Attachment #8787634 - Attachment is obsolete: true
Depends on: 1343826
Priority: -- → P3
Severity: normal → S3

All the referenced code seems gone now.

Blocks: sm-runtime
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → INCOMPLETE

Ah! -- worth resuscitating this one then?

Flags: needinfo?(andrebargull)

Hmm, I think we should at least add a comment to that line of code to explain the current situation. Things have slightly changed since this bug has been filed:

  • The public JSAPI function JS::ResetTimeZone will always trigger a time zone update, even if the offset is unchanged. (That means the test code attached to this bug doesn't show this issue anymore.)
  • Only when the internal js::ResetTimeZoneInternal function is called from JS::Realm::init for our periodic time zone modification checks, the bug described here can be observed.
  • Bug 1343826 added support to receive time zone change messages from the OS, so it shouldn't actually be necessary anymore for JS::Realm::init to check for time zone changes. At least as long as bug 1343826 covers all supported OSes and it works correctly -- and it doesn't quite seem to work on Ubuntu when manually modifying the time zone through the system settings. STR:
    • Open dev-tools and evaluate new Intl.DateTimeFormat().resolvedOptions().timeZone.
    • Change system time zone, for example from Europe/Berlin to Europe/Paris.
    • Switch back to the dev-tools console and evaluate new Intl.DateTimeFormat().resolvedOptions().timeZone again.
    • For me it's both times returning Europe/Berlin. Chromium correctly returns Europe/Paris after changing the time zone.
Flags: needinfo?(andrebargull)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: