Title: [229327] trunk/Source/WebCore
Revision
229327
Author
grao...@webkit.org
Date
2018-03-06 10:34:22 -0800 (Tue, 06 Mar 2018)

Log Message

[Web Animations] Add a new CSSAnimation subclass of WebAnimation
https://bugs.webkit.org/show_bug.cgi?id=183371
<rdar://problem/38181724>

Reviewed by Dean Jackson.

Adding a new CSSAnimation subclass which we will create in a later patch while resolving styles
upon identifying that a new CSS Animation has been added to an element.

* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* animation/CSSAnimation.cpp: Added.
(WebCore::CSSAnimation::create):
(WebCore::CSSAnimation::CSSAnimation):
* animation/CSSAnimation.h: Added.
* animation/CSSAnimation.idl: Added.
* animation/KeyframeEffectReadOnly.cpp
* animation/WebAnimation.h:
(WebCore::WebAnimation::isCSSAnimation const):
* animation/WebAnimation.idl:
* bindings/js/JSWebAnimationCustom.cpp:
(WebCore::toJSNewlyCreated):
(WebCore::toJS):
* bindings/js/WebCoreBuiltinNames.h:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/CMakeLists.txt (229326 => 229327)


--- trunk/Source/WebCore/CMakeLists.txt	2018-03-06 18:02:33 UTC (rev 229326)
+++ trunk/Source/WebCore/CMakeLists.txt	2018-03-06 18:34:22 UTC (rev 229327)
@@ -449,6 +449,7 @@
     animation/AnimationPlaybackEvent.idl
     animation/AnimationPlaybackEventInit.idl
     animation/AnimationTimeline.idl
+    animation/CSSAnimation.idl
     animation/CompositeOperation.idl
     animation/ComputedTimingProperties.idl
     animation/DocumentTimeline.idl

Modified: trunk/Source/WebCore/ChangeLog (229326 => 229327)


--- trunk/Source/WebCore/ChangeLog	2018-03-06 18:02:33 UTC (rev 229326)
+++ trunk/Source/WebCore/ChangeLog	2018-03-06 18:34:22 UTC (rev 229327)
@@ -1,3 +1,32 @@
+2018-03-06  Antoine Quint  <grao...@apple.com>
+
+        [Web Animations] Add a new CSSAnimation subclass of WebAnimation
+        https://bugs.webkit.org/show_bug.cgi?id=183371
+        <rdar://problem/38181724>
+
+        Reviewed by Dean Jackson.
+
+        Adding a new CSSAnimation subclass which we will create in a later patch while resolving styles
+        upon identifying that a new CSS Animation has been added to an element.
+
+        * CMakeLists.txt:
+        * DerivedSources.make:
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * animation/CSSAnimation.cpp: Added.
+        (WebCore::CSSAnimation::create):
+        (WebCore::CSSAnimation::CSSAnimation):
+        * animation/CSSAnimation.h: Added.
+        * animation/CSSAnimation.idl: Added.
+        * animation/KeyframeEffectReadOnly.cpp
+        * animation/WebAnimation.h:
+        (WebCore::WebAnimation::isCSSAnimation const):
+        * animation/WebAnimation.idl:
+        * bindings/js/JSWebAnimationCustom.cpp:
+        (WebCore::toJSNewlyCreated):
+        (WebCore::toJS):
+        * bindings/js/WebCoreBuiltinNames.h:
+
 2018-03-06  Ms2ger  <ms2...@igalia.com>
 
         Explicitly qualify some method calls on this in lambdas in Service Worker code.

Modified: trunk/Source/WebCore/DerivedSources.make (229326 => 229327)


--- trunk/Source/WebCore/DerivedSources.make	2018-03-06 18:02:33 UTC (rev 229326)
+++ trunk/Source/WebCore/DerivedSources.make	2018-03-06 18:34:22 UTC (rev 229327)
@@ -371,6 +371,7 @@
     $(WebCore)/animation/AnimationTimeline.idl \
     $(WebCore)/animation/CompositeOperation.idl \
     $(WebCore)/animation/ComputedTimingProperties.idl \
+    $(WebCore)/animation/CSSAnimation.idl \
     $(WebCore)/animation/DocumentTimeline.idl \
     $(WebCore)/animation/FillMode.idl \
     $(WebCore)/animation/IterationCompositeOperation.idl \

Modified: trunk/Source/WebCore/Sources.txt (229326 => 229327)


--- trunk/Source/WebCore/Sources.txt	2018-03-06 18:02:33 UTC (rev 229326)
+++ trunk/Source/WebCore/Sources.txt	2018-03-06 18:34:22 UTC (rev 229327)
@@ -336,6 +336,7 @@
 animation/AnimationEffectTimingReadOnly.cpp
 animation/AnimationPlaybackEvent.cpp
 animation/AnimationTimeline.cpp
+animation/CSSAnimation.cpp
 animation/DocumentTimeline.cpp
 animation/KeyframeEffect.cpp
 animation/KeyframeEffectReadOnly.cpp
@@ -2436,6 +2437,7 @@
 JSCryptoKeyUsage.cpp
 JSCryptoRsaHashedKeyAlgorithm.cpp
 JSCryptoRsaKeyAlgorithm.cpp
+JSCSSAnimation.cpp
 JSCustomElementRegistry.cpp
 JSCustomEvent.cpp
 JSDocumentTimeline.cpp

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (229326 => 229327)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2018-03-06 18:02:33 UTC (rev 229326)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2018-03-06 18:34:22 UTC (rev 229327)
@@ -1987,6 +1987,8 @@
 		71556CBE1F9F0A4900E78D08 /* JSKeyframeEffect.h in Headers */ = {isa = PBXBuildFile; fileRef = 71556CB71F9F09FC00E78D08 /* JSKeyframeEffect.h */; };
 		71A1B6081DEE5AD70073BCFB /* modern-media-controls-localized-strings.js in Resources */ = {isa = PBXBuildFile; fileRef = 71A1B6061DEE5A820073BCFB /* modern-media-controls-localized-strings.js */; };
 		71A57DF2154BE25C0009D120 /* SVGPathUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 71A57DF0154BE25C0009D120 /* SVGPathUtilities.h */; };
+		71B28427203CEC4C0036AA5D /* JSCSSAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 71B28426203CEC0D0036AA5D /* JSCSSAnimation.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		71C29E32203CE781008F36D2 /* CSSAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 71C29E30203CE76B008F36D2 /* CSSAnimation.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		71C916081D1483A300ACA47D /* UserInterfaceLayoutDirection.h in Headers */ = {isa = PBXBuildFile; fileRef = 71C916071D1483A300ACA47D /* UserInterfaceLayoutDirection.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		71DCB7021568197600862271 /* JSSVGZoomAndPan.h in Headers */ = {isa = PBXBuildFile; fileRef = 71DCB7001568197600862271 /* JSSVGZoomAndPan.h */; };
 		71E2183A17359FB8006E6E4D /* PlugInsResources.h in Headers */ = {isa = PBXBuildFile; fileRef = 71E2183817359FB8006E6E4D /* PlugInsResources.h */; };
@@ -8978,6 +8980,11 @@
 		71A57DEF154BE25C0009D120 /* SVGPathUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPathUtilities.cpp; sourceTree = "<group>"; };
 		71A57DF0154BE25C0009D120 /* SVGPathUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathUtilities.h; sourceTree = "<group>"; };
 		71B0460A1DD3C2EE00EE19CF /* status-support.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode._javascript_; path = "status-support.js"; sourceTree = "<group>"; };
+		71B28424203CEC0B0036AA5D /* JSCSSAnimation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCSSAnimation.cpp; sourceTree = "<group>"; };
+		71B28426203CEC0D0036AA5D /* JSCSSAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCSSAnimation.h; sourceTree = "<group>"; };
+		71C29E2E203CE76B008F36D2 /* CSSAnimation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSAnimation.cpp; sourceTree = "<group>"; };
+		71C29E30203CE76B008F36D2 /* CSSAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSAnimation.h; sourceTree = "<group>"; };
+		71C29E31203CE76C008F36D2 /* CSSAnimation.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CSSAnimation.idl; sourceTree = "<group>"; };
 		71C5BB1B1FB611EA0007A2AE /* Animatable.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Animatable.idl; sourceTree = "<group>"; };
 		71C916071D1483A300ACA47D /* UserInterfaceLayoutDirection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserInterfaceLayoutDirection.h; sourceTree = "<group>"; };
 		71CC7A1F152A0BFE009EEAF9 /* SVGAnimatedEnumeration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedEnumeration.cpp; sourceTree = "<group>"; };
@@ -15526,6 +15533,8 @@
 				71247E2E1FEA5F66008C08CE /* JSCompositeOperation.h */,
 				7116E2CD1FED765200C06FDE /* JSComputedTimingProperties.cpp */,
 				7116E2CE1FED765200C06FDE /* JSComputedTimingProperties.h */,
+				71B28424203CEC0B0036AA5D /* JSCSSAnimation.cpp */,
+				71B28426203CEC0D0036AA5D /* JSCSSAnimation.h */,
 				71025EDB1F99F1A8004A250C /* JSDocumentTimeline.cpp */,
 				71025EDC1F99F1A8004A250C /* JSDocumentTimeline.h */,
 				712BE4841FE867C2002031CC /* JSFillMode.cpp */,
@@ -19196,6 +19205,9 @@
 				71247E361FEA5F81008C08CE /* CompositeOperation.idl */,
 				7116E2CB1FED75D100C06FDE /* ComputedTimingProperties.h */,
 				7116E2C91FED75D000C06FDE /* ComputedTimingProperties.idl */,
+				71C29E2E203CE76B008F36D2 /* CSSAnimation.cpp */,
+				71C29E30203CE76B008F36D2 /* CSSAnimation.h */,
+				71C29E31203CE76C008F36D2 /* CSSAnimation.idl */,
 				713171321FBE78C500F758DE /* CSSPropertyBlendingClient.h */,
 				71025EC41F99F096004A250C /* DocumentTimeline.cpp */,
 				71025EC51F99F096004A250C /* DocumentTimeline.h */,
@@ -27107,6 +27119,7 @@
 				E172AF70180F289500FBADB9 /* CryptoKeyUsage.h in Headers */,
 				7C9ACAA81F3CCEB400F3AA09 /* CryptoRsaHashedKeyAlgorithm.h in Headers */,
 				7C9ACAA41F3CCE6900F3AA09 /* CryptoRsaKeyAlgorithm.h in Headers */,
+				71C29E32203CE781008F36D2 /* CSSAnimation.h in Headers */,
 				316FE1140E6E1DA700BF6088 /* CSSAnimationController.h in Headers */,
 				0F15DA8A0F3AAEE70000CE47 /* CSSAnimationControllerPrivate.h in Headers */,
 				31BC742E1AAFF45C006B4340 /* CSSAnimationTriggerScrollValue.h in Headers */,
@@ -28066,6 +28079,7 @@
 				57D0018D1DD5413200ED19D9 /* JSCryptoKeyUsage.h in Headers */,
 				7C9ACAC01F3CF1AF00F3AA09 /* JSCryptoRsaHashedKeyAlgorithm.h in Headers */,
 				7C9ACAC21F3CF1AF00F3AA09 /* JSCryptoRsaKeyAlgorithm.h in Headers */,
+				71B28427203CEC4C0036AA5D /* JSCSSAnimation.h in Headers */,
 				BC46C1FD0C0DDC8F0020CFC3 /* JSCSSFontFaceRule.h in Headers */,
 				BC46C1FF0C0DDC8F0020CFC3 /* JSCSSImportRule.h in Headers */,
 				316FE0720E6CCBEE00BF6088 /* JSCSSKeyframeRule.h in Headers */,

Copied: trunk/Source/WebCore/animation/CSSAnimation.cpp (from rev 229326, trunk/Source/WebCore/animation/WebAnimation.idl) (0 => 229327)


--- trunk/Source/WebCore/animation/CSSAnimation.cpp	                        (rev 0)
+++ trunk/Source/WebCore/animation/CSSAnimation.cpp	2018-03-06 18:34:22 UTC (rev 229327)
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    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 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 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
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "CSSAnimation.h"
+
+#include "Animation.h"
+#include "Element.h"
+
+namespace WebCore {
+
+Ref<CSSAnimation> CSSAnimation::create(Element& target, const Animation&)
+{
+    auto& document = target.document();
+
+    auto result = adoptRef(*new CSSAnimation(document));
+
+    return result;
+}
+
+CSSAnimation::CSSAnimation(Document& document)
+    : WebAnimation(document)
+{
+}
+
+
+} // namespace WebCore

Copied: trunk/Source/WebCore/animation/CSSAnimation.h (from rev 229326, trunk/Source/WebCore/animation/WebAnimation.idl) (0 => 229327)


--- trunk/Source/WebCore/animation/CSSAnimation.h	                        (rev 0)
+++ trunk/Source/WebCore/animation/CSSAnimation.h	2018-03-06 18:34:22 UTC (rev 229327)
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    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 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 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
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "WebAnimation.h"
+#include <wtf/Ref.h>
+
+namespace WebCore {
+
+class Animation;
+class Element;
+
+class CSSAnimation final : public WebAnimation {
+public:
+    static Ref<CSSAnimation> create(Element&, const Animation&);
+    ~CSSAnimation() = default;
+
+    bool isCSSAnimation() const override { return true; }
+    const String& animationName() const { return m_animationName; }
+
+private:
+    CSSAnimation(Document&);
+
+    String m_animationName;
+
+};
+
+} // namespace WebCore
+
+SPECIALIZE_TYPE_TRAITS_WEB_ANIMATION(CSSAnimation, isCSSAnimation())

Copied: trunk/Source/WebCore/animation/CSSAnimation.idl (from rev 229326, trunk/Source/WebCore/animation/WebAnimation.idl) (0 => 229327)


--- trunk/Source/WebCore/animation/CSSAnimation.idl	                        (rev 0)
+++ trunk/Source/WebCore/animation/CSSAnimation.idl	2018-03-06 18:34:22 UTC (rev 229327)
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    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 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 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
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+typedef USVString CSSOMString;
+
+[
+    EnabledAtRuntime=WebAnimations,
+    Exposed=Window
+] interface CSSAnimation : WebAnimation {
+    readonly attribute CSSOMString animationName;
+};

Modified: trunk/Source/WebCore/animation/KeyframeEffectReadOnly.cpp (229326 => 229327)


--- trunk/Source/WebCore/animation/KeyframeEffectReadOnly.cpp	2018-03-06 18:02:33 UTC (rev 229326)
+++ trunk/Source/WebCore/animation/KeyframeEffectReadOnly.cpp	2018-03-06 18:34:22 UTC (rev 229327)
@@ -27,6 +27,7 @@
 #include "KeyframeEffectReadOnly.h"
 
 #include "Animation.h"
+#include "AnimationEffectTimingReadOnly.h"
 #include "CSSComputedStyleDeclaration.h"
 #include "CSSPropertyAnimation.h"
 #include "CSSPropertyNames.h"
@@ -33,8 +34,11 @@
 #include "CSSStyleDeclaration.h"
 #include "CSSTimingFunctionValue.h"
 #include "Element.h"
+#include "FontCascade.h"
 #include "JSCompositeOperation.h"
 #include "JSKeyframeEffectReadOnly.h"
+#include "RenderBoxModelObject.h"
+#include "RenderElement.h"
 #include "RenderStyle.h"
 #include "StyleResolver.h"
 #include "TimingFunction.h"

Modified: trunk/Source/WebCore/animation/WebAnimation.h (229326 => 229327)


--- trunk/Source/WebCore/animation/WebAnimation.h	2018-03-06 18:02:33 UTC (rev 229326)
+++ trunk/Source/WebCore/animation/WebAnimation.h	2018-03-06 18:34:22 UTC (rev 229327)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2017-2018 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -46,12 +46,14 @@
 class Element;
 class RenderStyle;
 
-class WebAnimation final : public RefCounted<WebAnimation>, public EventTargetWithInlineData, public ActiveDOMObject {
+class WebAnimation : public RefCounted<WebAnimation>, public EventTargetWithInlineData, public ActiveDOMObject {
 public:
     static Ref<WebAnimation> create(Document&, AnimationEffectReadOnly*);
     static Ref<WebAnimation> create(Document&, AnimationEffectReadOnly*, AnimationTimeline*);
     ~WebAnimation();
 
+    virtual bool isCSSAnimation() const { return false; }
+
     const String& id() const { return m_id; }
     void setId(const String& id) { m_id = id; }
 
@@ -108,9 +110,10 @@
     using RefCounted::ref;
     using RefCounted::deref;
 
-private:
+protected:
     explicit WebAnimation(Document&);
 
+private:
     enum class RespectHoldTime { Yes, No };
     enum class AutoRewind { Yes, No };
     enum class TimeToRunPendingTask { NotScheduled, ASAP, WhenReady };
@@ -163,3 +166,8 @@
 };
 
 } // namespace WebCore
+
+#define SPECIALIZE_TYPE_TRAITS_WEB_ANIMATION(ToValueTypeName, predicate) \
+SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::ToValueTypeName) \
+static bool isType(const WebCore::WebAnimation& value) { return value.predicate; } \
+SPECIALIZE_TYPE_TRAITS_END()

Modified: trunk/Source/WebCore/animation/WebAnimation.idl (229326 => 229327)


--- trunk/Source/WebCore/animation/WebAnimation.idl	2018-03-06 18:02:33 UTC (rev 229326)
+++ trunk/Source/WebCore/animation/WebAnimation.idl	2018-03-06 18:34:22 UTC (rev 229327)
@@ -34,7 +34,8 @@
     ActiveDOMObject,
     EnabledAtRuntime=WebAnimations,
     InterfaceName=Animation,
-    CustomConstructor()
+    CustomConstructor(),
+    CustomToJSObject
 ] interface WebAnimation : EventTarget {
     attribute DOMString id;
     attribute AnimationEffectReadOnly? effect;

Modified: trunk/Source/WebCore/bindings/js/JSWebAnimationCustom.cpp (229326 => 229327)


--- trunk/Source/WebCore/bindings/js/JSWebAnimationCustom.cpp	2018-03-06 18:02:33 UTC (rev 229326)
+++ trunk/Source/WebCore/bindings/js/JSWebAnimationCustom.cpp	2018-03-06 18:34:22 UTC (rev 229327)
@@ -28,6 +28,7 @@
 
 #include "JSAnimationEffectReadOnly.h"
 #include "JSAnimationTimeline.h"
+#include "JSCSSAnimation.h"
 #include "JSDOMConstructor.h"
 
 namespace WebCore {
@@ -34,6 +35,18 @@
 
 using namespace JSC;
 
+JSValue toJSNewlyCreated(ExecState*, JSDOMGlobalObject* globalObject, Ref<WebAnimation>&& value)
+{
+    if (value->isCSSAnimation())
+        return createWrapper<CSSAnimation>(globalObject, WTFMove(value));
+    return createWrapper<WebAnimation>(globalObject, WTFMove(value));
+}
+
+JSValue toJS(ExecState* state, JSDOMGlobalObject* globalObject, WebAnimation& value)
+{
+    return wrap(state, globalObject, value);
+}
+
 EncodedJSValue JSC_HOST_CALL constructJSWebAnimation(ExecState& state)
 {
     VM& vm = state.vm();

Modified: trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h (229326 => 229327)


--- trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h	2018-03-06 18:02:33 UTC (rev 229326)
+++ trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h	2018-03-06 18:34:22 UTC (rev 229327)
@@ -49,6 +49,7 @@
     macro(Clients) \
     macro(Credential) \
     macro(CredentialsContainer) \
+    macro(CSSAnimation) \
     macro(CustomElementRegistry) \
     macro(DataTransferItem) \
     macro(DataTransferItemList) \
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to