Title: [218214] trunk/Source/WebCore
- Revision
- 218214
- Author
- [email protected]
- Date
- 2017-06-13 15:23:09 -0700 (Tue, 13 Jun 2017)
Log Message
Add logging for layout tests when rAF callbacks get suspended and resumed
https://bugs.webkit.org/show_bug.cgi?id=173326
Patch by Antoine Quint <[email protected]> on 2017-06-13
Reviewed by Simon Fraser.
In order to help diagnose webkit.org/b/168409 we log the ScriptedAnimationController
suspend count when it changes and log the backtrace so that we may understand why it
fails to be set back to 0 when some modern-media-controls tests run.
* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::suspend):
(WebCore::ScriptedAnimationController::resume):
(WebCore::ScriptedAnimationController::logSuspendCount):
* dom/ScriptedAnimationController.h:
* page/Settings.in:
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::resetToConsistentState):
(WebCore::InternalSettings::shouldLogScritedAnimationControllerSuspensionChange):
(WebCore::InternalSettings::setShouldLogScritedAnimationControllerSuspensionChange):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (218213 => 218214)
--- trunk/Source/WebCore/ChangeLog 2017-06-13 22:21:11 UTC (rev 218213)
+++ trunk/Source/WebCore/ChangeLog 2017-06-13 22:23:09 UTC (rev 218214)
@@ -1,3 +1,27 @@
+2017-06-13 Antoine Quint <[email protected]>
+
+ Add logging for layout tests when rAF callbacks get suspended and resumed
+ https://bugs.webkit.org/show_bug.cgi?id=173326
+
+ Reviewed by Simon Fraser.
+
+ In order to help diagnose webkit.org/b/168409 we log the ScriptedAnimationController
+ suspend count when it changes and log the backtrace so that we may understand why it
+ fails to be set back to 0 when some modern-media-controls tests run.
+
+ * dom/ScriptedAnimationController.cpp:
+ (WebCore::ScriptedAnimationController::suspend):
+ (WebCore::ScriptedAnimationController::resume):
+ (WebCore::ScriptedAnimationController::logSuspendCount):
+ * dom/ScriptedAnimationController.h:
+ * page/Settings.in:
+ * testing/InternalSettings.cpp:
+ (WebCore::InternalSettings::resetToConsistentState):
+ (WebCore::InternalSettings::shouldLogScritedAnimationControllerSuspensionChange):
+ (WebCore::InternalSettings::setShouldLogScritedAnimationControllerSuspensionChange):
+ * testing/InternalSettings.h:
+ * testing/InternalSettings.idl:
+
2017-06-13 Jer Noble <[email protected]>
Crash when MSE backed media element changes src/srcObject during PiP
Modified: trunk/Source/WebCore/dom/ScriptedAnimationController.cpp (218213 => 218214)
--- trunk/Source/WebCore/dom/ScriptedAnimationController.cpp 2017-06-13 22:21:11 UTC (rev 218213)
+++ trunk/Source/WebCore/dom/ScriptedAnimationController.cpp 2017-06-13 22:23:09 UTC (rev 218214)
@@ -73,6 +73,7 @@
void ScriptedAnimationController::suspend()
{
++m_suspendCount;
+ logSuspendCount();
}
void ScriptedAnimationController::resume()
@@ -82,10 +83,23 @@
if (m_suspendCount > 0)
--m_suspendCount;
+ logSuspendCount();
+
if (!m_suspendCount && m_callbacks.size())
scheduleAnimation();
}
+void ScriptedAnimationController::logSuspendCount()
+{
+#if defined NDEBUG
+ if (!m_document || !m_document->frame() || !m_document->frame()->settings().shouldLogScritedAnimationControllerSuspensionChange())
+ return;
+
+ WTFLogAlways("ScriptedAnimationController::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 (218213 => 218214)
--- trunk/Source/WebCore/dom/ScriptedAnimationController.h 2017-06-13 22:21:11 UTC (rev 218213)
+++ trunk/Source/WebCore/dom/ScriptedAnimationController.h 2017-06-13 22:23:09 UTC (rev 218214)
@@ -93,6 +93,7 @@
Document* m_document;
CallbackId m_nextCallbackId { 0 };
int m_suspendCount { 0 };
+ void logSuspendCount();
void scheduleAnimation();
void animationTimerFired();
Modified: trunk/Source/WebCore/page/Settings.in (218213 => 218214)
--- trunk/Source/WebCore/page/Settings.in 2017-06-13 22:21:11 UTC (rev 218213)
+++ trunk/Source/WebCore/page/Settings.in 2017-06-13 22:23:09 UTC (rev 218214)
@@ -277,6 +277,8 @@
inputEventsEnabled initial=true
+shouldLogScritedAnimationControllerSuspensionChange initial=true
+
quickTimePluginReplacementEnabled initial=defaultQuickTimePluginReplacementEnabled
youTubeFlashPluginReplacementEnabled initial=defaultYouTubeFlashPluginReplacementEnabled
Modified: trunk/Source/WebCore/testing/InternalSettings.cpp (218213 => 218214)
--- trunk/Source/WebCore/testing/InternalSettings.cpp 2017-06-13 22:21:11 UTC (rev 218213)
+++ trunk/Source/WebCore/testing/InternalSettings.cpp 2017-06-13 22:23:09 UTC (rev 218214)
@@ -265,6 +265,8 @@
m_page->mainFrame().setPageAndTextZoomFactors(1, 1);
m_page->setCanStartMedia(true);
+ settings().setShouldLogScritedAnimationControllerSuspensionChange(true);
+
settings().setForcePendingWebGLPolicy(false);
#if ENABLE(WIRELESS_PLAYBACK_TARGET)
settings().setAllowsAirPlayForMediaPlayback(false);
@@ -730,6 +732,16 @@
#endif
}
+bool InternalSettings::shouldLogScritedAnimationControllerSuspensionChange()
+{
+ return settings().shouldLogScritedAnimationControllerSuspensionChange();
+}
+
+void InternalSettings::setShouldLogScritedAnimationControllerSuspensionChange(bool shouldLogScritedAnimationControllerSuspensionChange)
+{
+ settings().setShouldLogScritedAnimationControllerSuspensionChange(shouldLogScritedAnimationControllerSuspensionChange);
+}
+
ExceptionOr<String> InternalSettings::userInterfaceDirectionPolicy()
{
if (!m_page)
Modified: trunk/Source/WebCore/testing/InternalSettings.h (218213 => 218214)
--- trunk/Source/WebCore/testing/InternalSettings.h 2017-06-13 22:21:11 UTC (rev 218213)
+++ trunk/Source/WebCore/testing/InternalSettings.h 2017-06-13 22:23:09 UTC (rev 218214)
@@ -111,6 +111,9 @@
ForcedAccessibilityValue forcedPrefersReducedMotionAccessibilityValue() const;
void setForcedPrefersReducedMotionAccessibilityValue(ForcedAccessibilityValue);
+ bool shouldLogScritedAnimationControllerSuspensionChange();
+ void setShouldLogScritedAnimationControllerSuspensionChange(bool);
+
// RuntimeEnabledFeatures.
static void setIndexedDBWorkersEnabled(bool);
static void setCSSGridLayoutEnabled(bool);
Modified: trunk/Source/WebCore/testing/InternalSettings.idl (218213 => 218214)
--- trunk/Source/WebCore/testing/InternalSettings.idl 2017-06-13 22:21:11 UTC (rev 218213)
+++ trunk/Source/WebCore/testing/InternalSettings.idl 2017-06-13 22:23:09 UTC (rev 218214)
@@ -95,7 +95,10 @@
[MayThrowException] boolean deferredCSSParserEnabled();
[MayThrowException] void setDeferredCSSParserEnabled(boolean enabled);
-
+
+ boolean shouldLogScritedAnimationControllerSuspensionChange();
+ void setShouldLogScritedAnimationControllerSuspensionChange(boolean shouldLogScritedAnimationControllerSuspensionChange);
+
[MayThrowException] void setShouldMockBoldSystemFontForAccessibility(boolean shouldMock);
attribute ForcedAccessibilityValue forcedColorsAreInvertedAccessibilityValue;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes