Changeset 223883 in webkit
- Timestamp:
- Oct 24, 2017 12:51:59 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 12 added
- 10 edited
- 10 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r223881 r223883 1 2017-10-24 Antoine Quint <graouts@apple.com> 2 3 [Web Animations] Add basic timing and target properties 4 https://bugs.webkit.org/show_bug.cgi?id=178674 5 6 Reviewed by Dean Jackson. 7 8 Add new tests to check the behavior of the newly exposed interfaces, 9 constructors and properties. 10 11 * webanimations/animation-effect-expected.txt: Added. 12 * webanimations/animation-effect-timing-expected.txt: Added. 13 * webanimations/animation-effect-timing.html: Added. 14 * webanimations/animation-effect.html: Added. 15 * webanimations/animation-interface-effect-property-expected.txt: Added. 16 * webanimations/animation-interface-effect-property.html: Added. 17 * webanimations/animation-interface-start-time-property-expected.txt: Added. 18 * webanimations/animation-interface-start-time-property.html: Added. 19 * webanimations/keyframe-effect-expected.txt: Added. 20 * webanimations/keyframe-effect-interface-timing-duration-expected.txt: Added. 21 * webanimations/keyframe-effect-interface-timing-duration.html: Added. 22 * webanimations/keyframe-effect.html: Added. 23 1 24 2017-10-24 Nan Wang <n_wang@apple.com> 2 25 -
trunk/Source/WebCore/CMakeLists.txt
r223878 r223883 419 419 Modules/webvr/VRStageParameters.idl 420 420 421 animation/AnimationEffect.idl 422 animation/AnimationEffectTiming.idl 421 423 animation/AnimationTimeline.idl 422 424 animation/DocumentTimeline.idl 425 animation/KeyframeEffect.idl 423 426 animation/WebAnimation.idl 424 427 -
trunk/Source/WebCore/ChangeLog
r223882 r223883 1 2017-10-24 Antoine Quint <graouts@apple.com> 2 3 [Web Animations] Add basic timing and target properties 4 https://bugs.webkit.org/show_bug.cgi?id=178674 5 6 Reviewed by Dean Jackson. 7 8 We add three new interfaces to expose enough properties to establish basic timing properties, 9 a start time and duration, and the target of an animation. The startTime property is set on 10 the Animation object, the target is set on the KeyframeEffect set as the effect property on 11 the Animation object, and the duration is set on the AnimationEffectTiming set on the effect. 12 13 Tests: webanimations/animation-effect-timing.html 14 webanimations/animation-effect.html 15 webanimations/animation-interface-effect-property.html 16 webanimations/animation-interface-start-time-property.html 17 webanimations/keyframe-effect-interface-timing-duration.html 18 webanimations/keyframe-effect.html 19 20 * CMakeLists.txt: 21 * DerivedSources.make: 22 * Sources.txt: 23 * WebCore.xcodeproj/project.pbxproj: 24 * animation/AnimationEffect.cpp: Copied from Source/WebCore/animation/WebAnimation.idl. 25 (WebCore::AnimationEffect::AnimationEffect): 26 (WebCore::AnimationEffect::~AnimationEffect): 27 * animation/AnimationEffect.h: Copied from Source/WebCore/animation/WebAnimation.h. 28 (WebCore::AnimationEffect::isKeyframeEffect const): 29 (WebCore::AnimationEffect::timing const): 30 (WebCore::AnimationEffect::classType const): 31 * animation/AnimationEffect.idl: Copied from Source/WebCore/animation/WebAnimation.idl. 32 * animation/AnimationEffectTiming.cpp: Copied from Source/WebCore/animation/WebAnimation.idl. 33 (WebCore::AnimationEffectTiming::create): 34 (WebCore::AnimationEffectTiming::AnimationEffectTiming): 35 (WebCore::AnimationEffectTiming::~AnimationEffectTiming): 36 * animation/AnimationEffectTiming.h: Copied from Source/WebCore/animation/WebAnimation.h. 37 * animation/AnimationEffectTiming.idl: Copied from Source/WebCore/animation/WebAnimation.idl. 38 * animation/KeyframeEffect.cpp: Copied from Source/WebCore/animation/WebAnimation.idl. 39 (WebCore::KeyframeEffect::create): 40 (WebCore::KeyframeEffect::KeyframeEffect): 41 * animation/KeyframeEffect.h: Copied from Source/WebCore/animation/WebAnimation.h. 42 * animation/KeyframeEffect.idl: Copied from Source/WebCore/animation/WebAnimation.idl. 43 * animation/WebAnimation.cpp: 44 (WebCore::WebAnimation::setEffect): 45 * animation/WebAnimation.h: 46 * animation/WebAnimation.idl: 47 * bindings/js/JSAnimationEffectCustom.cpp: Copied from Source/WebCore/animation/WebAnimation.cpp. 48 (WebCore::toJSNewlyCreated): 49 (WebCore::toJS): 50 * bindings/js/WebCoreBuiltinNames.h: 51 1 52 2017-10-24 Ryosuke Niwa <rniwa@webkit.org> 2 53 -
trunk/Source/WebCore/DerivedSources.make
r223855 r223883 343 343 $(WebCore)/Modules/webvr/VRPose.idl \ 344 344 $(WebCore)/Modules/webvr/VRStageParameters.idl \ 345 $(WebCore)/animation/AnimationEffect.idl \ 346 $(WebCore)/animation/AnimationEffectTiming.idl \ 345 347 $(WebCore)/animation/AnimationTimeline.idl \ 346 348 $(WebCore)/animation/DocumentTimeline.idl \ 349 $(WebCore)/animation/KeyframeEffect.idl \ 347 350 $(WebCore)/animation/WebAnimation.idl \ 348 351 $(WebCore)/crypto/CryptoAlgorithmParameters.idl \ -
trunk/Source/WebCore/Sources.txt
r223876 r223883 312 312 accessibility/AccessibilityTreeItem.cpp 313 313 314 animation/AnimationEffect.cpp 315 animation/AnimationEffectTiming.cpp 314 316 animation/AnimationTimeline.cpp 315 317 animation/DocumentTimeline.cpp 318 animation/KeyframeEffect.cpp 316 319 animation/WebAnimation.cpp 317 318 320 319 321 bindings/js/CachedModuleScriptLoader.cpp … … 324 326 bindings/js/GCController.cpp 325 327 bindings/js/IDBBindingUtilities.cpp 328 bindings/js/JSAnimationEffectCustom.cpp 326 329 bindings/js/JSAnimationTimelineCustom.cpp 327 330 bindings/js/JSAttrCustom.cpp … … 906 909 JSAnalyserNode.cpp 907 910 JSAnimationEvent.cpp 911 JSAnimationEffect.cpp 912 JSAnimationEffectTiming.cpp 908 913 JSAnimationTimeline.cpp 909 914 JSAttr.cpp … … 1222 1227 JSJsonWebKey.cpp 1223 1228 JSKeyboardEvent.cpp 1229 JSKeyframeEffect.cpp 1224 1230 JSLocation.cpp 1225 1231 JSLongRange.cpp -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r223876 r223883 2555 2555 7134496E146941B300720312 /* SVGLengthContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 7134496C146941B300720312 /* SVGLengthContext.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2556 2556 71537A01146BD9D7008BD615 /* SVGPathData.h in Headers */ = {isa = PBXBuildFile; fileRef = 715379FF146BD9D6008BD615 /* SVGPathData.h */; }; 2557 71556CB21F9F09BA00E78D08 /* AnimationEffect.h in Headers */ = {isa = PBXBuildFile; fileRef = 71556CAD1F9F099D00E78D08 /* AnimationEffect.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2558 71556CB31F9F09BA00E78D08 /* AnimationEffectTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = 71556CAE1F9F099D00E78D08 /* AnimationEffectTiming.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2559 71556CB41F9F09BA00E78D08 /* KeyframeEffect.h in Headers */ = {isa = PBXBuildFile; fileRef = 71556CAA1F9F099B00E78D08 /* KeyframeEffect.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2560 71556CBC1F9F0A4900E78D08 /* JSAnimationEffect.h in Headers */ = {isa = PBXBuildFile; fileRef = 71556CB81F9F09FC00E78D08 /* JSAnimationEffect.h */; }; 2561 71556CBD1F9F0A4900E78D08 /* JSAnimationEffectTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = 71556CB91F9F09FD00E78D08 /* JSAnimationEffectTiming.h */; }; 2562 71556CBE1F9F0A4900E78D08 /* JSKeyframeEffect.h in Headers */ = {isa = PBXBuildFile; fileRef = 71556CB71F9F09FC00E78D08 /* JSKeyframeEffect.h */; }; 2557 2563 7157F062150B6564006EAABD /* SVGAnimatedTransformList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7157F061150B6564006EAABD /* SVGAnimatedTransformList.cpp */; }; 2558 2564 71A1B6081DEE5AD70073BCFB /* modern-media-controls-localized-strings.js in Resources */ = {isa = PBXBuildFile; fileRef = 71A1B6061DEE5A820073BCFB /* modern-media-controls-localized-strings.js */; }; … … 9920 9926 715379FE146BD9D6008BD615 /* SVGPathData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPathData.cpp; sourceTree = "<group>"; }; 9921 9927 715379FF146BD9D6008BD615 /* SVGPathData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathData.h; sourceTree = "<group>"; }; 9928 71556CA81F9F099B00E78D08 /* KeyframeEffect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KeyframeEffect.cpp; sourceTree = "<group>"; }; 9929 71556CAA1F9F099B00E78D08 /* KeyframeEffect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeyframeEffect.h; sourceTree = "<group>"; }; 9930 71556CAB1F9F099C00E78D08 /* KeyframeEffect.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = KeyframeEffect.idl; sourceTree = "<group>"; }; 9931 71556CAC1F9F099D00E78D08 /* AnimationEffectTiming.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AnimationEffectTiming.cpp; sourceTree = "<group>"; }; 9932 71556CAD1F9F099D00E78D08 /* AnimationEffect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnimationEffect.h; sourceTree = "<group>"; }; 9933 71556CAE1F9F099D00E78D08 /* AnimationEffectTiming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnimationEffectTiming.h; sourceTree = "<group>"; }; 9934 71556CAF1F9F099E00E78D08 /* AnimationEffectTiming.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = AnimationEffectTiming.idl; sourceTree = "<group>"; }; 9935 71556CB01F9F099E00E78D08 /* AnimationEffect.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = AnimationEffect.idl; sourceTree = "<group>"; }; 9936 71556CB11F9F099F00E78D08 /* AnimationEffect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AnimationEffect.cpp; sourceTree = "<group>"; }; 9937 71556CB51F9F09DC00E78D08 /* JSAnimationEffectCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAnimationEffectCustom.cpp; sourceTree = "<group>"; }; 9938 71556CB61F9F09FC00E78D08 /* JSKeyframeEffect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSKeyframeEffect.cpp; sourceTree = "<group>"; }; 9939 71556CB71F9F09FC00E78D08 /* JSKeyframeEffect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSKeyframeEffect.h; sourceTree = "<group>"; }; 9940 71556CB81F9F09FC00E78D08 /* JSAnimationEffect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSAnimationEffect.h; sourceTree = "<group>"; }; 9941 71556CB91F9F09FD00E78D08 /* JSAnimationEffectTiming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSAnimationEffectTiming.h; sourceTree = "<group>"; }; 9942 71556CBA1F9F09FD00E78D08 /* JSAnimationEffect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAnimationEffect.cpp; sourceTree = "<group>"; }; 9943 71556CBB1F9F09FE00E78D08 /* JSAnimationEffectTiming.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAnimationEffectTiming.cpp; sourceTree = "<group>"; }; 9922 9944 7157E3D11DC1EE4B0094550E /* scrubbing-support.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "scrubbing-support.js"; sourceTree = "<group>"; }; 9923 9945 7157F061150B6564006EAABD /* SVGAnimatedTransformList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedTransformList.cpp; sourceTree = "<group>"; }; … … 16098 16120 isa = PBXGroup; 16099 16121 children = ( 16122 71556CBA1F9F09FD00E78D08 /* JSAnimationEffect.cpp */, 16123 71556CB81F9F09FC00E78D08 /* JSAnimationEffect.h */, 16124 71556CBB1F9F09FE00E78D08 /* JSAnimationEffectTiming.cpp */, 16125 71556CB91F9F09FD00E78D08 /* JSAnimationEffectTiming.h */, 16100 16126 71025EDA1F99F1A7004A250C /* JSAnimationTimeline.cpp */, 16101 16127 71025ED91F99F1A7004A250C /* JSAnimationTimeline.h */, 16102 16128 71025EDB1F99F1A8004A250C /* JSDocumentTimeline.cpp */, 16103 16129 71025EDC1F99F1A8004A250C /* JSDocumentTimeline.h */, 16130 71556CB61F9F09FC00E78D08 /* JSKeyframeEffect.cpp */, 16131 71556CB71F9F09FC00E78D08 /* JSKeyframeEffect.h */, 16104 16132 71025ED71F99F1A6004A250C /* JSWebAnimation.cpp */, 16105 16133 71025ED81F99F1A6004A250C /* JSWebAnimation.h */, … … 19304 19332 isa = PBXGroup; 19305 19333 children = ( 19334 71556CB11F9F099F00E78D08 /* AnimationEffect.cpp */, 19335 71556CAD1F9F099D00E78D08 /* AnimationEffect.h */, 19336 71556CB01F9F099E00E78D08 /* AnimationEffect.idl */, 19337 71556CAC1F9F099D00E78D08 /* AnimationEffectTiming.cpp */, 19338 71556CAE1F9F099D00E78D08 /* AnimationEffectTiming.h */, 19339 71556CAF1F9F099E00E78D08 /* AnimationEffectTiming.idl */, 19306 19340 71025EC61F99F096004A250C /* AnimationTimeline.cpp */, 19307 19341 71025EC71F99F096004A250C /* AnimationTimeline.h */, … … 19310 19344 71025EC51F99F096004A250C /* DocumentTimeline.h */, 19311 19345 71025ECA1F99F096004A250C /* DocumentTimeline.idl */, 19346 71556CA81F9F099B00E78D08 /* KeyframeEffect.cpp */, 19347 71556CAA1F9F099B00E78D08 /* KeyframeEffect.h */, 19348 71556CAB1F9F099C00E78D08 /* KeyframeEffect.idl */, 19312 19349 71025EC31F99F096004A250C /* WebAnimation.cpp */, 19313 19350 71025EC21F99F096004A250C /* WebAnimation.h */, … … 19558 19595 isa = PBXGroup; 19559 19596 children = ( 19597 71556CB51F9F09DC00E78D08 /* JSAnimationEffectCustom.cpp */, 19560 19598 71025ED51F99F147004A250C /* JSAnimationTimelineCustom.cpp */, 19561 19599 BC2ED6BB0C6BD2F000920BFF /* JSAttrCustom.cpp */, … … 26560 26598 49E912AB0EFAC906009D0CAF /* Animation.h in Headers */, 26561 26599 316FE1120E6E1DA700BF6088 /* AnimationBase.h in Headers */, 26600 71556CB21F9F09BA00E78D08 /* AnimationEffect.h in Headers */, 26601 71556CB31F9F09BA00E78D08 /* AnimationEffectTiming.h in Headers */, 26562 26602 319848011A1D817B00A13318 /* AnimationEvent.h in Headers */, 26563 26603 49E912AD0EFAC906009D0CAF /* AnimationList.h in Headers */, … … 27827 27867 576814451E70CB1F00E77754 /* JSAesKeyParams.h in Headers */, 27828 27868 FDA15ECA12B03F50003A583A /* JSAnalyserNode.h in Headers */, 27869 71556CBC1F9F0A4900E78D08 /* JSAnimationEffect.h in Headers */, 27870 71556CBD1F9F0A4900E78D08 /* JSAnimationEffectTiming.h in Headers */, 27829 27871 3198480C1A1E6CE800A13318 /* JSAnimationEvent.h in Headers */, 27830 27872 71025EDE1F99F1EC004A250C /* JSAnimationTimeline.h in Headers */, … … 28188 28230 57E2335B1DC7D5E500F28D01 /* JSJsonWebKey.h in Headers */, 28189 28231 A86629D309DA2B48009633A5 /* JSKeyboardEvent.h in Headers */, 28232 71556CBE1F9F0A4900E78D08 /* JSKeyframeEffect.h in Headers */, 28190 28233 935F45430F7C3B5F00D7C1FB /* JSLazyEventListener.h in Headers */, 28191 28234 BCE1C43C0D9830D3003B02F2 /* JSLocation.h in Headers */, … … 28636 28679 265541391489811C000DFC5D /* KeyEventCodesIOS.h in Headers */, 28637 28680 316FE11A0E6E1DA700BF6088 /* KeyframeAnimation.h in Headers */, 28681 71556CB41F9F09BA00E78D08 /* KeyframeEffect.h in Headers */, 28638 28682 BC5EBA110E823E4700B25965 /* KeyframeList.h in Headers */, 28639 28683 E15FF7D518C9553800FE4C87 /* KeypressCommand.h in Headers */, -
trunk/Source/WebCore/animation/AnimationEffect.cpp
r223882 r223883 24 24 */ 25 25 26 [ 27 EnabledAtRuntime=WebAnimations, 28 InterfaceName=Animation, 29 ImplementationLacksVTable, 30 Constructor(optional AnimationTimeline? timeline) 31 ] interface WebAnimation { 32 readonly attribute AnimationTimeline? timeline; 33 }; 26 #include "config.h" 27 #include "AnimationEffect.h" 28 29 #include "AnimationEffectTiming.h" 30 31 namespace WebCore { 32 33 AnimationEffect::AnimationEffect(ClassType classType) 34 : m_classType(classType) 35 { 36 m_timing = AnimationEffectTiming::create(); 37 } 38 39 } // namespace WebCore -
trunk/Source/WebCore/animation/AnimationEffect.h
r223882 r223883 26 26 #pragma once 27 27 28 #include "AnimationEffectTiming.h" 28 29 #include <wtf/Forward.h> 29 30 #include <wtf/Ref.h> … … 33 34 namespace WebCore { 34 35 35 class AnimationTimeline; 36 class AnimationEffect : public RefCounted<AnimationEffect> { 37 public: 38 bool isKeyframeEffect() const { return m_classType == KeyframeEffectClass; } 39 AnimationEffectTiming* timing() const { return m_timing.get(); } 36 40 37 class WebAnimation final : public RefCounted<WebAnimation> { 38 public: 39 static Ref<WebAnimation> create(AnimationTimeline*); 40 ~WebAnimation(); 41 virtual ~AnimationEffect() { } 41 42 42 AnimationTimeline* timeline() const { return m_timeline.get(); } 43 String description(); 43 protected: 44 enum ClassType { 45 KeyframeEffectClass 46 }; 47 48 ClassType classType() const { return m_classType; } 49 50 explicit AnimationEffect(ClassType); 44 51 45 52 private: 46 WebAnimation(AnimationTimeline*);47 RefPtr<Animation Timeline> m_timeline;53 ClassType m_classType; 54 RefPtr<AnimationEffectTiming> m_timing; 48 55 }; 49 56 50 57 } // namespace WebCore 58 59 #define SPECIALIZE_TYPE_TRAITS_ANIMATION_EFFECT(ToValueTypeName, predicate) \ 60 SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::ToValueTypeName) \ 61 static bool isType(const WebCore::AnimationEffect& value) { return value.predicate; } \ 62 SPECIALIZE_TYPE_TRAITS_END() -
trunk/Source/WebCore/animation/AnimationEffect.idl
r223882 r223883 26 26 [ 27 27 EnabledAtRuntime=WebAnimations, 28 InterfaceName=Animation, 29 ImplementationLacksVTable, 30 Constructor(optional AnimationTimeline? timeline) 31 ] interface WebAnimation { 32 readonly attribute AnimationTimeline? timeline; 28 CustomToJSObject 29 ] interface AnimationEffect { 30 readonly attribute AnimationEffectTiming timing; 33 31 }; -
trunk/Source/WebCore/animation/AnimationEffectTiming.cpp
r223882 r223883 24 24 */ 25 25 26 [ 27 EnabledAtRuntime=WebAnimations, 28 InterfaceName=Animation, 29 ImplementationLacksVTable, 30 Constructor(optional AnimationTimeline? timeline) 31 ] interface WebAnimation { 32 readonly attribute AnimationTimeline? timeline; 33 }; 26 #include "config.h" 27 #include "AnimationEffectTiming.h" 28 29 namespace WebCore { 30 31 Ref<AnimationEffectTiming> AnimationEffectTiming::create() 32 { 33 return adoptRef(*new AnimationEffectTiming()); 34 } 35 36 AnimationEffectTiming::AnimationEffectTiming() 37 : m_duration(0) 38 { 39 } 40 41 AnimationEffectTiming::~AnimationEffectTiming() 42 { 43 } 44 45 } // namespace WebCore -
trunk/Source/WebCore/animation/AnimationEffectTiming.h
r223882 r223883 30 30 #include <wtf/RefCounted.h> 31 31 #include <wtf/RefPtr.h> 32 #include <wtf/Seconds.h> 32 33 33 34 namespace WebCore { 34 35 35 class AnimationTimeline; 36 class AnimationEffectTiming final : public RefCounted<AnimationEffectTiming> { 37 public: 38 static Ref<AnimationEffectTiming> create(); 39 ~AnimationEffectTiming(); 36 40 37 class WebAnimation final : public RefCounted<WebAnimation> { 38 public: 39 static Ref<WebAnimation> create(AnimationTimeline*); 40 ~WebAnimation(); 41 42 AnimationTimeline* timeline() const { return m_timeline.get(); } 43 String description(); 41 double bindingsDuration() const { return m_duration.value(); } 42 void setBindingsDuration(double duration) { m_duration = Seconds(duration); } 43 Seconds duration() const { return m_duration; } 44 void setDuration(Seconds& duration) { m_duration = duration; } 44 45 45 46 private: 46 WebAnimation(AnimationTimeline*);47 RefPtr<AnimationTimeline> m_timeline;47 AnimationEffectTiming(); 48 Seconds m_duration; 48 49 }; 49 50 -
trunk/Source/WebCore/animation/AnimationEffectTiming.idl
r223882 r223883 26 26 [ 27 27 EnabledAtRuntime=WebAnimations, 28 InterfaceName=Animation, 29 ImplementationLacksVTable, 30 Constructor(optional AnimationTimeline? timeline) 31 ] interface WebAnimation { 32 readonly attribute AnimationTimeline? timeline; 28 ImplementationLacksVTable 29 ] interface AnimationEffectTiming { 30 [ImplementedAs=bindingsDuration] attribute unrestricted double duration; 33 31 }; -
trunk/Source/WebCore/animation/KeyframeEffect.cpp
r223882 r223883 24 24 */ 25 25 26 [ 27 EnabledAtRuntime=WebAnimations, 28 InterfaceName=Animation, 29 ImplementationLacksVTable, 30 Constructor(optional AnimationTimeline? timeline) 31 ] interface WebAnimation { 32 readonly attribute AnimationTimeline? timeline; 33 }; 26 #include "config.h" 27 #include "KeyframeEffect.h" 28 29 #include "Element.h" 30 31 namespace WebCore { 32 33 Ref<KeyframeEffect> KeyframeEffect::create(Element* target) 34 { 35 return adoptRef(*new KeyframeEffect(target)); 36 } 37 38 KeyframeEffect::KeyframeEffect(Element* target) 39 : AnimationEffect(KeyframeEffectClass) 40 , m_target(target) 41 { 42 } 43 44 } // namespace WebCore -
trunk/Source/WebCore/animation/KeyframeEffect.h
r223882 r223883 26 26 #pragma once 27 27 28 #include <wtf/Forward.h>28 #include "AnimationEffect.h" 29 29 #include <wtf/Ref.h> 30 #include <wtf/RefCounted.h>31 #include <wtf/RefPtr.h>32 30 33 31 namespace WebCore { 34 32 35 class AnimationTimeline;33 class Element; 36 34 37 class WebAnimation final : public RefCounted<WebAnimation>{35 class KeyframeEffect final : public AnimationEffect { 38 36 public: 39 static Ref< WebAnimation> create(AnimationTimeline*);40 ~ WebAnimation();37 static Ref<KeyframeEffect> create(Element*); 38 ~KeyframeEffect() { } 41 39 42 AnimationTimeline* timeline() const { return m_timeline.get(); } 43 String description(); 40 Element* target() const { return m_target.get(); } 44 41 45 42 private: 46 WebAnimation(AnimationTimeline*); 47 RefPtr<AnimationTimeline> m_timeline; 43 KeyframeEffect(Element*); 44 RefPtr<Element> m_target; 45 48 46 }; 49 47 50 48 } // namespace WebCore 49 50 SPECIALIZE_TYPE_TRAITS_ANIMATION_EFFECT(KeyframeEffect, isKeyframeEffect()); -
trunk/Source/WebCore/animation/KeyframeEffect.idl
r223882 r223883 26 26 [ 27 27 EnabledAtRuntime=WebAnimations, 28 InterfaceName=Animation, 29 ImplementationLacksVTable, 30 Constructor(optional AnimationTimeline? timeline) 31 ] interface WebAnimation { 32 readonly attribute AnimationTimeline? timeline; 28 Constructor(Element? target) 29 ] interface KeyframeEffect : AnimationEffect { 30 readonly attribute Element? target; 33 31 }; -
trunk/Source/WebCore/animation/WebAnimation.cpp
r223825 r223883 26 26 #include "config.h" 27 27 #include "WebAnimation.h" 28 29 #include "AnimationEffect.h" 30 #include "AnimationTimeline.h" 28 31 #include <wtf/text/WTFString.h> 29 30 #include "AnimationTimeline.h"31 32 32 33 namespace WebCore { … … 53 54 } 54 55 56 void WebAnimation::setEffect(RefPtr<AnimationEffect>&& effect) 57 { 58 m_effect = WTFMove(effect); 59 } 60 61 std::optional<double> WebAnimation::bindingsStartTime() const 62 { 63 if (m_startTime) 64 return m_startTime->secondsSinceEpoch().value(); 65 return std::nullopt; 66 } 67 68 void WebAnimation::setBindingsStartTime(std::optional<double> startTime) 69 { 70 if (startTime == std::nullopt) 71 m_startTime = std::nullopt; 72 else 73 m_startTime = MonotonicTime::fromRawSeconds(startTime.value()); 74 } 75 55 76 String WebAnimation::description() 56 77 { -
trunk/Source/WebCore/animation/WebAnimation.h
r223825 r223883 27 27 28 28 #include <wtf/Forward.h> 29 #include <wtf/MonotonicTime.h> 30 #include <wtf/Optional.h> 29 31 #include <wtf/Ref.h> 30 32 #include <wtf/RefCounted.h> … … 33 35 namespace WebCore { 34 36 37 class AnimationEffect; 35 38 class AnimationTimeline; 36 39 … … 40 43 ~WebAnimation(); 41 44 45 AnimationEffect* effect() const { return m_effect.get(); } 46 void setEffect(RefPtr<AnimationEffect>&&); 42 47 AnimationTimeline* timeline() const { return m_timeline.get(); } 48 std::optional<double> bindingsStartTime() const; 49 void setBindingsStartTime(std::optional<double>); 50 std::optional<MonotonicTime> startTime() const { return m_startTime; } 51 void setStartTime(MonotonicTime& startTime) { m_startTime = startTime; } 52 43 53 String description(); 44 54 45 55 private: 46 56 WebAnimation(AnimationTimeline*); 57 RefPtr<AnimationEffect> m_effect; 47 58 RefPtr<AnimationTimeline> m_timeline; 59 std::optional<MonotonicTime> m_startTime; 48 60 }; 49 61 -
trunk/Source/WebCore/animation/WebAnimation.idl
r223779 r223883 30 30 Constructor(optional AnimationTimeline? timeline) 31 31 ] interface WebAnimation { 32 attribute AnimationEffect? effect; 32 33 readonly attribute AnimationTimeline? timeline; 34 [ImplementedAs=bindingsStartTime] attribute double? startTime; 33 35 }; -
trunk/Source/WebCore/bindings/js/JSAnimationEffectCustom.cpp
r223882 r223883 25 25 26 26 #include "config.h" 27 #include "WebAnimation.h" 28 #include <wtf/text/WTFString.h> 27 #include "JSAnimationEffect.h" 29 28 30 #include "AnimationTimeline.h" 29 #include "JSDOMBinding.h" 30 #include "JSKeyframeEffect.h" 31 #include "KeyframeEffect.h" 32 33 using namespace JSC; 31 34 32 35 namespace WebCore { 33 36 34 Ref<WebAnimation> WebAnimation::create(AnimationTimeline* timeline)37 JSValue toJSNewlyCreated(ExecState*, JSDOMGlobalObject* globalObject, Ref<AnimationEffect>&& value) 35 38 { 36 auto result = adoptRef(*new WebAnimation(timeline)); 37 38 if (timeline) 39 timeline->addAnimation(result.copyRef()); 40 41 return result; 39 if (value->isKeyframeEffect()) 40 return createWrapper<KeyframeEffect>(globalObject, WTFMove(value)); 41 return createWrapper<AnimationEffect>(globalObject, WTFMove(value)); 42 42 } 43 43 44 WebAnimation::WebAnimation(AnimationTimeline* timeline) 45 : m_timeline(timeline) 44 JSValue toJS(ExecState* state, JSDOMGlobalObject* globalObject, AnimationEffect& value) 46 45 { 47 } 48 49 WebAnimation::~WebAnimation() 50 { 51 if (m_timeline) 52 m_timeline->removeAnimation(*this); 53 } 54 55 String WebAnimation::description() 56 { 57 return "Animation"; 46 return wrap(state, globalObject, value); 58 47 } 59 48 -
trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h
r223779 r223883 33 33 #define WEBCORE_COMMON_PRIVATE_IDENTIFIERS_EACH_PROPERTY_NAME(macro) \ 34 34 macro(Animation) \ 35 macro(AnimationEffect) \ 36 macro(AnimationEffectTiming) \ 35 37 macro(AnimationTimeline) \ 36 38 macro(ApplePaySession) \ … … 76 78 macro(IntersectionObserver) \ 77 79 macro(IntersectionObserverEntry) \ 80 macro(KeyframeEffect) \ 78 81 macro(MediaEncryptedEvent) \ 79 82 macro(MediaKeyMessageEvent) \
Note: See TracChangeset
for help on using the changeset viewer.