Title: [256512] trunk
Revision
256512
Author
s...@apple.com
Date
2020-02-13 09:11:28 -0800 (Thu, 13 Feb 2020)

Log Message

Unreviewed, rolling out r255158, 255405 and r255486

Caused test flakiness and PLT regression.

Patch by Said Abou-Hallawa <s...@apple.com> on 2020-02-13

Source/WebCore:

* Headers.cmake:
* WebCore.xcodeproj/project.pbxproj:
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::updateThrottlingState):
(WebCore::DocumentTimeline::animationInterval const):
* animation/DocumentTimeline.h:
* dom/Document.cpp:
(WebCore::Document::requestAnimationFrame):
(WebCore::Document::updateLastHandledUserGestureTimestamp):
* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::ScriptedAnimationController):
(WebCore::throttlingReasonToString):
(WebCore::throttlingReasonsToString):
(WebCore::ScriptedAnimationController::addThrottlingReason):
(WebCore::ScriptedAnimationController::removeThrottlingReason):
(WebCore::ScriptedAnimationController::isThrottled const):
(WebCore::ScriptedAnimationController::registerCallback):
(WebCore::ScriptedAnimationController::cancelCallback):
(WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks):
(WebCore::ScriptedAnimationController::interval const):
(WebCore::ScriptedAnimationController::page const):
(WebCore::ScriptedAnimationController::scheduleAnimation):
(WebCore::ScriptedAnimationController::animationTimerFired):
(WebCore::ScriptedAnimationController::preferredScriptedAnimationInterval const): Deleted.
(WebCore::ScriptedAnimationController::isThrottledRelativeToPage const): Deleted.
(WebCore::ScriptedAnimationController::shouldRescheduleRequestAnimationFrame const): Deleted.
* dom/ScriptedAnimationController.h:
(WebCore::ScriptedAnimationController::addThrottlingReason): Deleted.
(WebCore::ScriptedAnimationController::removeThrottlingReason): Deleted.
* page/FrameView.cpp:
(WebCore::FrameView::updateScriptedAnimationsAndTimersThrottlingState):
* page/Page.cpp:
(WebCore::m_deviceOrientationUpdateProvider):
(WebCore::Page::isLowPowerModeEnabled const):
(WebCore::Page::setLowPowerModeEnabledOverrideForTesting):
(WebCore::updateScriptedAnimationsThrottlingReason):
(WebCore::Page::setIsVisuallyIdleInternal):
(WebCore::Page::handleLowModePowerChange):
(WebCore::Page::renderingUpdateThrottlingEnabled const): Deleted.
(WebCore::Page::renderingUpdateThrottlingEnabledChanged): Deleted.
(WebCore::Page::isRenderingUpdateThrottled const): Deleted.
(WebCore::Page::preferredRenderingUpdateInterval const): Deleted.
* page/Page.h:
(WebCore::Page::isLowPowerModeEnabled const): Deleted.
(WebCore::Page::canUpdateThrottlingReason const): Deleted.
* page/RenderingUpdateScheduler.cpp:
(WebCore::RenderingUpdateScheduler::scheduleTimedRenderingUpdate):
(WebCore::RenderingUpdateScheduler::startTimer):
(WebCore::RenderingUpdateScheduler::adjustFramesPerSecond): Deleted.
(WebCore::RenderingUpdateScheduler::adjustRenderingUpdateFrequency): Deleted.
* page/RenderingUpdateScheduler.h:
* page/Settings.yaml:
* page/SettingsBase.cpp:
(WebCore::SettingsBase::renderingUpdateThrottlingEnabledChanged): Deleted.
* page/SettingsBase.h:
* platform/graphics/AnimationFrameRate.h: Removed.
* platform/graphics/DisplayRefreshMonitor.h:
(WebCore::DisplayRefreshMonitor::setPreferredFramesPerSecond): Deleted.
* platform/graphics/DisplayRefreshMonitorManager.cpp:
(WebCore::DisplayRefreshMonitorManager::createMonitorForClient):
(WebCore::DisplayRefreshMonitorManager::registerClient):
(WebCore::DisplayRefreshMonitorManager::scheduleAnimation):
(WebCore::DisplayRefreshMonitorManager::windowScreenDidChange):
(WebCore::DisplayRefreshMonitorManager::monitorForClient): Deleted.
(WebCore::DisplayRefreshMonitorManager::setPreferredFramesPerSecond): Deleted.
* platform/graphics/DisplayRefreshMonitorManager.h:
(WebCore::DisplayRefreshMonitorManager::DisplayRefreshMonitorManager):
* platform/graphics/GraphicsLayerUpdater.cpp:
(WebCore::GraphicsLayerUpdater::GraphicsLayerUpdater):
* platform/graphics/ios/DisplayRefreshMonitorIOS.mm:
(-[WebDisplayLinkHandler setPreferredFramesPerSecond:]): Deleted.

Source/WebKit:

* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetRenderingUpdateThrottlingEnabled): Deleted.
(WKPreferencesGetRenderingUpdateThrottlingEnabled): Deleted.
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.messages.in:
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
(-[WKOneShotDisplayLinkHandler setPreferredFramesPerSecond:]): Deleted.
(WebKit::RemoteLayerTreeDrawingAreaProxy::setPreferredFramesPerSecond): Deleted.
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm:
(WebKit::RemoteLayerTreeDisplayRefreshMonitor::setPreferredFramesPerSecond): Deleted.
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::setPreferredFramesPerSecond): Deleted.

Source/WebKitLegacy/mac:

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences renderingUpdateThrottlingEnabled]): Deleted.
(-[WebPreferences setRenderingUpdateThrottlingEnabled:]): Deleted.
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKitLegacy/win:

* Interfaces/IWebPreferencesPrivate.idl:
* WebPreferenceKeysPrivate.h:
* WebPreferences.cpp:
(WebPreferences::initializeDefaultSettings):
(WebPreferences::renderingUpdateThrottlingEnabled): Deleted.
(WebPreferences::setRenderingUpdateThrottlingEnabled): Deleted.
* WebPreferences.h:
* WebView.cpp:
(WebView::notifyPreferencesChanged):

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebPreferencesToConsistentValues):
* DumpRenderTree/win/DumpRenderTree.cpp:
(enableExperimentalFeatures):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):

LayoutTests:

* fast/animation/css-animation-throttling-lowPowerMode.html:
* fast/animation/request-animation-frame-throttle-subframe.html:
* fast/animation/request-animation-frame-throttling-detached-iframe.html:
* fast/animation/request-animation-frame-throttling-lowPowerMode-expected.txt:
* fast/animation/request-animation-frame-throttling-lowPowerMode.html:
* fast/animation/request-animation-frame-throttling-outside-viewport-expected.txt: Removed.
* fast/animation/request-animation-frame-throttling-outside-viewport.html: Removed.
* fast/animation/resources/frame-with-animation-2.html: Removed.
* http/tests/frame-throttling/raf-throttle-in-cross-origin-subframe.html:
* platform/mac-wk2/TestExpectations:

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (256511 => 256512)


--- trunk/LayoutTests/ChangeLog	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/LayoutTests/ChangeLog	2020-02-13 17:11:28 UTC (rev 256512)
@@ -1,3 +1,20 @@
+2020-02-13  Said Abou-Hallawa  <s...@apple.com>
+
+        Unreviewed, rolling out r255158, 255405 and r255486
+
+        Caused test flakiness and PLT regression.
+
+        * fast/animation/css-animation-throttling-lowPowerMode.html:
+        * fast/animation/request-animation-frame-throttle-subframe.html:
+        * fast/animation/request-animation-frame-throttling-detached-iframe.html:
+        * fast/animation/request-animation-frame-throttling-lowPowerMode-expected.txt:
+        * fast/animation/request-animation-frame-throttling-lowPowerMode.html:
+        * fast/animation/request-animation-frame-throttling-outside-viewport-expected.txt: Removed.
+        * fast/animation/request-animation-frame-throttling-outside-viewport.html: Removed.
+        * fast/animation/resources/frame-with-animation-2.html: Removed.
+        * http/tests/frame-throttling/raf-throttle-in-cross-origin-subframe.html:
+        * platform/mac-wk2/TestExpectations:
+
 2020-02-13  Jacob Uphoff  <jacob_uph...@apple.com>
 
         [ macOS wk2 ] webgpu/whlsl/return-local-variable.html is flaky failing

Modified: trunk/LayoutTests/fast/animation/css-animation-throttling-lowPowerMode.html (256511 => 256512)


--- trunk/LayoutTests/fast/animation/css-animation-throttling-lowPowerMode.html	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/LayoutTests/fast/animation/css-animation-throttling-lowPowerMode.html	2020-02-13 17:11:28 UTC (rev 256512)
@@ -25,9 +25,6 @@
 description("Tests that CSS animations are throttled in low power mode.");
 jsTestIsAsync = true;
 
-if (window.internals)
-  internals.settings.setRenderingUpdateThrottlingEnabled(true);
-
 const element = document.getElementById("testElement");
 element._onanimationstart_ = function() {
     element._onanimationstart_ = null;

Modified: trunk/LayoutTests/fast/animation/request-animation-frame-throttle-subframe.html (256511 => 256512)


--- trunk/LayoutTests/fast/animation/request-animation-frame-throttle-subframe.html	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/LayoutTests/fast/animation/request-animation-frame-throttle-subframe.html	2020-02-13 17:11:28 UTC (rev 256512)
@@ -6,9 +6,6 @@
 description("Tests that requestAnimationFrame is throttled in subframes that are outside the viewport");
 window.jsTestIsAsync = true;
 
-if (window.internals)
-    internals.settings.setRenderingUpdateThrottlingEnabled(true);
-
 function checkSubframesThrottled()
 {
     shouldBeTrue("testFrame.contentWindow.internals.isRequestAnimationFrameThrottled()");

Modified: trunk/LayoutTests/fast/animation/request-animation-frame-throttling-detached-iframe.html (256511 => 256512)


--- trunk/LayoutTests/fast/animation/request-animation-frame-throttling-detached-iframe.html	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/LayoutTests/fast/animation/request-animation-frame-throttling-detached-iframe.html	2020-02-13 17:11:28 UTC (rev 256512)
@@ -6,9 +6,6 @@
 description("Test that requestAnimationFrame gets the right throttling in an iframe when inserted into a document.");
 jsTestIsAsync = true;
 
-if (window.internals)
-    internals.settings.setRenderingUpdateThrottlingEnabled(true);
-
 let i = 0;
 function doWork()
 {

Modified: trunk/LayoutTests/fast/animation/request-animation-frame-throttling-lowPowerMode-expected.txt (256511 => 256512)


--- trunk/LayoutTests/fast/animation/request-animation-frame-throttling-lowPowerMode-expected.txt	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/LayoutTests/fast/animation/request-animation-frame-throttling-lowPowerMode-expected.txt	2020-02-13 17:11:28 UTC (rev 256512)
@@ -3,7 +3,23 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS farmesPerSecond < 35 is true
+PASS internals.isRequestAnimationFrameThrottled() is false
+PASS internals.requestAnimationFrameInterval is Infinity
+rAFHandle = requestAnimationFrame(doWork);
+PASS internals.isRequestAnimationFrameThrottled() is false
+PASS internals.requestAnimationFrameInterval is 0.015
+internals.setLowPowerModeEnabled(true);
+PASS internals.isRequestAnimationFrameThrottled() is true
+PASS internals.requestAnimationFrameInterval is 0.030
+cancelAnimationFrame(rAFHandle);
+PASS internals.isRequestAnimationFrameThrottled() is true
+PASS internals.requestAnimationFrameInterval is 0.030
+rAFHandle = requestAnimationFrame(doWork);
+PASS internals.isRequestAnimationFrameThrottled() is true
+PASS internals.requestAnimationFrameInterval is 0.030
+internals.setLowPowerModeEnabled(false);
+PASS internals.isRequestAnimationFrameThrottled() is false
+PASS internals.requestAnimationFrameInterval is 0.015
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/fast/animation/request-animation-frame-throttling-lowPowerMode.html (256511 => 256512)


--- trunk/LayoutTests/fast/animation/request-animation-frame-throttling-lowPowerMode.html	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/LayoutTests/fast/animation/request-animation-frame-throttling-lowPowerMode.html	2020-02-13 17:11:28 UTC (rev 256512)
@@ -1,33 +1,36 @@
 <!DOCTYPE html>
 <html>
 <body>
-    <script src=""
-    <script>
-        description("Test that requestAnimationFrame gets throttled in low power mode.");
-        window.jsTestIsAsync = true;
+<script src=""
+<script>
+description("Test that requestAnimationFrame gets throttled in low power mode.");
 
-        if (window.internals) {
-            internals.settings.setRenderingUpdateThrottlingEnabled(true);
-            internals.setLowPowerModeEnabled(true);
-        }
+let rAFHandle;
+let i = 0;
+function doWork()
+{
+    i++;
+    rAFHandle = requestAnimationFrame(doWork);
+}
 
-        var start = null;
-        var farmesPerSecond = 0;
-        function doWork(timestamp) {
-            if (!start)
-                start = timestamp;
-            if (timestamp - start < 1000) {
-                ++farmesPerSecond;
-                window.requestAnimationFrame(doWork);
-            }
-            else {
-                // The LowPowerMode throttling interval = 30_ms. The frame rate ~= 33.3 fps.
-                shouldBeTrue("farmesPerSecond < 35");
-                finishJSTest();
-            }
-        }
-        window.requestAnimationFrame(doWork);
-    </script>
-    <script src=""
+shouldBeFalse("internals.isRequestAnimationFrameThrottled()");
+shouldBe("internals.requestAnimationFrameInterval", "Infinity");
+evalAndLog("rAFHandle = requestAnimationFrame(doWork);");
+shouldBeFalse("internals.isRequestAnimationFrameThrottled()");
+shouldBe("internals.requestAnimationFrameInterval", "0.015");
+evalAndLog("internals.setLowPowerModeEnabled(true);");
+shouldBeTrue("internals.isRequestAnimationFrameThrottled()");
+shouldBe("internals.requestAnimationFrameInterval", "0.030");
+evalAndLog("cancelAnimationFrame(rAFHandle);");
+shouldBeTrue("internals.isRequestAnimationFrameThrottled()");
+shouldBe("internals.requestAnimationFrameInterval", "0.030");
+evalAndLog("rAFHandle = requestAnimationFrame(doWork);");
+shouldBeTrue("internals.isRequestAnimationFrameThrottled()");
+shouldBe("internals.requestAnimationFrameInterval", "0.030");
+evalAndLog("internals.setLowPowerModeEnabled(false);");
+shouldBeFalse("internals.isRequestAnimationFrameThrottled()");
+shouldBe("internals.requestAnimationFrameInterval", "0.015");
+</script>
+<script src=""
 </body>
 </html>

Deleted: trunk/LayoutTests/fast/animation/request-animation-frame-throttling-outside-viewport-expected.txt (256511 => 256512)


--- trunk/LayoutTests/fast/animation/request-animation-frame-throttling-outside-viewport-expected.txt	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/LayoutTests/fast/animation/request-animation-frame-throttling-outside-viewport-expected.txt	2020-02-13 17:11:28 UTC (rev 256512)
@@ -1,11 +0,0 @@
-Test that requestAnimationFrame gets the right throttling in an iframe when when it's outside the viewport.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS framesPerSecond > 0 is true
-PASS iframeFramesPerSecond == 0 is true
-PASS successfullyParsed is true
-
-TEST COMPLETE
-

Deleted: trunk/LayoutTests/fast/animation/request-animation-frame-throttling-outside-viewport.html (256511 => 256512)


--- trunk/LayoutTests/fast/animation/request-animation-frame-throttling-outside-viewport.html	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/LayoutTests/fast/animation/request-animation-frame-throttling-outside-viewport.html	2020-02-13 17:11:28 UTC (rev 256512)
@@ -1,48 +0,0 @@
-<!DOCTYPE html>
-<html>
-<body>
-    <div style="height: 1000px;"></div>
-    <script src=""
-    <script>
-        description("Test that requestAnimationFrame gets the right throttling in an iframe when when it's outside the viewport.");
-        jsTestIsAsync = true;
-
-        if (window.internals)
-            internals.settings.setRenderingUpdateThrottlingEnabled(true);
-
-        var framesPerSecond = 0;
-        var iframeFramesPerSecond = 0;
-
-        window._onmessage_ = function(e){
-            if (e.data == 'subFrameRAFMessage') {
-                ++iframeFramesPerSecond;
-            }
-        };
-
-        const frame = document.createElement("iframe");
-        frame.src = ""
-        frame._onload_ = function() {
-            var start = null;
-            function doWork(timestamp) {
-                if (!start)
-                    start = timestamp;
-                if (timestamp - start < 1000) {
-                    ++framesPerSecond;
-                    window.requestAnimationFrame(doWork);
-                }
-                else {
-                    shouldBeTrue("framesPerSecond > 0");
-
-                    // The OutsideViewport throttling = 10_s. subFrameRAFMessage
-                    // should not ever be received during the first second.
-                    shouldBeTrue("iframeFramesPerSecond == 0");
-                    finishJSTest();
-                }
-            }
-            window.requestAnimationFrame(doWork);
-        }
-        document.body.appendChild(frame);
-    </script>
-    <script src=""
-</body>
-</html>

Deleted: trunk/LayoutTests/fast/animation/resources/frame-with-animation-2.html (256511 => 256512)


--- trunk/LayoutTests/fast/animation/resources/frame-with-animation-2.html	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/LayoutTests/fast/animation/resources/frame-with-animation-2.html	2020-02-13 17:11:28 UTC (rev 256512)
@@ -1,7 +0,0 @@
-<script>
-	function doWork(timestamp) {
-		window.top.postMessage('subFrameRAFMessage', '*');
-		window.requestAnimationFrame(doWork);
-	}
-	window.requestAnimationFrame(doWork);
-</script>

Modified: trunk/LayoutTests/http/tests/frame-throttling/raf-throttle-in-cross-origin-subframe.html (256511 => 256512)


--- trunk/LayoutTests/http/tests/frame-throttling/raf-throttle-in-cross-origin-subframe.html	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/LayoutTests/http/tests/frame-throttling/raf-throttle-in-cross-origin-subframe.html	2020-02-13 17:11:28 UTC (rev 256512)
@@ -13,10 +13,7 @@
     <script>
     description("Tests that requestAnimationFrame is throttled in subframes that are cross-origin, and not in same-origin frames");
     window.jsTestIsAsync = true;
-
-    if (window.internals)
-        internals.settings.setRenderingUpdateThrottlingEnabled(true);
-
+    
     var crossOriginFrame;
     var sameOriginFrame
 

Modified: trunk/LayoutTests/platform/mac-wk2/TestExpectations (256511 => 256512)


--- trunk/LayoutTests/platform/mac-wk2/TestExpectations	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/LayoutTests/platform/mac-wk2/TestExpectations	2020-02-13 17:11:28 UTC (rev 256512)
@@ -940,8 +940,6 @@
 
 webkit.org/b/206961 [ Mojave ] media/media-fragments/TC0035.html [ Pass Failure ]
 
-webkit.org/b/206839 http/tests/frame-throttling/raf-throttle-in-cross-origin-subframe.html [ Pass Failure ]
-
 webkit.org/b/207003 tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-overflow.html [ Pass Failure ]
 
 webkit.org/b/207060 imported/w3c/web-platform-tests/html/webappapis/timers/type-long-setinterval.html [ Pass Failure ]

Modified: trunk/Source/WebCore/ChangeLog (256511 => 256512)


--- trunk/Source/WebCore/ChangeLog	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebCore/ChangeLog	2020-02-13 17:11:28 UTC (rev 256512)
@@ -1,3 +1,81 @@
+2020-02-13  Said Abou-Hallawa  <s...@apple.com>
+
+        Unreviewed, rolling out r255158, 255405 and r255486
+
+        Caused test flakiness and PLT regression.
+
+        * Headers.cmake:
+        * WebCore.xcodeproj/project.pbxproj:
+        * animation/DocumentTimeline.cpp:
+        (WebCore::DocumentTimeline::updateThrottlingState):
+        (WebCore::DocumentTimeline::animationInterval const):
+        * animation/DocumentTimeline.h:
+        * dom/Document.cpp:
+        (WebCore::Document::requestAnimationFrame):
+        (WebCore::Document::updateLastHandledUserGestureTimestamp):
+        * dom/ScriptedAnimationController.cpp:
+        (WebCore::ScriptedAnimationController::ScriptedAnimationController):
+        (WebCore::throttlingReasonToString):
+        (WebCore::throttlingReasonsToString):
+        (WebCore::ScriptedAnimationController::addThrottlingReason):
+        (WebCore::ScriptedAnimationController::removeThrottlingReason):
+        (WebCore::ScriptedAnimationController::isThrottled const):
+        (WebCore::ScriptedAnimationController::registerCallback):
+        (WebCore::ScriptedAnimationController::cancelCallback):
+        (WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks):
+        (WebCore::ScriptedAnimationController::interval const):
+        (WebCore::ScriptedAnimationController::page const):
+        (WebCore::ScriptedAnimationController::scheduleAnimation):
+        (WebCore::ScriptedAnimationController::animationTimerFired):
+        (WebCore::ScriptedAnimationController::preferredScriptedAnimationInterval const): Deleted.
+        (WebCore::ScriptedAnimationController::isThrottledRelativeToPage const): Deleted.
+        (WebCore::ScriptedAnimationController::shouldRescheduleRequestAnimationFrame const): Deleted.
+        * dom/ScriptedAnimationController.h:
+        (WebCore::ScriptedAnimationController::addThrottlingReason): Deleted.
+        (WebCore::ScriptedAnimationController::removeThrottlingReason): Deleted.
+        * page/FrameView.cpp:
+        (WebCore::FrameView::updateScriptedAnimationsAndTimersThrottlingState):
+        * page/Page.cpp:
+        (WebCore::m_deviceOrientationUpdateProvider):
+        (WebCore::Page::isLowPowerModeEnabled const):
+        (WebCore::Page::setLowPowerModeEnabledOverrideForTesting):
+        (WebCore::updateScriptedAnimationsThrottlingReason):
+        (WebCore::Page::setIsVisuallyIdleInternal):
+        (WebCore::Page::handleLowModePowerChange):
+        (WebCore::Page::renderingUpdateThrottlingEnabled const): Deleted.
+        (WebCore::Page::renderingUpdateThrottlingEnabledChanged): Deleted.
+        (WebCore::Page::isRenderingUpdateThrottled const): Deleted.
+        (WebCore::Page::preferredRenderingUpdateInterval const): Deleted.
+        * page/Page.h:
+        (WebCore::Page::isLowPowerModeEnabled const): Deleted.
+        (WebCore::Page::canUpdateThrottlingReason const): Deleted.
+        * page/RenderingUpdateScheduler.cpp:
+        (WebCore::RenderingUpdateScheduler::scheduleTimedRenderingUpdate):
+        (WebCore::RenderingUpdateScheduler::startTimer):
+        (WebCore::RenderingUpdateScheduler::adjustFramesPerSecond): Deleted.
+        (WebCore::RenderingUpdateScheduler::adjustRenderingUpdateFrequency): Deleted.
+        * page/RenderingUpdateScheduler.h:
+        * page/Settings.yaml:
+        * page/SettingsBase.cpp:
+        (WebCore::SettingsBase::renderingUpdateThrottlingEnabledChanged): Deleted.
+        * page/SettingsBase.h:
+        * platform/graphics/AnimationFrameRate.h: Removed.
+        * platform/graphics/DisplayRefreshMonitor.h:
+        (WebCore::DisplayRefreshMonitor::setPreferredFramesPerSecond): Deleted.
+        * platform/graphics/DisplayRefreshMonitorManager.cpp:
+        (WebCore::DisplayRefreshMonitorManager::createMonitorForClient):
+        (WebCore::DisplayRefreshMonitorManager::registerClient):
+        (WebCore::DisplayRefreshMonitorManager::scheduleAnimation):
+        (WebCore::DisplayRefreshMonitorManager::windowScreenDidChange):
+        (WebCore::DisplayRefreshMonitorManager::monitorForClient): Deleted.
+        (WebCore::DisplayRefreshMonitorManager::setPreferredFramesPerSecond): Deleted.
+        * platform/graphics/DisplayRefreshMonitorManager.h:
+        (WebCore::DisplayRefreshMonitorManager::DisplayRefreshMonitorManager):
+        * platform/graphics/GraphicsLayerUpdater.cpp:
+        (WebCore::GraphicsLayerUpdater::GraphicsLayerUpdater):
+        * platform/graphics/ios/DisplayRefreshMonitorIOS.mm:
+        (-[WebDisplayLinkHandler setPreferredFramesPerSecond:]): Deleted.
+
 2020-02-13  Zalan Bujtas  <za...@apple.com>
 
         [LFC][IFC] LineCandidateContent can have only one float item

Modified: trunk/Source/WebCore/Headers.cmake (256511 => 256512)


--- trunk/Source/WebCore/Headers.cmake	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebCore/Headers.cmake	2020-02-13 17:11:28 UTC (rev 256512)
@@ -1033,7 +1033,6 @@
 
     platform/graphics/AlphaPremultiplication.h
     platform/graphics/ANGLEWebKitBridge.h
-    platform/graphics/AnimationFrameRate.h
     platform/graphics/AudioTrackPrivate.h
     platform/graphics/BitmapImage.h
     platform/graphics/Color.h

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (256511 => 256512)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2020-02-13 17:11:28 UTC (rev 256512)
@@ -2130,7 +2130,6 @@
 		72144333223EC8B000F12FF7 /* SVGProperty.h in Headers */ = {isa = PBXBuildFile; fileRef = 55EE5363223B2A2400FBA944 /* SVGProperty.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		72144334223EC91600F12FF7 /* SVGPropertyOwner.h in Headers */ = {isa = PBXBuildFile; fileRef = 55EE5360223B2A2100FBA944 /* SVGPropertyOwner.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		72283F0E230B268C00F5D828 /* ImagePaintingOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 72C18A3F230B04B7006847C7 /* ImagePaintingOptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		722A815D238FDAF000C00583 /* AnimationFrameRate.h in Headers */ = {isa = PBXBuildFile; fileRef = 722A815C238FD50500C00583 /* AnimationFrameRate.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		724ED3321A3A8B2300F5F13C /* JSEXTBlendMinMax.h in Headers */ = {isa = PBXBuildFile; fileRef = 724ED3301A3A8B2300F5F13C /* JSEXTBlendMinMax.h */; };
 		724EE5501DC80D7F00A91FFB /* ActivityState.h in Headers */ = {isa = PBXBuildFile; fileRef = 724EE54E1DC7F25B00A91FFB /* ActivityState.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		724EE5511DC80D8400A91FFB /* ActivityStateChangeObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 724EE54F1DC7F25B00A91FFB /* ActivityStateChangeObserver.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -9561,7 +9560,6 @@
 		71FF851822A3F81F005D5959 /* NavigatorMaxTouchPoints.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NavigatorMaxTouchPoints.idl; sourceTree = "<group>"; };
 		721443452240C8BA00F12FF7 /* SVGAnimatedValueProperty.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedValueProperty.h; sourceTree = "<group>"; };
 		721443462240CAD200F12FF7 /* SVGValueProperty.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SVGValueProperty.h; sourceTree = "<group>"; };
-		722A815C238FD50500C00583 /* AnimationFrameRate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AnimationFrameRate.h; sourceTree = "<group>"; };
 		724ED3291A3A7E5400F5F13C /* EXTBlendMinMax.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EXTBlendMinMax.cpp; sourceTree = "<group>"; };
 		724ED32A1A3A7E5400F5F13C /* EXTBlendMinMax.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EXTBlendMinMax.h; sourceTree = "<group>"; };
 		724ED32B1A3A7E5400F5F13C /* EXTBlendMinMax.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = EXTBlendMinMax.idl; sourceTree = "<group>"; };
@@ -24914,7 +24912,6 @@
 				7299BC6423D686A600CC6883 /* AlphaPremultiplication.h */,
 				490707E41219C04300D90E51 /* ANGLEWebKitBridge.cpp */,
 				490707E51219C04300D90E51 /* ANGLEWebKitBridge.h */,
-				722A815C238FD50500C00583 /* AnimationFrameRate.h */,
 				BEF29EE91715DD0900C4B4C9 /* AudioTrackPrivate.h */,
 				A89943270B42338700D7C802 /* BitmapImage.cpp */,
 				A89943260B42338700D7C802 /* BitmapImage.h */,
@@ -28944,7 +28941,6 @@
 				71EFCEDC202B38A900D7C411 /* AnimationEffect.h in Headers */,
 				71E2C42621C935280024F8C8 /* AnimationEffectPhase.h in Headers */,
 				319848011A1D817B00A13318 /* AnimationEvent.h in Headers */,
-				722A815D238FDAF000C00583 /* AnimationFrameRate.h in Headers */,
 				49E912AD0EFAC906009D0CAF /* AnimationList.h in Headers */,
 				714C7C661FDAD2A100F2BEE1 /* AnimationPlaybackEvent.h in Headers */,
 				714C7C671FDAD2A900F2BEE1 /* AnimationPlaybackEventInit.h in Headers */,

Modified: trunk/Source/WebCore/animation/DocumentTimeline.cpp (256511 => 256512)


--- trunk/Source/WebCore/animation/DocumentTimeline.cpp	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebCore/animation/DocumentTimeline.cpp	2020-02-13 17:11:28 UTC (rev 256512)
@@ -46,6 +46,9 @@
 #include "Settings.h"
 #include <_javascript_Core/VM.h>
 
+static const Seconds defaultAnimationInterval { 15_ms };
+static const Seconds throttledAnimationInterval { 30_ms };
+
 namespace WebCore {
 
 Ref<DocumentTimeline> DocumentTimeline::create(Document& document)
@@ -204,11 +207,16 @@
     return animations;
 }
 
+void DocumentTimeline::updateThrottlingState()
+{
+    scheduleAnimationResolution();
+}
+
 Seconds DocumentTimeline::animationInterval() const
 {
     if (!m_document || !m_document->page())
         return Seconds::infinity();
-    return m_document->page()->preferredRenderingUpdateInterval();
+    return m_document->page()->isLowPowerModeEnabled() ? throttledAnimationInterval : defaultAnimationInterval;
 }
 
 void DocumentTimeline::suspendAnimations()

Modified: trunk/Source/WebCore/animation/DocumentTimeline.h (256511 => 256512)


--- trunk/Source/WebCore/animation/DocumentTimeline.h	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebCore/animation/DocumentTimeline.h	2020-02-13 17:11:28 UTC (rev 256512)
@@ -76,6 +76,7 @@
     void updateCurrentTime(DOMHighResTimeStamp timestamp);
     void updateAnimationsAndSendEvents();
 
+    void updateThrottlingState();
     WEBCORE_EXPORT Seconds animationInterval() const;
     WEBCORE_EXPORT void suspendAnimations();
     WEBCORE_EXPORT void resumeAnimations();

Modified: trunk/Source/WebCore/dom/Document.cpp (256511 => 256512)


--- trunk/Source/WebCore/dom/Document.cpp	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebCore/dom/Document.cpp	2020-02-13 17:11:28 UTC (rev 256512)
@@ -6516,8 +6516,11 @@
         if (!page() || page()->scriptedAnimationsSuspended())
             m_scriptedAnimationController->suspend();
 
+        if (page() && page()->isLowPowerModeEnabled())
+            m_scriptedAnimationController->addThrottlingReason(ScriptedAnimationController::ThrottlingReason::LowPowerMode);
+
         if (!topOrigin().canAccess(securityOrigin()) && !hasHadUserInteraction())
-            m_scriptedAnimationController->addThrottlingReason(ThrottlingReason::NonInteractedCrossOriginFrame);
+            m_scriptedAnimationController->addThrottlingReason(ScriptedAnimationController::ThrottlingReason::NonInteractedCrossOriginFrame);
     }
 
     return m_scriptedAnimationController->registerCallback(WTFMove(callback));
@@ -6756,7 +6759,7 @@
 
     if (static_cast<bool>(time) && m_scriptedAnimationController) {
         // It's OK to always remove NonInteractedCrossOriginFrame even if this frame isn't cross-origin.
-        m_scriptedAnimationController->removeThrottlingReason(ThrottlingReason::NonInteractedCrossOriginFrame);
+        m_scriptedAnimationController->removeThrottlingReason(ScriptedAnimationController::ThrottlingReason::NonInteractedCrossOriginFrame);
     }
 
     // DOM Timer alignment may depend on the user having interacted with the document.

Modified: trunk/Source/WebCore/dom/ScriptedAnimationController.cpp (256511 => 256512)


--- trunk/Source/WebCore/dom/ScriptedAnimationController.cpp	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebCore/dom/ScriptedAnimationController.cpp	2020-02-13 17:11:28 UTC (rev 256512)
@@ -1,6 +1,5 @@
 /*
  * Copyright (C) 2011 Google Inc. All Rights Reserved.
- * Copyright (C) 2019 Apple Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -27,16 +26,37 @@
 #include "config.h"
 #include "ScriptedAnimationController.h"
 
+#include "Chrome.h"
+#include "ChromeClient.h"
+#include "CustomHeaderFields.h"
+#include "DOMWindow.h"
+#include "Document.h"
+#include "DocumentLoader.h"
+#include "Frame.h"
+#include "FrameView.h"
 #include "InspectorInstrumentation.h"
+#include "Logging.h"
 #include "Page.h"
 #include "RequestAnimationFrameCallback.h"
 #include "Settings.h"
+#include <algorithm>
+#include <wtf/Ref.h>
 #include <wtf/SystemTracing.h>
+#include <wtf/text/StringBuilder.h>
 
+// Allow a little more than 60fps to make sure we can at least hit that frame rate.
+static const Seconds fullSpeedAnimationInterval { 15_ms };
+// Allow a little more than 30fps to make sure we can at least hit that frame rate.
+static const Seconds halfSpeedThrottlingAnimationInterval { 30_ms };
+static const Seconds aggressiveThrottlingAnimationInterval { 10_s };
+
+#define RELEASE_LOG_IF_ALLOWED(fmt, ...) RELEASE_LOG_IF(page() && page()->isAlwaysOnLoggingAllowed(), PerformanceLogging, "%p - ScriptedAnimationController::" fmt, this, ##__VA_ARGS__)
+
 namespace WebCore {
 
 ScriptedAnimationController::ScriptedAnimationController(Document& document)
     : m_document(makeWeakPtr(document))
+    , m_animationTimer(*this, &ScriptedAnimationController::animationTimerFired)
 {
 }
 
@@ -47,25 +67,6 @@
     return m_document && m_document->settings().requestAnimationFrameEnabled();
 }
 
-Page* ScriptedAnimationController::page() const
-{
-    return m_document ? m_document->page() : nullptr;
-}
-
-Seconds ScriptedAnimationController::preferredScriptedAnimationInterval() const
-{
-    if (auto* page = this->page())
-        return page->renderingUpdateThrottlingEnabled() ? preferredFrameInterval(m_throttlingReasons) : FullSpeedAnimationInterval;
-    return FullSpeedAnimationInterval;
-}
-
-Seconds ScriptedAnimationController::interval() const
-{
-    if (auto* page = this->page())
-        return std::max(preferredScriptedAnimationInterval(), page->preferredRenderingUpdateInterval());
-    return FullSpeedAnimationInterval;
-}
-
 void ScriptedAnimationController::suspend()
 {
     ++m_suspendCount;
@@ -82,51 +83,110 @@
         scheduleAnimation();
 }
 
-bool ScriptedAnimationController::isThrottled() const
+#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) && !RELEASE_LOG_DISABLED
+
+static const char* throttlingReasonToString(ScriptedAnimationController::ThrottlingReason reason)
 {
-    if (auto* page = this->page())
-        return page->renderingUpdateThrottlingEnabled() && (page->isRenderingUpdateThrottled() || !m_throttlingReasons.isEmpty());
-    return false;
+    switch (reason) {
+    case ScriptedAnimationController::ThrottlingReason::VisuallyIdle:
+        return "VisuallyIdle";
+    case ScriptedAnimationController::ThrottlingReason::OutsideViewport:
+        return "OutsideViewport";
+    case ScriptedAnimationController::ThrottlingReason::LowPowerMode:
+        return "LowPowerMode";
+    case ScriptedAnimationController::ThrottlingReason::NonInteractedCrossOriginFrame:
+        return "NonInteractiveCrossOriginFrame";
+    }
 }
 
-bool ScriptedAnimationController::isThrottledRelativeToPage() const
+static String throttlingReasonsToString(OptionSet<ScriptedAnimationController::ThrottlingReason> reasons)
 {
-    if (auto* page = this->page())
-        return page->preferredRenderingUpdateInterval() < preferredScriptedAnimationInterval();
-    return false;
+    if (reasons.isEmpty())
+        return "[Unthrottled]"_s;
+
+    StringBuilder builder;
+    for (auto reason : reasons) {
+        if (!builder.isEmpty())
+            builder.append('|');
+        builder.append(throttlingReasonToString(reason));
+    }
+    return builder.toString();
 }
 
-bool ScriptedAnimationController::shouldRescheduleRequestAnimationFrame(DOMHighResTimeStamp timestamp) const
+#endif
+
+void ScriptedAnimationController::addThrottlingReason(ThrottlingReason reason)
 {
-    return isThrottledRelativeToPage() && Seconds(timestamp - m_lastAnimationFrameTimestamp) < preferredScriptedAnimationInterval();
+#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
+    if (m_throttlingReasons.contains(reason))
+        return;
+
+    m_throttlingReasons.add(reason);
+
+    RELEASE_LOG_IF_ALLOWED("addThrottlingReason(%s) -> %s", throttlingReasonToString(reason), throttlingReasonsToString(m_throttlingReasons).utf8().data());
+
+    if (m_animationTimer.isActive()) {
+        m_animationTimer.stop();
+        scheduleAnimation();
+    }
+#else
+    UNUSED_PARAM(reason);
+#endif
 }
 
+void ScriptedAnimationController::removeThrottlingReason(ThrottlingReason reason)
+{
+#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
+    if (!m_throttlingReasons.contains(reason))
+        return;
+
+    m_throttlingReasons.remove(reason);
+
+    RELEASE_LOG_IF_ALLOWED("removeThrottlingReason(%s) -> %s", throttlingReasonToString(reason), throttlingReasonsToString(m_throttlingReasons).utf8().data());
+
+    if (m_animationTimer.isActive()) {
+        m_animationTimer.stop();
+        scheduleAnimation();
+    }
+#else
+    UNUSED_PARAM(reason);
+#endif
+}
+
+bool ScriptedAnimationController::isThrottled() const
+{
+#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
+    return !m_throttlingReasons.isEmpty();
+#else
+    return false;
+#endif
+}
+
 ScriptedAnimationController::CallbackId ScriptedAnimationController::registerCallback(Ref<RequestAnimationFrameCallback>&& callback)
 {
-    CallbackId callbackId = ++m_nextCallbackId;
+    ScriptedAnimationController::CallbackId id = ++m_nextCallbackId;
     callback->m_firedOrCancelled = false;
-    callback->m_id = callbackId;
+    callback->m_id = id;
     m_callbacks.append(WTFMove(callback));
 
     if (m_document)
-        InspectorInstrumentation::didRequestAnimationFrame(*m_document, callbackId);
+        InspectorInstrumentation::didRequestAnimationFrame(*m_document, id);
 
     if (!m_suspendCount)
         scheduleAnimation();
-    return callbackId;
+    return id;
 }
 
-void ScriptedAnimationController::cancelCallback(CallbackId callbackId)
+void ScriptedAnimationController::cancelCallback(CallbackId id)
 {
-    bool cancelled = m_callbacks.removeFirstMatching([&](auto& callback) {
-        if (callback->m_id != callbackId)
-            return false;
-        callback->m_firedOrCancelled = true;
-        return true;
-    });
-
-    if (cancelled && m_document)
-        InspectorInstrumentation::didCancelAnimationFrame(*m_document, callbackId);
+    for (size_t i = 0; i < m_callbacks.size(); ++i) {
+        if (m_callbacks[i]->m_id == id) {
+            m_callbacks[i]->m_firedOrCancelled = true;
+            InspectorInstrumentation::didCancelAnimationFrame(*m_document, id);
+            m_callbacks.remove(i);
+            return;
+        }
+    }
 }
 
 void ScriptedAnimationController::serviceRequestAnimationFrameCallbacks(DOMHighResTimeStamp timestamp)
@@ -134,11 +194,6 @@
     if (!m_callbacks.size() || m_suspendCount || !requestAnimationFrameEnabled())
         return;
 
-    if (shouldRescheduleRequestAnimationFrame(timestamp)) {
-        scheduleAnimation();
-        return;
-    }
-    
     TraceScope tracingScope(RAFCallbackStart, RAFCallbackEnd);
 
     // We round this to the nearest microsecond so that we can return a time that matches what is returned by document.timeline.currentTime.
@@ -168,19 +223,72 @@
         return callback->m_firedOrCancelled;
     });
 
-    m_lastAnimationFrameTimestamp = timestamp;
-
     if (m_callbacks.size())
         scheduleAnimation();
 }
 
+Seconds ScriptedAnimationController::interval() const
+{
+#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
+    if (m_throttlingReasons.contains(ThrottlingReason::VisuallyIdle) || m_throttlingReasons.contains(ThrottlingReason::OutsideViewport))
+        return aggressiveThrottlingAnimationInterval;
+
+    if (m_throttlingReasons.contains(ThrottlingReason::LowPowerMode))
+        return halfSpeedThrottlingAnimationInterval;
+
+    if (m_throttlingReasons.contains(ThrottlingReason::NonInteractedCrossOriginFrame))
+        return halfSpeedThrottlingAnimationInterval;
+
+    ASSERT(m_throttlingReasons.isEmpty());
+#endif
+    return fullSpeedAnimationInterval;
+}
+
+Page* ScriptedAnimationController::page() const
+{
+    return m_document ? m_document->page() : nullptr;
+}
+
 void ScriptedAnimationController::scheduleAnimation()
 {
     if (!requestAnimationFrameEnabled())
         return;
 
-    if (auto* page = this->page())
-        page->renderingUpdateScheduler().scheduleTimedRenderingUpdate();
+#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
+    if (!m_isUsingTimer && !isThrottled()) {
+        if (auto* page = this->page()) {
+            page->renderingUpdateScheduler().scheduleTimedRenderingUpdate();
+            return;
+        }
+
+        m_isUsingTimer = true;
+    }
+#endif
+    if (m_animationTimer.isActive())
+        return;
+
+    Seconds animationInterval = interval();
+    Seconds scheduleDelay = std::max(animationInterval - Seconds(m_document->domWindow()->nowTimestamp() - m_lastAnimationFrameTimestamp), 0_s);
+
+    if (isThrottled()) {
+        // FIXME: not ideal to snapshot time both in now() and nowTimestamp(), the latter of which also has reduced resolution.
+        MonotonicTime now = MonotonicTime::now();
+
+        MonotonicTime fireTime = now + scheduleDelay;
+        Seconds alignmentInterval = 10_ms;
+        // Snap to the nearest alignmentInterval.
+        Seconds alignment = (fireTime + alignmentInterval / 2) % alignmentInterval;
+        MonotonicTime alignedFireTime = fireTime - alignment;
+        scheduleDelay = alignedFireTime - now;
+    }
+
+    m_animationTimer.startOneShot(scheduleDelay);
 }
 
+void ScriptedAnimationController::animationTimerFired()
+{
+    m_lastAnimationFrameTimestamp = m_document->domWindow()->nowTimestamp();
+    serviceRequestAnimationFrameCallbacks(m_lastAnimationFrameTimestamp);
 }
+
+}

Modified: trunk/Source/WebCore/dom/ScriptedAnimationController.h (256511 => 256512)


--- trunk/Source/WebCore/dom/ScriptedAnimationController.h	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebCore/dom/ScriptedAnimationController.h	2020-02-13 17:11:28 UTC (rev 256512)
@@ -1,6 +1,5 @@
 /*
  * Copyright (C) 2011 Google Inc. All Rights Reserved.
- * Copyright (C) 2019 Apple Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -26,13 +25,12 @@
 
 #pragma once
 
-#include "AnimationFrameRate.h"
 #include "DOMHighResTimeStamp.h"
+#include "Timer.h"
 #include <wtf/OptionSet.h>
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
 #include <wtf/Vector.h>
-#include <wtf/WeakPtr.h>
 
 namespace WebCore {
 
@@ -50,7 +48,6 @@
     ~ScriptedAnimationController();
     void clearDocumentPointer() { m_document = nullptr; }
     bool requestAnimationFrameEnabled() const;
-    WEBCORE_EXPORT Seconds interval() const;
 
     typedef int CallbackId;
 
@@ -60,29 +57,41 @@
 
     void suspend();
     void resume();
-    
-    void addThrottlingReason(ThrottlingReason reason) { m_throttlingReasons.add(reason); }
-    void removeThrottlingReason(ThrottlingReason reason) { m_throttlingReasons.remove(reason); }
+
+    enum class ThrottlingReason {
+        VisuallyIdle                    = 1 << 0,
+        OutsideViewport                 = 1 << 1,
+        LowPowerMode                    = 1 << 2,
+        NonInteractedCrossOriginFrame   = 1 << 3,
+    };
+    void addThrottlingReason(ThrottlingReason);
+    void removeThrottlingReason(ThrottlingReason);
+
     WEBCORE_EXPORT bool isThrottled() const;
+    WEBCORE_EXPORT Seconds interval() const;
 
 private:
     ScriptedAnimationController(Document&);
 
-    Page* page() const;
-    Seconds preferredScriptedAnimationInterval() const;
-    bool isThrottledRelativeToPage() const;
-    bool shouldRescheduleRequestAnimationFrame(DOMHighResTimeStamp) const;
     void scheduleAnimation();
+    void animationTimerFired();
 
-    using CallbackList = Vector<RefPtr<RequestAnimationFrameCallback>>;
+    Page* page() const;
+
+    typedef Vector<RefPtr<RequestAnimationFrameCallback>> CallbackList;
     CallbackList m_callbacks;
-    DOMHighResTimeStamp m_lastAnimationFrameTimestamp { 0 };
 
     WeakPtr<Document> m_document;
     CallbackId m_nextCallbackId { 0 };
     int m_suspendCount { 0 };
 
+    Timer m_animationTimer;
+    double m_lastAnimationFrameTimestamp { 0 };
+
+#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
     OptionSet<ThrottlingReason> m_throttlingReasons;
+    bool m_isUsingTimer { false };
+#endif
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/page/FrameView.cpp (256511 => 256512)


--- trunk/Source/WebCore/page/FrameView.cpp	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebCore/page/FrameView.cpp	2020-02-13 17:11:28 UTC (rev 256512)
@@ -2527,9 +2527,9 @@
 
     if (auto* scriptedAnimationController = document->scriptedAnimationController()) {
         if (shouldThrottle)
-            scriptedAnimationController->addThrottlingReason(ThrottlingReason::OutsideViewport);
+            scriptedAnimationController->addThrottlingReason(ScriptedAnimationController::ThrottlingReason::OutsideViewport);
         else
-            scriptedAnimationController->removeThrottlingReason(ThrottlingReason::OutsideViewport);
+            scriptedAnimationController->removeThrottlingReason(ScriptedAnimationController::ThrottlingReason::OutsideViewport);
     }
 
     document->setTimerThrottlingEnabled(shouldThrottle);

Modified: trunk/Source/WebCore/page/Page.cpp (256511 => 256512)


--- trunk/Source/WebCore/page/Page.cpp	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebCore/page/Page.cpp	2020-02-13 17:11:28 UTC (rev 256512)
@@ -22,7 +22,6 @@
 
 #include "ActivityStateChangeObserver.h"
 #include "AlternativeTextClient.h"
-#include "AnimationFrameRate.h"
 #include "ApplicationCacheStorage.h"
 #include "AuthenticatorCoordinator.h"
 #include "BackForwardCache.h"
@@ -335,9 +334,6 @@
             m_corsDisablingPatterns.uncheckedAppend(WTFMove(parsedPattern));
     }
     m_corsDisablingPatterns.shrinkToFit();
-    
-    if (m_lowPowerModeNotifier->isLowPowerModeEnabled())
-        m_throttlingReasons.add(ThrottlingReason::LowPowerMode);
 }
 
 Page::~Page()
@@ -1163,20 +1159,18 @@
     return !isUtilityPage() && nonUtilityPageCount == 1;
 }
 
-void Page::setLowPowerModeEnabledOverrideForTesting(Optional<bool> isEnabled)
+bool Page::isLowPowerModeEnabled() const
 {
-    // Remove ThrottlingReason::LowPowerMode so handleLowModePowerChange() can do its work.
-    m_throttlingReasonsOverridenForTesting.remove(ThrottlingReason::LowPowerMode);
+    if (m_lowPowerModeEnabledOverrideForTesting)
+        return m_lowPowerModeEnabledOverrideForTesting.value();
 
-    // Use the current low power mode value of the device.
-    if (!isEnabled) {
-        handleLowModePowerChange(m_lowPowerModeNotifier->isLowPowerModeEnabled());
-        return;
-    }
+    return m_lowPowerModeNotifier->isLowPowerModeEnabled();
+}
 
-    // Override the value and add ThrottlingReason::LowPowerMode so it won't change.
-    handleLowModePowerChange(isEnabled.value());
-    m_throttlingReasonsOverridenForTesting.add(ThrottlingReason::LowPowerMode);
+void Page::setLowPowerModeEnabledOverrideForTesting(Optional<bool> isEnabled)
+{
+    m_lowPowerModeEnabledOverrideForTesting = isEnabled;
+    handleLowModePowerChange(m_lowPowerModeEnabledOverrideForTesting.valueOr(false));
 }
 
 void Page::setTopContentInset(float contentInset)
@@ -1382,53 +1376,34 @@
     });
 }
 
-bool Page::renderingUpdateThrottlingEnabled() const
+enum class ThrottlingReasonOperation { Add, Remove };
+static void updateScriptedAnimationsThrottlingReason(Page& page, ThrottlingReasonOperation operation, ScriptedAnimationController::ThrottlingReason reason)
 {
-    return m_settings->renderingUpdateThrottlingEnabled();
+    page.forEachDocument([&] (Document& document) {
+        if (auto* controller = document.scriptedAnimationController()) {
+            if (operation == ThrottlingReasonOperation::Add)
+                controller->addThrottlingReason(reason);
+            else
+                controller->removeThrottlingReason(reason);
+        }
+    });
 }
 
-void Page::renderingUpdateThrottlingEnabledChanged()
-{
-    renderingUpdateScheduler().adjustRenderingUpdateFrequency();
-}
-
-bool Page::isRenderingUpdateThrottled() const
-{
-    return renderingUpdateThrottlingEnabled() && !m_throttlingReasons.isEmpty();
-}
-
-Seconds Page::preferredRenderingUpdateInterval() const
-{
-    return renderingUpdateThrottlingEnabled() ? preferredFrameInterval(m_throttlingReasons) : FullSpeedAnimationInterval;
-}
-
 void Page::setIsVisuallyIdleInternal(bool isVisuallyIdle)
 {
-    if (isVisuallyIdle == m_throttlingReasons.contains(ThrottlingReason::VisuallyIdle))
-        return;
-
-    m_throttlingReasons = m_throttlingReasons ^ ThrottlingReason::VisuallyIdle;
-
-    if (renderingUpdateThrottlingEnabled())
-        renderingUpdateScheduler().adjustRenderingUpdateFrequency();
+    updateScriptedAnimationsThrottlingReason(*this, isVisuallyIdle ? ThrottlingReasonOperation::Add : ThrottlingReasonOperation::Remove, ScriptedAnimationController::ThrottlingReason::VisuallyIdle);
 }
 
 void Page::handleLowModePowerChange(bool isLowPowerModeEnabled)
 {
-    if (!canUpdateThrottlingReason(ThrottlingReason::LowPowerMode))
-        return;
-
-    if (isLowPowerModeEnabled == m_throttlingReasons.contains(ThrottlingReason::LowPowerMode))
-        return;
-
-    m_throttlingReasons = m_throttlingReasons ^ ThrottlingReason::LowPowerMode;
-
-    if (renderingUpdateThrottlingEnabled())
-        renderingUpdateScheduler().adjustRenderingUpdateFrequency();
-
-    if (!RuntimeEnabledFeatures::sharedFeatures().webAnimationsCSSIntegrationEnabled())
+    updateScriptedAnimationsThrottlingReason(*this, isLowPowerModeEnabled ? ThrottlingReasonOperation::Add : ThrottlingReasonOperation::Remove, ScriptedAnimationController::ThrottlingReason::LowPowerMode);
+    if (RuntimeEnabledFeatures::sharedFeatures().webAnimationsCSSIntegrationEnabled()) {
+        forEachDocument([] (Document& document) {
+            if (auto timeline = document.existingTimeline())
+                timeline->updateThrottlingState();
+        });
+    } else
         mainFrame().animation().updateThrottlingState();
-
     updateDOMTimerAlignmentInterval();
 }
 

Modified: trunk/Source/WebCore/page/Page.h (256511 => 256512)


--- trunk/Source/WebCore/page/Page.h	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebCore/page/Page.h	2020-02-13 17:11:28 UTC (rev 256512)
@@ -21,7 +21,6 @@
 #pragma once
 
 #include "ActivityState.h"
-#include "AnimationFrameRate.h"
 #include "DisabledAdaptations.h"
 #include "Document.h"
 #include "FindOptions.h"
@@ -698,15 +697,9 @@
     bool isOnlyNonUtilityPage() const;
     bool isUtilityPage() const { return m_isUtilityPage; }
 
-    bool isLowPowerModeEnabled() const { return m_throttlingReasons.contains(ThrottlingReason::LowPowerMode); }
+    bool isLowPowerModeEnabled() const;
     WEBCORE_EXPORT void setLowPowerModeEnabledOverrideForTesting(Optional<bool>);
 
-    bool renderingUpdateThrottlingEnabled() const;
-    void renderingUpdateThrottlingEnabledChanged();
-    bool isRenderingUpdateThrottled() const;
-    Seconds preferredRenderingUpdateInterval() const;
-    bool canUpdateThrottlingReason(ThrottlingReason reason) const { return !m_throttlingReasonsOverridenForTesting.contains(reason); }
-
     WEBCORE_EXPORT void applicationWillResignActive();
     WEBCORE_EXPORT void applicationDidEnterBackground();
     WEBCORE_EXPORT void applicationWillEnterForeground();
@@ -970,6 +963,7 @@
 
     std::unique_ptr<PerformanceMonitor> m_performanceMonitor;
     std::unique_ptr<LowPowerModeNotifier> m_lowPowerModeNotifier;
+    Optional<bool> m_lowPowerModeEnabledOverrideForTesting;
 
     Optional<Navigation> m_navigationToLogWhenVisible;
 
@@ -1003,8 +997,6 @@
 #endif
 
     Vector<UserContentURLPattern> m_corsDisablingPatterns;
-    OptionSet<ThrottlingReason> m_throttlingReasons;
-    OptionSet<ThrottlingReason> m_throttlingReasonsOverridenForTesting;
 };
 
 inline PageGroup& Page::group()

Modified: trunk/Source/WebCore/page/RenderingUpdateScheduler.cpp (256511 => 256512)


--- trunk/Source/WebCore/page/RenderingUpdateScheduler.cpp	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebCore/page/RenderingUpdateScheduler.cpp	2020-02-13 17:11:28 UTC (rev 256512)
@@ -42,27 +42,6 @@
 #endif
 }
 
-#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) && PLATFORM(IOS_FAMILY)
-void RenderingUpdateScheduler::adjustFramesPerSecond()
-{
-    Seconds interval = m_page.preferredRenderingUpdateInterval();
-    // CADisplayLink.preferredFramesPerSecond is an integer. So a fraction PreferredFramesPerSecond can't be set.
-    if (interval < 1_s)
-        DisplayRefreshMonitorManager::sharedManager().setPreferredFramesPerSecond(*this, preferredFramesPerSecond(interval));
-}
-#endif
-
-void RenderingUpdateScheduler::adjustRenderingUpdateFrequency()
-{
-#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) && PLATFORM(IOS_FAMILY)
-    adjustFramesPerSecond();
-#endif
-    if (isScheduled()) {
-        clearScheduled();
-        scheduleTimedRenderingUpdate();
-    }
-}
-
 void RenderingUpdateScheduler::scheduleTimedRenderingUpdate()
 {
     if (isScheduled())
@@ -76,25 +55,12 @@
 
     tracePoint(ScheduleRenderingUpdate);
 
-    Seconds interval = m_page.preferredRenderingUpdateInterval();
-
 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
-    // CADisplayLink.preferredFramesPerSecond is an integer. Fall back to timer if the PreferredFramesPerSecond is a fraction.
-    if (interval < 1_s) {
-#if PLATFORM(IOS_FAMILY)
-        if (!m_isMonitorCreated) {
-            adjustFramesPerSecond();
-            m_isMonitorCreated = true;
-        }
-#else
-        if (interval == FullSpeedAnimationInterval)
+    if (!DisplayRefreshMonitorManager::sharedManager().scheduleAnimation(*this))
 #endif
-            m_scheduled = DisplayRefreshMonitorManager::sharedManager().scheduleAnimation(*this);
-    }
-#endif
+        startTimer(Seconds(1.0 / 60));
 
-    if (!isScheduled())
-        startTimer(interval);
+    m_scheduled = true;
 }
 
 bool RenderingUpdateScheduler::isScheduled() const
@@ -108,7 +74,6 @@
     ASSERT(!isScheduled());
     m_refreshTimer = makeUnique<Timer>(*this, &RenderingUpdateScheduler::displayRefreshFired);
     m_refreshTimer->startOneShot(delay);
-    m_scheduled = true;
 }
 
 void RenderingUpdateScheduler::clearScheduled()

Modified: trunk/Source/WebCore/page/RenderingUpdateScheduler.h (256511 => 256512)


--- trunk/Source/WebCore/page/RenderingUpdateScheduler.h	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebCore/page/RenderingUpdateScheduler.h	2020-02-13 17:11:28 UTC (rev 256512)
@@ -46,8 +46,6 @@
     }
 
     RenderingUpdateScheduler(Page&);
-    
-    void adjustRenderingUpdateFrequency();
     void scheduleTimedRenderingUpdate();
     void scheduleImmediateRenderingUpdate();
     void scheduleRenderingUpdate();
@@ -58,9 +56,6 @@
 
 private:
 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
-#if PLATFORM(IOS_FAMILY)
-    void adjustFramesPerSecond();
-#endif
     RefPtr<DisplayRefreshMonitor> createDisplayRefreshMonitor(PlatformDisplayID) const final;
     void displayRefreshFired() final;
 #else
@@ -72,9 +67,6 @@
     void clearScheduled();
 
     Page& m_page;
-#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) && PLATFORM(IOS_FAMILY)
-    bool m_isMonitorCreated;
-#endif
     bool m_scheduled { false };
     std::unique_ptr<Timer> m_refreshTimer;
 };

Modified: trunk/Source/WebCore/page/Settings.yaml (256511 => 256512)


--- trunk/Source/WebCore/page/Settings.yaml	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebCore/page/Settings.yaml	2020-02-13 17:11:28 UTC (rev 256512)
@@ -769,10 +769,6 @@
   initial: false
   onChange: hiddenPageCSSAnimationSuspensionEnabledChanged
 
-renderingUpdateThrottlingEnabled:
-  initial: true
-  onChange: renderingUpdateThrottlingEnabledChanged
-
 storageBlockingPolicy:
   type: SecurityOrigin::StorageBlockingPolicy
   initial: SecurityOrigin::AllowAllStorage

Modified: trunk/Source/WebCore/page/SettingsBase.cpp (256511 => 256512)


--- trunk/Source/WebCore/page/SettingsBase.cpp	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebCore/page/SettingsBase.cpp	2020-02-13 17:11:28 UTC (rev 256512)
@@ -407,12 +407,6 @@
         m_page->hiddenPageCSSAnimationSuspensionStateChanged();
 }
 
-void SettingsBase::renderingUpdateThrottlingEnabledChanged()
-{
-    if (m_page)
-        m_page->renderingUpdateThrottlingEnabledChanged();
-}
-
 void SettingsBase::resourceUsageOverlayVisibleChanged()
 {
 #if ENABLE(RESOURCE_USAGE)

Modified: trunk/Source/WebCore/page/SettingsBase.h (256511 => 256512)


--- trunk/Source/WebCore/page/SettingsBase.h	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebCore/page/SettingsBase.h	2020-02-13 17:11:28 UTC (rev 256512)
@@ -194,7 +194,6 @@
     void scrollingPerformanceLoggingEnabledChanged();
     void hiddenPageDOMTimerThrottlingStateChanged();
     void hiddenPageCSSAnimationSuspensionEnabledChanged();
-    void renderingUpdateThrottlingEnabledChanged();
     void resourceUsageOverlayVisibleChanged();
     void iceCandidateFilteringEnabledChanged();
 #if ENABLE(TEXT_AUTOSIZING)

Deleted: trunk/Source/WebCore/platform/graphics/AnimationFrameRate.h (256511 => 256512)


--- trunk/Source/WebCore/platform/graphics/AnimationFrameRate.h	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebCore/platform/graphics/AnimationFrameRate.h	2020-02-13 17:11:28 UTC (rev 256512)
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 2019 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include <wtf/OptionSet.h>
-#include <wtf/Seconds.h>
-
-namespace WebCore {
-
-using FramesPerSecond = unsigned;
-
-enum class ThrottlingReason {
-    VisuallyIdle                    = 1 << 0,
-    OutsideViewport                 = 1 << 1,
-    LowPowerMode                    = 1 << 2,
-    NonInteractedCrossOriginFrame   = 1 << 3,
-};
-
-// Allow a little more than 60fps to make sure we can at least hit that frame rate.
-constexpr const Seconds FullSpeedAnimationInterval { 15_ms };
-// Allow a little more than 30fps to make sure we can at least hit that frame rate.
-constexpr const Seconds HalfSpeedThrottlingAnimationInterval { 30_ms };
-constexpr const Seconds AggressiveThrottlingAnimationInterval { 10_s };
-
-constexpr const FramesPerSecond FullSpeedFramesPerSecond = 60;
-constexpr const FramesPerSecond HalfSpeedThrottlingFramesPerSecond = 30;
-constexpr const FramesPerSecond ZeroFramesPerSecond = 0;
-
-inline Seconds preferredFrameInterval(const OptionSet<ThrottlingReason>& throttlingReasons)
-{
-    if (throttlingReasons.containsAny({ ThrottlingReason::VisuallyIdle, ThrottlingReason::OutsideViewport }))
-        return AggressiveThrottlingAnimationInterval;
-
-    if (throttlingReasons.containsAny({ ThrottlingReason::LowPowerMode, ThrottlingReason::NonInteractedCrossOriginFrame }))
-        return HalfSpeedThrottlingAnimationInterval;
-
-    ASSERT(throttlingReasons.isEmpty());
-    return FullSpeedAnimationInterval;
-}
-
-inline FramesPerSecond preferredFramesPerSecond(Seconds preferredFrameInterval)
-{
-    if (preferredFrameInterval == FullSpeedAnimationInterval)
-        return FullSpeedFramesPerSecond;
-
-    if (preferredFrameInterval == HalfSpeedThrottlingAnimationInterval)
-        return HalfSpeedThrottlingFramesPerSecond;
-
-    ASSERT_NOT_REACHED();
-    return ZeroFramesPerSecond;
-}
-
-}

Modified: trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitor.h (256511 => 256512)


--- trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitor.h	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitor.h	2020-02-13 17:11:28 UTC (rev 256512)
@@ -27,7 +27,6 @@
 
 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
 
-#include "AnimationFrameRate.h"
 #include "PlatformScreen.h"
 #include <wtf/HashSet.h>
 #include <wtf/Lock.h>
@@ -46,8 +45,6 @@
 
     virtual void displayLinkFired() { }
 
-    virtual void setPreferredFramesPerSecond(FramesPerSecond) { }
-
     // Return true if callback request was scheduled, false if it couldn't be
     // (e.g., hardware refresh is not available)
     virtual bool requestRefreshCallback() = 0;

Modified: trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitorManager.cpp (256511 => 256512)


--- trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitorManager.cpp	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitorManager.cpp	2020-02-13 17:11:28 UTC (rev 256512)
@@ -42,11 +42,8 @@
     return manager.get();
 }
 
-DisplayRefreshMonitor* DisplayRefreshMonitorManager::monitorForClient(DisplayRefreshMonitorClient& client)
+DisplayRefreshMonitor* DisplayRefreshMonitorManager::createMonitorForClient(DisplayRefreshMonitorClient& client)
 {
-    if (!client.hasDisplayID())
-        return nullptr;
-
     PlatformDisplayID clientDisplayID = client.displayID();
     if (auto* existingMonitor = monitorForDisplayID(clientDisplayID)) {
         existingMonitor->addClient(client);
@@ -57,7 +54,7 @@
     if (!monitor)
         return nullptr;
 
-    LOG(RequestAnimationFrame, "DisplayRefreshMonitorManager::monitorForClient() - created monitor %p", monitor.get());
+    LOG(RequestAnimationFrame, "DisplayRefreshMonitorManager::createMonitorForClient() - created monitor %p", monitor.get());
     monitor->addClient(client);
     DisplayRefreshMonitor* result = monitor.get();
     m_monitors.append({ WTFMove(monitor) });
@@ -64,6 +61,14 @@
     return result;
 }
 
+void DisplayRefreshMonitorManager::registerClient(DisplayRefreshMonitorClient& client)
+{
+    if (!client.hasDisplayID())
+        return;
+
+    createMonitorForClient(client);
+}
+
 void DisplayRefreshMonitorManager::unregisterClient(DisplayRefreshMonitorClient& client)
 {
     if (!client.hasDisplayID())
@@ -80,19 +85,17 @@
     }
 }
 
-void DisplayRefreshMonitorManager::setPreferredFramesPerSecond(DisplayRefreshMonitorClient& client, FramesPerSecond preferredFramesPerSecond)
+bool DisplayRefreshMonitorManager::scheduleAnimation(DisplayRefreshMonitorClient& client)
 {
-    if (auto* monitor = monitorForClient(client))
-        monitor->setPreferredFramesPerSecond(preferredFramesPerSecond);
-}
+    if (!client.hasDisplayID())
+        return false;
 
-bool DisplayRefreshMonitorManager::scheduleAnimation(DisplayRefreshMonitorClient& client)
-{
-    if (auto* monitor = monitorForClient(client)) {
-        client.setIsScheduled(true);
-        return monitor->requestRefreshCallback();
-    }
-    return false;
+    DisplayRefreshMonitor* monitor = createMonitorForClient(client);
+    if (!monitor)
+        return false;
+
+    client.setIsScheduled(true);
+    return monitor->requestRefreshCallback();
 }
 
 void DisplayRefreshMonitorManager::displayDidRefresh(DisplayRefreshMonitor& monitor)
@@ -113,6 +116,7 @@
     
     unregisterClient(client);
     client.setDisplayID(displayID);
+    registerClient(client);
     if (client.isScheduled())
         scheduleAnimation(client);
 }

Modified: trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitorManager.h (256511 => 256512)


--- trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitorManager.h	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebCore/platform/graphics/DisplayRefreshMonitorManager.h	2020-02-13 17:11:28 UTC (rev 256512)
@@ -27,7 +27,6 @@
 
 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
 
-#include "AnimationFrameRate.h"
 #include "DisplayRefreshMonitor.h"
 #include "PlatformScreen.h"
 #include <wtf/NeverDestroyed.h>
@@ -38,28 +37,29 @@
 
 class DisplayRefreshMonitorManager {
     friend class NeverDestroyed<DisplayRefreshMonitorManager>;
-    friend class DisplayRefreshMonitor;
 public:
     WEBCORE_EXPORT static DisplayRefreshMonitorManager& sharedManager();
-
+    
+    void registerClient(DisplayRefreshMonitorClient&);
     void unregisterClient(DisplayRefreshMonitorClient&);
 
-    void setPreferredFramesPerSecond(DisplayRefreshMonitorClient&, FramesPerSecond);
     bool scheduleAnimation(DisplayRefreshMonitorClient&);
     void windowScreenDidChange(PlatformDisplayID, DisplayRefreshMonitorClient&);
 
     WEBCORE_EXPORT void displayWasUpdated(PlatformDisplayID);
-
+    
 private:
-    DisplayRefreshMonitorManager() = default;
+    friend class DisplayRefreshMonitor;
+    void displayDidRefresh(DisplayRefreshMonitor&);
+    
+    DisplayRefreshMonitorManager() { }
     virtual ~DisplayRefreshMonitorManager();
 
-    void displayDidRefresh(DisplayRefreshMonitor&);
-
     size_t findMonitorForDisplayID(PlatformDisplayID) const;
     DisplayRefreshMonitor* monitorForDisplayID(PlatformDisplayID) const;
-    DisplayRefreshMonitor* monitorForClient(DisplayRefreshMonitorClient&);
 
+    DisplayRefreshMonitor* createMonitorForClient(DisplayRefreshMonitorClient&);
+
     struct DisplayRefreshMonitorWrapper {
         DisplayRefreshMonitorWrapper(DisplayRefreshMonitorWrapper&&) = default;
         ~DisplayRefreshMonitorWrapper()

Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayerUpdater.cpp (256511 => 256512)


--- trunk/Source/WebCore/platform/graphics/GraphicsLayerUpdater.cpp	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayerUpdater.cpp	2020-02-13 17:11:28 UTC (rev 256512)
@@ -35,6 +35,7 @@
 GraphicsLayerUpdater::GraphicsLayerUpdater(GraphicsLayerUpdaterClient& client, PlatformDisplayID displayID)
     : m_client(client)
 {
+    DisplayRefreshMonitorManager::sharedManager().registerClient(*this);
     DisplayRefreshMonitorManager::sharedManager().windowScreenDidChange(displayID, *this);
     DisplayRefreshMonitorManager::sharedManager().scheduleAnimation(*this);
 }

Modified: trunk/Source/WebCore/platform/graphics/ios/DisplayRefreshMonitorIOS.mm (256511 => 256512)


--- trunk/Source/WebCore/platform/graphics/ios/DisplayRefreshMonitorIOS.mm	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebCore/platform/graphics/ios/DisplayRefreshMonitorIOS.mm	2020-02-13 17:11:28 UTC (rev 256512)
@@ -40,7 +40,6 @@
 }
 
 - (id)initWithMonitor:(DisplayRefreshMonitorIOS*)monitor;
-- (void)setPreferredFramesPerSecond:(NSInteger)preferredFramesPerSecond;
 - (void)handleDisplayLink:(CADisplayLink *)sender;
 - (void)invalidate;
 
@@ -66,11 +65,6 @@
     [super dealloc];
 }
 
-- (void)setPreferredFramesPerSecond:(NSInteger)preferredFramesPerSecond
-{
-    m_displayLink.preferredFramesPerSecond = preferredFramesPerSecond;
-}
-
 - (void)handleDisplayLink:(CADisplayLink *)sender
 {
     UNUSED_PARAM(sender);

Modified: trunk/Source/WebKit/ChangeLog (256511 => 256512)


--- trunk/Source/WebKit/ChangeLog	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebKit/ChangeLog	2020-02-13 17:11:28 UTC (rev 256512)
@@ -1,3 +1,26 @@
+2020-02-13  Said Abou-Hallawa  <s...@apple.com>
+
+        Unreviewed, rolling out r255158, 255405 and r255486
+
+        Caused test flakiness and PLT regression.
+
+        * Shared/WebPreferences.yaml:
+        * UIProcess/API/C/WKPreferences.cpp:
+        (WKPreferencesSetRenderingUpdateThrottlingEnabled): Deleted.
+        (WKPreferencesGetRenderingUpdateThrottlingEnabled): Deleted.
+        * UIProcess/API/C/WKPreferencesRefPrivate.h:
+        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
+        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.messages.in:
+        * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
+        (-[WKOneShotDisplayLinkHandler setPreferredFramesPerSecond:]): Deleted.
+        (WebKit::RemoteLayerTreeDrawingAreaProxy::setPreferredFramesPerSecond): Deleted.
+        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.h:
+        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm:
+        (WebKit::RemoteLayerTreeDisplayRefreshMonitor::setPreferredFramesPerSecond): Deleted.
+        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
+        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
+        (WebKit::RemoteLayerTreeDrawingArea::setPreferredFramesPerSecond): Deleted.
+
 2020-02-12  Ryan Haddad  <ryanhad...@apple.com>
 
         Unreviewed, rolling out r256010.

Modified: trunk/Source/WebKit/Shared/WebPreferences.yaml (256511 => 256512)


--- trunk/Source/WebKit/Shared/WebPreferences.yaml	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebKit/Shared/WebPreferences.yaml	2020-02-13 17:11:28 UTC (rev 256512)
@@ -496,10 +496,6 @@
   type: bool
   defaultValue: DEFAULT_HIDDEN_PAGE_CSS_ANIMATION_SUSPENSION_ENABLED
 
-RenderingUpdateThrottlingEnabled:
-  type: bool
-  defaultValue: true
-
 LowPowerVideoAudioBufferSizeEnabled:
   type: bool
   defaultValue: true

Modified: trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp (256511 => 256512)


--- trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp	2020-02-13 17:11:28 UTC (rev 256512)
@@ -1319,16 +1319,6 @@
     return toImpl(preferencesRef)->hiddenPageCSSAnimationSuspensionEnabled();
 }
 
-void WKPreferencesSetRenderingUpdateThrottlingEnabled(WKPreferencesRef preferencesRef, bool enabled)
-{
-    toImpl(preferencesRef)->setRenderingUpdateThrottlingEnabled(enabled);
-}
-
-bool WKPreferencesGetRenderingUpdateThrottlingEnabled(WKPreferencesRef preferencesRef)
-{
-    return toImpl(preferencesRef)->renderingUpdateThrottlingEnabled();
-}
-
 void WKPreferencesSetIncrementalRenderingSuppressionTimeout(WKPreferencesRef preferencesRef, double timeout)
 {
     toImpl(preferencesRef)->setIncrementalRenderingSuppressionTimeout(timeout);

Modified: trunk/Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h (256511 => 256512)


--- trunk/Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h	2020-02-13 17:11:28 UTC (rev 256512)
@@ -306,10 +306,6 @@
 WK_EXPORT void WKPreferencesSetHiddenPageCSSAnimationSuspensionEnabled(WKPreferencesRef preferences, bool enabled);
 WK_EXPORT bool WKPreferencesGetHiddenPageCSSAnimationSuspensionEnabled(WKPreferencesRef preferences);
 
-// Defaults to true.
-WK_EXPORT void WKPreferencesSetRenderingUpdateThrottlingEnabled(WKPreferencesRef preferences, bool enabled);
-WK_EXPORT bool WKPreferencesGetRenderingUpdateThrottlingEnabled(WKPreferencesRef preferences);
-
 // Defaults to false
 WK_EXPORT void WKPreferencesSetSnapshotAllPlugIns(WKPreferencesRef preferencesRef, bool enabled);
 WK_EXPORT bool WKPreferencesGetSnapshotAllPlugIns(WKPreferencesRef preferencesRef);

Modified: trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h (256511 => 256512)


--- trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h	2020-02-13 17:11:28 UTC (rev 256512)
@@ -28,7 +28,6 @@
 #include "DrawingAreaProxy.h"
 #include "RemoteLayerTreeHost.h"
 #include "TransactionID.h"
-#include <WebCore/AnimationFrameRate.h>
 #include <WebCore/FloatPoint.h>
 #include <WebCore/IntPoint.h>
 #include <WebCore/IntSize.h>
@@ -98,7 +97,6 @@
     void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
 
     // Message handlers
-    void setPreferredFramesPerSecond(WebCore::FramesPerSecond);
     void willCommitLayerTree(TransactionID);
     void commitLayerTree(const RemoteLayerTreeTransaction&, const RemoteScrollingCoordinatorTransaction&);
     

Modified: trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.messages.in (256511 => 256512)


--- trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.messages.in	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.messages.in	2020-02-13 17:11:28 UTC (rev 256512)
@@ -21,7 +21,6 @@
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 messages -> RemoteLayerTreeDrawingAreaProxy : DrawingAreaProxy NotRefCounted {
-    void SetPreferredFramesPerSecond(unsigned preferredFramesPerSecond)
     void WillCommitLayerTree(WebKit::TransactionID transactionID)
     void CommitLayerTree(WebKit::RemoteLayerTreeTransaction layerTreeTransaction, WebKit::RemoteScrollingCoordinatorTransaction scrollingTreeTransaction)
 }

Modified: trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm (256511 => 256512)


--- trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm	2020-02-13 17:11:28 UTC (rev 256512)
@@ -49,7 +49,6 @@
 }
 
 - (id)initWithDrawingAreaProxy:(WebKit::RemoteLayerTreeDrawingAreaProxy*)drawingAreaProxy;
-- (void)setPreferredFramesPerSecond:(NSInteger)preferredFramesPerSecond;
 - (void)displayLinkFired:(CADisplayLink *)sender;
 - (void)invalidate;
 - (void)schedule;
@@ -77,11 +76,6 @@
     [super dealloc];
 }
 
-- (void)setPreferredFramesPerSecond:(NSInteger)preferredFramesPerSecond
-{
-    _displayLink.preferredFramesPerSecond = preferredFramesPerSecond;
-}
-
 - (void)displayLinkFired:(CADisplayLink *)sender
 {
     ASSERT(isUIThread());
@@ -189,15 +183,6 @@
     m_isWaitingForDidUpdateGeometry = true;
 }
 
-void RemoteLayerTreeDrawingAreaProxy::setPreferredFramesPerSecond(FramesPerSecond preferredFramesPerSecond)
-{
-#if PLATFORM(IOS_FAMILY)
-    [displayLinkHandler() setPreferredFramesPerSecond:preferredFramesPerSecond];
-#else
-    UNUSED_PARAM(preferredFramesPerSecond);
-#endif
-}
-
 void RemoteLayerTreeDrawingAreaProxy::willCommitLayerTree(TransactionID transactionID)
 {
     m_pendingLayerTreeTransactionID = transactionID;

Modified: trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.h (256511 => 256512)


--- trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.h	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.h	2020-02-13 17:11:28 UTC (rev 256512)
@@ -28,7 +28,6 @@
 #if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
 
 #include "RemoteLayerTreeDrawingArea.h"
-#include <WebCore/AnimationFrameRate.h>
 #include <WebCore/DisplayRefreshMonitor.h>
 
 namespace WebKit {
@@ -42,7 +41,6 @@
     
     virtual ~RemoteLayerTreeDisplayRefreshMonitor();
 
-    void setPreferredFramesPerSecond(WebCore::FramesPerSecond) override;
     bool requestRefreshCallback() override;
 
     void didUpdateLayers();

Modified: trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm (256511 => 256512)


--- trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm	2020-02-13 17:11:28 UTC (rev 256512)
@@ -43,12 +43,6 @@
         m_drawingArea->willDestroyDisplayRefreshMonitor(this);
 }
 
-void RemoteLayerTreeDisplayRefreshMonitor::setPreferredFramesPerSecond(FramesPerSecond preferredFramesPerSecond)
-{
-    if (m_drawingArea)
-        m_drawingArea->setPreferredFramesPerSecond(preferredFramesPerSecond);
-}
-
 bool RemoteLayerTreeDisplayRefreshMonitor::requestRefreshCallback()
 {
     if (!m_drawingArea || !isActive())

Modified: trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h (256511 => 256512)


--- trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h	2020-02-13 17:11:28 UTC (rev 256512)
@@ -29,7 +29,6 @@
 #include "DrawingArea.h"
 #include "GraphicsLayerCARemote.h"
 #include "RemoteLayerTreeTransaction.h"
-#include <WebCore/AnimationFrameRate.h>
 #include <WebCore/GraphicsLayerClient.h>
 #include <WebCore/Timer.h>
 #include <atomic>
@@ -74,7 +73,6 @@
 
     RefPtr<WebCore::DisplayRefreshMonitor> createDisplayRefreshMonitor(WebCore::PlatformDisplayID) override;
     void willDestroyDisplayRefreshMonitor(WebCore::DisplayRefreshMonitor*);
-    void setPreferredFramesPerSecond(WebCore::FramesPerSecond);
 
     bool shouldUseTiledBackingForFrameView(const WebCore::FrameView&) const override;
 

Modified: trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm (256511 => 256512)


--- trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm	2020-02-13 17:11:28 UTC (rev 256512)
@@ -123,11 +123,6 @@
     }
 }
 
-void RemoteLayerTreeDrawingArea::setPreferredFramesPerSecond(FramesPerSecond preferredFramesPerSecond)
-{
-    send(Messages::RemoteLayerTreeDrawingAreaProxy::SetPreferredFramesPerSecond(preferredFramesPerSecond));
-}
-
 void RemoteLayerTreeDrawingArea::updateRootLayers()
 {
     Vector<Ref<GraphicsLayer>> children;

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (256511 => 256512)


--- trunk/Source/WebKitLegacy/mac/ChangeLog	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2020-02-13 17:11:28 UTC (rev 256512)
@@ -1,3 +1,18 @@
+2020-02-13  Said Abou-Hallawa  <s...@apple.com>
+
+        Unreviewed, rolling out r255158, 255405 and r255486
+
+        Caused test flakiness and PLT regression.
+
+        * WebView/WebPreferenceKeysPrivate.h:
+        * WebView/WebPreferences.mm:
+        (+[WebPreferences initialize]):
+        (-[WebPreferences renderingUpdateThrottlingEnabled]): Deleted.
+        (-[WebPreferences setRenderingUpdateThrottlingEnabled:]): Deleted.
+        * WebView/WebPreferencesPrivate.h:
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChanged:]):
+
 2020-02-12  Truitt Savell  <tsav...@apple.com>
 
         Unreviewed, rolling out r256463.

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h (256511 => 256512)


--- trunk/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h	2020-02-13 17:11:28 UTC (rev 256512)
@@ -166,7 +166,6 @@
 #define WebKitPlugInSnapshottingEnabledPreferenceKey @"WebKitPlugInSnapshottingEnabled"
 #define WebKitHiddenPageDOMTimerThrottlingEnabledPreferenceKey @"WebKitHiddenPageDOMTimerThrottlingEnabled"
 #define WebKitHiddenPageCSSAnimationSuspensionEnabledPreferenceKey @"WebKitHiddenPageCSSAnimationSuspensionEnabled"
-#define WebKitRenderingUpdateThrottlingEnabledPreferenceKey @"WebKitRenderingUpdateThrottlingEnabled"
 #define WebKitLowPowerVideoAudioBufferSizeEnabledPreferenceKey @"WebKitLowPowerVideoAudioBufferSizeEnabled"
 #define WebKitUseLegacyTextAlignPositionedElementBehaviorPreferenceKey @"WebKitUseLegacyTextAlignPositionedElementBehavior"
 #define WebKitMediaSourceEnabledPreferenceKey @"WebKitMediaSourceEnabled"

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm (256511 => 256512)


--- trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebPreferences.mm	2020-02-13 17:11:28 UTC (rev 256512)
@@ -594,7 +594,6 @@
         [NSNumber numberWithLongLong:ApplicationCacheStorage::noQuota()], WebKitApplicationCacheDefaultOriginQuota,
         @NO, WebKitHiddenPageDOMTimerThrottlingEnabledPreferenceKey,
         @YES, WebKitHiddenPageCSSAnimationSuspensionEnabledPreferenceKey,
-        @YES, WebKitRenderingUpdateThrottlingEnabledPreferenceKey,
         @NO, WebKitLowPowerVideoAudioBufferSizeEnabledPreferenceKey,
         
         @NO, WebKitUseLegacyTextAlignPositionedElementBehaviorPreferenceKey,
@@ -2797,16 +2796,6 @@
     [self _setBoolValue:enabled forKey:WebKitHiddenPageCSSAnimationSuspensionEnabledPreferenceKey];
 }
 
-- (BOOL)renderingUpdateThrottlingEnabled
-{
-    return [self _boolValueForKey:WebKitRenderingUpdateThrottlingEnabledPreferenceKey];
-}
-
-- (void)setRenderingUpdateThrottlingEnabled:(BOOL)enabled
-{
-    [self _setBoolValue:enabled forKey:WebKitRenderingUpdateThrottlingEnabledPreferenceKey];
-}
-
 - (BOOL)lowPowerVideoAudioBufferSizeEnabled
 {
     return [self _boolValueForKey:WebKitLowPowerVideoAudioBufferSizeEnabledPreferenceKey];

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h (256511 => 256512)


--- trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h	2020-02-13 17:11:28 UTC (rev 256512)
@@ -492,9 +492,6 @@
 - (BOOL)hiddenPageCSSAnimationSuspensionEnabled;
 - (void)setHiddenPageCSSAnimationSuspensionEnabled:(BOOL)flag;
 
-- (BOOL)renderingUpdateThrottlingEnabled;
-- (void)setRenderingUpdateThrottlingEnabled:(BOOL)flag;
-
 - (BOOL)lowPowerVideoAudioBufferSizeEnabled;
 - (void)setLowPowerVideoAudioBufferSizeEnabled:(BOOL)enabled;
 

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebView.mm (256511 => 256512)


--- trunk/Source/WebKitLegacy/mac/WebView/WebView.mm	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebView.mm	2020-02-13 17:11:28 UTC (rev 256512)
@@ -3128,8 +3128,8 @@
     RuntimeEnabledFeatures::sharedFeatures().setAdClickAttributionEnabled([preferences adClickAttributionEnabled]);
 
     settings.setHiddenPageDOMTimerThrottlingEnabled([preferences hiddenPageDOMTimerThrottlingEnabled]);
+
     settings.setHiddenPageCSSAnimationSuspensionEnabled([preferences hiddenPageCSSAnimationSuspensionEnabled]);
-    settings.setRenderingUpdateThrottlingEnabled([preferences renderingUpdateThrottlingEnabled]);
 
     WebCore::DeprecatedGlobalSettings::setResourceLoadStatisticsEnabled([preferences resourceLoadStatisticsEnabled]);
 

Modified: trunk/Source/WebKitLegacy/win/ChangeLog (256511 => 256512)


--- trunk/Source/WebKitLegacy/win/ChangeLog	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebKitLegacy/win/ChangeLog	2020-02-13 17:11:28 UTC (rev 256512)
@@ -1,3 +1,19 @@
+2020-02-13  Said Abou-Hallawa  <s...@apple.com>
+
+        Unreviewed, rolling out r255158, 255405 and r255486
+
+        Caused test flakiness and PLT regression.
+
+        * Interfaces/IWebPreferencesPrivate.idl:
+        * WebPreferenceKeysPrivate.h:
+        * WebPreferences.cpp:
+        (WebPreferences::initializeDefaultSettings):
+        (WebPreferences::renderingUpdateThrottlingEnabled): Deleted.
+        (WebPreferences::setRenderingUpdateThrottlingEnabled): Deleted.
+        * WebPreferences.h:
+        * WebView.cpp:
+        (WebView::notifyPreferencesChanged):
+
 2020-02-12  Truitt Savell  <tsav...@apple.com>
 
         Unreviewed, rolling out r256463.

Modified: trunk/Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl (256511 => 256512)


--- trunk/Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebKitLegacy/win/Interfaces/IWebPreferencesPrivate.idl	2020-02-13 17:11:28 UTC (rev 256512)
@@ -258,8 +258,6 @@
     HRESULT setAspectRatioOfImgFromWidthAndHeightEnabled([in] BOOL enabled);
     HRESULT setWebSQLEnabled([in] BOOL enabled);
     HRESULT webSQLEnabled([out, retval] BOOL* enabled);
-    HRESULT setRenderingUpdateThrottlingEnabled([in] BOOL enabled);
-    HRESULT renderingUpdateThrottlingEnabled([out, retval] BOOL* enabled);
 }
 
 [uuid(04D4AAE1-5D01-4CCD-B46E-C022F10A6826)]

Modified: trunk/Source/WebKitLegacy/win/WebPreferenceKeysPrivate.h (256511 => 256512)


--- trunk/Source/WebKitLegacy/win/WebPreferenceKeysPrivate.h	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebKitLegacy/win/WebPreferenceKeysPrivate.h	2020-02-13 17:11:28 UTC (rev 256512)
@@ -227,7 +227,3 @@
 #define WebKitAspectRatioOfImgFromWidthAndHeightEnabledPreferenceKey "WebKitAspectRatioOfImgFromWidthAndHeightEnabled"
 
 #define WebKitWebSQLEnabledPreferenceKey "WebKitWebSQLEnabled"
-
-#define WebKitRenderingUpdateThrottlingEnabledPreferenceKey "WebKitRenderingUpdateThrottlingEnabled"
-
-#define WebKitRenderingUpdateThrottlingEnabledPreferenceKey "WebKitRenderingUpdateThrottlingEnabled"

Modified: trunk/Source/WebKitLegacy/win/WebPreferences.cpp (256511 => 256512)


--- trunk/Source/WebKitLegacy/win/WebPreferences.cpp	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebKitLegacy/win/WebPreferences.cpp	2020-02-13 17:11:28 UTC (rev 256512)
@@ -354,8 +354,6 @@
 
     CFDictionaryAddValue(defaults, CFSTR(WebKitWebSQLEnabledPreferenceKey), kCFBooleanFalse);
 
-    CFDictionaryAddValue(defaults, CFSTR(WebKitRenderingUpdateThrottlingEnabledPreferenceKey), kCFBooleanTrue);
-
     defaultSettings = defaults;
 #endif
 }
@@ -2472,20 +2470,6 @@
     return S_OK;
 }
 
-HRESULT WebPreferences::renderingUpdateThrottlingEnabled(_Out_ BOOL* enabled)
-{
-    if (!enabled)
-        return E_POINTER;
-    *enabled = boolValueForKey(WebKitRenderingUpdateThrottlingEnabledPreferenceKey);
-    return S_OK;
-}
-
-HRESULT WebPreferences::setRenderingUpdateThrottlingEnabled(BOOL enabled)
-{
-    setBoolValue(WebKitRenderingUpdateThrottlingEnabledPreferenceKey, enabled);
-    return S_OK;
-}
-
 HRESULT WebPreferences::allowTopNavigationToDataURLs(_Out_ BOOL* allowAccess)
 {
     if (!allowAccess)

Modified: trunk/Source/WebKitLegacy/win/WebPreferences.h (256511 => 256512)


--- trunk/Source/WebKitLegacy/win/WebPreferences.h	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebKitLegacy/win/WebPreferences.h	2020-02-13 17:11:28 UTC (rev 256512)
@@ -303,8 +303,6 @@
     virtual HRESULT STDMETHODCALLTYPE setAspectRatioOfImgFromWidthAndHeightEnabled(BOOL);
     virtual HRESULT STDMETHODCALLTYPE webSQLEnabled(_Out_ BOOL*);
     virtual HRESULT STDMETHODCALLTYPE setWebSQLEnabled(BOOL);
-    virtual HRESULT STDMETHODCALLTYPE renderingUpdateThrottlingEnabled(_Out_ BOOL*);
-    virtual HRESULT STDMETHODCALLTYPE setRenderingUpdateThrottlingEnabled(BOOL);
 
     // IWebPreferencesPrivate8
     virtual HRESULT STDMETHODCALLTYPE allowTopNavigationToDataURLs(_Out_ BOOL*);

Modified: trunk/Source/WebKitLegacy/win/WebView.cpp (256511 => 256512)


--- trunk/Source/WebKitLegacy/win/WebView.cpp	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Source/WebKitLegacy/win/WebView.cpp	2020-02-13 17:11:28 UTC (rev 256512)
@@ -5615,11 +5615,6 @@
         return hr;
     settings.setRequestAnimationFrameEnabled(enabled);
 
-    hr = prefsPrivate->renderingUpdateThrottlingEnabled(&enabled);
-    if (FAILED(hr))
-        return hr;
-    settings.setRenderingUpdateThrottlingEnabled(enabled);
-
     hr = prefsPrivate->mockScrollbarsEnabled(&enabled);
     if (FAILED(hr))
         return hr;

Modified: trunk/Tools/ChangeLog (256511 => 256512)


--- trunk/Tools/ChangeLog	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Tools/ChangeLog	2020-02-13 17:11:28 UTC (rev 256512)
@@ -1,3 +1,16 @@
+2020-02-13  Said Abou-Hallawa  <s...@apple.com>
+
+        Unreviewed, rolling out r255158, 255405 and r255486
+
+        Caused test flakiness and PLT regression.
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (resetWebPreferencesToConsistentValues):
+        * DumpRenderTree/win/DumpRenderTree.cpp:
+        (enableExperimentalFeatures):
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::resetPreferencesToConsistentValues):
+
 2020-02-12  Jonathan Bedard  <jbed...@apple.com>
 
         run-_javascript_core-tests: Allow insecure requests on upload

Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm (256511 => 256512)


--- trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm	2020-02-13 17:11:28 UTC (rev 256512)
@@ -995,7 +995,6 @@
 
     [preferences setHiddenPageDOMTimerThrottlingEnabled:NO];
     [preferences setHiddenPageCSSAnimationSuspensionEnabled:NO];
-    [preferences setRenderingUpdateThrottlingEnabled:NO];
     [preferences setRemotePlaybackEnabled:YES];
 
     [preferences setMediaDevicesEnabled:YES];

Modified: trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp (256511 => 256512)


--- trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Tools/DumpRenderTree/win/DumpRenderTree.cpp	2020-02-13 17:11:28 UTC (rev 256512)
@@ -801,7 +801,6 @@
     prefsPrivate->setWebAnimationsMutableTimelinesEnabled(TRUE);
     prefsPrivate->setServerTimingEnabled(TRUE);
     prefsPrivate->setAspectRatioOfImgFromWidthAndHeightEnabled(TRUE);
-    prefsPrivate->setRenderingUpdateThrottlingEnabled(FALSE);
     // FIXME: WebGL2
     // FIXME: WebRTC
 }

Modified: trunk/Tools/WebKitTestRunner/TestController.cpp (256511 => 256512)


--- trunk/Tools/WebKitTestRunner/TestController.cpp	2020-02-13 17:08:46 UTC (rev 256511)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp	2020-02-13 17:11:28 UTC (rev 256512)
@@ -908,7 +908,6 @@
 
     WKPreferencesSetHiddenPageDOMTimerThrottlingEnabled(preferences, false);
     WKPreferencesSetHiddenPageCSSAnimationSuspensionEnabled(preferences, false);
-    WKPreferencesSetRenderingUpdateThrottlingEnabled(preferences, false);
 
     WKPreferencesSetAcceleratedDrawingEnabled(preferences, m_shouldUseAcceleratedDrawing || options.useAcceleratedDrawing);
     // FIXME: We should be testing the default.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to