<?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>4784</bug_id>
          
          <creation_ts>2005-08-31 15:37:48 -0700</creation_ts>
          <short_desc>Wrong order in calls when using setInterval and setTimeout</short_desc>
          <delta_ts>2006-12-19 09:43:17 -0800</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>http://mir.aculo.us/stuff/interval-test/test/functional/texteffects_test.html</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Thomas Fuchs">thomas</reporter>
          <assigned_to name="Maciej Stachowiak">mjs</assigned_to>
          <cc>ian</cc>
    
    <cc>joost</cc>
    
    <cc>mrowe</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>18166</commentid>
    <comment_count>0</comment_count>
    <who name="Thomas Fuchs">thomas</who>
    <bug_when>2005-08-31 15:37:48 -0700</bug_when>
    <thetext>If multiple simultaneous calls are made to setInterval/setTimeout Safari begins to execute JavaScript in a 
wrong order and starts to neclect earlier setInterval intervals.

See the provided URL for a test case. Click on &quot;DropOut&quot; by the black boxes for the most noticeable 
problem that is causes by this bug.

For a correctly working implementation, see the URL in Firefox 1.0.X or Firefox DP 2.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18169</commentid>
    <comment_count>1</comment_count>
    <who name="Thomas Fuchs">thomas</who>
    <bug_when>2005-08-31 16:00:36 -0700</bug_when>
    <thetext>&quot;DropOut&quot; also works fine on the black boxes in Internet Explorer 6 on W2K.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18173</commentid>
    <comment_count>2</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2005-08-31 23:18:23 -0700</bug_when>
    <thetext>I can see the problem that you describe, but without a significantly reduced test case it&apos;s not easy to say 
whether your diagnosis is accurate.  Are you able to come up with a reduced test case that demonstrates 
the problem?  http://webkit.opendarwin.org/quality/reduction.html has more info if you need it.

I&apos;m confirming this as our behaviour differs substantially from Firefox.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>18185</commentid>
    <comment_count>3</comment_count>
      <attachid>3709</attachid>
    <who name="Thomas Fuchs">thomas</who>
    <bug_when>2005-09-01 07:58:16 -0700</bug_when>
    <thetext>Created attachment 3709
Testcase

This is a test case showing that Safari has wildly varying timing when
setInterval is called multiple times.

If I can I&apos;ll come up with an even tighter test case.

Example:
IntervalTimer #0: 6 iterations, avg. delta: 38.666666666666664, min: 5, max: 58

IntervalTimer #1: 6 iterations, avg. delta: 152.83333333333334, min: 5, max:
735
IntervalTimer #2: 5 iterations, avg. delta: 184.8, min: 39, max: 741
(...)
IntervalTimer #13: 4 iterations, avg. delta: 40.25, min: 40, max: 41
(...)
IntervalTimer #98: 4 iterations, avg. delta: 212.25, min: 35, max: 723
IntervalTimer #99: 4 iterations, avg. delta: 213.75, min: 34, max: 730

On Firefox DP 2, results are consistent:
IntervalTimer #0: 11 iterations, avg. delta: 89.18181818181819, min: 77, max:
143
IntervalTimer #1: 11 iterations, avg. delta: 89.0909090909091, min: 77, max:
143
IntervalTimer #2: 11 iterations, avg. delta: 89.0909090909091, min: 77, max:
143
IntervalTimer #3: 11 iterations, avg. delta: 89, min: 77, max: 143
IntervalTimer #4: 11 iterations, avg. delta: 89.0909090909091, min: 77, max:
143
IntervalTimer #5: 11 iterations, avg. delta: 89.0909090909091, min: 77, max:
144
(...)
IntervalTimer #98: 11 iterations, avg. delta: 89.45454545454545, min: 77, max:
133
IntervalTimer #99: 11 iterations, avg. delta: 89.45454545454545, min: 77, max:
133</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>31559</commentid>
    <comment_count>4</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2006-02-06 05:40:12 -0800</bug_when>
    <thetext>See also Bug 7099.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41015</commentid>
    <comment_count>5</comment_count>
    <who name="">mitz</who>
    <bug_when>2006-12-19 09:43:17 -0800</bug_when>
    <thetext>I think r12774 (fix for bug 7209) fixed this.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>3709</attachid>
            <date>2005-09-01 07:58:16 -0700</date>
            <delta_ts>2005-09-01 07:58:16 -0700</delta_ts>
            <desc>Testcase</desc>
            <filename>webkit_bug_4784.html</filename>
            <type>text/html</type>
            <size>2040</size>
            <attacher name="Thomas Fuchs">thomas</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWwgUFVCTElDICItLy9XM0MvL0RURCBYSFRNTCAxLjAgVHJhbnNpdGlvbmFs
Ly9FTiIgImh0dHA6Ly93d3cudzMub3JnL1RSL3hodG1sMS9EVEQveGh0bWwxLXRyYW5zaXRpb25h
bC5kdGQiPgo8aHRtbCB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94aHRtbCI+CiAgPGhl
YWQ+CiAgICA8dGl0bGU+VGVzdCBjYXNlIGZvciBCdWcgIzQ3ODQ8L3RpdGxlPgogIDwvaGVhZD4K
ICA8Ym9keT4KICAgIAogICAgPGgxPlRpbWUgYmV0d2VlbiBjYWxscyB0byBzZXRJbnRlcnZhbCgu
Li4sIDQwKSBvbiBtdWx0aXBsZSBzZXRJbnRlcnZhb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gdGltZXJzW2ldLmRpc3Bvc2UoKTsi
LCAxMDAwKTsKICAgIAogICAgPC9zY3JpcHQ+Cgo8L2JvZHk+CjwvaHRtbD4K
</data>

          </attachment>
      

    </bug>

</bugzilla>