diff options
Diffstat (limited to 'Source/WebCore/dom/WebKitAnimationEvent.h')
-rw-r--r-- | Source/WebCore/dom/WebKitAnimationEvent.h | 41 |
1 files changed, 16 insertions, 25 deletions
diff --git a/Source/WebCore/dom/WebKitAnimationEvent.h b/Source/WebCore/dom/WebKitAnimationEvent.h index 9f3c5b3fb..5506b6197 100644 --- a/Source/WebCore/dom/WebKitAnimationEvent.h +++ b/Source/WebCore/dom/WebKitAnimationEvent.h @@ -10,10 +10,10 @@ * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR @@ -23,33 +23,27 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef WebKitAnimationEvent_h -#define WebKitAnimationEvent_h +#pragma once #include "Event.h" namespace WebCore { -struct WebKitAnimationEventInit : public EventInit { - WebKitAnimationEventInit(); - - String animationName; - double elapsedTime; -}; - -class WebKitAnimationEvent : public Event { +class WebKitAnimationEvent final : public Event { public: - static PassRefPtr<WebKitAnimationEvent> create() - { - return adoptRef(new WebKitAnimationEvent); - } - static PassRefPtr<WebKitAnimationEvent> create(const AtomicString& type, const String& animationName, double elapsedTime) + static Ref<WebKitAnimationEvent> create(const AtomicString& type, const String& animationName, double elapsedTime) { - return adoptRef(new WebKitAnimationEvent(type, animationName, elapsedTime)); + return adoptRef(*new WebKitAnimationEvent(type, animationName, elapsedTime)); } - static PassRefPtr<WebKitAnimationEvent> create(const AtomicString& type, const WebKitAnimationEventInit& initializer) + + struct Init : EventInit { + String animationName; + double elapsedTime { 0.0 }; + }; + + static Ref<WebKitAnimationEvent> create(const AtomicString& type, const Init& initializer, IsTrusted isTrusted = IsTrusted::No) { - return adoptRef(new WebKitAnimationEvent(type, initializer)); + return adoptRef(*new WebKitAnimationEvent(type, initializer, isTrusted)); } virtual ~WebKitAnimationEvent(); @@ -57,17 +51,14 @@ public: const String& animationName() const; double elapsedTime() const; - virtual EventInterface eventInterface() const override; + EventInterface eventInterface() const override; private: - WebKitAnimationEvent(); WebKitAnimationEvent(const AtomicString& type, const String& animationName, double elapsedTime); - WebKitAnimationEvent(const AtomicString&, const WebKitAnimationEventInit&); + WebKitAnimationEvent(const AtomicString&, const Init&, IsTrusted); String m_animationName; double m_elapsedTime; }; } // namespace WebCore - -#endif // WebKitAnimationEvent_h |