Changeset 252007 in webkit


Ignore:
Timestamp:
Nov 4, 2019 12:36:17 PM (5 years ago)
Author:
Chris Dumez
Message:

Port WebAnimation to the HTML5 event loop
https://bugs.webkit.org/show_bug.cgi?id=203797

Reviewed by Ryosuke Niwa.

  • animation/WebAnimation.cpp:

(WebCore::WebAnimation::WebAnimation):
(WebCore::WebAnimation::enqueueAnimationPlaybackEvent):
(WebCore::WebAnimation::stop):
(WebCore::WebAnimation::hasPendingActivity const):

  • animation/WebAnimation.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r252003 r252007  
     12019-11-04  Chris Dumez  <cdumez@apple.com>
     2
     3        Port WebAnimation to the HTML5 event loop
     4        https://bugs.webkit.org/show_bug.cgi?id=203797
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        * animation/WebAnimation.cpp:
     9        (WebCore::WebAnimation::WebAnimation):
     10        (WebCore::WebAnimation::enqueueAnimationPlaybackEvent):
     11        (WebCore::WebAnimation::stop):
     12        (WebCore::WebAnimation::hasPendingActivity const):
     13        * animation/WebAnimation.h:
     14
    1152019-11-04  Chris Dumez  <cdumez@apple.com>
    216
  • trunk/Source/WebCore/animation/WebAnimation.cpp

    r251959 r252007  
    2727#include "WebAnimation.h"
    2828
     29#include "AbstractEventLoop.h"
    2930#include "AnimationEffect.h"
    3031#include "AnimationPlaybackEvent.h"
     
    6970    , m_readyPromise(makeUniqueRef<ReadyPromise>(*this, &WebAnimation::readyPromiseResolve))
    7071    , m_finishedPromise(makeUniqueRef<FinishedPromise>(*this, &WebAnimation::finishedPromiseResolve))
    71     , m_taskQueue(SuspendableTaskQueue::create(document))
    7272{
    7373    m_readyPromise->resolve(*this);
     
    627627    } else {
    628628        // Otherwise, queue a task to dispatch event at animation. The task source for this task is the DOM manipulation task source.
    629         m_taskQueue->enqueueTask([this, event = WTFMove(event)] {
    630             dispatchEvent(event);
    631         });
     629        queueTaskToDispatchEvent(*this, TaskSource::DOMManipulation, WTFMove(event));
    632630    }
    633631}
     
    11821180void WebAnimation::stop()
    11831181{
    1184     m_taskQueue->cancelAllTasks();
    11851182    ActiveDOMObject::stop();
    11861183    removeAllEventListeners();
     
    11901187{
    11911188    // Keep the JS wrapper alive if the animation is considered relevant or could become relevant again by virtue of having a timeline.
    1192     return m_timeline || m_isRelevant || m_taskQueue->hasPendingTasks() || ActiveDOMObject::hasPendingActivity();
     1189    return m_timeline || m_isRelevant || ActiveDOMObject::hasPendingActivity();
    11931190}
    11941191
  • trunk/Source/WebCore/animation/WebAnimation.h

    r251959 r252007  
    3030#include "ExceptionOr.h"
    3131#include "IDLTypes.h"
    32 #include "SuspendableTaskQueue.h"
    3332#include "WebAnimationUtilities.h"
    3433#include <wtf/Markable.h>
     
    180179    UniqueRef<ReadyPromise> m_readyPromise;
    181180    UniqueRef<FinishedPromise> m_finishedPromise;
    182     UniqueRef<SuspendableTaskQueue> m_taskQueue;
    183181    Markable<Seconds, Seconds::MarkableTraits> m_previousCurrentTime;
    184182    Markable<Seconds, Seconds::MarkableTraits> m_startTime;
Note: See TracChangeset for help on using the changeset viewer.