Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(931)

Unified Diff: Source/core/dom/ScriptedAnimationController.cpp

Issue 337883003: Call media query change listeners asynchronously. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: tests fixed Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/dom/ScriptedAnimationController.cpp
diff --git a/Source/core/dom/ScriptedAnimationController.cpp b/Source/core/dom/ScriptedAnimationController.cpp
index 3f5f9b9e41023d58b8ec291289ac85009afd492b..41a2dc7d31427d7836964b5632c67b9fd7e1db49 100644
--- a/Source/core/dom/ScriptedAnimationController.cpp
+++ b/Source/core/dom/ScriptedAnimationController.cpp
@@ -26,6 +26,7 @@
#include "config.h"
#include "core/dom/ScriptedAnimationController.h"
+#include "core/css/MediaQueryMatcher.h"
#include "core/dom/Document.h"
#include "core/dom/RequestAnimationFrameCallback.h"
#include "core/events/Event.h"
@@ -171,7 +172,7 @@ void ScriptedAnimationController::executeCallbacks(double monotonicTimeNow)
void ScriptedAnimationController::serviceScriptedAnimations(double monotonicTimeNow)
{
- if (!m_callbacks.size() && !m_eventQueue.size())
+ if (!m_callbacks.size() && !m_eventQueue.size() && !m_document->mediaQueryMatcher().hasDelayedListeners())
return;
if (m_suspendCount)
@@ -179,6 +180,7 @@ void ScriptedAnimationController::serviceScriptedAnimations(double monotonicTime
RefPtrWillBeRawPtr<ScriptedAnimationController> protect(this);
+ m_document->mediaQueryMatcher().notifyDelayedListeners();
dispatchEvents();
executeCallbacks(monotonicTimeNow);
@@ -207,7 +209,7 @@ void ScriptedAnimationController::scheduleAnimationIfNeeded()
if (m_suspendCount)
return;
- if (!m_callbacks.size() && !m_eventQueue.size())
+ if (!m_callbacks.size() && !m_eventQueue.size() && !m_document->mediaQueryMatcher().hasDelayedListeners())
esprehn 2014/07/01 00:01:06 ScriptedAnimationController should not be reaching
cbiesinger 2014/07/01 00:12:09 So, what should I do instead?
return;
if (FrameView* frameView = m_document->view())
« Source/core/dom/Document.h ('K') | « Source/core/dom/ScriptedAnimationController.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698