[Web Animations] Add basic timing and target properties
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Oct 2017 07:51:59 +0000 (07:51 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 24 Oct 2017 07:51:59 +0000 (07:51 +0000)
https://bugs.webkit.org/show_bug.cgi?id=178674

Patch by Antoine Quint <graouts@apple.com> on 2017-10-24
Reviewed by Dean Jackson.

Source/WebCore:

We add three new interfaces to expose enough properties to establish basic timing properties,
a start time and duration, and the target of an animation. The startTime property is set on
the Animation object, the target is set on the KeyframeEffect set as the effect property on
the Animation object, and the duration is set on the AnimationEffectTiming set on the effect.

Tests: webanimations/animation-effect-timing.html
       webanimations/animation-effect.html
       webanimations/animation-interface-effect-property.html
       webanimations/animation-interface-start-time-property.html
       webanimations/keyframe-effect-interface-timing-duration.html
       webanimations/keyframe-effect.html

* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* animation/AnimationEffect.cpp: Copied from Source/WebCore/animation/WebAnimation.idl.
(WebCore::AnimationEffect::AnimationEffect):
(WebCore::AnimationEffect::~AnimationEffect):
* animation/AnimationEffect.h: Copied from Source/WebCore/animation/WebAnimation.h.
(WebCore::AnimationEffect::isKeyframeEffect const):
(WebCore::AnimationEffect::timing const):
(WebCore::AnimationEffect::classType const):
* animation/AnimationEffect.idl: Copied from Source/WebCore/animation/WebAnimation.idl.
* animation/AnimationEffectTiming.cpp: Copied from Source/WebCore/animation/WebAnimation.idl.
(WebCore::AnimationEffectTiming::create):
(WebCore::AnimationEffectTiming::AnimationEffectTiming):
(WebCore::AnimationEffectTiming::~AnimationEffectTiming):
* animation/AnimationEffectTiming.h: Copied from Source/WebCore/animation/WebAnimation.h.
* animation/AnimationEffectTiming.idl: Copied from Source/WebCore/animation/WebAnimation.idl.
* animation/KeyframeEffect.cpp: Copied from Source/WebCore/animation/WebAnimation.idl.
(WebCore::KeyframeEffect::create):
(WebCore::KeyframeEffect::KeyframeEffect):
* animation/KeyframeEffect.h: Copied from Source/WebCore/animation/WebAnimation.h.
* animation/KeyframeEffect.idl: Copied from Source/WebCore/animation/WebAnimation.idl.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::setEffect):
* animation/WebAnimation.h:
* animation/WebAnimation.idl:
* bindings/js/JSAnimationEffectCustom.cpp: Copied from Source/WebCore/animation/WebAnimation.cpp.
(WebCore::toJSNewlyCreated):
(WebCore::toJS):
* bindings/js/WebCoreBuiltinNames.h:

LayoutTests:

Add new tests to check the behavior of the newly exposed interfaces,
constructors and properties.

* webanimations/animation-effect-expected.txt: Added.
* webanimations/animation-effect-timing-expected.txt: Added.
* webanimations/animation-effect-timing.html: Added.
* webanimations/animation-effect.html: Added.
* webanimations/animation-interface-effect-property-expected.txt: Added.
* webanimations/animation-interface-effect-property.html: Added.
* webanimations/animation-interface-start-time-property-expected.txt: Added.
* webanimations/animation-interface-start-time-property.html: Added.
* webanimations/keyframe-effect-expected.txt: Added.
* webanimations/keyframe-effect-interface-timing-duration-expected.txt: Added.
* webanimations/keyframe-effect-interface-timing-duration.html: Added.
* webanimations/keyframe-effect.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223883 268f45cc-cd09-0410-ab3c-d52691b4dbfc

32 files changed:
LayoutTests/ChangeLog
LayoutTests/webanimations/animation-effect-expected.txt [new file with mode: 0644]
LayoutTests/webanimations/animation-effect-timing-expected.txt [new file with mode: 0644]
LayoutTests/webanimations/animation-effect-timing.html [new file with mode: 0644]
LayoutTests/webanimations/animation-effect.html [new file with mode: 0644]
LayoutTests/webanimations/animation-interface-effect-property-expected.txt [new file with mode: 0644]
LayoutTests/webanimations/animation-interface-effect-property.html [new file with mode: 0644]
LayoutTests/webanimations/animation-interface-start-time-property-expected.txt [new file with mode: 0644]
LayoutTests/webanimations/animation-interface-start-time-property.html [new file with mode: 0644]
LayoutTests/webanimations/keyframe-effect-expected.txt [new file with mode: 0644]
LayoutTests/webanimations/keyframe-effect-interface-timing-duration-expected.txt [new file with mode: 0644]
LayoutTests/webanimations/keyframe-effect-interface-timing-duration.html [new file with mode: 0644]
LayoutTests/webanimations/keyframe-effect.html [new file with mode: 0644]
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.make
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/animation/AnimationEffect.cpp [new file with mode: 0644]
Source/WebCore/animation/AnimationEffect.h [new file with mode: 0644]
Source/WebCore/animation/AnimationEffect.idl [new file with mode: 0644]
Source/WebCore/animation/AnimationEffectTiming.cpp [new file with mode: 0644]
Source/WebCore/animation/AnimationEffectTiming.h [new file with mode: 0644]
Source/WebCore/animation/AnimationEffectTiming.idl [new file with mode: 0644]
Source/WebCore/animation/KeyframeEffect.cpp [new file with mode: 0644]
Source/WebCore/animation/KeyframeEffect.h [new file with mode: 0644]
Source/WebCore/animation/KeyframeEffect.idl [new file with mode: 0644]
Source/WebCore/animation/WebAnimation.cpp
Source/WebCore/animation/WebAnimation.h
Source/WebCore/animation/WebAnimation.idl
Source/WebCore/bindings/js/JSAnimationEffectCustom.cpp [new file with mode: 0644]
Source/WebCore/bindings/js/WebCoreBuiltinNames.h

index 64e6e6f..8ae6881 100644 (file)
@@ -1,3 +1,26 @@
+2017-10-24  Antoine Quint  <graouts@apple.com>
+
+        [Web Animations] Add basic timing and target properties
+        https://bugs.webkit.org/show_bug.cgi?id=178674
+
+        Reviewed by Dean Jackson.
+
+        Add new tests to check the behavior of the newly exposed interfaces,
+        constructors and properties.
+
+        * webanimations/animation-effect-expected.txt: Added.
+        * webanimations/animation-effect-timing-expected.txt: Added.
+        * webanimations/animation-effect-timing.html: Added.
+        * webanimations/animation-effect.html: Added.
+        * webanimations/animation-interface-effect-property-expected.txt: Added.
+        * webanimations/animation-interface-effect-property.html: Added.
+        * webanimations/animation-interface-start-time-property-expected.txt: Added.
+        * webanimations/animation-interface-start-time-property.html: Added.
+        * webanimations/keyframe-effect-expected.txt: Added.
+        * webanimations/keyframe-effect-interface-timing-duration-expected.txt: Added.
+        * webanimations/keyframe-effect-interface-timing-duration.html: Added.
+        * webanimations/keyframe-effect.html: Added.
+
 2017-10-24  Nan Wang  <n_wang@apple.com>
 
         AX: Crash at -[WebAccessibilityObjectWrapper _accessibilityMinValue] + 24
diff --git a/LayoutTests/webanimations/animation-effect-expected.txt b/LayoutTests/webanimations/animation-effect-expected.txt
new file mode 100644 (file)
index 0000000..d8ee74c
--- /dev/null
@@ -0,0 +1,15 @@
+Check that the AnimationEffect interface is defined and does not expose a constructor.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+The AnimationEffect interface is defined.
+PASS AnimationEffect is defined.
+
+The AnimationEffect interface cannot be constructed.
+PASS new AnimationEffect threw exception TypeError: function is not a constructor (evaluating 'new AnimationEffect').
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/webanimations/animation-effect-timing-expected.txt b/LayoutTests/webanimations/animation-effect-timing-expected.txt
new file mode 100644 (file)
index 0000000..a085847
--- /dev/null
@@ -0,0 +1,15 @@
+Check that the AnimationEffectTiming interface is defined and does not expose a constructor.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+The AnimationEffectTiming interface is defined.
+PASS AnimationEffectTiming is defined.
+
+The AnimationEffectTiming interface cannot be constructed.
+PASS new AnimationEffectTiming threw exception TypeError: function is not a constructor (evaluating 'new AnimationEffectTiming').
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/webanimations/animation-effect-timing.html b/LayoutTests/webanimations/animation-effect-timing.html
new file mode 100644 (file)
index 0000000..98f3f14
--- /dev/null
@@ -0,0 +1,16 @@
+<script src="../resources/js-test-pre.js"></script>
+<script>
+
+description("Check that the AnimationEffectTiming interface is defined and does not expose a constructor.");
+
+debug("The AnimationEffectTiming interface is defined.");
+shouldBeDefined("AnimationEffectTiming");
+
+debug("");
+debug("The AnimationEffectTiming interface cannot be constructed.");
+shouldThrow("new AnimationEffectTiming");
+
+debug("");
+
+</script>
+<script src="../resources/js-test-post.js"></script>
\ No newline at end of file
diff --git a/LayoutTests/webanimations/animation-effect.html b/LayoutTests/webanimations/animation-effect.html
new file mode 100644 (file)
index 0000000..cc39189
--- /dev/null
@@ -0,0 +1,16 @@
+<script src="../resources/js-test-pre.js"></script>
+<script>
+
+description("Check that the AnimationEffect interface is defined and does not expose a constructor.");
+
+debug("The AnimationEffect interface is defined.");
+shouldBeDefined("AnimationEffect");
+
+debug("");
+debug("The AnimationEffect interface cannot be constructed.");
+shouldThrow("new AnimationEffect");
+
+debug("");
+
+</script>
+<script src="../resources/js-test-post.js"></script>
\ No newline at end of file
diff --git a/LayoutTests/webanimations/animation-interface-effect-property-expected.txt b/LayoutTests/webanimations/animation-interface-effect-property-expected.txt
new file mode 100644 (file)
index 0000000..225fef1
--- /dev/null
@@ -0,0 +1,28 @@
+Check the behavior of the effect property on Animation objects.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+The animation.effect property should be null by default.
+PASS animation.effect is null
+
+The animation.effect property can be set to a KeyframeEffect object.
+PASS animation.effect is effectA
+
+The animation.effect property can be set to another KeyframeEffect object.
+PASS animation.effect is effectB
+
+The animation.effect property can be set back to null.
+PASS animation.effect is null
+
+The animation.effect property cannot be set to something other than null or an AnimationEffect object.
+PASS animation.effect = 0 threw exception TypeError: The Animation.effect attribute must be an instance of AnimationEffect.
+PASS animation.effect = [] threw exception TypeError: The Animation.effect attribute must be an instance of AnimationEffect.
+PASS animation.effect = {} threw exception TypeError: The Animation.effect attribute must be an instance of AnimationEffect.
+PASS animation.effect = false threw exception TypeError: The Animation.effect attribute must be an instance of AnimationEffect.
+PASS animation.effect = 'effect' threw exception TypeError: The Animation.effect attribute must be an instance of AnimationEffect.
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/webanimations/animation-interface-effect-property.html b/LayoutTests/webanimations/animation-interface-effect-property.html
new file mode 100644 (file)
index 0000000..03b13d7
--- /dev/null
@@ -0,0 +1,38 @@
+<script src="../resources/js-test-pre.js"></script>
+<script>
+
+description("Check the behavior of the effect property on Animation objects.");
+
+debug("The animation.effect property should be null by default.");
+const animation = new Animation;
+shouldBeNull("animation.effect");
+
+debug("");
+debug("The animation.effect property can be set to a KeyframeEffect object.");
+const effectA = new KeyframeEffect(document.body);
+animation.effect = effectA;
+shouldBe("animation.effect", "effectA");
+
+debug("");
+debug("The animation.effect property can be set to another KeyframeEffect object.");
+const effectB = new KeyframeEffect(document.body);
+animation.effect = effectB;
+shouldBe("animation.effect", "effectB");
+
+debug("");
+debug("The animation.effect property can be set back to null.");
+animation.effect = null;
+shouldBeNull("animation.effect");
+
+debug("");
+debug("The animation.effect property cannot be set to something other than null or an AnimationEffect object.");
+shouldThrow("animation.effect = 0");
+shouldThrow("animation.effect = []");
+shouldThrow("animation.effect = {}");
+shouldThrow("animation.effect = false");
+shouldThrow("animation.effect = 'effect'");
+
+debug("");
+
+</script>
+<script src="../resources/js-test-post.js"></script>
\ No newline at end of file
diff --git a/LayoutTests/webanimations/animation-interface-start-time-property-expected.txt b/LayoutTests/webanimations/animation-interface-start-time-property-expected.txt
new file mode 100644 (file)
index 0000000..b32009c
--- /dev/null
@@ -0,0 +1,18 @@
+Check the behavior of the startTime property on Animation objects.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+The animation.startTime property should be null by default.
+PASS animation.startTime is null
+
+The animation.startTime property can be set to a number.
+PASS animation.startTime is 2
+
+The animation.effect property can be set back to null.
+PASS animation.startTime is null
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/webanimations/animation-interface-start-time-property.html b/LayoutTests/webanimations/animation-interface-start-time-property.html
new file mode 100644 (file)
index 0000000..5ce17ce
--- /dev/null
@@ -0,0 +1,23 @@
+<script src="../resources/js-test-pre.js"></script>
+<script>
+
+description("Check the behavior of the startTime property on Animation objects.");
+
+debug("The animation.startTime property should be null by default.");
+const animation = new Animation;
+shouldBeNull("animation.startTime");
+
+debug("");
+debug("The animation.startTime property can be set to a number.");
+animation.startTime = 2;
+shouldBe("animation.startTime", "2");
+
+debug("");
+debug("The animation.effect property can be set back to null.");
+animation.startTime = null;
+shouldBeNull("animation.startTime");
+
+debug("");
+
+</script>
+<script src="../resources/js-test-post.js"></script>
\ No newline at end of file
diff --git a/LayoutTests/webanimations/keyframe-effect-expected.txt b/LayoutTests/webanimations/keyframe-effect-expected.txt
new file mode 100644 (file)
index 0000000..e818cf3
--- /dev/null
@@ -0,0 +1,28 @@
+Check that the KeyframeEffect interface is defined and exposes a constructor.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+The KeyframeEffect interface is defined.
+PASS KeyframeEffect is defined.
+
+The KeyframeEffect interface cannot be constructed without parameters.
+PASS new KeyframeEffect threw exception TypeError: Not enough arguments.
+
+The KeyframeEffect interface constructor throws if the parameter has the wrong type.
+PASS (new KeyframeEffect(0)) threw exception TypeError: Argument 1 ('target') to the KeyframeEffect constructor must be an instance of Element.
+PASS (new KeyframeEffect({})) threw exception TypeError: Argument 1 ('target') to the KeyframeEffect constructor must be an instance of Element.
+PASS (new KeyframeEffect([])) threw exception TypeError: Argument 1 ('target') to the KeyframeEffect constructor must be an instance of Element.
+PASS (new KeyframeEffect(false)) threw exception TypeError: Argument 1 ('target') to the KeyframeEffect constructor must be an instance of Element.
+PASS (new KeyframeEffect('element')) threw exception TypeError: Argument 1 ('target') to the KeyframeEffect constructor must be an instance of Element.
+
+The KeyframeEffect interface target is set to the provided Element.
+PASS (new KeyframeEffect(document.body)).target is document.body
+
+A KeyframeEffect object target is read-only.
+PASS effect.target is document.body
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/webanimations/keyframe-effect-interface-timing-duration-expected.txt b/LayoutTests/webanimations/keyframe-effect-interface-timing-duration-expected.txt
new file mode 100644 (file)
index 0000000..07e3516
--- /dev/null
@@ -0,0 +1,17 @@
+Check that KeyframeEffect objects expose a duration through its timing property.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Check the default state of the timing and duration properties.
+PASS keyframeEffect.timing is defined.
+PASS keyframeEffect.timing.duration is defined.
+PASS keyframeEffect.timing.duration is 0
+
+Check that we can update the timing duration.
+PASS keyframeEffect.timing.duration is 2
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/webanimations/keyframe-effect-interface-timing-duration.html b/LayoutTests/webanimations/keyframe-effect-interface-timing-duration.html
new file mode 100644 (file)
index 0000000..9450613
--- /dev/null
@@ -0,0 +1,20 @@
+<script src="../resources/js-test-pre.js"></script>
+<script>
+
+description("Check that KeyframeEffect objects expose a duration through its timing property.");
+
+debug("Check the default state of the timing and duration properties.");
+const keyframeEffect = new KeyframeEffect(document.body);
+shouldBeDefined("keyframeEffect.timing");
+shouldBeDefined("keyframeEffect.timing.duration");
+shouldBe("keyframeEffect.timing.duration", "0");
+
+debug("");
+debug("Check that we can update the timing duration.");
+keyframeEffect.timing.duration = 2;
+shouldBe("keyframeEffect.timing.duration", "2");
+
+debug("");
+
+</script>
+<script src="../resources/js-test-post.js"></script>
\ No newline at end of file
diff --git a/LayoutTests/webanimations/keyframe-effect.html b/LayoutTests/webanimations/keyframe-effect.html
new file mode 100644 (file)
index 0000000..72c60cd
--- /dev/null
@@ -0,0 +1,34 @@
+<script src="../resources/js-test-pre.js"></script>
+<script>
+
+description("Check that the KeyframeEffect interface is defined and exposes a constructor.");
+
+debug("The KeyframeEffect interface is defined.");
+shouldBeDefined("KeyframeEffect");
+
+debug("");
+debug("The KeyframeEffect interface cannot be constructed without parameters.");
+shouldThrow("new KeyframeEffect");
+
+debug("");
+debug("The KeyframeEffect interface constructor throws if the parameter has the wrong type.");
+shouldThrow("(new KeyframeEffect(0))");
+shouldThrow("(new KeyframeEffect({}))");
+shouldThrow("(new KeyframeEffect([]))");
+shouldThrow("(new KeyframeEffect(false))");
+shouldThrow("(new KeyframeEffect('element'))");
+
+debug("");
+debug("The KeyframeEffect interface target is set to the provided Element.");
+shouldBe("(new KeyframeEffect(document.body)).target", "document.body");
+
+debug("");
+debug("A KeyframeEffect object target is read-only.");
+const effect = new KeyframeEffect(document.body);
+effect.target = document.createElement("div");
+shouldBe("effect.target", "document.body");
+
+debug("");
+
+</script>
+<script src="../resources/js-test-post.js"></script>
\ No newline at end of file
index 11930f2..2d11824 100644 (file)
@@ -418,8 +418,11 @@ set(WebCore_NON_SVG_IDL_FILES
     Modules/webvr/VRPose.idl
     Modules/webvr/VRStageParameters.idl
 
+    animation/AnimationEffect.idl
+    animation/AnimationEffectTiming.idl
     animation/AnimationTimeline.idl
     animation/DocumentTimeline.idl
+    animation/KeyframeEffect.idl
     animation/WebAnimation.idl
 
     crypto/CryptoAlgorithmParameters.idl
index 1b8a1c7..dbc2235 100644 (file)
@@ -1,3 +1,54 @@
+2017-10-24  Antoine Quint  <graouts@apple.com>
+
+        [Web Animations] Add basic timing and target properties
+        https://bugs.webkit.org/show_bug.cgi?id=178674
+
+        Reviewed by Dean Jackson.
+
+        We add three new interfaces to expose enough properties to establish basic timing properties,
+        a start time and duration, and the target of an animation. The startTime property is set on
+        the Animation object, the target is set on the KeyframeEffect set as the effect property on
+        the Animation object, and the duration is set on the AnimationEffectTiming set on the effect.
+
+        Tests: webanimations/animation-effect-timing.html
+               webanimations/animation-effect.html
+               webanimations/animation-interface-effect-property.html
+               webanimations/animation-interface-start-time-property.html
+               webanimations/keyframe-effect-interface-timing-duration.html
+               webanimations/keyframe-effect.html
+
+        * CMakeLists.txt:
+        * DerivedSources.make:
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * animation/AnimationEffect.cpp: Copied from Source/WebCore/animation/WebAnimation.idl.
+        (WebCore::AnimationEffect::AnimationEffect):
+        (WebCore::AnimationEffect::~AnimationEffect):
+        * animation/AnimationEffect.h: Copied from Source/WebCore/animation/WebAnimation.h.
+        (WebCore::AnimationEffect::isKeyframeEffect const):
+        (WebCore::AnimationEffect::timing const):
+        (WebCore::AnimationEffect::classType const):
+        * animation/AnimationEffect.idl: Copied from Source/WebCore/animation/WebAnimation.idl.
+        * animation/AnimationEffectTiming.cpp: Copied from Source/WebCore/animation/WebAnimation.idl.
+        (WebCore::AnimationEffectTiming::create):
+        (WebCore::AnimationEffectTiming::AnimationEffectTiming):
+        (WebCore::AnimationEffectTiming::~AnimationEffectTiming):
+        * animation/AnimationEffectTiming.h: Copied from Source/WebCore/animation/WebAnimation.h.
+        * animation/AnimationEffectTiming.idl: Copied from Source/WebCore/animation/WebAnimation.idl.
+        * animation/KeyframeEffect.cpp: Copied from Source/WebCore/animation/WebAnimation.idl.
+        (WebCore::KeyframeEffect::create):
+        (WebCore::KeyframeEffect::KeyframeEffect):
+        * animation/KeyframeEffect.h: Copied from Source/WebCore/animation/WebAnimation.h.
+        * animation/KeyframeEffect.idl: Copied from Source/WebCore/animation/WebAnimation.idl.
+        * animation/WebAnimation.cpp:
+        (WebCore::WebAnimation::setEffect):
+        * animation/WebAnimation.h:
+        * animation/WebAnimation.idl:
+        * bindings/js/JSAnimationEffectCustom.cpp: Copied from Source/WebCore/animation/WebAnimation.cpp.
+        (WebCore::toJSNewlyCreated):
+        (WebCore::toJS):
+        * bindings/js/WebCoreBuiltinNames.h:
+
 2017-10-24  Ryosuke Niwa  <rniwa@webkit.org>
 
         RenderSVGModelObject::checkIntersection triggers layout
index e5302cc..083ce05 100644 (file)
@@ -342,8 +342,11 @@ JS_BINDING_IDLS = \
     $(WebCore)/Modules/webvr/VRLayerInit.idl \
     $(WebCore)/Modules/webvr/VRPose.idl \
     $(WebCore)/Modules/webvr/VRStageParameters.idl \
+    $(WebCore)/animation/AnimationEffect.idl \
+    $(WebCore)/animation/AnimationEffectTiming.idl \
     $(WebCore)/animation/AnimationTimeline.idl \
     $(WebCore)/animation/DocumentTimeline.idl \
+    $(WebCore)/animation/KeyframeEffect.idl \
     $(WebCore)/animation/WebAnimation.idl \
     $(WebCore)/crypto/CryptoAlgorithmParameters.idl \
     $(WebCore)/crypto/CryptoKey.idl \
index 3c8a6fa..6f70b38 100644 (file)
@@ -311,11 +311,13 @@ accessibility/AccessibilityTableRow.cpp
 accessibility/AccessibilityTree.cpp
 accessibility/AccessibilityTreeItem.cpp
 
+animation/AnimationEffect.cpp
+animation/AnimationEffectTiming.cpp
 animation/AnimationTimeline.cpp
 animation/DocumentTimeline.cpp
+animation/KeyframeEffect.cpp
 animation/WebAnimation.cpp
 
-
 bindings/js/CachedModuleScriptLoader.cpp
 bindings/js/CachedScriptFetcher.cpp
 bindings/js/CallTracer.cpp
@@ -323,6 +325,7 @@ bindings/js/CommonVM.cpp
 bindings/js/DOMWrapperWorld.cpp
 bindings/js/GCController.cpp
 bindings/js/IDBBindingUtilities.cpp
+bindings/js/JSAnimationEffectCustom.cpp
 bindings/js/JSAnimationTimelineCustom.cpp
 bindings/js/JSAttrCustom.cpp
 bindings/js/JSAudioTrackCustom.cpp
@@ -905,6 +908,8 @@ JSAesGcmParams.cpp
 JSAesKeyParams.cpp
 JSAnalyserNode.cpp
 JSAnimationEvent.cpp
+JSAnimationEffect.cpp
+JSAnimationEffectTiming.cpp
 JSAnimationTimeline.cpp
 JSAttr.cpp
 JSAudioBuffer.cpp
@@ -1221,6 +1226,7 @@ JSIntersectionObserverCallback.cpp
 JSIntersectionObserverEntry.cpp
 JSJsonWebKey.cpp
 JSKeyboardEvent.cpp
+JSKeyframeEffect.cpp
 JSLocation.cpp
 JSLongRange.cpp
 JSMediaController.cpp
index 21b833e..0942854 100644 (file)
                7134496D146941B300720312 /* SVGLengthContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7134496B146941B300720312 /* SVGLengthContext.cpp */; };
                7134496E146941B300720312 /* SVGLengthContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 7134496C146941B300720312 /* SVGLengthContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
                71537A01146BD9D7008BD615 /* SVGPathData.h in Headers */ = {isa = PBXBuildFile; fileRef = 715379FF146BD9D6008BD615 /* SVGPathData.h */; };
+               71556CB21F9F09BA00E78D08 /* AnimationEffect.h in Headers */ = {isa = PBXBuildFile; fileRef = 71556CAD1F9F099D00E78D08 /* AnimationEffect.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               71556CB31F9F09BA00E78D08 /* AnimationEffectTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = 71556CAE1F9F099D00E78D08 /* AnimationEffectTiming.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               71556CB41F9F09BA00E78D08 /* KeyframeEffect.h in Headers */ = {isa = PBXBuildFile; fileRef = 71556CAA1F9F099B00E78D08 /* KeyframeEffect.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               71556CBC1F9F0A4900E78D08 /* JSAnimationEffect.h in Headers */ = {isa = PBXBuildFile; fileRef = 71556CB81F9F09FC00E78D08 /* JSAnimationEffect.h */; };
+               71556CBD1F9F0A4900E78D08 /* JSAnimationEffectTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = 71556CB91F9F09FD00E78D08 /* JSAnimationEffectTiming.h */; };
+               71556CBE1F9F0A4900E78D08 /* JSKeyframeEffect.h in Headers */ = {isa = PBXBuildFile; fileRef = 71556CB71F9F09FC00E78D08 /* JSKeyframeEffect.h */; };
                7157F062150B6564006EAABD /* SVGAnimatedTransformList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7157F061150B6564006EAABD /* SVGAnimatedTransformList.cpp */; };
                71A1B6081DEE5AD70073BCFB /* modern-media-controls-localized-strings.js in Resources */ = {isa = PBXBuildFile; fileRef = 71A1B6061DEE5A820073BCFB /* modern-media-controls-localized-strings.js */; };
                71A57DF1154BE25C0009D120 /* SVGPathUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 71A57DEF154BE25C0009D120 /* SVGPathUtilities.cpp */; };
                7152CEC31DD2236B00FD5962 /* slider-thumb@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "slider-thumb@2x.png"; sourceTree = "<group>"; };
                715379FE146BD9D6008BD615 /* SVGPathData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGPathData.cpp; sourceTree = "<group>"; };
                715379FF146BD9D6008BD615 /* SVGPathData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathData.h; sourceTree = "<group>"; };
+               71556CA81F9F099B00E78D08 /* KeyframeEffect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KeyframeEffect.cpp; sourceTree = "<group>"; };
+               71556CAA1F9F099B00E78D08 /* KeyframeEffect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeyframeEffect.h; sourceTree = "<group>"; };
+               71556CAB1F9F099C00E78D08 /* KeyframeEffect.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = KeyframeEffect.idl; sourceTree = "<group>"; };
+               71556CAC1F9F099D00E78D08 /* AnimationEffectTiming.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AnimationEffectTiming.cpp; sourceTree = "<group>"; };
+               71556CAD1F9F099D00E78D08 /* AnimationEffect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnimationEffect.h; sourceTree = "<group>"; };
+               71556CAE1F9F099D00E78D08 /* AnimationEffectTiming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnimationEffectTiming.h; sourceTree = "<group>"; };
+               71556CAF1F9F099E00E78D08 /* AnimationEffectTiming.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = AnimationEffectTiming.idl; sourceTree = "<group>"; };
+               71556CB01F9F099E00E78D08 /* AnimationEffect.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = AnimationEffect.idl; sourceTree = "<group>"; };
+               71556CB11F9F099F00E78D08 /* AnimationEffect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AnimationEffect.cpp; sourceTree = "<group>"; };
+               71556CB51F9F09DC00E78D08 /* JSAnimationEffectCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAnimationEffectCustom.cpp; sourceTree = "<group>"; };
+               71556CB61F9F09FC00E78D08 /* JSKeyframeEffect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSKeyframeEffect.cpp; sourceTree = "<group>"; };
+               71556CB71F9F09FC00E78D08 /* JSKeyframeEffect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSKeyframeEffect.h; sourceTree = "<group>"; };
+               71556CB81F9F09FC00E78D08 /* JSAnimationEffect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSAnimationEffect.h; sourceTree = "<group>"; };
+               71556CB91F9F09FD00E78D08 /* JSAnimationEffectTiming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSAnimationEffectTiming.h; sourceTree = "<group>"; };
+               71556CBA1F9F09FD00E78D08 /* JSAnimationEffect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAnimationEffect.cpp; sourceTree = "<group>"; };
+               71556CBB1F9F09FE00E78D08 /* JSAnimationEffectTiming.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAnimationEffectTiming.cpp; sourceTree = "<group>"; };
                7157E3D11DC1EE4B0094550E /* scrubbing-support.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "scrubbing-support.js"; sourceTree = "<group>"; };
                7157F061150B6564006EAABD /* SVGAnimatedTransformList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedTransformList.cpp; sourceTree = "<group>"; };
                716C8DF11E48B269005BD0DA /* volume-down-support.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "volume-down-support.js"; sourceTree = "<group>"; };
                1221E0581C02B409006A1A00 /* Animation */ = {
                        isa = PBXGroup;
                        children = (
+                               71556CBA1F9F09FD00E78D08 /* JSAnimationEffect.cpp */,
+                               71556CB81F9F09FC00E78D08 /* JSAnimationEffect.h */,
+                               71556CBB1F9F09FE00E78D08 /* JSAnimationEffectTiming.cpp */,
+                               71556CB91F9F09FD00E78D08 /* JSAnimationEffectTiming.h */,
                                71025EDA1F99F1A7004A250C /* JSAnimationTimeline.cpp */,
                                71025ED91F99F1A7004A250C /* JSAnimationTimeline.h */,
                                71025EDB1F99F1A8004A250C /* JSDocumentTimeline.cpp */,
                                71025EDC1F99F1A8004A250C /* JSDocumentTimeline.h */,
+                               71556CB61F9F09FC00E78D08 /* JSKeyframeEffect.cpp */,
+                               71556CB71F9F09FC00E78D08 /* JSKeyframeEffect.h */,
                                71025ED71F99F1A6004A250C /* JSWebAnimation.cpp */,
                                71025ED81F99F1A6004A250C /* JSWebAnimation.h */,
                        );
                71025EC11F99F096004A250C /* animation */ = {
                        isa = PBXGroup;
                        children = (
+                               71556CB11F9F099F00E78D08 /* AnimationEffect.cpp */,
+                               71556CAD1F9F099D00E78D08 /* AnimationEffect.h */,
+                               71556CB01F9F099E00E78D08 /* AnimationEffect.idl */,
+                               71556CAC1F9F099D00E78D08 /* AnimationEffectTiming.cpp */,
+                               71556CAE1F9F099D00E78D08 /* AnimationEffectTiming.h */,
+                               71556CAF1F9F099E00E78D08 /* AnimationEffectTiming.idl */,
                                71025EC61F99F096004A250C /* AnimationTimeline.cpp */,
                                71025EC71F99F096004A250C /* AnimationTimeline.h */,
                                71025EC91F99F096004A250C /* AnimationTimeline.idl */,
                                71025EC41F99F096004A250C /* DocumentTimeline.cpp */,
                                71025EC51F99F096004A250C /* DocumentTimeline.h */,
                                71025ECA1F99F096004A250C /* DocumentTimeline.idl */,
+                               71556CA81F9F099B00E78D08 /* KeyframeEffect.cpp */,
+                               71556CAA1F9F099B00E78D08 /* KeyframeEffect.h */,
+                               71556CAB1F9F099C00E78D08 /* KeyframeEffect.idl */,
                                71025EC31F99F096004A250C /* WebAnimation.cpp */,
                                71025EC21F99F096004A250C /* WebAnimation.h */,
                                71025EC81F99F096004A250C /* WebAnimation.idl */,
                7C3D8EE41E08BABE0023B084 /* GC / Wrapping Only */ = {
                        isa = PBXGroup;
                        children = (
+                               71556CB51F9F09DC00E78D08 /* JSAnimationEffectCustom.cpp */,
                                71025ED51F99F147004A250C /* JSAnimationTimelineCustom.cpp */,
                                BC2ED6BB0C6BD2F000920BFF /* JSAttrCustom.cpp */,
                                BE6DF70E171CA2DA00DD52B8 /* JSAudioTrackCustom.cpp */,
                                490707E71219C04300D90E51 /* ANGLEWebKitBridge.h in Headers */,
                                49E912AB0EFAC906009D0CAF /* Animation.h in Headers */,
                                316FE1120E6E1DA700BF6088 /* AnimationBase.h in Headers */,
+                               71556CB21F9F09BA00E78D08 /* AnimationEffect.h in Headers */,
+                               71556CB31F9F09BA00E78D08 /* AnimationEffectTiming.h in Headers */,
                                319848011A1D817B00A13318 /* AnimationEvent.h in Headers */,
                                49E912AD0EFAC906009D0CAF /* AnimationList.h in Headers */,
                                71025ECD1F99F0CE004A250C /* AnimationTimeline.h in Headers */,
                                57B5F8101E5E2A4E00F34F90 /* JSAesGcmParams.h in Headers */,
                                576814451E70CB1F00E77754 /* JSAesKeyParams.h in Headers */,
                                FDA15ECA12B03F50003A583A /* JSAnalyserNode.h in Headers */,
+                               71556CBC1F9F0A4900E78D08 /* JSAnimationEffect.h in Headers */,
+                               71556CBD1F9F0A4900E78D08 /* JSAnimationEffectTiming.h in Headers */,
                                3198480C1A1E6CE800A13318 /* JSAnimationEvent.h in Headers */,
                                71025EDE1F99F1EC004A250C /* JSAnimationTimeline.h in Headers */,
                                A1DF5A991F7EC8C00058A477 /* JSApplePayContactField.h in Headers */,
                                0F4710E81DB700C7002DCEC3 /* JSIntersectionObserverEntry.h in Headers */,
                                57E2335B1DC7D5E500F28D01 /* JSJsonWebKey.h in Headers */,
                                A86629D309DA2B48009633A5 /* JSKeyboardEvent.h in Headers */,
+                               71556CBE1F9F0A4900E78D08 /* JSKeyframeEffect.h in Headers */,
                                935F45430F7C3B5F00D7C1FB /* JSLazyEventListener.h in Headers */,
                                BCE1C43C0D9830D3003B02F2 /* JSLocation.h in Headers */,
                                93A806201E03B585008A1F26 /* JSLongRange.h in Headers */,
                                A513B3D7114B1666001C429B /* KeyEventCocoa.h in Headers */,
                                265541391489811C000DFC5D /* KeyEventCodesIOS.h in Headers */,
                                316FE11A0E6E1DA700BF6088 /* KeyframeAnimation.h in Headers */,
+                               71556CB41F9F09BA00E78D08 /* KeyframeEffect.h in Headers */,
                                BC5EBA110E823E4700B25965 /* KeyframeList.h in Headers */,
                                E15FF7D518C9553800FE4C87 /* KeypressCommand.h in Headers */,
                                450CEBF115073BBE002BB149 /* LabelableElement.h in Headers */,
diff --git a/Source/WebCore/animation/AnimationEffect.cpp b/Source/WebCore/animation/AnimationEffect.cpp
new file mode 100644 (file)
index 0000000..bf19a54
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2017 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 "AnimationEffect.h"
+
+#include "AnimationEffectTiming.h"
+
+namespace WebCore {
+
+AnimationEffect::AnimationEffect(ClassType classType)
+    : m_classType(classType)
+{
+    m_timing = AnimationEffectTiming::create();
+}
+
+} // namespace WebCore
diff --git a/Source/WebCore/animation/AnimationEffect.h b/Source/WebCore/animation/AnimationEffect.h
new file mode 100644 (file)
index 0000000..706383f
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2017 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 "AnimationEffectTiming.h"
+#include <wtf/Forward.h>
+#include <wtf/Ref.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+class AnimationEffect : public RefCounted<AnimationEffect> {
+public:
+    bool isKeyframeEffect() const { return m_classType == KeyframeEffectClass; }
+    AnimationEffectTiming* timing() const { return m_timing.get(); }
+
+    virtual ~AnimationEffect() { }
+
+protected:
+    enum ClassType {
+        KeyframeEffectClass
+    };
+
+    ClassType classType() const { return m_classType; }
+
+    explicit AnimationEffect(ClassType);
+
+private:
+    ClassType m_classType;
+    RefPtr<AnimationEffectTiming> m_timing;
+};
+
+} // namespace WebCore
+
+#define SPECIALIZE_TYPE_TRAITS_ANIMATION_EFFECT(ToValueTypeName, predicate) \
+SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::ToValueTypeName) \
+static bool isType(const WebCore::AnimationEffect& value) { return value.predicate; } \
+SPECIALIZE_TYPE_TRAITS_END()
diff --git a/Source/WebCore/animation/AnimationEffect.idl b/Source/WebCore/animation/AnimationEffect.idl
new file mode 100644 (file)
index 0000000..8e82cbc
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2017 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.
+ */
+
+[
+    EnabledAtRuntime=WebAnimations,
+    CustomToJSObject
+] interface AnimationEffect {
+    readonly attribute AnimationEffectTiming timing;
+};
diff --git a/Source/WebCore/animation/AnimationEffectTiming.cpp b/Source/WebCore/animation/AnimationEffectTiming.cpp
new file mode 100644 (file)
index 0000000..43fc26c
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2017 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 "AnimationEffectTiming.h"
+
+namespace WebCore {
+
+Ref<AnimationEffectTiming> AnimationEffectTiming::create()
+{
+    return adoptRef(*new AnimationEffectTiming());
+}
+
+AnimationEffectTiming::AnimationEffectTiming()
+    : m_duration(0)
+{
+}
+
+AnimationEffectTiming::~AnimationEffectTiming()
+{
+}
+
+} // namespace WebCore
diff --git a/Source/WebCore/animation/AnimationEffectTiming.h b/Source/WebCore/animation/AnimationEffectTiming.h
new file mode 100644 (file)
index 0000000..1bc4642
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2017 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 <wtf/Forward.h>
+#include <wtf/Ref.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+#include <wtf/Seconds.h>
+
+namespace WebCore {
+
+class AnimationEffectTiming final : public RefCounted<AnimationEffectTiming> {
+public:
+    static Ref<AnimationEffectTiming> create();
+    ~AnimationEffectTiming();
+
+    double bindingsDuration() const { return m_duration.value(); }
+    void setBindingsDuration(double duration) { m_duration = Seconds(duration); }
+    Seconds duration() const { return m_duration; }
+    void setDuration(Seconds& duration) { m_duration = duration; }
+
+private:
+    AnimationEffectTiming();
+    Seconds m_duration;
+};
+
+} // namespace WebCore
diff --git a/Source/WebCore/animation/AnimationEffectTiming.idl b/Source/WebCore/animation/AnimationEffectTiming.idl
new file mode 100644 (file)
index 0000000..df8e873
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2017 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.
+ */
+
+[
+    EnabledAtRuntime=WebAnimations,
+    ImplementationLacksVTable
+] interface AnimationEffectTiming {
+    [ImplementedAs=bindingsDuration] attribute unrestricted double duration;
+};
diff --git a/Source/WebCore/animation/KeyframeEffect.cpp b/Source/WebCore/animation/KeyframeEffect.cpp
new file mode 100644 (file)
index 0000000..cb7bb22
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2017 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 "KeyframeEffect.h"
+
+#include "Element.h"
+
+namespace WebCore {
+
+Ref<KeyframeEffect> KeyframeEffect::create(Element* target)
+{
+    return adoptRef(*new KeyframeEffect(target));
+}
+
+KeyframeEffect::KeyframeEffect(Element* target)
+    : AnimationEffect(KeyframeEffectClass)
+    , m_target(target)
+{
+}
+
+} // namespace WebCore
diff --git a/Source/WebCore/animation/KeyframeEffect.h b/Source/WebCore/animation/KeyframeEffect.h
new file mode 100644 (file)
index 0000000..d5e4f36
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2017 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 "AnimationEffect.h"
+#include <wtf/Ref.h>
+
+namespace WebCore {
+
+class Element;
+
+class KeyframeEffect final : public AnimationEffect {
+public:
+    static Ref<KeyframeEffect> create(Element*);
+    ~KeyframeEffect() { }
+
+    Element* target() const { return m_target.get(); }
+
+private:
+    KeyframeEffect(Element*);
+    RefPtr<Element> m_target;
+
+};
+
+} // namespace WebCore
+
+SPECIALIZE_TYPE_TRAITS_ANIMATION_EFFECT(KeyframeEffect, isKeyframeEffect());
diff --git a/Source/WebCore/animation/KeyframeEffect.idl b/Source/WebCore/animation/KeyframeEffect.idl
new file mode 100644 (file)
index 0000000..538e831
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2017 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.
+ */
+
+[
+    EnabledAtRuntime=WebAnimations,
+    Constructor(Element? target)
+] interface KeyframeEffect : AnimationEffect {
+    readonly attribute Element? target;
+};
index 969d842..893262f 100644 (file)
 
 #include "config.h"
 #include "WebAnimation.h"
-#include <wtf/text/WTFString.h>
 
+#include "AnimationEffect.h"
 #include "AnimationTimeline.h"
+#include <wtf/text/WTFString.h>
 
 namespace WebCore {
 
@@ -52,6 +53,26 @@ WebAnimation::~WebAnimation()
         m_timeline->removeAnimation(*this);
 }
 
+void WebAnimation::setEffect(RefPtr<AnimationEffect>&& effect)
+{
+    m_effect = WTFMove(effect);
+}
+
+std::optional<double> WebAnimation::bindingsStartTime() const
+{
+    if (m_startTime)
+        return m_startTime->secondsSinceEpoch().value();
+    return std::nullopt;
+}
+
+void WebAnimation::setBindingsStartTime(std::optional<double> startTime)
+{
+    if (startTime == std::nullopt)
+        m_startTime = std::nullopt;
+    else
+        m_startTime = MonotonicTime::fromRawSeconds(startTime.value());
+}
+
 String WebAnimation::description()
 {
     return "Animation";
index e7d8bf8..c320793 100644 (file)
 #pragma once
 
 #include <wtf/Forward.h>
+#include <wtf/MonotonicTime.h>
+#include <wtf/Optional.h>
 #include <wtf/Ref.h>
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
 
 namespace WebCore {
 
+class AnimationEffect;
 class AnimationTimeline;
 
 class WebAnimation final : public RefCounted<WebAnimation> {
@@ -39,12 +42,21 @@ public:
     static Ref<WebAnimation> create(AnimationTimeline*);
     ~WebAnimation();
 
+    AnimationEffect* effect() const { return m_effect.get(); }
+    void setEffect(RefPtr<AnimationEffect>&&);
     AnimationTimeline* timeline() const { return m_timeline.get(); }
+    std::optional<double> bindingsStartTime() const;
+    void setBindingsStartTime(std::optional<double>);
+    std::optional<MonotonicTime> startTime() const { return m_startTime; }
+    void setStartTime(MonotonicTime& startTime) { m_startTime = startTime; }
+
     String description();
 
 private:
     WebAnimation(AnimationTimeline*);
+    RefPtr<AnimationEffect> m_effect;
     RefPtr<AnimationTimeline> m_timeline;
+    std::optional<MonotonicTime> m_startTime;
 };
 
 } // namespace WebCore
index 361ffab..e1993cc 100644 (file)
@@ -29,5 +29,7 @@
     ImplementationLacksVTable,
     Constructor(optional AnimationTimeline? timeline)
 ] interface WebAnimation {
+    attribute AnimationEffect? effect;
     readonly attribute AnimationTimeline? timeline;
+    [ImplementedAs=bindingsStartTime] attribute double? startTime;
 };
diff --git a/Source/WebCore/bindings/js/JSAnimationEffectCustom.cpp b/Source/WebCore/bindings/js/JSAnimationEffectCustom.cpp
new file mode 100644 (file)
index 0000000..9ae152b
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2017 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 "JSAnimationEffect.h"
+
+#include "JSDOMBinding.h"
+#include "JSKeyframeEffect.h"
+#include "KeyframeEffect.h"
+
+using namespace JSC;
+
+namespace WebCore {
+
+JSValue toJSNewlyCreated(ExecState*, JSDOMGlobalObject* globalObject, Ref<AnimationEffect>&& value)
+{
+    if (value->isKeyframeEffect())
+        return createWrapper<KeyframeEffect>(globalObject, WTFMove(value));
+    return createWrapper<AnimationEffect>(globalObject, WTFMove(value));
+}
+
+JSValue toJS(ExecState* state, JSDOMGlobalObject* globalObject, AnimationEffect& value)
+{
+    return wrap(state, globalObject, value);
+}
+
+} // namespace WebCore
index f58943d..b2ca885 100644 (file)
@@ -32,6 +32,8 @@ namespace WebCore {
 
 #define WEBCORE_COMMON_PRIVATE_IDENTIFIERS_EACH_PROPERTY_NAME(macro) \
     macro(Animation) \
+    macro(AnimationEffect) \
+    macro(AnimationEffectTiming) \
     macro(AnimationTimeline) \
     macro(ApplePaySession) \
     macro(AttachmentElement) \
@@ -75,6 +77,7 @@ namespace WebCore {
     macro(InputEvent) \
     macro(IntersectionObserver) \
     macro(IntersectionObserverEntry) \
+    macro(KeyframeEffect) \
     macro(MediaEncryptedEvent) \
     macro(MediaKeyMessageEvent) \
     macro(MediaKeySession) \