Changeset 212845 in webkit
- Timestamp:
- Feb 22, 2017, 12:44:30 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/TestExpectations (modified) (1 diff)
-
LayoutTests/fast/dom/timer-throttling-hidden-page-expected.txt (modified) (1 diff)
-
LayoutTests/fast/dom/timer-throttling-hidden-page-non-nested-expected.txt (added)
-
LayoutTests/fast/dom/timer-throttling-hidden-page-non-nested.html (added)
-
LayoutTests/fast/dom/timer-throttling-hidden-page.html (modified) (4 diffs)
-
LayoutTests/platform/ios-simulator/TestExpectations (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/dom/Document.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r212841 r212845 1 2017-02-22 Chris Dumez <cdumez@apple.com> 2 3 Do not aggressively throttle DOM timers until they've reached their max nesting level 4 https://bugs.webkit.org/show_bug.cgi?id=168700 5 <rdar://problem/29808005> 6 7 Reviewed by Simon Fraser. 8 9 Add layout test coverage. 10 11 * TestExpectations: 12 * fast/dom/timer-throttling-hidden-page-expected.txt: 13 * fast/dom/timer-throttling-hidden-page-non-nested-expected.txt: Added. 14 * fast/dom/timer-throttling-hidden-page-non-nested.html: Added. 15 * fast/dom/timer-throttling-hidden-page.html: 16 1 17 2017-02-22 Antti Koivisto <antti@apple.com> 2 18 -
trunk/LayoutTests/TestExpectations
r212812 r212845 109 109 # media/W3C/video/networkState/networkState_during_progress.html is flaky 110 110 webkit.org/b/76280 media/W3C/video/networkState/networkState_during_progress.html [ Pass Failure ] 111 112 webkit.org/b/118301 fast/dom/timer-throttling-hidden-page.html [ Skip ]113 111 114 112 # This test will run slowly in debug mode, but is plenty fast in release. -
trunk/LayoutTests/fast/dom/timer-throttling-hidden-page-expected.txt
r130720 r212845 4 4 5 5 6 PASS timerIntervalWhilePageVisible is within 20 of 100 7 PASS firstTimerIntervalWhilePageHidden is >= 80 8 PASS firstTimerIntervalWhilePageHidden <= 1120 is true 9 PASS timerIntervalWhilePageHidden is within 20 of 1000 10 PASS timerIntervalWhilePageVisible is within 20 of 100 6 PASS timerIntervalWhilePageVisible is within 20 of 10 7 PASS timerIntervalWhilePageVisible is within 20 of 10 8 PASS timerIntervalWhilePageVisible is within 20 of 10 9 PASS timerIntervalWhilePageVisible is within 20 of 10 10 PASS timerIntervalWhilePageVisible is within 20 of 10 11 PASS timerIntervalWhilePageHidden > (timeoutInterval + tolerance) is true 12 PASS timerIntervalWhilePageVisible is within 20 of 10 11 13 PASS successfullyParsed is true 12 14 13 15 TEST COMPLETE 14 This test measures the time taken to fire a 10 0ms DOM Timer when the page visibility is set to "visible", "hidden" and then back to "visible". Due to hidden page timer throttling, the timer should fire close to 1s when page is hidden. And it should fire close to 100ms, when the page is visible.16 This test measures the time taken to fire a 10ms DOM Timer when the page visibility is set to "visible", "hidden" and then back to "visible". Due to hidden page timer throttling, the timer should fire close to s when page is hidden. And it should fire close to 10ms, when the page is visible. -
trunk/LayoutTests/fast/dom/timer-throttling-hidden-page.html
r155265 r212845 10 10 var firstTimerWhileHidden = true; 11 11 var isPageVisible = true; 12 var timeoutInterval = 10 0;12 var timeoutInterval = 10; 13 13 var tolerance = 20; 14 var timerAlignmentInterval = 1000;14 var maxNestingLevel = 5; 15 15 16 16 function testTimer() … … 18 18 var date = new Date(); 19 19 var time = date.getTime(); 20 if (!isPageVisible) { 21 if (firstTimerWhileHidden) { 22 firstTimerIntervalWhilePageHidden = time - previousTime; 23 var minValue = timeoutInterval - tolerance; 24 shouldBeGreaterThanOrEqual("firstTimerIntervalWhilePageHidden", minValue.toString()); 25 var maxValue = timeoutInterval + timerAlignmentInterval + tolerance; 26 shouldBeTrue("firstTimerIntervalWhilePageHidden <= " + maxValue); 27 firstTimerWhileHidden = false; 28 } else { 29 timerIntervalWhilePageHidden = time - previousTime; 30 shouldBeCloseTo("timerIntervalWhilePageHidden", timerAlignmentInterval, tolerance); 31 } 20 if (!isPageVisible && timerCount >= maxNestingLevel) { 21 timerIntervalWhilePageHidden = time - previousTime; 22 shouldBeTrue("timerIntervalWhilePageHidden > (timeoutInterval + tolerance)"); 32 23 } else { 33 24 timerIntervalWhilePageVisible = time - previousTime; … … 41 32 testRunner.setPageVisibility("hidden"); 42 33 isPageVisible = false; 43 } else if (timerCount == 3) {34 } else if (timerCount == maxNestingLevel + 1) { 44 35 testRunner.resetPageVisibility(); 45 36 isPageVisible = true; 46 } else if (timerCount > = 4){37 } else if (timerCount > maxNestingLevel + 1){ 47 38 finishJSTest(); 48 39 return; … … 63 54 timeoutIntervalSpans[i].innerText = timeoutInterval; 64 55 65 document.getElementById('alignmentInterval').innerText = timerAlignmentInterval / 1000;66 67 56 testRunner.dumpAsText(); 68 57 setTimeout(testTimer, timeoutInterval); -
trunk/LayoutTests/platform/ios-simulator/TestExpectations
r212617 r212845 301 301 302 302 # testRunner.setPageVisibility is not implemented for iOS 303 webkit.org/b/165799 fast/dom/timer-throttling-hidden-page.html [ Skip ] 304 webkit.org/b/165799 fast/dom/timer-throttling-hidden-page-non-nested.html [ Skip ] 303 305 webkit.org/b/165799 fast/events/page-visibility-onvisibilitychange.html [ Skip ] 304 306 webkit.org/b/165799 svg/animations/animations-paused-page-non-visible.html [ Skip ] -
trunk/Source/WebCore/ChangeLog
r212844 r212845 1 2017-02-22 Chris Dumez <cdumez@apple.com> 2 3 Do not aggressively throttle DOM timers until they've reached their max nesting level 4 https://bugs.webkit.org/show_bug.cgi?id=168700 5 <rdar://problem/29808005> 6 7 Reviewed by Simon Fraser. 8 9 Do not aggressively throttle DOM timers until they've actually areached their max 10 nesting level (5). This overly aggressive throttling of non-nested timers is what 11 was causing Google Maps to use 100% CPU in background tabs for several minutes. 12 13 Test: fast/dom/timer-throttling-hidden-page-non-nested.html 14 15 * dom/Document.cpp: 16 (WebCore::Document::timerAlignmentInterval): 17 1 18 2017-02-22 Eric Carlson <eric.carlson@apple.com> 2 19 -
trunk/Source/WebCore/dom/Document.cpp
r212629 r212845 2848 2848 { 2849 2849 auto alignmentInterval = ScriptExecutionContext::timerAlignmentInterval(hasReachedMaxNestingLevel); 2850 if (!hasReachedMaxNestingLevel) 2851 return alignmentInterval; 2850 2852 2851 2853 // Apply Document-level DOMTimer throttling only if timers have reached their maximum nesting level as the Page may still be visible. 2852 if (m_isTimerThrottlingEnabled && hasReachedMaxNestingLevel)2854 if (m_isTimerThrottlingEnabled) 2853 2855 alignmentInterval = std::max(alignmentInterval, DOMTimer::hiddenPageAlignmentInterval()); 2854 2856
Note:
See TracChangeset
for help on using the changeset viewer.