DeclarativeAnimation should suspend, resume, & stop m_eventQueue
authorgraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Jul 2018 17:08:44 +0000 (17:08 +0000)
committergraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Jul 2018 17:08:44 +0000 (17:08 +0000)
https://bugs.webkit.org/show_bug.cgi?id=187216
<rdar://problem/41669739>

Reviewed by Ryosuke Niwa.

Suspend, resume and close the GenericEventQueue for DeclarativeAnimation as instructed through the DOMActiveObject protocol.

* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::stop):
(WebCore::DeclarativeAnimation::suspend):
(WebCore::DeclarativeAnimation::resume):
* animation/DeclarativeAnimation.h:
* animation/WebAnimation.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234049 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/animation/DeclarativeAnimation.cpp
Source/WebCore/animation/DeclarativeAnimation.h
Source/WebCore/animation/WebAnimation.h

index 34b1dfc..556c499 100644 (file)
@@ -1,3 +1,20 @@
+2018-07-20  Antoine Quint  <graouts@apple.com>
+
+        DeclarativeAnimation should suspend, resume, & stop m_eventQueue
+        https://bugs.webkit.org/show_bug.cgi?id=187216
+        <rdar://problem/41669739>
+
+        Reviewed by Ryosuke Niwa.
+
+        Suspend, resume and close the GenericEventQueue for DeclarativeAnimation as instructed through the DOMActiveObject protocol.
+
+        * animation/DeclarativeAnimation.cpp:
+        (WebCore::DeclarativeAnimation::stop):
+        (WebCore::DeclarativeAnimation::suspend):
+        (WebCore::DeclarativeAnimation::resume):
+        * animation/DeclarativeAnimation.h:
+        * animation/WebAnimation.h:
+
 2018-07-20  Zalan Bujtas  <zalan@apple.com>
 
         [LFC][Inline formatting context] Add basic text content handling.
index b32b478..8a74b8a 100644 (file)
@@ -208,4 +208,22 @@ void DeclarativeAnimation::enqueueDOMEvent(const AtomicString& eventType, Second
         m_eventQueue.enqueueEvent(TransitionEvent::create(eventType, downcast<CSSTransition>(this)->transitionProperty(), time, PseudoElement::pseudoElementNameForEvents(m_target.pseudoId())));
 }
 
+void DeclarativeAnimation::stop()
+{
+    m_eventQueue.close();
+    WebAnimation::stop();
+}
+
+void DeclarativeAnimation::suspend(ReasonForSuspension reason)
+{
+    m_eventQueue.suspend();
+    WebAnimation::suspend(reason);
+}
+
+void DeclarativeAnimation::resume()
+{
+    m_eventQueue.resume();
+    WebAnimation::resume();
+}
+
 } // namespace WebCore
index ce14e51..d28dadb 100644 (file)
@@ -60,6 +60,11 @@ private:
     void enqueueDOMEvent(const AtomicString&, Seconds);
     void remove() final;
 
+    // ActiveDOMObject.
+    void suspend(ReasonForSuspension) final;
+    void resume() final;
+    void stop() final;
+
     Element& m_target;
     Ref<Animation> m_backingAnimation;
     bool m_wasPending { false };
index d0578e8..9b83f39 100644 (file)
@@ -129,6 +129,7 @@ protected:
     explicit WebAnimation(Document&);
 
     bool isEffectInvalidationSuspended() { return m_suspendCount; }
+    void stop() override;
 
 private:
     enum class DidSeek { Yes, No };
@@ -180,7 +181,6 @@ private:
     // ActiveDOMObject.
     const char* activeDOMObjectName() const final;
     bool canSuspendForDocumentSuspension() const final;
-    void stop() final;
 
     // EventTarget
     EventTargetInterface eventTargetInterface() const final { return WebAnimationEventTargetInterfaceType; }