<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>12070</bug_id>
          
          <creation_ts>2007-01-02 07:08:28 -0800</creation_ts>
          <short_desc>REGRESSION: KJS::getUTCOffset() caches UTC offset but ignores time zone changes</short_desc>
          <delta_ts>2007-06-24 12:04:45 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>420+</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Regression</keywords>
          <priority>P1</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="David Kilzer (:ddkilzer)">ddkilzer</reporter>
          <assigned_to name="David Kilzer (:ddkilzer)">ddkilzer</assigned_to>
          <cc>kmccullough</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>37847</commentid>
    <comment_count>0</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-01-02 07:08:28 -0800</bug_when>
    <thetext>The KJS::getUTCOffset() method in JavaScriptCore/kjs/DateMath.cpp caches the UTC offset, but it never checks to see if the time zone has changed after caching the value (e.g., if a user opened the Date &amp; Time system preference pane and changed their Mac&apos;s time zone).

This doesn&apos;t seem to cause any issues (e.g., when running the test for Bug 12057), but I&apos;d like to do further testing.  This bug is a reminder to do that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37555</commentid>
    <comment_count>1</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-01-02 20:14:52 -0800</bug_when>
    <thetext>Caching the UTC offset does create problems when changing the time zone through the Date &amp; Time system preferences pane.  It may be as simple as reporting the wrong time zone (reporting a daylight saving time zone when it&apos;s not daylight saving time) to reporting the wrong time zone offset (e.g., +1800 instead of -0600).

Steps to reproduce:

1. Quit WebKit.
2. Set time zone to &quot;London - England&quot; (GMT +0000) in Date &amp; Time pane.
3. Open WebKit.
4. Open this URL:  javascript:alert(new Date())
5. Set time zone to &quot;Chicago - U.S.A.&quot; (CST -0600) in Date &amp; Time pane.
6. Open this URL again: javascript:alert(new Date())

Expected results:

Time zone should be reported as -0600 (CST) with the correct date and time.

Actual results:

Time zone is reported as +1800 (CDT) (or similar).

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37537</commentid>
    <comment_count>2</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-01-02 20:22:19 -0800</bug_when>
    <thetext>(In reply to comment #1)
&gt; Caching the UTC offset does create problems when changing the time zone through
&gt; the Date &amp; Time system preferences pane.  It may be as simple as reporting the
&gt; wrong time zone (reporting a daylight saving time zone when it&apos;s not daylight
&gt; saving time) to reporting the wrong time zone offset (e.g., +1800 instead of
&gt; -0600).

To be more specific, it may be as simple as the wrong time zone being reported (but the correct time), to reporting the wrong time zone offset, the wrong time zone (in DST when it shouldn&apos;t be) and a date in the future!

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37530</commentid>
    <comment_count>3</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-01-02 20:27:10 -0800</bug_when>
    <thetext>Confirmed that this is a regression from shipping Safari 2.0.4 (419.3) on Mac OS X 10.4.8 (8N1037).  Tested on locally-built debug build of WebKit r18541.

There are basically two solutions:

1. Don&apos;t cache the UTC offset.
2. Cache the UTC offset and check for time zone changes to determine if it needs to be recalculated.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37220</commentid>
    <comment_count>4</comment_count>
      <attachid>12205</attachid>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-01-03 22:01:52 -0800</bug_when>
    <thetext>Created attachment 12205
Patch v1

If the user changes time zones without restarting a WebKit application like Safari, the cached UTC offset will cause JavaScript to report the wrong time zone and/or the wrong time.  The simple solution is to stop caching the UTC offset and calculate it every time.  That&apos;s what this patch does.

Note that no performance testing has been done.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36975</commentid>
    <comment_count>5</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-01-04 21:57:26 -0800</bug_when>
    <thetext>Committed by Kevin McCullough in r18584.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6462</commentid>
    <comment_count>6</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-06-24 12:04:45 -0700</bug_when>
    <thetext>Mass removal of NeedsRadar keyword from my bugs that have already been RESOLVED.

</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>12205</attachid>
            <date>2007-01-03 22:01:52 -0800</date>
            <delta_ts>2007-01-04 11:11:18 -0800</delta_ts>
            <desc>Patch v1</desc>
            <filename>bug-12070-v1.diff</filename>
            <type>text/plain</type>
            <size>1737</size>
            <attacher name="David Kilzer (:ddkilzer)">ddkilzer</attacher>
            
              <data encoding="base64">SW5kZXg6IEphdmFTY3JpcHRDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBKYXZhU2NyaXB0
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDE4NTc0KQorKysgSmF2YVNjcmlwdENvcmUvQ2hhbmdl
TG9nCSh3b3JraW5nIGNvcHkpCkBAI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NldEluaXRpYWxp
emVkID0gZmFsc2U7Ci0gICAgaWYgKCF1dGNPZmZzZXRJbml0aWFsaXplZCkgewotICAgICAgICB0
bSBsb2NhbHQ7CisgICAgdG0gbG9jYWx0OwogCi0gICAgICAgIG1lbXNldCgmbG9jYWx0LCAwLCBz
aXplb2YobG9jYWx0KSk7CisgICAgbWVtc2V0KCZsb2NhbHQsIDAsIHNpemVvZihsb2NhbHQpKTsK
IAotICAgICAgICAvLyBnZXQgdGhlIGRpZmZlcmVuY2UgYmV0d2VlbiB0aGlzIHRpbWUgem9uZSBh
bmQgVVRDIG9uIEphbiAwMSwgMjAwMCAxMjowMDowMCBBTQotICAgICAgICBsb2NhbHQudG1fbWRh
eSA9IDE7Ci0gICAgICAgIGxvY2FsdC50bV95ZWFyID0gMTAwOwotICAgICAgICB1dGNPZmZzZXQg
PSA5NDY2ODQ4MDAuMCAtIG1rdGltZSgmbG9jYWx0KTsKKyAgICAvLyBnZXQgdGhlIGRpZmZlcmVu
Y2UgYmV0d2VlbiB0aGlzIHRpbWUgem9uZSBhbmQgVVRDIG9uIEphbiAwMSwgMjAwMCAxMjowMDow
MCBBTQorICAgIGxvY2FsdC50bV9tZGF5ID0gMTsKKyAgICBsb2NhbHQudG1feWVhciA9IDEwMDsK
KyAgICBkb3VibGUgdXRjT2Zmc2V0ID0gOTQ2Njg0ODAwLjAgLSBta3RpbWUoJmxvY2FsdCk7CiAK
LSAgICAgICAgdXRjT2Zmc2V0ICo9IG1zUGVyU2Vjb25kOworICAgIHV0Y09mZnNldCAqPSBtc1Bl
clNlY29uZDsKIAotICAgICAgICB1dGNPZmZzZXRJbml0aWFsaXplZCA9IHRydWU7Ci0gICAgfQog
ICAgIHJldHVybiB1dGNPZmZzZXQ7CiB9CiAK
</data>
<flag name="review"
          id="4532"
          type_id="1"
          status="+"
          setter="kmccullough"
    />
          </attachment>
      

    </bug>

</bugzilla>