Add logging to identify when the Page suspends scripted animations
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Jun 2017 18:37:02 +0000 (18:37 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Jun 2017 18:37:02 +0000 (18:37 +0000)
commit9d6f482e03efb6c3e2a020545f7687011f52bf2d
tree2ae98bda57aa21a8d35453da117afd09ddd1c2b8
parentc58991c14d8f6da9c8f558dadb3f63e77a1538cf
Add logging to identify when the Page suspends scripted animations
https://bugs.webkit.org/show_bug.cgi?id=173626

Patch by Antoine Quint <graouts@apple.com> on 2017-06-21
Reviewed by Tim Horton.

Source/WebCore:

We have a longstanding issue that some media/modern-media-controls tests time out due to
requestAnimationFrame callbacks not being serviced, which is tracked by webkit.org/b/173628.
We added some logging to identify when ScriptedAnimationController would get suspended in
webkit.org/b/173326. This logging points to the fact that the reason rAF callbacks aren't
serviced is because Document::requestAnimationFrame() suspends rAF when the page reports
that scripted animations ought to be suspended, which is true when m_scriptedAnimationsSuspended
is true. This patch adds logging that tracks when this flag is set, provided a new setting
shouldLogScriptedAnimationControllerSuspensionChange is true.

* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::logSuspendCount):
* page/Page.cpp:
(WebCore::Page::suspendScriptedAnimations):
(WebCore::Page::resumeScriptedAnimations):
* page/Settings.in:

Source/WebKit/mac:

Add a new preference to control the new shouldLogScriptedAnimationControllerSuspensionChange settings
through WebKit. This is specific to WK1 since the issue we're trying to pinpoint only occurs on WK1 bots.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences shouldLogScriptedAnimationControllerSuspensionChange]):
(-[WebPreferences setShouldLogScriptedAnimationControllerSuspensionChange:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Tools:

Turn the new logging on for WK1/DRT since the issue we're trying to pinpoint only occurs on WK1 bots.

* DumpRenderTree/mac/DumpRenderTree.mm:
(resetWebPreferencesToConsistentValues):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@218640 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/dom/ScriptedAnimationController.cpp
Source/WebCore/page/Page.cpp
Source/WebCore/page/Settings.in
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
Source/WebKit/mac/WebView/WebPreferences.mm
Source/WebKit/mac/WebView/WebPreferencesPrivate.h
Source/WebKit/mac/WebView/WebView.mm
Tools/ChangeLog
Tools/DumpRenderTree/mac/DumpRenderTree.mm