Changeset 176282 in webkit
- Timestamp:
- Nov 18, 2014, 2:05:10 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/dom/timer-unthrottle-on-scroll-expected.txt (added)
-
LayoutTests/fast/dom/timer-unthrottle-on-scroll.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/page/DOMTimer.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r176263 r176282 1 2014-11-18 Chris Dumez <cdumez@apple.com> 2 3 DOMTimers sometimes don't get unthrottled on scrolling 4 https://bugs.webkit.org/show_bug.cgi?id=138838 5 6 Reviewed by Antti Koivisto. 7 8 Add a layout test to verify that DOMTimers get unthrottled on scroll if 9 the element whose style they are changing is inside the viewport after 10 the scroll. 11 12 * fast/dom/timer-unthrottle-on-scroll-expected.txt: Added. 13 * fast/dom/timer-unthrottle-on-scroll.html: Added. 14 1 15 2014-11-18 Myles C. Maxfield <litherum@gmail.com> 2 16 -
trunk/Source/WebCore/ChangeLog
r176278 r176282 1 2014-11-18 Chris Dumez <cdumez@apple.com> 2 3 DOMTimers sometimes don't get unthrottled on scrolling 4 https://bugs.webkit.org/show_bug.cgi?id=138838 5 6 Reviewed by Antti Koivisto. 7 8 DOMTimers sometimes didn't get unthrottled on scrolling. This is 9 because we stopped listening for viewport changes every time the 10 timer fires, but we didn't listen for those changes again if we 11 decided the timer should stay throttled after the timer's action 12 was executed. 13 14 We should listen for viewport changes again after executing the 15 timer's action, if there are elements outside the viewport causing 16 the DOMTimer to be throttled, even if the throttleState hasn't 17 changed (i.e the timer stays throttled). 18 19 Test: fast/dom/timer-unthrottle-on-scroll.html 20 21 * page/DOMTimer.cpp: 22 (WebCore::DOMTimer::updateThrottlingStateIfNecessary): 23 (WebCore::DOMTimer::updateTimerIntervalIfNecessary): 24 (WebCore::DOMTimer::updateThrottlingStateAfterViewportChange): 25 1 26 2014-11-18 Daniel Bates <dbates@webkit.org> 2 27 -
trunk/Source/WebCore/page/DOMTimer.cpp
r176212 r176282 255 255 { 256 256 if (fireState.scriptMadeUserObservableChanges()) { 257 ASSERT(m_elementsCausingThrottling.isEmpty()); 257 258 if (m_throttleState != ShouldNotThrottle) { 258 259 m_throttleState = ShouldNotThrottle; 259 ASSERT(m_elementsCausingThrottling.isEmpty());260 260 updateTimerIntervalIfNecessary(); 261 261 } … … 263 263 if (m_throttleState != ShouldThrottle) { 264 264 m_throttleState = ShouldThrottle; 265 fireState.elementsChangedOutsideViewport(m_elementsCausingThrottling);266 265 updateTimerIntervalIfNecessary(); 267 266 } 267 // Update our vector of Elements causing throttling and register 268 // for viewport changes if the vector is not empty. 269 fireState.elementsChangedOutsideViewport(m_elementsCausingThrottling); 270 if (isIntervalDependentOnViewport()) 271 registerForViewportChanges(); 268 272 } 269 273 } … … 429 433 return; 430 434 431 // Timer was throttled / unthrottled, make sure we register / unregister432 // from the FrameView if the timer's interval is dependent on viewport.433 if (isIntervalDependentOnViewport())434 registerForViewportChanges();435 else if (m_throttleState == ShouldNotThrottle)436 unregisterForViewportChanges();437 438 435 if (repeatInterval()) { 439 436 ASSERT(WTF::areEssentiallyEqual(repeatInterval(), previousInterval, oneMillisecond)); … … 458 455 LOG(DOMTimers, "%p - Script is changing style of an element that is now inside the viewport, unthrottling the timer.", this); 459 456 m_throttleState = ShouldNotThrottle; 457 unregisterForViewportChanges(); 460 458 updateTimerIntervalIfNecessary(); 461 459 break;
Note:
See TracChangeset
for help on using the changeset viewer.