Diff
Modified: trunk/Source/WebCore/ChangeLog (218729 => 218730)
--- trunk/Source/WebCore/ChangeLog 2017-06-23 00:22:45 UTC (rev 218729)
+++ trunk/Source/WebCore/ChangeLog 2017-06-23 01:13:21 UTC (rev 218730)
@@ -1,3 +1,24 @@
+2017-06-22 Antoine Quint <[email protected]>
+
+ Log when scripted animations get suspended and resumed
+ https://bugs.webkit.org/show_bug.cgi?id=173751
+
+ Reviewed by Dean Jackson.
+
+ More work toward understanding why rAF callbacks are not serviced on bots (webkit.org/b/173628).
+
+ * dom/Document.cpp:
+ (WebCore::Document::requestAnimationFrame):
+ * dom/ScriptedAnimationController.cpp:
+ (WebCore::ScriptedAnimationController::suspend):
+ (WebCore::ScriptedAnimationController::resume):
+ (WebCore::ScriptedAnimationController::logSuspendCount): Deleted.
+ * dom/ScriptedAnimationController.h:
+ * page/Page.cpp:
+ (WebCore::Page::suspendScriptedAnimations):
+ (WebCore::Page::resumeScriptedAnimations):
+ (WebCore::Page::setIsVisibleInternal):
+
2017-06-22 Zalan Bujtas <[email protected]>
REGRESSION(r214712): Infinite recursion in RenderTable::layout in paginated mode
Modified: trunk/Source/WebCore/dom/Document.cpp (218729 => 218730)
--- trunk/Source/WebCore/dom/Document.cpp 2017-06-23 00:22:45 UTC (rev 218729)
+++ trunk/Source/WebCore/dom/Document.cpp 2017-06-23 01:13:21 UTC (rev 218730)
@@ -145,6 +145,7 @@
#include "RenderView.h"
#include "RenderWidget.h"
#include "RequestAnimationFrameCallback.h"
+#include "RuntimeApplicationChecks.h"
#include "RuntimeEnabledFeatures.h"
#include "SVGDocumentExtensions.h"
#include "SVGElement.h"
@@ -6236,6 +6237,15 @@
// It's possible that the Page may have suspended scripted animations before
// we were created. We need to make sure that we don't start up the animation
// controller on a background tab, for example.
+
+#if PLATFORM(MAC)
+ if (MacApplication::isDumpRenderTree()) {
+ WTFLogAlways("\nDocument::requestAnimationFrame called on %p, page = %p", this, page());
+ if (page())
+ WTFLogAlways("page()->scriptedAnimationsSuspended() = %s", page()->scriptedAnimationsSuspended() ? "true" : "false");
+ }
+#endif
+
if (!page() || page()->scriptedAnimationsSuspended())
m_scriptedAnimationController->suspend();
Modified: trunk/Source/WebCore/dom/ScriptedAnimationController.cpp (218729 => 218730)
--- trunk/Source/WebCore/dom/ScriptedAnimationController.cpp 2017-06-23 00:22:45 UTC (rev 218729)
+++ trunk/Source/WebCore/dom/ScriptedAnimationController.cpp 2017-06-23 01:13:21 UTC (rev 218730)
@@ -76,7 +76,13 @@
void ScriptedAnimationController::suspend()
{
++m_suspendCount;
- logSuspendCount();
+
+#if PLATFORM(MAC)
+ if (MacApplication::isDumpRenderTree()) {
+ WTFLogAlways("\nScriptedAnimationController::suspend() called on %p, m_suspendCount = %d, document = %p", this, m_suspendCount, &m_document);
+ WTFReportBacktrace();
+ }
+#endif
}
void ScriptedAnimationController::resume()
@@ -86,23 +92,18 @@
if (m_suspendCount > 0)
--m_suspendCount;
- logSuspendCount();
+#if PLATFORM(MAC)
+ if (MacApplication::isDumpRenderTree()) {
+ WTFLogAlways("\nScriptedAnimationController::resume() called on %p, m_suspendCount = %d, document = %p", this, m_suspendCount, &m_document);
+ WTFLogAlways("Document = %p", &m_document);
+ WTFReportBacktrace();
+ }
+#endif
if (!m_suspendCount && m_callbacks.size())
scheduleAnimation();
}
-void ScriptedAnimationController::logSuspendCount()
-{
-#if PLATFORM(MAC)
- if (!MacApplication::isDumpRenderTree())
- return;
-
- WTFLogAlways("\nScriptedAnimationController::m_suspendCount = %d", m_suspendCount);
- WTFReportBacktrace();
-#endif
-}
-
#if USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) && !RELEASE_LOG_DISABLED
static const char* throttlingReasonToString(ScriptedAnimationController::ThrottlingReason reason)
Modified: trunk/Source/WebCore/dom/ScriptedAnimationController.h (218729 => 218730)
--- trunk/Source/WebCore/dom/ScriptedAnimationController.h 2017-06-23 00:22:45 UTC (rev 218729)
+++ trunk/Source/WebCore/dom/ScriptedAnimationController.h 2017-06-23 01:13:21 UTC (rev 218730)
@@ -88,7 +88,6 @@
Document* m_document;
CallbackId m_nextCallbackId { 0 };
int m_suspendCount { 0 };
- void logSuspendCount();
void scheduleAnimation();
void animationTimerFired();
Modified: trunk/Source/WebCore/page/Page.cpp (218729 => 218730)
--- trunk/Source/WebCore/page/Page.cpp 2017-06-23 00:22:45 UTC (rev 218729)
+++ trunk/Source/WebCore/page/Page.cpp 2017-06-23 01:13:21 UTC (rev 218730)
@@ -1152,7 +1152,7 @@
{
#if PLATFORM(MAC)
if (MacApplication::isDumpRenderTree()) {
- WTFLogAlways("\nPage::suspendScriptedAnimations()");
+ WTFLogAlways("\nPage::suspendScriptedAnimations() %p", this);
WTFReportBacktrace();
}
#endif
@@ -1168,7 +1168,7 @@
{
#if PLATFORM(MAC)
if (MacApplication::isDumpRenderTree()) {
- WTFLogAlways("\nPage::resumeScriptedAnimations()");
+ WTFLogAlways("\nPage::resumeScriptedAnimations() %p", this);
WTFReportBacktrace();
}
#endif
@@ -1689,6 +1689,10 @@
if (isVisible) {
m_isPrerender = false;
+#if PLATFORM(MAC)
+ if (MacApplication::isDumpRenderTree())
+ WTFLogAlways("\nPage::setIsVisibleInternal(%s), %p", isVisible ? "true" : "false", this);
+#endif
resumeScriptedAnimations();
#if PLATFORM(IOS)
resumeDeviceMotionAndOrientationUpdates();
@@ -1726,6 +1730,11 @@
#if PLATFORM(IOS)
suspendDeviceMotionAndOrientationUpdates();
#endif
+
+#if PLATFORM(MAC)
+ if (MacApplication::isDumpRenderTree())
+ WTFLogAlways("\nPage::setIsVisibleInternal(%s), %p", isVisible ? "true" : "false", this);
+#endif
suspendScriptedAnimations();
if (FrameView* view = mainFrame().view())