Changeset 79455 in webkit


Ignore:
Timestamp:
Feb 23, 2011 10:00:09 AM (13 years ago)
Author:
kbr@google.com
Message:

2011-02-22 Kenneth Russell <kbr@google.com>

Reviewed by Darin Fisher.

Per-page minimum DOMTimer interval broken for repeating timers
https://bugs.webkit.org/show_bug.cgi?id=55014

When the minimum timer interval is adjusted, if the timer is
repeating, cause its repeat interval to be set to its original
timeout clamped to the new minimum interval.

Tests: fast/dom/timer-increase-min-interval-repeating.html

fast/dom/timer-increase-then-decrease-min-interval-repeating.html

  • page/DOMTimer.cpp: (WebCore::DOMTimer::adjustMinimumTimerInterval):

2011-02-23 Kenneth Russell <kbr@google.com>

Reviewed by Darin Fisher.

Per-page minimum DOMTimer interval broken for repeating timers
https://bugs.webkit.org/show_bug.cgi?id=55014

Add tests using setInterval rather than setTimeout.
timer-increase-then-decrease-min-interval-repeating.html catches
the bug.

  • fast/dom/timer-increase-min-interval-repeating-expected.txt: Added.
  • fast/dom/timer-increase-min-interval-repeating.html: Added.
  • fast/dom/timer-increase-then-decrease-min-interval-repeating-expected.txt: Added.
  • fast/dom/timer-increase-then-decrease-min-interval-repeating.html: Added.
  • platform/mac-wk2/Skipped:
Location:
trunk
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r79454 r79455  
     12011-02-23  Kenneth Russell  <kbr@google.com>
     2
     3        Reviewed by Darin Fisher.
     4
     5        Per-page minimum DOMTimer interval broken for repeating timers
     6        https://bugs.webkit.org/show_bug.cgi?id=55014
     7
     8        Add tests using setInterval rather than setTimeout.
     9        timer-increase-then-decrease-min-interval-repeating.html catches
     10        the bug.
     11
     12        * fast/dom/timer-increase-min-interval-repeating-expected.txt: Added.
     13        * fast/dom/timer-increase-min-interval-repeating.html: Added.
     14        * fast/dom/timer-increase-then-decrease-min-interval-repeating-expected.txt: Added.
     15        * fast/dom/timer-increase-then-decrease-min-interval-repeating.html: Added.
     16        * platform/mac-wk2/Skipped:
     17
    1182011-02-23  Jessie Berlin  <jberlin@apple.com>
    219
  • trunk/LayoutTests/platform/mac-wk2/Skipped

    r79425 r79455  
    19681968fast/dom/timer-increase-min-interval-and-reset-part-1.html
    19691969fast/dom/timer-increase-min-interval-and-reset-part-2.html
     1970fast/dom/timer-increase-min-interval-repeating.html
    19701971fast/dom/timer-increase-min-interval.html
     1972fast/dom/timer-increase-then-decrease-min-interval-repeating.html
    19711973fast/dom/timer-increase-then-decrease-min-interval.html
    19721974
  • trunk/Source/WebCore/ChangeLog

    r79451 r79455  
     12011-02-22  Kenneth Russell  <kbr@google.com>
     2
     3        Reviewed by Darin Fisher.
     4
     5        Per-page minimum DOMTimer interval broken for repeating timers
     6        https://bugs.webkit.org/show_bug.cgi?id=55014
     7
     8        When the minimum timer interval is adjusted, if the timer is
     9        repeating, cause its repeat interval to be set to its original
     10        timeout clamped to the new minimum interval.
     11
     12        Tests: fast/dom/timer-increase-min-interval-repeating.html
     13               fast/dom/timer-increase-then-decrease-min-interval-repeating.html
     14
     15        * page/DOMTimer.cpp:
     16        (WebCore::DOMTimer::adjustMinimumTimerInterval):
     17
    1182011-02-23  Dan Bernstein  <mitz@apple.com>
    219
  • trunk/Source/WebCore/page/DOMTimer.cpp

    r78620 r79455  
    154154    if (m_nestingLevel < maxTimerNestingLevel)
    155155        return;
     156
     157    double newMinimumInterval = scriptExecutionContext()->minimumTimerInterval();
     158    double newClampedInterval = intervalClampedToMinimum(m_originalTimeout, newMinimumInterval);
     159
     160    if (repeatInterval()) {
     161        augmentRepeatInterval(newClampedInterval - repeatInterval());
     162        return;
     163    }
     164
    156165    double previousClampedInterval = intervalClampedToMinimum(m_originalTimeout, oldMinimumTimerInterval);
    157     double newClampedInterval = intervalClampedToMinimum(m_originalTimeout, scriptExecutionContext()->minimumTimerInterval());
    158166    augmentFireInterval(newClampedInterval - previousClampedInterval);
    159167}
Note: See TracChangeset for help on using the changeset viewer.