Changeset 229327 in webkit
- Timestamp:
- Mar 6, 2018 10:34:22 AM (6 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 10 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/CMakeLists.txt
r229112 r229327 450 450 animation/AnimationPlaybackEventInit.idl 451 451 animation/AnimationTimeline.idl 452 animation/CSSAnimation.idl 452 453 animation/CompositeOperation.idl 453 454 animation/ComputedTimingProperties.idl -
trunk/Source/WebCore/ChangeLog
r229323 r229327 1 2018-03-06 Antoine Quint <graouts@apple.com> 2 3 [Web Animations] Add a new CSSAnimation subclass of WebAnimation 4 https://bugs.webkit.org/show_bug.cgi?id=183371 5 <rdar://problem/38181724> 6 7 Reviewed by Dean Jackson. 8 9 Adding a new CSSAnimation subclass which we will create in a later patch while resolving styles 10 upon identifying that a new CSS Animation has been added to an element. 11 12 * CMakeLists.txt: 13 * DerivedSources.make: 14 * Sources.txt: 15 * WebCore.xcodeproj/project.pbxproj: 16 * animation/CSSAnimation.cpp: Added. 17 (WebCore::CSSAnimation::create): 18 (WebCore::CSSAnimation::CSSAnimation): 19 * animation/CSSAnimation.h: Added. 20 * animation/CSSAnimation.idl: Added. 21 * animation/KeyframeEffectReadOnly.cpp 22 * animation/WebAnimation.h: 23 (WebCore::WebAnimation::isCSSAnimation const): 24 * animation/WebAnimation.idl: 25 * bindings/js/JSWebAnimationCustom.cpp: 26 (WebCore::toJSNewlyCreated): 27 (WebCore::toJS): 28 * bindings/js/WebCoreBuiltinNames.h: 29 1 30 2018-03-06 Ms2ger <Ms2ger@igalia.com> 2 31 -
trunk/Source/WebCore/DerivedSources.make
r229124 r229327 372 372 $(WebCore)/animation/CompositeOperation.idl \ 373 373 $(WebCore)/animation/ComputedTimingProperties.idl \ 374 $(WebCore)/animation/CSSAnimation.idl \ 374 375 $(WebCore)/animation/DocumentTimeline.idl \ 375 376 $(WebCore)/animation/FillMode.idl \ -
trunk/Source/WebCore/Sources.txt
r229112 r229327 337 337 animation/AnimationPlaybackEvent.cpp 338 338 animation/AnimationTimeline.cpp 339 animation/CSSAnimation.cpp 339 340 animation/DocumentTimeline.cpp 340 341 animation/KeyframeEffect.cpp … … 2437 2438 JSCryptoRsaHashedKeyAlgorithm.cpp 2438 2439 JSCryptoRsaKeyAlgorithm.cpp 2440 JSCSSAnimation.cpp 2439 2441 JSCustomElementRegistry.cpp 2440 2442 JSCustomEvent.cpp -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r229140 r229327 1988 1988 71A1B6081DEE5AD70073BCFB /* modern-media-controls-localized-strings.js in Resources */ = {isa = PBXBuildFile; fileRef = 71A1B6061DEE5A820073BCFB /* modern-media-controls-localized-strings.js */; }; 1989 1989 71A57DF2154BE25C0009D120 /* SVGPathUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 71A57DF0154BE25C0009D120 /* SVGPathUtilities.h */; }; 1990 71B28427203CEC4C0036AA5D /* JSCSSAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 71B28426203CEC0D0036AA5D /* JSCSSAnimation.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1991 71C29E32203CE781008F36D2 /* CSSAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 71C29E30203CE76B008F36D2 /* CSSAnimation.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1990 1992 71C916081D1483A300ACA47D /* UserInterfaceLayoutDirection.h in Headers */ = {isa = PBXBuildFile; fileRef = 71C916071D1483A300ACA47D /* UserInterfaceLayoutDirection.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1991 1993 71DCB7021568197600862271 /* JSSVGZoomAndPan.h in Headers */ = {isa = PBXBuildFile; fileRef = 71DCB7001568197600862271 /* JSSVGZoomAndPan.h */; }; … … 8979 8981 71A57DF0154BE25C0009D120 /* SVGPathUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathUtilities.h; sourceTree = "<group>"; }; 8980 8982 71B0460A1DD3C2EE00EE19CF /* status-support.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "status-support.js"; sourceTree = "<group>"; }; 8983 71B28424203CEC0B0036AA5D /* JSCSSAnimation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCSSAnimation.cpp; sourceTree = "<group>"; }; 8984 71B28426203CEC0D0036AA5D /* JSCSSAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCSSAnimation.h; sourceTree = "<group>"; }; 8985 71C29E2E203CE76B008F36D2 /* CSSAnimation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSAnimation.cpp; sourceTree = "<group>"; }; 8986 71C29E30203CE76B008F36D2 /* CSSAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSAnimation.h; sourceTree = "<group>"; }; 8987 71C29E31203CE76C008F36D2 /* CSSAnimation.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CSSAnimation.idl; sourceTree = "<group>"; }; 8981 8988 71C5BB1B1FB611EA0007A2AE /* Animatable.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Animatable.idl; sourceTree = "<group>"; }; 8982 8989 71C916071D1483A300ACA47D /* UserInterfaceLayoutDirection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserInterfaceLayoutDirection.h; sourceTree = "<group>"; }; … … 15527 15534 7116E2CD1FED765200C06FDE /* JSComputedTimingProperties.cpp */, 15528 15535 7116E2CE1FED765200C06FDE /* JSComputedTimingProperties.h */, 15536 71B28424203CEC0B0036AA5D /* JSCSSAnimation.cpp */, 15537 71B28426203CEC0D0036AA5D /* JSCSSAnimation.h */, 15529 15538 71025EDB1F99F1A8004A250C /* JSDocumentTimeline.cpp */, 15530 15539 71025EDC1F99F1A8004A250C /* JSDocumentTimeline.h */, … … 19197 19206 7116E2CB1FED75D100C06FDE /* ComputedTimingProperties.h */, 19198 19207 7116E2C91FED75D000C06FDE /* ComputedTimingProperties.idl */, 19208 71C29E2E203CE76B008F36D2 /* CSSAnimation.cpp */, 19209 71C29E30203CE76B008F36D2 /* CSSAnimation.h */, 19210 71C29E31203CE76C008F36D2 /* CSSAnimation.idl */, 19199 19211 713171321FBE78C500F758DE /* CSSPropertyBlendingClient.h */, 19200 19212 71025EC41F99F096004A250C /* DocumentTimeline.cpp */, … … 27108 27120 7C9ACAA81F3CCEB400F3AA09 /* CryptoRsaHashedKeyAlgorithm.h in Headers */, 27109 27121 7C9ACAA41F3CCE6900F3AA09 /* CryptoRsaKeyAlgorithm.h in Headers */, 27122 71C29E32203CE781008F36D2 /* CSSAnimation.h in Headers */, 27110 27123 316FE1140E6E1DA700BF6088 /* CSSAnimationController.h in Headers */, 27111 27124 0F15DA8A0F3AAEE70000CE47 /* CSSAnimationControllerPrivate.h in Headers */, … … 28067 28080 7C9ACAC01F3CF1AF00F3AA09 /* JSCryptoRsaHashedKeyAlgorithm.h in Headers */, 28068 28081 7C9ACAC21F3CF1AF00F3AA09 /* JSCryptoRsaKeyAlgorithm.h in Headers */, 28082 71B28427203CEC4C0036AA5D /* JSCSSAnimation.h in Headers */, 28069 28083 BC46C1FD0C0DDC8F0020CFC3 /* JSCSSFontFaceRule.h in Headers */, 28070 28084 BC46C1FF0C0DDC8F0020CFC3 /* JSCSSImportRule.h in Headers */, -
trunk/Source/WebCore/animation/CSSAnimation.cpp
r229326 r229327 1 1 /* 2 * Copyright (C) 201 7Apple Inc. All rights reserved.2 * Copyright (C) 2018 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 enum AnimationPlayState { 27 "idle", 28 "running", 29 "paused", 30 "finished" 31 }; 26 #include "config.h" 27 #include "CSSAnimation.h" 32 28 33 [ 34 ActiveDOMObject, 35 EnabledAtRuntime=WebAnimations, 36 InterfaceName=Animation, 37 CustomConstructor() 38 ] interface WebAnimation : EventTarget { 39 attribute DOMString id; 40 attribute AnimationEffectReadOnly? effect; 41 attribute AnimationTimeline? timeline; 42 [ImplementedAs=bindingsStartTime] attribute double? startTime; 43 [MayThrowException, ImplementedAs=bindingsCurrentTime] attribute double? currentTime; 44 attribute double playbackRate; 45 readonly attribute AnimationPlayState playState; 46 readonly attribute boolean pending; 47 attribute EventHandler onfinish; 48 attribute EventHandler oncancel; 49 readonly attribute Promise<WebAnimation> ready; 50 readonly attribute Promise<WebAnimation> finished; 51 void cancel(); 52 [MayThrowException] void finish(); 53 [MayThrowException] void play(); 54 [MayThrowException] void pause(); 55 [MayThrowException] void reverse(); 56 }; 29 #include "Animation.h" 30 #include "Element.h" 31 32 namespace WebCore { 33 34 Ref<CSSAnimation> CSSAnimation::create(Element& target, const Animation&) 35 { 36 auto& document = target.document(); 37 38 auto result = adoptRef(*new CSSAnimation(document)); 39 40 return result; 41 } 42 43 CSSAnimation::CSSAnimation(Document& document) 44 : WebAnimation(document) 45 { 46 } 47 48 49 } // namespace WebCore -
trunk/Source/WebCore/animation/CSSAnimation.h
r229326 r229327 1 1 /* 2 * Copyright (C) 201 7Apple Inc. All rights reserved.2 * Copyright (C) 2018 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 enum AnimationPlayState { 27 "idle", 28 "running", 29 "paused", 30 "finished" 26 #pragma once 27 28 #include "WebAnimation.h" 29 #include <wtf/Ref.h> 30 31 namespace WebCore { 32 33 class Animation; 34 class Element; 35 36 class CSSAnimation final : public WebAnimation { 37 public: 38 static Ref<CSSAnimation> create(Element&, const Animation&); 39 ~CSSAnimation() = default; 40 41 bool isCSSAnimation() const override { return true; } 42 const String& animationName() const { return m_animationName; } 43 44 private: 45 CSSAnimation(Document&); 46 47 String m_animationName; 48 31 49 }; 32 50 33 [ 34 ActiveDOMObject, 35 EnabledAtRuntime=WebAnimations, 36 InterfaceName=Animation, 37 CustomConstructor() 38 ] interface WebAnimation : EventTarget { 39 attribute DOMString id; 40 attribute AnimationEffectReadOnly? effect; 41 attribute AnimationTimeline? timeline; 42 [ImplementedAs=bindingsStartTime] attribute double? startTime; 43 [MayThrowException, ImplementedAs=bindingsCurrentTime] attribute double? currentTime; 44 attribute double playbackRate; 45 readonly attribute AnimationPlayState playState; 46 readonly attribute boolean pending; 47 attribute EventHandler onfinish; 48 attribute EventHandler oncancel; 49 readonly attribute Promise<WebAnimation> ready; 50 readonly attribute Promise<WebAnimation> finished; 51 void cancel(); 52 [MayThrowException] void finish(); 53 [MayThrowException] void play(); 54 [MayThrowException] void pause(); 55 [MayThrowException] void reverse(); 56 }; 51 } // namespace WebCore 52 53 SPECIALIZE_TYPE_TRAITS_WEB_ANIMATION(CSSAnimation, isCSSAnimation()) -
trunk/Source/WebCore/animation/CSSAnimation.idl
r229326 r229327 1 1 /* 2 * Copyright (C) 201 7Apple Inc. All rights reserved.2 * Copyright (C) 2018 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 enum AnimationPlayState { 27 "idle", 28 "running", 29 "paused", 30 "finished" 31 }; 26 typedef USVString CSSOMString; 32 27 33 28 [ 34 ActiveDOMObject,35 29 EnabledAtRuntime=WebAnimations, 36 InterfaceName=Animation, 37 CustomConstructor() 38 ] interface WebAnimation : EventTarget { 39 attribute DOMString id; 40 attribute AnimationEffectReadOnly? effect; 41 attribute AnimationTimeline? timeline; 42 [ImplementedAs=bindingsStartTime] attribute double? startTime; 43 [MayThrowException, ImplementedAs=bindingsCurrentTime] attribute double? currentTime; 44 attribute double playbackRate; 45 readonly attribute AnimationPlayState playState; 46 readonly attribute boolean pending; 47 attribute EventHandler onfinish; 48 attribute EventHandler oncancel; 49 readonly attribute Promise<WebAnimation> ready; 50 readonly attribute Promise<WebAnimation> finished; 51 void cancel(); 52 [MayThrowException] void finish(); 53 [MayThrowException] void play(); 54 [MayThrowException] void pause(); 55 [MayThrowException] void reverse(); 30 Exposed=Window 31 ] interface CSSAnimation : WebAnimation { 32 readonly attribute CSSOMString animationName; 56 33 }; -
trunk/Source/WebCore/animation/KeyframeEffectReadOnly.cpp
r228717 r229327 28 28 29 29 #include "Animation.h" 30 #include "AnimationEffectTimingReadOnly.h" 30 31 #include "CSSComputedStyleDeclaration.h" 31 32 #include "CSSPropertyAnimation.h" … … 34 35 #include "CSSTimingFunctionValue.h" 35 36 #include "Element.h" 37 #include "FontCascade.h" 36 38 #include "JSCompositeOperation.h" 37 39 #include "JSKeyframeEffectReadOnly.h" 40 #include "RenderBoxModelObject.h" 41 #include "RenderElement.h" 38 42 #include "RenderStyle.h" 39 43 #include "StyleResolver.h" -
trunk/Source/WebCore/animation/WebAnimation.h
r229069 r229327 1 1 /* 2 * Copyright (C) 2017 Apple Inc. All rights reserved.2 * Copyright (C) 2017-2018 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 47 47 class RenderStyle; 48 48 49 class WebAnimation final: public RefCounted<WebAnimation>, public EventTargetWithInlineData, public ActiveDOMObject {49 class WebAnimation : public RefCounted<WebAnimation>, public EventTargetWithInlineData, public ActiveDOMObject { 50 50 public: 51 51 static Ref<WebAnimation> create(Document&, AnimationEffectReadOnly*); 52 52 static Ref<WebAnimation> create(Document&, AnimationEffectReadOnly*, AnimationTimeline*); 53 53 ~WebAnimation(); 54 55 virtual bool isCSSAnimation() const { return false; } 54 56 55 57 const String& id() const { return m_id; } … … 109 111 using RefCounted::deref; 110 112 111 pr ivate:113 protected: 112 114 explicit WebAnimation(Document&); 113 115 116 private: 114 117 enum class RespectHoldTime { Yes, No }; 115 118 enum class AutoRewind { Yes, No }; … … 164 167 165 168 } // namespace WebCore 169 170 #define SPECIALIZE_TYPE_TRAITS_WEB_ANIMATION(ToValueTypeName, predicate) \ 171 SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::ToValueTypeName) \ 172 static bool isType(const WebCore::WebAnimation& value) { return value.predicate; } \ 173 SPECIALIZE_TYPE_TRAITS_END() -
trunk/Source/WebCore/animation/WebAnimation.idl
r229058 r229327 35 35 EnabledAtRuntime=WebAnimations, 36 36 InterfaceName=Animation, 37 CustomConstructor() 37 CustomConstructor(), 38 CustomToJSObject 38 39 ] interface WebAnimation : EventTarget { 39 40 attribute DOMString id; -
trunk/Source/WebCore/bindings/js/JSWebAnimationCustom.cpp
r228333 r229327 29 29 #include "JSAnimationEffectReadOnly.h" 30 30 #include "JSAnimationTimeline.h" 31 #include "JSCSSAnimation.h" 31 32 #include "JSDOMConstructor.h" 32 33 … … 34 35 35 36 using namespace JSC; 37 38 JSValue toJSNewlyCreated(ExecState*, JSDOMGlobalObject* globalObject, Ref<WebAnimation>&& value) 39 { 40 if (value->isCSSAnimation()) 41 return createWrapper<CSSAnimation>(globalObject, WTFMove(value)); 42 return createWrapper<WebAnimation>(globalObject, WTFMove(value)); 43 } 44 45 JSValue toJS(ExecState* state, JSDOMGlobalObject* globalObject, WebAnimation& value) 46 { 47 return wrap(state, globalObject, value); 48 } 36 49 37 50 EncodedJSValue JSC_HOST_CALL constructJSWebAnimation(ExecState& state) -
trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h
r228427 r229327 50 50 macro(Credential) \ 51 51 macro(CredentialsContainer) \ 52 macro(CSSAnimation) \ 52 53 macro(CustomElementRegistry) \ 53 54 macro(DataTransferItem) \
Note: See TracChangeset
for help on using the changeset viewer.