Title: [229340] trunk/Source/WebCore
Revision
229340
Author
commit-qu...@webkit.org
Date
2018-03-06 13:27:03 -0800 (Tue, 06 Mar 2018)

Log Message

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

Patch by Antoine Quint <grao...@apple.com> on 2018-03-06
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/CSSTransition.cpp: Added.
(WebCore::CSSTransition::create):
(WebCore::CSSTransition::CSSTransition):
* animation/CSSTransition.h: Added.
* animation/CSSTransition.idl: Added.
* animation/KeyframeEffect.cpp:
* animation/WebAnimation.h:
(WebCore::WebAnimation::isCSSTransition const):
* bindings/js/JSWebAnimationCustom.cpp:
(WebCore::toJSNewlyCreated):
* bindings/js/WebCoreBuiltinNames.h:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/CMakeLists.txt (229339 => 229340)


--- trunk/Source/WebCore/CMakeLists.txt	2018-03-06 21:00:35 UTC (rev 229339)
+++ trunk/Source/WebCore/CMakeLists.txt	2018-03-06 21:27:03 UTC (rev 229340)
@@ -450,6 +450,7 @@
     animation/AnimationPlaybackEventInit.idl
     animation/AnimationTimeline.idl
     animation/CSSAnimation.idl
+    animation/CSSTransition.idl
     animation/CompositeOperation.idl
     animation/ComputedTimingProperties.idl
     animation/DocumentTimeline.idl

Modified: trunk/Source/WebCore/ChangeLog (229339 => 229340)


--- trunk/Source/WebCore/ChangeLog	2018-03-06 21:00:35 UTC (rev 229339)
+++ trunk/Source/WebCore/ChangeLog	2018-03-06 21:27:03 UTC (rev 229340)
@@ -1,3 +1,30 @@
+2018-03-06  Antoine Quint  <grao...@apple.com>
+
+        [Web Animations] Add a new CSSTransition subclass of WebAnimation
+        https://bugs.webkit.org/show_bug.cgi?id=183373
+        <rdar://problem/38181985>
+
+        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/CSSTransition.cpp: Added.
+        (WebCore::CSSTransition::create):
+        (WebCore::CSSTransition::CSSTransition):
+        * animation/CSSTransition.h: Added.
+        * animation/CSSTransition.idl: Added.
+        * animation/KeyframeEffect.cpp:
+        * animation/WebAnimation.h:
+        (WebCore::WebAnimation::isCSSTransition const):
+        * bindings/js/JSWebAnimationCustom.cpp:
+        (WebCore::toJSNewlyCreated):
+        * bindings/js/WebCoreBuiltinNames.h:
+
 2018-03-06  Megan Gardner  <megan_gard...@apple.com>
 
         Ensure system appearance is default for web content

Modified: trunk/Source/WebCore/DerivedSources.make (229339 => 229340)


--- trunk/Source/WebCore/DerivedSources.make	2018-03-06 21:00:35 UTC (rev 229339)
+++ trunk/Source/WebCore/DerivedSources.make	2018-03-06 21:27:03 UTC (rev 229340)
@@ -372,6 +372,7 @@
     $(WebCore)/animation/CompositeOperation.idl \
     $(WebCore)/animation/ComputedTimingProperties.idl \
     $(WebCore)/animation/CSSAnimation.idl \
+    $(WebCore)/animation/CSSTransition.idl \
     $(WebCore)/animation/DocumentTimeline.idl \
     $(WebCore)/animation/FillMode.idl \
     $(WebCore)/animation/IterationCompositeOperation.idl \

Modified: trunk/Source/WebCore/Sources.txt (229339 => 229340)


--- trunk/Source/WebCore/Sources.txt	2018-03-06 21:00:35 UTC (rev 229339)
+++ trunk/Source/WebCore/Sources.txt	2018-03-06 21:27:03 UTC (rev 229340)
@@ -337,6 +337,7 @@
 animation/AnimationPlaybackEvent.cpp
 animation/AnimationTimeline.cpp
 animation/CSSAnimation.cpp
+animation/CSSTransition.cpp
 animation/DocumentTimeline.cpp
 animation/KeyframeEffect.cpp
 animation/KeyframeEffectReadOnly.cpp
@@ -2438,6 +2439,7 @@
 JSCryptoRsaHashedKeyAlgorithm.cpp
 JSCryptoRsaKeyAlgorithm.cpp
 JSCSSAnimation.cpp
+JSCSSTransition.cpp
 JSCustomElementRegistry.cpp
 JSCustomEvent.cpp
 JSDocumentTimeline.cpp

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (229339 => 229340)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2018-03-06 21:00:35 UTC (rev 229339)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2018-03-06 21:27:03 UTC (rev 229340)
@@ -8829,6 +8829,11 @@
 		711FB0751DC7688F00C4C708 /* placard-support.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode._javascript_; path = "placard-support.js"; sourceTree = "<group>"; };
 		712157C01DCCCA0700AA7A92 /* macos-fullscreen-media-controls.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = "macos-fullscreen-media-controls.css"; sourceTree = "<group>"; };
 		712157C11DCCCA0700AA7A92 /* macos-fullscreen-media-controls.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode._javascript_; path = "macos-fullscreen-media-controls.js"; sourceTree = "<group>"; };
+		7123C1822047399200789392 /* JSCSSTransition.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCSSTransition.cpp; sourceTree = "<group>"; };
+		7123C1842047399300789392 /* JSCSSTransition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCSSTransition.h; sourceTree = "<group>"; };
+		7123C185204739B900789392 /* CSSTransition.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CSSTransition.idl; sourceTree = "<group>"; };
+		7123C186204739BA00789392 /* CSSTransition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSTransition.h; sourceTree = "<group>"; };
+		7123C187204739BB00789392 /* CSSTransition.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSTransition.cpp; sourceTree = "<group>"; };
 		71247E261FEA5F60008C08CE /* JSKeyframeAnimationOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSKeyframeAnimationOptions.h; sourceTree = "<group>"; };
 		71247E281FEA5F61008C08CE /* JSIterationCompositeOperation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSIterationCompositeOperation.cpp; sourceTree = "<group>"; };
 		71247E291FEA5F62008C08CE /* JSKeyframeAnimationOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSKeyframeAnimationOptions.cpp; sourceTree = "<group>"; };
@@ -15539,6 +15544,8 @@
 				7116E2CE1FED765200C06FDE /* JSComputedTimingProperties.h */,
 				71B28424203CEC0B0036AA5D /* JSCSSAnimation.cpp */,
 				71B28426203CEC0D0036AA5D /* JSCSSAnimation.h */,
+				7123C1822047399200789392 /* JSCSSTransition.cpp */,
+				7123C1842047399300789392 /* JSCSSTransition.h */,
 				71025EDB1F99F1A8004A250C /* JSDocumentTimeline.cpp */,
 				71025EDC1F99F1A8004A250C /* JSDocumentTimeline.h */,
 				712BE4841FE867C2002031CC /* JSFillMode.cpp */,
@@ -19215,6 +19222,9 @@
 				71C29E30203CE76B008F36D2 /* CSSAnimation.h */,
 				71C29E31203CE76C008F36D2 /* CSSAnimation.idl */,
 				713171321FBE78C500F758DE /* CSSPropertyBlendingClient.h */,
+				7123C187204739BB00789392 /* CSSTransition.cpp */,
+				7123C186204739BA00789392 /* CSSTransition.h */,
+				7123C185204739B900789392 /* CSSTransition.idl */,
 				71025EC41F99F096004A250C /* DocumentTimeline.cpp */,
 				71025EC51F99F096004A250C /* DocumentTimeline.h */,
 				71025ECA1F99F096004A250C /* DocumentTimeline.idl */,

Added: trunk/Source/WebCore/animation/CSSTransition.cpp (0 => 229340)


--- trunk/Source/WebCore/animation/CSSTransition.cpp	                        (rev 0)
+++ trunk/Source/WebCore/animation/CSSTransition.cpp	2018-03-06 21:27:03 UTC (rev 229340)
@@ -0,0 +1,48 @@
+/*
+ * 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 "CSSTransition.h"
+
+#include "Animation.h"
+#include "Element.h"
+
+namespace WebCore {
+
+Ref<CSSTransition> CSSTransition::create(Element& target, const Animation&)
+{
+    auto& document = target.document();
+
+    auto result = adoptRef(*new CSSTransition(document));
+
+    return result;
+}
+
+CSSTransition::CSSTransition(Document& document)
+    : WebAnimation(document)
+{
+}
+
+} // namespace WebCore

Added: trunk/Source/WebCore/animation/CSSTransition.h (0 => 229340)


--- trunk/Source/WebCore/animation/CSSTransition.h	                        (rev 0)
+++ trunk/Source/WebCore/animation/CSSTransition.h	2018-03-06 21:27:03 UTC (rev 229340)
@@ -0,0 +1,54 @@
+/*
+ * 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 "CSSPropertyNames.h"
+#include "WebAnimation.h"
+#include <wtf/Ref.h>
+
+namespace WebCore {
+
+class Animation;
+class Element;
+
+class CSSTransition final : public WebAnimation {
+public:
+    static Ref<CSSTransition> create(Element&, const Animation&);
+    ~CSSTransition() = default;
+
+    bool isCSSTransition() const override { return true; }
+    String transitionProperty() const { return getPropertyNameString(m_transitionProperty); }
+
+private:
+    CSSTransition(Document&);
+
+    CSSPropertyID m_transitionProperty;
+
+};
+
+} // namespace WebCore
+
+SPECIALIZE_TYPE_TRAITS_WEB_ANIMATION(CSSTransition, isCSSTransition())

Added: trunk/Source/WebCore/animation/CSSTransition.idl (0 => 229340)


--- trunk/Source/WebCore/animation/CSSTransition.idl	                        (rev 0)
+++ trunk/Source/WebCore/animation/CSSTransition.idl	2018-03-06 21:27:03 UTC (rev 229340)
@@ -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 CSSTransition : WebAnimation {
+    readonly attribute CSSOMString transitionProperty;
+};

Modified: trunk/Source/WebCore/animation/KeyframeEffect.cpp (229339 => 229340)


--- trunk/Source/WebCore/animation/KeyframeEffect.cpp	2018-03-06 21:00:35 UTC (rev 229339)
+++ trunk/Source/WebCore/animation/KeyframeEffect.cpp	2018-03-06 21:27:03 UTC (rev 229340)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "KeyframeEffect.h"
 
+#include "AnimationEffectTiming.h"
+
 namespace WebCore {
 using namespace JSC;
 

Modified: trunk/Source/WebCore/animation/WebAnimation.h (229339 => 229340)


--- trunk/Source/WebCore/animation/WebAnimation.h	2018-03-06 21:00:35 UTC (rev 229339)
+++ trunk/Source/WebCore/animation/WebAnimation.h	2018-03-06 21:27:03 UTC (rev 229340)
@@ -53,6 +53,7 @@
     ~WebAnimation();
 
     virtual bool isCSSAnimation() const { return false; }
+    virtual bool isCSSTransition() const { return false; }
 
     const String& id() const { return m_id; }
     void setId(const String& id) { m_id = id; }

Modified: trunk/Source/WebCore/bindings/js/JSWebAnimationCustom.cpp (229339 => 229340)


--- trunk/Source/WebCore/bindings/js/JSWebAnimationCustom.cpp	2018-03-06 21:00:35 UTC (rev 229339)
+++ trunk/Source/WebCore/bindings/js/JSWebAnimationCustom.cpp	2018-03-06 21:27:03 UTC (rev 229340)
@@ -29,6 +29,7 @@
 #include "JSAnimationEffectReadOnly.h"
 #include "JSAnimationTimeline.h"
 #include "JSCSSAnimation.h"
+#include "JSCSSTransition.h"
 #include "JSDOMConstructor.h"
 
 namespace WebCore {
@@ -39,6 +40,8 @@
 {
     if (value->isCSSAnimation())
         return createWrapper<CSSAnimation>(globalObject, WTFMove(value));
+    if (value->isCSSTransition())
+        return createWrapper<CSSTransition>(globalObject, WTFMove(value));
     return createWrapper<WebAnimation>(globalObject, WTFMove(value));
 }
 

Modified: trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h (229339 => 229340)


--- trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h	2018-03-06 21:00:35 UTC (rev 229339)
+++ trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h	2018-03-06 21:27:03 UTC (rev 229340)
@@ -50,6 +50,7 @@
     macro(Credential) \
     macro(CredentialsContainer) \
     macro(CSSAnimation) \
+    macro(CSSTransition) \
     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