[Web Animations] Implement getTiming() and updateTiming()
authorgraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Nov 2018 11:15:30 +0000 (11:15 +0000)
committergraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Nov 2018 11:15:30 +0000 (11:15 +0000)
https://bugs.webkit.org/show_bug.cgi?id=186511
<rdar://problem/41000677>

Reviewed by Dean Jackson.

The Web Animations API has been further simplified by removing the AnimationEffectTiming and AnimationEffectTimingReadOnly
interfaces, removing the "timing" property on AnimationEffect replacing it with getTiming() and updateTiming() methods. This
does not change the features of the API but simply how they are exposed.

* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* animation/AnimationEffect.cpp:
(WebCore::AnimationEffect::AnimationEffect):
(WebCore::AnimationEffect::~AnimationEffect):
(WebCore::AnimationEffect::phase const):
(WebCore::AnimationEffect::activeTime const):
(WebCore::AnimationEffect::overallProgress const):
(WebCore::AnimationEffect::simpleIterationProgress const):
(WebCore::AnimationEffect::currentIteration const):
(WebCore::AnimationEffect::currentDirection const):
(WebCore::AnimationEffect::transformedProgress const):
(WebCore::AnimationEffect::getTiming):
(WebCore::AnimationEffect::getComputedTiming):
(WebCore::AnimationEffect::updateTiming):
(WebCore::AnimationEffect::setIterationStart):
(WebCore::AnimationEffect::setIterations):
(WebCore::AnimationEffect::endTime const):
(WebCore::AnimationEffect::setDelay):
(WebCore::AnimationEffect::setEndDelay):
(WebCore::AnimationEffect::setFill):
(WebCore::AnimationEffect::setIterationDuration):
(WebCore::AnimationEffect::setDirection):
(WebCore::AnimationEffect::setTimingFunction):
(WebCore::AnimationEffect::activeDuration const):
* animation/AnimationEffect.h:
(WebCore::AnimationEffect::delay const):
(WebCore::AnimationEffect::endDelay const):
(WebCore::AnimationEffect::fill const):
(WebCore::AnimationEffect::iterationStart const):
(WebCore::AnimationEffect::iterations const):
(WebCore::AnimationEffect::iterationDuration const):
(WebCore::AnimationEffect::direction const):
(WebCore::AnimationEffect::timingFunction const):
* animation/AnimationEffect.idl:
* animation/AnimationEffectTiming.idl: Removed.
* animation/AnimationEffectTimingReadOnly.cpp: Removed.
* animation/AnimationEffectTimingReadOnly.h: Removed.
* animation/AnimationEffectTimingReadOnly.idl: Removed.
* animation/CSSAnimation.cpp:
(WebCore::CSSAnimation::syncPropertiesWithBackingAnimation):
* animation/CSSTransition.cpp:
(WebCore::CSSTransition::setTimingProperties):
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::invalidateDOMEvents):
* animation/DocumentTimeline.cpp:
* animation/EffectTiming.idl:
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::create):
(WebCore::KeyframeEffect::KeyframeEffect):
(WebCore::KeyframeEffect::copyPropertiesFromSource):
(WebCore::KeyframeEffect::setAnimatedPropertiesInStyle):
(WebCore::KeyframeEffect::applyPendingAcceleratedActions):
(WebCore::KeyframeEffect::backingAnimationForCompositedRenderer const):
* animation/KeyframeEffect.h:
* animation/OptionalEffectTiming.h: Renamed from Source/WebCore/animation/AnimationEffectTiming.h.
* animation/OptionalEffectTiming.idl: Renamed from Source/WebCore/animation/AnimationEffectTiming.cpp.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::effectTimingDidChange):
(WebCore::WebAnimation::updatePlaybackRate):
* animation/WebAnimation.h:
(WebCore::WebAnimation::isRelevant const):
* bindings/js/JSAnimationEffectTimingReadOnlyCustom.cpp: Removed.
* bindings/js/WebCoreBuiltinNames.h:

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

25 files changed:
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
Source/WebCore/animation/AnimationEffect.h
Source/WebCore/animation/AnimationEffect.idl
Source/WebCore/animation/AnimationEffectTiming.idl [deleted file]
Source/WebCore/animation/AnimationEffectTimingReadOnly.cpp [deleted file]
Source/WebCore/animation/AnimationEffectTimingReadOnly.h [deleted file]
Source/WebCore/animation/AnimationEffectTimingReadOnly.idl [deleted file]
Source/WebCore/animation/CSSAnimation.cpp
Source/WebCore/animation/CSSTransition.cpp
Source/WebCore/animation/DeclarativeAnimation.cpp
Source/WebCore/animation/DocumentTimeline.cpp
Source/WebCore/animation/EffectTiming.idl
Source/WebCore/animation/KeyframeEffect.cpp
Source/WebCore/animation/KeyframeEffect.h
Source/WebCore/animation/OptionalEffectTiming.h [moved from Source/WebCore/animation/AnimationEffectTiming.h with 69% similarity]
Source/WebCore/animation/OptionalEffectTiming.idl [moved from Source/WebCore/animation/AnimationEffectTiming.cpp with 74% similarity]
Source/WebCore/animation/WebAnimation.cpp
Source/WebCore/animation/WebAnimation.h
Source/WebCore/bindings/js/JSAnimationEffectTimingReadOnlyCustom.cpp [deleted file]
Source/WebCore/bindings/js/WebCoreBuiltinNames.h

index a676729..c778f7f 100644 (file)
@@ -482,9 +482,7 @@ set(WebCore_NON_SVG_IDL_FILES
 
     animation/Animatable.idl
     animation/AnimationEffect.idl
-    animation/AnimationEffectTiming.idl
     animation/EffectTiming.idl
-    animation/AnimationEffectTimingReadOnly.idl
     animation/AnimationPlaybackEvent.idl
     animation/AnimationPlaybackEventInit.idl
     animation/AnimationTimeline.idl
@@ -499,6 +497,7 @@ set(WebCore_NON_SVG_IDL_FILES
     animation/KeyframeAnimationOptions.idl
     animation/KeyframeEffect.idl
     animation/KeyframeEffectOptions.idl
+    animation/OptionalEffectTiming.idl
     animation/PlaybackDirection.idl
     animation/WebAnimation.idl
 
index c6cdf77..e679254 100644 (file)
@@ -1,5 +1,84 @@
 2018-11-06  Antoine Quint  <graouts@apple.com>
 
+        [Web Animations] Implement getTiming() and updateTiming()
+        https://bugs.webkit.org/show_bug.cgi?id=186511
+        <rdar://problem/41000677>
+
+        Reviewed by Dean Jackson.
+
+        The Web Animations API has been further simplified by removing the AnimationEffectTiming and AnimationEffectTimingReadOnly
+        interfaces, removing the "timing" property on AnimationEffect replacing it with getTiming() and updateTiming() methods. This
+        does not change the features of the API but simply how they are exposed.
+
+        * CMakeLists.txt:
+        * DerivedSources.make:
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * animation/AnimationEffect.cpp:
+        (WebCore::AnimationEffect::AnimationEffect):
+        (WebCore::AnimationEffect::~AnimationEffect):
+        (WebCore::AnimationEffect::phase const):
+        (WebCore::AnimationEffect::activeTime const):
+        (WebCore::AnimationEffect::overallProgress const):
+        (WebCore::AnimationEffect::simpleIterationProgress const):
+        (WebCore::AnimationEffect::currentIteration const):
+        (WebCore::AnimationEffect::currentDirection const):
+        (WebCore::AnimationEffect::transformedProgress const):
+        (WebCore::AnimationEffect::getTiming):
+        (WebCore::AnimationEffect::getComputedTiming):
+        (WebCore::AnimationEffect::updateTiming):
+        (WebCore::AnimationEffect::setIterationStart):
+        (WebCore::AnimationEffect::setIterations):
+        (WebCore::AnimationEffect::endTime const):
+        (WebCore::AnimationEffect::setDelay):
+        (WebCore::AnimationEffect::setEndDelay):
+        (WebCore::AnimationEffect::setFill):
+        (WebCore::AnimationEffect::setIterationDuration):
+        (WebCore::AnimationEffect::setDirection):
+        (WebCore::AnimationEffect::setTimingFunction):
+        (WebCore::AnimationEffect::activeDuration const):
+        * animation/AnimationEffect.h:
+        (WebCore::AnimationEffect::delay const):
+        (WebCore::AnimationEffect::endDelay const):
+        (WebCore::AnimationEffect::fill const):
+        (WebCore::AnimationEffect::iterationStart const):
+        (WebCore::AnimationEffect::iterations const):
+        (WebCore::AnimationEffect::iterationDuration const):
+        (WebCore::AnimationEffect::direction const):
+        (WebCore::AnimationEffect::timingFunction const):
+        * animation/AnimationEffect.idl:
+        * animation/AnimationEffectTiming.idl: Removed.
+        * animation/AnimationEffectTimingReadOnly.cpp: Removed.
+        * animation/AnimationEffectTimingReadOnly.h: Removed.
+        * animation/AnimationEffectTimingReadOnly.idl: Removed.
+        * animation/CSSAnimation.cpp:
+        (WebCore::CSSAnimation::syncPropertiesWithBackingAnimation):
+        * animation/CSSTransition.cpp:
+        (WebCore::CSSTransition::setTimingProperties):
+        * animation/DeclarativeAnimation.cpp:
+        (WebCore::DeclarativeAnimation::invalidateDOMEvents):
+        * animation/DocumentTimeline.cpp:
+        * animation/EffectTiming.idl:
+        * animation/KeyframeEffect.cpp:
+        (WebCore::KeyframeEffect::create):
+        (WebCore::KeyframeEffect::KeyframeEffect):
+        (WebCore::KeyframeEffect::copyPropertiesFromSource):
+        (WebCore::KeyframeEffect::setAnimatedPropertiesInStyle):
+        (WebCore::KeyframeEffect::applyPendingAcceleratedActions):
+        (WebCore::KeyframeEffect::backingAnimationForCompositedRenderer const):
+        * animation/KeyframeEffect.h:
+        * animation/OptionalEffectTiming.h: Renamed from Source/WebCore/animation/AnimationEffectTiming.h.
+        * animation/OptionalEffectTiming.idl: Renamed from Source/WebCore/animation/AnimationEffectTiming.cpp.
+        * animation/WebAnimation.cpp:
+        (WebCore::WebAnimation::effectTimingDidChange):
+        (WebCore::WebAnimation::updatePlaybackRate):
+        * animation/WebAnimation.h:
+        (WebCore::WebAnimation::isRelevant const):
+        * bindings/js/JSAnimationEffectTimingReadOnlyCustom.cpp: Removed.
+        * bindings/js/WebCoreBuiltinNames.h:
+
+2018-11-06  Antoine Quint  <graouts@apple.com>
+
         [Web Animations] Update the Web Animations API to remove all the ReadOnly interfaces
         https://bugs.webkit.org/show_bug.cgi?id=186512
         <rdar://problem/41000691>
index 43ebf25..dfff3a2 100644 (file)
@@ -398,9 +398,7 @@ JS_BINDING_IDLS = \
     $(WebCore)/accessibility/AriaAttributes.idl \
     $(WebCore)/animation/Animatable.idl \
     $(WebCore)/animation/AnimationEffect.idl \
-    $(WebCore)/animation/AnimationEffectTiming.idl \
     $(WebCore)/animation/EffectTiming.idl \
-    $(WebCore)/animation/AnimationEffectTimingReadOnly.idl \
     $(WebCore)/animation/AnimationPlaybackEvent.idl \
     $(WebCore)/animation/AnimationPlaybackEventInit.idl \
     $(WebCore)/animation/AnimationTimeline.idl \
@@ -415,6 +413,7 @@ JS_BINDING_IDLS = \
     $(WebCore)/animation/KeyframeAnimationOptions.idl \
     $(WebCore)/animation/KeyframeEffect.idl \
     $(WebCore)/animation/KeyframeEffectOptions.idl \
+    $(WebCore)/animation/OptionalEffectTiming.idl \
     $(WebCore)/animation/PlaybackDirection.idl \
     $(WebCore)/animation/WebAnimation.idl \
     $(WebCore)/crypto/CryptoAlgorithmParameters.idl \
index 12657f4..d2e6cb2 100644 (file)
@@ -349,8 +349,6 @@ accessibility/AccessibilityTreeItem.cpp
 accessibility/AccessibleSetValueEvent.cpp
 
 animation/AnimationEffect.cpp
-animation/AnimationEffectTiming.cpp
-animation/AnimationEffectTimingReadOnly.cpp
 animation/AnimationPlaybackEvent.cpp
 animation/AnimationTimeline.cpp
 animation/CSSAnimation.cpp
@@ -371,7 +369,6 @@ bindings/js/GCController.cpp
 bindings/js/IDBBindingUtilities.cpp
 bindings/js/JSAuthenticatorResponseCustom.cpp
 bindings/js/JSAnimationEffectCustom.cpp
-bindings/js/JSAnimationEffectTimingReadOnlyCustom.cpp
 bindings/js/JSAnimationTimelineCustom.cpp
 bindings/js/JSAttrCustom.cpp
 bindings/js/JSAudioTrackCustom.cpp
@@ -2451,9 +2448,7 @@ JSAesKeyParams.cpp
 JSAnalyserNode.cpp
 JSAnimationEvent.cpp
 JSAnimationEffect.cpp
-JSAnimationEffectTiming.cpp
 JSEffectTiming.cpp
-JSAnimationEffectTimingReadOnly.cpp
 JSAnimationPlaybackEvent.cpp
 JSAnimationPlaybackEventInit.cpp
 JSAnimationTimeline.cpp
@@ -2860,12 +2855,13 @@ JSOfflineAudioCompletionEvent.cpp
 JSOfflineAudioContext.cpp
 JSOffscreenCanvas.cpp
 JSOffscreenCanvasRenderingContext2D.cpp
-JSPaintRenderingContext2D.cpp
+JSOptionalEffectTiming.cpp
 JSOscillatorNode.cpp
 JSOverconstrainedError.cpp
 JSOverconstrainedErrorEvent.cpp
 JSOverflowEvent.cpp
 JSPageTransitionEvent.cpp
+JSPaintRenderingContext2D.cpp
 JSPannerNode.cpp
 JSParentNode.cpp
 JSPath2D.cpp
index 65764be..7078c13 100644 (file)
                7116E2CF1FED765B00C06FDE /* JSComputedEffectTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = 7116E2CE1FED765200C06FDE /* JSComputedEffectTiming.h */; settings = {ATTRIBUTES = (Private, ); }; };
                7117445914BC34EC00EE5FC8 /* SVGTextMetricsBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 7117445714BC34E200EE5FC8 /* SVGTextMetricsBuilder.h */; };
                7118FED515685CC60030B79A /* JSSVGViewSpec.h in Headers */ = {isa = PBXBuildFile; fileRef = 7118FED315685CC60030B79A /* JSSVGViewSpec.h */; };
+               71207340216DFB0000C78329 /* OptionalEffectTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = 7120733D216DFAF100C78329 /* OptionalEffectTiming.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               71207343216DFB4100C78329 /* JSOptionalEffectTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = 71207341216DFB3100C78329 /* JSOptionalEffectTiming.h */; settings = {ATTRIBUTES = (Private, ); }; };
                71247E371FEA5F86008C08CE /* CompositeOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 71247E351FEA5F81008C08CE /* CompositeOperation.h */; settings = {ATTRIBUTES = (Private, ); }; };
                71247E381FEA5F86008C08CE /* IterationCompositeOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 71247E331FEA5F80008C08CE /* IterationCompositeOperation.h */; settings = {ATTRIBUTES = (Private, ); }; };
                71247E391FEA5F86008C08CE /* KeyframeAnimationOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 71247E2F1FEA5F7D008C08CE /* KeyframeAnimationOptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
                713171341FBE78DB00F758DE /* CSSPropertyBlendingClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 713171321FBE78C500F758DE /* CSSPropertyBlendingClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
                7132445120109DA500AE7FB2 /* WebAnimationUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 7132444F20109D9B00AE7FB2 /* WebAnimationUtilities.h */; settings = {ATTRIBUTES = (Private, ); }; };
                7134496E146941B300720312 /* SVGLengthContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 7134496C146941B300720312 /* SVGLengthContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               71495DD6202B065700ADFD34 /* AnimationEffectTimingReadOnly.h in Headers */ = {isa = PBXBuildFile; fileRef = 71495DD5202B064300ADFD34 /* AnimationEffectTimingReadOnly.h */; settings = {ATTRIBUTES = (Private, ); }; };
                71495DDB202B06F100ADFD34 /* JSEffectTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = 71495DDA202B06DE00ADFD34 /* JSEffectTiming.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               71495DDC202B06F700ADFD34 /* JSAnimationEffectTimingReadOnly.h in Headers */ = {isa = PBXBuildFile; fileRef = 71495DD7202B06DA00ADFD34 /* JSAnimationEffectTimingReadOnly.h */; settings = {ATTRIBUTES = (Private, ); }; };
                714C7C661FDAD2A100F2BEE1 /* AnimationPlaybackEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 714C7C651FDAD27B00F2BEE1 /* AnimationPlaybackEvent.h */; settings = {ATTRIBUTES = (Private, ); }; };
                714C7C671FDAD2A900F2BEE1 /* AnimationPlaybackEventInit.h in Headers */ = {isa = PBXBuildFile; fileRef = 714C7C621FDAD27A00F2BEE1 /* AnimationPlaybackEventInit.h */; settings = {ATTRIBUTES = (Private, ); }; };
                714C7C6C1FDADAF300F2BEE1 /* JSAnimationPlaybackEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 714C7C6A1FDADAD500F2BEE1 /* JSAnimationPlaybackEvent.h */; };
                714C7C6D1FDADAF600F2BEE1 /* JSAnimationPlaybackEventInit.h in Headers */ = {isa = PBXBuildFile; fileRef = 714C7C6B1FDADAD500F2BEE1 /* JSAnimationPlaybackEventInit.h */; };
                71537A01146BD9D7008BD615 /* SVGPathData.h in Headers */ = {isa = PBXBuildFile; fileRef = 715379FF146BD9D6008BD615 /* SVGPathData.h */; };
-               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, ); }; };
-               71556CBD1F9F0A4900E78D08 /* JSAnimationEffectTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = 71556CB91F9F09FD00E78D08 /* JSAnimationEffectTiming.h */; };
                71556CBE1F9F0A4900E78D08 /* JSKeyframeEffect.h in Headers */ = {isa = PBXBuildFile; fileRef = 71556CB71F9F09FC00E78D08 /* JSKeyframeEffect.h */; };
                715AD7202050513200D592DC /* DeclarativeAnimation.h in Headers */ = {isa = PBXBuildFile; fileRef = 715AD71D2050512400D592DC /* DeclarativeAnimation.h */; settings = {ATTRIBUTES = (Private, ); }; };
                715AD7212050513F00D592DC /* CSSTransition.h in Headers */ = {isa = PBXBuildFile; fileRef = 7123C186204739BA00789392 /* CSSTransition.h */; };
                71025EDC1F99F1A8004A250C /* JSDocumentTimeline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDocumentTimeline.h; sourceTree = "<group>"; };
                710FA74B1DEE576D004C715E /* controls-bar.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "controls-bar.js"; sourceTree = "<group>"; };
                710FA74C1DEE577E004C715E /* controls-visibility-support.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "controls-visibility-support.js"; sourceTree = "<group>"; };
-               7110F953202B67D500C466D7 /* JSAnimationEffectTimingReadOnlyCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAnimationEffectTimingReadOnlyCustom.cpp; sourceTree = "<group>"; };
                7116E2C91FED75D000C06FDE /* ComputedEffectTiming.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ComputedEffectTiming.idl; sourceTree = "<group>"; };
                7116E2CB1FED75D100C06FDE /* ComputedEffectTiming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ComputedEffectTiming.h; sourceTree = "<group>"; };
                7116E2CD1FED765200C06FDE /* JSComputedEffectTiming.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSComputedEffectTiming.cpp; sourceTree = "<group>"; };
                7118FED215685CC60030B79A /* JSSVGViewSpec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGViewSpec.cpp; sourceTree = "<group>"; };
                7118FED315685CC60030B79A /* JSSVGViewSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSVGViewSpec.h; sourceTree = "<group>"; };
                711FB0751DC7688F00C4C708 /* placard-support.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "placard-support.js"; sourceTree = "<group>"; };
+               7120733D216DFAF100C78329 /* OptionalEffectTiming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OptionalEffectTiming.h; sourceTree = "<group>"; };
+               7120733F216DFAF200C78329 /* OptionalEffectTiming.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = OptionalEffectTiming.idl; sourceTree = "<group>"; };
+               71207341216DFB3100C78329 /* JSOptionalEffectTiming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSOptionalEffectTiming.h; sourceTree = "<group>"; };
+               71207342216DFB3100C78329 /* JSOptionalEffectTiming.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSOptionalEffectTiming.cpp; sourceTree = "<group>"; };
                712157C01DCCCA0700AA7A92 /* macos-fullscreen-media-controls.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = "macos-fullscreen-media-controls.css"; sourceTree = "<group>"; };
                712157C11DCCCA0700AA7A92 /* macos-fullscreen-media-controls.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "macos-fullscreen-media-controls.js"; sourceTree = "<group>"; };
                7123C1822047399200789392 /* JSCSSTransition.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCSSTransition.cpp; sourceTree = "<group>"; };
                714131481DC9D6EF00336107 /* js-files */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "js-files"; sourceTree = "<group>"; };
                7146DF8B1DEFC2ED0046F98B /* tracks-panel.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = "tracks-panel.css"; sourceTree = "<group>"; };
                7146DF8C1DEFC2ED0046F98B /* tracks-panel.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "tracks-panel.js"; sourceTree = "<group>"; };
-               71495DD2202B064100ADFD34 /* AnimationEffectTimingReadOnly.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = AnimationEffectTimingReadOnly.idl; sourceTree = "<group>"; };
-               71495DD4202B064200ADFD34 /* AnimationEffectTimingReadOnly.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AnimationEffectTimingReadOnly.cpp; sourceTree = "<group>"; };
-               71495DD5202B064300ADFD34 /* AnimationEffectTimingReadOnly.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnimationEffectTimingReadOnly.h; sourceTree = "<group>"; };
-               71495DD7202B06DA00ADFD34 /* JSAnimationEffectTimingReadOnly.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSAnimationEffectTimingReadOnly.h; sourceTree = "<group>"; };
                71495DD8202B06DC00ADFD34 /* JSEffectTiming.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSEffectTiming.cpp; sourceTree = "<group>"; };
-               71495DD9202B06DD00ADFD34 /* JSAnimationEffectTimingReadOnly.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAnimationEffectTimingReadOnly.cpp; sourceTree = "<group>"; };
                71495DDA202B06DE00ADFD34 /* JSEffectTiming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSEffectTiming.h; sourceTree = "<group>"; };
                714C7C601FDAD27900F2BEE1 /* AnimationPlaybackEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AnimationPlaybackEvent.cpp; sourceTree = "<group>"; };
                714C7C621FDAD27A00F2BEE1 /* AnimationPlaybackEventInit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AnimationPlaybackEventInit.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>"; };
-               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>"; };
                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>"; };
-               71556CB91F9F09FD00E78D08 /* JSAnimationEffectTiming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSAnimationEffectTiming.h; 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>"; };
                715AD71D2050512400D592DC /* DeclarativeAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeclarativeAnimation.h; sourceTree = "<group>"; };
                1221E0581C02B409006A1A00 /* Animation */ = {
                        isa = PBXGroup;
                        children = (
-                               71556CBB1F9F09FE00E78D08 /* JSAnimationEffectTiming.cpp */,
-                               71556CB91F9F09FD00E78D08 /* JSAnimationEffectTiming.h */,
                                71495DD8202B06DC00ADFD34 /* JSEffectTiming.cpp */,
                                71495DDA202B06DE00ADFD34 /* JSEffectTiming.h */,
-                               71495DD9202B06DD00ADFD34 /* JSAnimationEffectTimingReadOnly.cpp */,
-                               71495DD7202B06DA00ADFD34 /* JSAnimationEffectTimingReadOnly.h */,
                                714C7C691FDADAD500F2BEE1 /* JSAnimationPlaybackEvent.cpp */,
                                714C7C6A1FDADAD500F2BEE1 /* JSAnimationPlaybackEvent.h */,
                                714C7C681FDADAD400F2BEE1 /* JSAnimationPlaybackEventInit.cpp */,
                                71556CB71F9F09FC00E78D08 /* JSKeyframeEffect.h */,
                                71247E2D1FEA5F65008C08CE /* JSKeyframeEffectOptions.cpp */,
                                71247E2A1FEA5F62008C08CE /* JSKeyframeEffectOptions.h */,
+                               71207342216DFB3100C78329 /* JSOptionalEffectTiming.cpp */,
+                               71207341216DFB3100C78329 /* JSOptionalEffectTiming.h */,
                                712BE4871FE8685A002031CC /* JSPlaybackDirection.cpp */,
                                712BE4861FE86859002031CC /* JSPlaybackDirection.h */,
                                71025ED71F99F1A6004A250C /* JSWebAnimation.cpp */,
                                71EFCEDA202B388F00D7C411 /* AnimationEffect.cpp */,
                                71EFCED7202B388D00D7C411 /* AnimationEffect.h */,
                                71EFCED6202B388C00D7C411 /* AnimationEffect.idl */,
-                               71556CAC1F9F099D00E78D08 /* AnimationEffectTiming.cpp */,
-                               71556CAE1F9F099D00E78D08 /* AnimationEffectTiming.h */,
-                               71556CAF1F9F099E00E78D08 /* AnimationEffectTiming.idl */,
                                712BE47C1FE86448002031CC /* EffectTiming.h */,
                                712BE47A1FE86447002031CC /* EffectTiming.idl */,
-                               71495DD4202B064200ADFD34 /* AnimationEffectTimingReadOnly.cpp */,
-                               71495DD5202B064300ADFD34 /* AnimationEffectTimingReadOnly.h */,
-                               71495DD2202B064100ADFD34 /* AnimationEffectTimingReadOnly.idl */,
                                714C7C601FDAD27900F2BEE1 /* AnimationPlaybackEvent.cpp */,
                                714C7C651FDAD27B00F2BEE1 /* AnimationPlaybackEvent.h */,
                                714C7C641FDAD27B00F2BEE1 /* AnimationPlaybackEvent.idl */,
                                71556CAB1F9F099C00E78D08 /* KeyframeEffect.idl */,
                                71247E321FEA5F7F008C08CE /* KeyframeEffectOptions.h */,
                                71247E301FEA5F7E008C08CE /* KeyframeEffectOptions.idl */,
+                               7120733D216DFAF100C78329 /* OptionalEffectTiming.h */,
+                               7120733F216DFAF200C78329 /* OptionalEffectTiming.idl */,
                                712BE47E1FE8649D002031CC /* PlaybackDirection.h */,
                                712BE47F1FE8649E002031CC /* PlaybackDirection.idl */,
                                71025EC31F99F096004A250C /* WebAnimation.cpp */,
                        isa = PBXGroup;
                        children = (
                                71EFCEDE202B39C700D7C411 /* JSAnimationEffectCustom.cpp */,
-                               7110F953202B67D500C466D7 /* JSAnimationEffectTimingReadOnlyCustom.cpp */,
                                71025ED51F99F147004A250C /* JSAnimationTimelineCustom.cpp */,
                                BC2ED6BB0C6BD2F000920BFF /* JSAttrCustom.cpp */,
                                BE6DF70E171CA2DA00DD52B8 /* JSAudioTrackCustom.cpp */,
                                49E912AB0EFAC906009D0CAF /* Animation.h in Headers */,
                                316FE1120E6E1DA700BF6088 /* AnimationBase.h in Headers */,
                                71EFCEDC202B38A900D7C411 /* AnimationEffect.h in Headers */,
-                               71556CB31F9F09BA00E78D08 /* AnimationEffectTiming.h in Headers */,
                                712BE47D1FE86458002031CC /* EffectTiming.h in Headers */,
-                               71495DD6202B065700ADFD34 /* AnimationEffectTimingReadOnly.h in Headers */,
                                319848011A1D817B00A13318 /* AnimationEvent.h in Headers */,
                                49E912AD0EFAC906009D0CAF /* AnimationList.h in Headers */,
                                714C7C661FDAD2A100F2BEE1 /* AnimationPlaybackEvent.h in Headers */,
                                57B5F8101E5E2A4E00F34F90 /* JSAesGcmParams.h in Headers */,
                                576814451E70CB1F00E77754 /* JSAesKeyParams.h in Headers */,
                                FDA15ECA12B03F50003A583A /* JSAnalyserNode.h in Headers */,
-                               71556CBD1F9F0A4900E78D08 /* JSAnimationEffectTiming.h in Headers */,
                                71495DDB202B06F100ADFD34 /* JSEffectTiming.h in Headers */,
-                               71495DDC202B06F700ADFD34 /* JSAnimationEffectTimingReadOnly.h in Headers */,
                                3198480C1A1E6CE800A13318 /* JSAnimationEvent.h in Headers */,
                                714C7C6C1FDADAF300F2BEE1 /* JSAnimationPlaybackEvent.h in Headers */,
                                714C7C6D1FDADAF600F2BEE1 /* JSAnimationPlaybackEventInit.h in Headers */,
                                6515EC920D9723FF0063D49A /* JSSVGAltGlyphElement.h in Headers */,
                                24D9129613CA956100D21915 /* JSSVGAltGlyphItemElement.h in Headers */,
                                B222F6990AB771950022EFAD /* JSSVGAngle.h in Headers */,
+                               71207340216DFB0000C78329 /* OptionalEffectTiming.h in Headers */,
                                B2FA3D370AB75A6F000E5AC4 /* JSSVGAnimateColorElement.h in Headers */,
                                B2FA3D390AB75A6F000E5AC4 /* JSSVGAnimatedAngle.h in Headers */,
                                B2FA3D3B0AB75A6F000E5AC4 /* JSSVGAnimatedBoolean.h in Headers */,
                                514C76790CE923A1007EF3CD /* ResourceHandle.h in Headers */,
                                514C767A0CE923A1007EF3CD /* ResourceHandleClient.h in Headers */,
                                514C767B0CE923A1007EF3CD /* ResourceHandleInternal.h in Headers */,
+                               71207343216DFB4100C78329 /* JSOptionalEffectTiming.h in Headers */,
                                656D373F0ADBA5DE00A4554D /* ResourceLoader.h in Headers */,
                                D0A3A7311405A39800FB8ED3 /* ResourceLoaderOptions.h in Headers */,
                                51AF503616F100F60095B2E8 /* ResourceLoaderTypes.h in Headers */,
index 085da32..2b8c538 100644 (file)
 #include "config.h"
 #include "AnimationEffect.h"
 
-#include "AnimationEffectTimingReadOnly.h"
 #include "FillMode.h"
 #include "JSComputedEffectTiming.h"
 #include "WebAnimationUtilities.h"
 
 namespace WebCore {
 
-AnimationEffect::AnimationEffect(Ref<AnimationEffectTimingReadOnly>&& timing)
-    , m_timing(WTFMove(timing))
+AnimationEffect::AnimationEffect()
+    : m_timingFunction(LinearTimingFunction::create())
 {
-    m_timing->setEffect(this);
 }
 
 AnimationEffect::~AnimationEffect()
 {
-    m_timing->setEffect(nullptr);
-}
-
-void AnimationEffect::timingDidChange()
-{
-    if (m_animation)
-        m_animation->effectTimingPropertiesDidChange();
 }
 
 std::optional<Seconds> AnimationEffect::localTime() const
@@ -63,8 +54,8 @@ auto AnimationEffect::phase() const -> Phase
     // https://drafts.csswg.org/web-animations-1/#animation-effect-phases-and-states
 
     bool animationIsBackwards = m_animation && m_animation->playbackRate() < 0;
-    auto beforeActiveBoundaryTime = std::max(std::min(m_timing->delay(), m_timing->endTime()), 0_s);
-    auto activeAfterBoundaryTime = std::max(std::min(m_timing->delay() + m_timing->activeDuration(), m_timing->endTime()), 0_s);
+    auto beforeActiveBoundaryTime = std::max(std::min(m_delay, endTime()), 0_s);
+    auto activeAfterBoundaryTime = std::max(std::min(m_delay + activeDuration(), endTime()), 0_s);
 
     // (This should be the last statement, but it's more efficient to cache the local time and return right away if it's not resolved.)
     // Furthermore, it is often convenient to refer to the case when an animation effect is in none of the above phases
@@ -111,23 +102,23 @@ std::optional<Seconds> AnimationEffect::activeTime() const
     if (effectPhase == Phase::Before) {
         // If the fill mode is backwards or both, return the result of evaluating
         // max(local time - start delay, 0).
-        if (m_timing->fill() == FillMode::Backwards || m_timing->fill() == FillMode::Both)
-            return std::max(localTime().value() - m_timing->delay(), 0_s);
+        if (m_fill == FillMode::Backwards || m_fill == FillMode::Both)
+            return std::max(localTime().value() - m_delay, 0_s);
         // Otherwise, return an unresolved time value.
         return std::nullopt;
     }
 
     // If the animation effect is in the active phase, return the result of evaluating local time - start delay.
     if (effectPhase == Phase::Active)
-        return localTime().value() - m_timing->delay();
+        return localTime().value() - m_delay;
 
     // If the animation effect is in the after phase, the result depends on the first matching
     // condition from the following,
     if (effectPhase == Phase::After) {
         // If the fill mode is forwards or both, return the result of evaluating
         // max(min(local time - start delay, active duration), 0).
-        if (m_timing->fill() == FillMode::Forwards || m_timing->fill() == FillMode::Both)
-            return std::max(std::min(localTime().value() - m_timing->delay(), m_timing->activeDuration()), 0_s);
+        if (m_fill == FillMode::Forwards || m_fill == FillMode::Both)
+            return std::max(std::min(localTime().value() - m_delay, activeDuration()), 0_s);
         // Otherwise, return an unresolved time value.
         return std::nullopt;
     }
@@ -151,17 +142,17 @@ std::optional<double> AnimationEffect::overallProgress() const
     // 2. Calculate an initial value for overall progress based on the first matching condition from below,
     double overallProgress;
 
-    if (!m_timing->iterationDuration()) {
+    if (!m_iterationDuration) {
         // If the iteration duration is zero, if the animation effect is in the before phase, let overall progress be zero,
         // otherwise, let it be equal to the iteration count.
-        overallProgress = phase() == Phase::Before ? 0 : m_timing->iterations();
+        overallProgress = phase() == Phase::Before ? 0 : m_iterations;
     } else {
         // Otherwise, let overall progress be the result of calculating active time / iteration duration.
-        overallProgress = secondsToWebAnimationsAPITime(effectActiveTime.value()) / secondsToWebAnimationsAPITime(m_timing->iterationDuration());
+        overallProgress = secondsToWebAnimationsAPITime(effectActiveTime.value()) / secondsToWebAnimationsAPITime(m_iterationDuration);
     }
 
     // 3. Return the result of calculating overall progress + iteration start.
-    overallProgress += m_timing->iterationStart();
+    overallProgress += m_iterationStart;
     return std::abs(overallProgress);
 }
 
@@ -182,7 +173,7 @@ std::optional<double> AnimationEffect::simpleIterationProgress() const
     // 2. If overall progress is infinity, let the simple iteration progress be iteration start % 1.0,
     // otherwise, let the simple iteration progress be overall progress % 1.0.
     double overallProgressValue = effectOverallProgress.value();
-    double simpleIterationProgress = std::isinf(overallProgressValue) ? fmod(m_timing->iterationStart(), 1) : fmod(overallProgressValue, 1);
+    double simpleIterationProgress = std::isinf(overallProgressValue) ? fmod(m_iterationStart, 1) : fmod(overallProgressValue, 1);
 
     // 3. If all of the following conditions are true,
     //
@@ -192,7 +183,7 @@ std::optional<double> AnimationEffect::simpleIterationProgress() const
     // the iteration count is not equal to zero.
     // let the simple iteration progress be 1.0.
     auto effectPhase = phase();
-    if (!simpleIterationProgress && (effectPhase == Phase::Active || effectPhase == Phase::After) && std::abs(activeTime().value().microseconds() - m_timing->activeDuration().microseconds()) < timeEpsilon.microseconds() && m_timing->iterations())
+    if (!simpleIterationProgress && (effectPhase == Phase::Active || effectPhase == Phase::After) && std::abs(activeTime().value().microseconds() - activeDuration().microseconds()) < timeEpsilon.microseconds() && m_iterations)
         return 1;
 
     return simpleIterationProgress;
@@ -210,7 +201,7 @@ std::optional<double> AnimationEffect::currentIteration() const
         return std::nullopt;
 
     // 2. If the animation effect is in the after phase and the iteration count is infinity, return infinity.
-    if (phase() == Phase::After && std::isinf(m_timing->iterations()))
+    if (phase() == Phase::After && std::isinf(m_iterations))
         return std::numeric_limits<double>::infinity();
 
     // 3. If the simple iteration progress is 1.0, return floor(overall progress) - 1.
@@ -227,17 +218,17 @@ AnimationEffect::ComputedDirection AnimationEffect::currentDirection() const
     // https://drafts.csswg.org/web-animations-1/#calculating-the-directed-progress
 
     // If playback direction is normal, let the current direction be forwards.
-    if (m_timing->direction() == PlaybackDirection::Normal)
+    if (m_direction == PlaybackDirection::Normal)
         return AnimationEffect::ComputedDirection::Forwards;
     
     // If playback direction is reverse, let the current direction be reverse.
-    if (m_timing->direction() == PlaybackDirection::Reverse)
+    if (m_direction == PlaybackDirection::Reverse)
         return AnimationEffect::ComputedDirection::Reverse;
     
     // Otherwise, let d be the current iteration.
     auto d = currentIteration().value();
     // If playback direction is alternate-reverse increment d by 1.
-    if (m_timing->direction() == PlaybackDirection::AlternateReverse)
+    if (m_direction == PlaybackDirection::AlternateReverse)
         d++;
     // If d % 2 == 0, let the current direction be forwards, otherwise let the current direction be reverse.
     // If d is infinity, let the current direction be forwards.
@@ -282,11 +273,10 @@ std::optional<double> AnimationEffect::transformedProgress() const
 
     auto effectDirectedProgressValue = effectDirectedProgress.value();
 
-    if (auto iterationDuration = m_timing->iterationDuration().seconds()) {
+    if (auto iterationDuration = m_iterationDuration.seconds()) {
         bool before = false;
-        auto* timingFunction = m_timing->timingFunction();
         // 2. Calculate the value of the before flag as follows:
-        if (is<StepsTimingFunction>(timingFunction)) {
+        if (is<StepsTimingFunction>(m_timingFunction)) {
             // 1. Determine the current direction using the procedure defined in §3.9.1 Calculating the directed progress.
             // 2. If the current direction is forwards, let going forwards be true, otherwise it is false.
             bool goingForwards = currentDirection() == AnimationEffect::ComputedDirection::Forwards;
@@ -298,7 +288,7 @@ std::optional<double> AnimationEffect::transformedProgress() const
 
         // 3. Return the result of evaluating the animation effect’s timing function passing directed progress as the
         //    input progress value and before flag as the before flag.
-        return timingFunction->transformTime(effectDirectedProgressValue, iterationDuration, before);
+        return m_timingFunction->transformTime(effectDirectedProgressValue, iterationDuration, before);
     }
 
     return effectDirectedProgressValue;
@@ -309,20 +299,36 @@ std::optional<double> AnimationEffect::iterationProgress() const
     return transformedProgress();
 }
 
+EffectTiming AnimationEffect::getTiming()
+{
+    EffectTiming timing;
+    timing.delay = secondsToWebAnimationsAPITime(m_delay);
+    timing.endDelay = secondsToWebAnimationsAPITime(m_endDelay);
+    timing.fill = m_fill;
+    timing.iterationStart = m_iterationStart;
+    timing.iterations = m_iterations;
+    if (m_iterationDuration == 0_s)
+        timing.duration = "auto";
+    else
+        timing.duration = secondsToWebAnimationsAPITime(m_iterationDuration);
+    timing.direction = m_direction;
+    timing.easing = m_timingFunction->cssText();
+    return timing;
+}
+
 ComputedEffectTiming AnimationEffect::getComputedTiming()
 {
     ComputedEffectTiming computedTiming;
-    computedTiming.delay = m_timing->bindingsDelay();
-    computedTiming.endDelay = m_timing->bindingsEndDelay();
-    auto fillMode = m_timing->fill();
-    computedTiming.fill = fillMode == FillMode::Auto ? FillMode::None : fillMode;
-    computedTiming.iterationStart = m_timing->iterationStart();
-    computedTiming.iterations = m_timing->iterations();
-    computedTiming.duration = secondsToWebAnimationsAPITime(m_timing->iterationDuration());
-    computedTiming.direction = m_timing->direction();
-    computedTiming.easing = m_timing->easing();
-    computedTiming.endTime = secondsToWebAnimationsAPITime(m_timing->endTime());
-    computedTiming.activeDuration = secondsToWebAnimationsAPITime(m_timing->activeDuration());
+    computedTiming.delay = secondsToWebAnimationsAPITime(m_delay);
+    computedTiming.endDelay = secondsToWebAnimationsAPITime(m_endDelay);
+    computedTiming.fill = m_fill == FillMode::Auto ? FillMode::None : m_fill;
+    computedTiming.iterationStart = m_iterationStart;
+    computedTiming.iterations = m_iterations;
+    computedTiming.duration = secondsToWebAnimationsAPITime(m_iterationDuration);
+    computedTiming.direction = m_direction;
+    computedTiming.easing = m_timingFunction->cssText();
+    computedTiming.endTime = secondsToWebAnimationsAPITime(endTime());
+    computedTiming.activeDuration = secondsToWebAnimationsAPITime(activeDuration());
     if (auto effectLocalTime = localTime())
         computedTiming.localTime = secondsToWebAnimationsAPITime(effectLocalTime.value());
     computedTiming.progress = iterationProgress();
@@ -330,4 +336,184 @@ ComputedEffectTiming AnimationEffect::getComputedTiming()
     return computedTiming;
 }
 
+ExceptionOr<void> AnimationEffect::updateTiming(std::optional<OptionalEffectTiming> timing)
+{
+    // 6.5.4. Updating the timing of an AnimationEffect
+    // https://drafts.csswg.org/web-animations/#updating-animationeffect-timing
+
+    // To update the timing properties of an animation effect, effect, from an EffectTiming or OptionalEffectTiming object, input, perform the following steps:
+    if (!timing)
+        return { };
+
+    // 1. If the iterationStart member of input is present and less than zero, throw a TypeError and abort this procedure.
+    if (timing->iterationStart) {
+        if (timing->iterationStart.value() < 0)
+            return Exception { TypeError };
+    }
+
+    // 2. If the iterations member of input is present, and less than zero or is the value NaN, throw a TypeError and abort this procedure.
+    if (timing->iterations) {
+        if (timing->iterations.value() < 0 || std::isnan(timing->iterations.value()))
+            return Exception { TypeError };
+    }
+
+    // 3. If the duration member of input is present, and less than zero or is the value NaN, throw a TypeError and abort this procedure.
+    // FIXME: should it not throw an exception on a string other than "auto"?
+    if (timing->duration) {
+        if (WTF::holds_alternative<double>(timing->duration.value())) {
+            auto durationAsDouble = WTF::get<double>(timing->duration.value());
+            if (durationAsDouble < 0 || std::isnan(durationAsDouble))
+                return Exception { TypeError };
+        } else {
+            if (WTF::get<String>(timing->duration.value()) != "auto")
+                return Exception { TypeError };
+        }
+    }
+
+    // 4. If the easing member of input is present but cannot be parsed using the <timing-function> production [CSS-EASING-1], throw a TypeError and abort this procedure.
+    if (!timing->easing.isNull()) {
+        auto timingFunctionResult = TimingFunction::createFromCSSText(timing->easing);
+        if (timingFunctionResult.hasException())
+            return timingFunctionResult.releaseException();
+        m_timingFunction = timingFunctionResult.returnValue();
+    }
+
+    // 5. Assign each member present in input to the corresponding timing property of effect as follows:
+    //
+    //    delay → start delay
+    //    endDelay → end delay
+    //    fill → fill mode
+    //    iterationStart → iteration start
+    //    iterations → iteration count
+    //    duration → iteration duration
+    //    direction → playback direction
+    //    easing → timing function
+
+    if (timing->delay)
+        m_delay = Seconds::fromMilliseconds(timing->delay.value());
+
+    if (timing->endDelay)
+        m_endDelay = Seconds::fromMilliseconds(timing->endDelay.value());
+
+    if (timing->fill)
+        m_fill = timing->fill.value();
+
+    if (timing->iterationStart)
+        m_iterationStart = timing->iterationStart.value();
+
+    if (timing->iterations)
+        m_iterations = timing->iterations.value();
+
+    if (timing->duration)
+        m_iterationDuration = WTF::holds_alternative<double>(timing->duration.value()) ? Seconds::fromMilliseconds(WTF::get<double>(timing->duration.value())) : 0_s;
+
+    if (timing->direction)
+        m_direction = timing->direction.value();
+
+    if (m_animation)
+        m_animation->effectTimingDidChange();
+
+    return { };
+}
+
+ExceptionOr<void> AnimationEffect::setIterationStart(double iterationStart)
+{
+    // https://drafts.csswg.org/web-animations-1/#dom-animationeffecttiming-iterationstart
+    // If an attempt is made to set this attribute to a value less than zero, a TypeError must
+    // be thrown and the value of the iterationStart attribute left unchanged.
+    if (iterationStart < 0)
+        return Exception { TypeError };
+
+    if (m_iterationStart == iterationStart)
+        return { };
+
+    m_iterationStart = iterationStart;
+
+    return { };
+}
+
+ExceptionOr<void> AnimationEffect::setIterations(double iterations)
+{
+    // https://drafts.csswg.org/web-animations-1/#dom-animationeffecttiming-iterations
+    // If an attempt is made to set this attribute to a value less than zero or a NaN value, a
+    // TypeError must be thrown and the value of the iterations attribute left unchanged.
+    if (iterations < 0 || std::isnan(iterations))
+        return Exception { TypeError };
+
+    if (m_iterations == iterations)
+        return { };
+        
+    m_iterations = iterations;
+
+    return { };
+}
+
+Seconds AnimationEffect::endTime() const
+{
+    // 3.5.3 The active interval
+    // https://drafts.csswg.org/web-animations-1/#end-time
+
+    // The end time of an animation effect is the result of evaluating max(start delay + active duration + end delay, 0).
+    auto endTime = m_delay + activeDuration() + m_endDelay;
+    return endTime > 0_s ? endTime : 0_s;
+}
+
+void AnimationEffect::setDelay(const Seconds& delay)
+{
+    if (m_delay == delay)
+        return;
+
+    m_delay = delay;
+}
+
+void AnimationEffect::setEndDelay(const Seconds& endDelay)
+{
+    if (m_endDelay == endDelay)
+        return;
+
+    m_endDelay = endDelay;
+}
+
+void AnimationEffect::setFill(FillMode fill)
+{
+    if (m_fill == fill)
+        return;
+
+    m_fill = fill;
+}
+
+void AnimationEffect::setIterationDuration(const Seconds& duration)
+{
+    if (m_iterationDuration == duration)
+        return;
+
+    m_iterationDuration = duration;
+}
+
+void AnimationEffect::setDirection(PlaybackDirection direction)
+{
+    if (m_direction == direction)
+        return;
+
+    m_direction = direction;
+}
+
+void AnimationEffect::setTimingFunction(const RefPtr<TimingFunction>& timingFunction)
+{
+    m_timingFunction = timingFunction;
+}
+
+Seconds AnimationEffect::activeDuration() const
+{
+    // 3.8.2. Calculating the active duration
+    // https://drafts.csswg.org/web-animations-1/#calculating-the-active-duration
+
+    // The active duration is calculated as follows:
+    // active duration = iteration duration × iteration count
+    // If either the iteration duration or iteration count are zero, the active duration is zero.
+    if (!m_iterationDuration || !m_iterations)
+        return 0_s;
+    return m_iterationDuration * m_iterations;
+}
+
 } // namespace WebCore
index 75f2286..e621693 100644 (file)
 
 #pragma once
 
+#include "AnimationEffect.h"
 #include "ComputedEffectTiming.h"
+#include "ExceptionOr.h"
+#include "FillMode.h"
+#include "KeyframeEffectOptions.h"
+#include "OptionalEffectTiming.h"
+#include "PlaybackDirection.h"
+#include "TimingFunction.h"
 #include "WebAnimation.h"
+#include "WebAnimationUtilities.h"
 #include <wtf/Forward.h>
 #include <wtf/Ref.h>
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
+#include <wtf/Seconds.h>
+#include <wtf/Variant.h>
 #include <wtf/WeakPtr.h>
 
 namespace WebCore {
 
-class AnimationEffectTimingReadOnly;
-
 class AnimationEffect : public RefCounted<AnimationEffect> {
 public:
     virtual ~AnimationEffect();
 
     virtual bool isKeyframeEffect() const { return false; }
-    AnimationEffectTimingReadOnly* timing() const { return m_timing.get(); }
+
+    EffectTiming getTiming();
     ComputedEffectTiming getComputedTiming();
+    ExceptionOr<void> updateTiming(std::optional<OptionalEffectTiming>);
+
     virtual void apply(RenderStyle&) = 0;
     virtual void invalidate() = 0;
     virtual void animationDidSeek() = 0;
@@ -52,18 +63,42 @@ public:
     WebAnimation* animation() const { return m_animation.get(); }
     void setAnimation(WebAnimation* animation) { m_animation = makeWeakPtr(animation); }
 
+    Seconds delay() const { return m_delay; }
+    void setDelay(const Seconds&);
+
+    Seconds endDelay() const { return m_endDelay; }
+    void setEndDelay(const Seconds&);
+
+    FillMode fill() const { return m_fill; }
+    void setFill(FillMode);
+
+    double iterationStart() const { return m_iterationStart; }
+    ExceptionOr<void> setIterationStart(double);
+
+    double iterations() const { return m_iterations; }
+    ExceptionOr<void> setIterations(double);
+
+    Seconds iterationDuration() const { return m_iterationDuration; }
+    void setIterationDuration(const Seconds&);
+
+    PlaybackDirection direction() const { return m_direction; }
+    void setDirection(PlaybackDirection);
+
+    TimingFunction* timingFunction() const { return m_timingFunction.get(); }
+    void setTimingFunction(const RefPtr<TimingFunction>&);
+
     std::optional<Seconds> localTime() const;
     std::optional<Seconds> activeTime() const;
+    Seconds endTime() const;
     std::optional<double> iterationProgress() const;
     std::optional<double> currentIteration() const;
+    Seconds activeDuration() const;
 
     enum class Phase { Before, Active, After, Idle };
     Phase phase() const;
 
-    void timingDidChange();
-
 protected:
-    explicit AnimationEffect(Ref<AnimationEffectTimingReadOnly>&&);
+    explicit AnimationEffect();
 
 private:
     enum class ComputedDirection { Forwards, Reverse };
@@ -73,9 +108,16 @@ private:
     AnimationEffect::ComputedDirection currentDirection() const;
     std::optional<double> directedProgress() const;
     std::optional<double> transformedProgress() const;
-
+    
+    Seconds m_delay { 0_s };
+    Seconds m_endDelay { 0_s };
+    FillMode m_fill { FillMode::Auto };
+    double m_iterationStart { 0 };
+    double m_iterations { 1 };
+    Seconds m_iterationDuration { 0_s };
+    PlaybackDirection m_direction { PlaybackDirection::Normal };
+    RefPtr<TimingFunction> m_timingFunction;
     WeakPtr<WebAnimation> m_animation;
-    RefPtr<AnimationEffectTimingReadOnly> m_timing;
 };
 
 } // namespace WebCore
index 97a5920..2d9e60d 100644 (file)
@@ -28,6 +28,7 @@
     Exposed=Window,
     CustomToJSObject
 ] interface AnimationEffect {
-    readonly attribute AnimationEffectTimingReadOnly timing;
+    EffectTiming getTiming();
     ComputedEffectTiming getComputedTiming();
+    [MayThrowException] void updateTiming(optional OptionalEffectTiming timing);
 };
diff --git a/Source/WebCore/animation/AnimationEffectTiming.idl b/Source/WebCore/animation/AnimationEffectTiming.idl
deleted file mode 100644 (file)
index 6d7e826..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2017-2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * 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,
-    Exposed=Window,
-    ImplementationLacksVTable
-] interface AnimationEffectTiming : AnimationEffectTimingReadOnly {
-    [ImplementedAs=bindingsDelay] inherit attribute double delay;
-    [ImplementedAs=bindingsEndDelay] inherit attribute double endDelay;
-    inherit attribute FillMode fill;
-    [MayThrowException] inherit attribute double iterationStart;
-    [MayThrowException] inherit attribute unrestricted double iterations;
-    [MayThrowException, ImplementedAs=bindingsDuration] inherit attribute (unrestricted double or DOMString) duration;
-    inherit attribute PlaybackDirection direction;
-    [MayThrowException] inherit attribute DOMString easing;
-};
diff --git a/Source/WebCore/animation/AnimationEffectTimingReadOnly.cpp b/Source/WebCore/animation/AnimationEffectTimingReadOnly.cpp
deleted file mode 100644 (file)
index 5cee25c..0000000
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "AnimationEffectTimingReadOnly.h"
-
-#include "AnimationEffect.h"
-
-namespace WebCore {
-
-Ref<AnimationEffectTimingReadOnly> AnimationEffectTimingReadOnly::create()
-{
-    return adoptRef(*new AnimationEffectTimingReadOnly(AnimationEffectTimingReadOnlyClass));
-}
-
-AnimationEffectTimingReadOnly::AnimationEffectTimingReadOnly(ClassType classType)
-    : m_classType(classType)
-    , m_timingFunction(LinearTimingFunction::create())
-{
-}
-
-AnimationEffectTimingReadOnly::~AnimationEffectTimingReadOnly()
-{
-}
-
-void AnimationEffectTimingReadOnly::propertyDidChange()
-{
-    m_effect->timingDidChange();
-}
-
-ExceptionOr<void> AnimationEffectTimingReadOnly::setProperties(std::optional<Variant<double, KeyframeEffectOptions>>&& options)
-{
-    if (!options)
-        return { };
-
-    auto optionsValue = options.value();
-    Variant<double, String> bindingsDuration;
-    if (WTF::holds_alternative<double>(optionsValue))
-        bindingsDuration = WTF::get<double>(optionsValue);
-    else {
-        auto keyframeEffectOptions = WTF::get<KeyframeEffectOptions>(optionsValue);
-        bindingsDuration = keyframeEffectOptions.duration;
-        setBindingsDelay(keyframeEffectOptions.delay);
-        setBindingsEndDelay(keyframeEffectOptions.endDelay);
-        setFill(keyframeEffectOptions.fill);
-
-        auto setIterationStartResult = setIterationStart(keyframeEffectOptions.iterationStart);
-        if (setIterationStartResult.hasException())
-            return setIterationStartResult.releaseException();
-
-        auto setIterationsResult = setIterations(keyframeEffectOptions.iterations);
-        if (setIterationsResult.hasException())
-            return setIterationsResult.releaseException();
-
-        setDirection(keyframeEffectOptions.direction);
-        auto setEasingResult = setEasing(keyframeEffectOptions.easing);
-        if (setEasingResult.hasException())
-            return setEasingResult.releaseException();
-    }
-
-    auto setBindingsDurationResult = setBindingsDuration(WTFMove(bindingsDuration));
-    if (setBindingsDurationResult.hasException())
-        return setBindingsDurationResult.releaseException();
-
-    return { };
-}
-
-void AnimationEffectTimingReadOnly::copyPropertiesFromSource(AnimationEffectTimingReadOnly* source)
-{
-    m_fill = source->m_fill;
-    m_delay = source->m_delay;
-    m_endDelay = source->m_endDelay;
-    m_direction = source->m_direction;
-    m_iterations = source->m_iterations;
-    m_timingFunction = source->m_timingFunction;
-    m_iterationStart = source->m_iterationStart;
-    m_iterationDuration = source->m_iterationDuration;
-}
-
-ExceptionOr<void> AnimationEffectTimingReadOnly::setIterationStart(double iterationStart)
-{
-    // https://drafts.csswg.org/web-animations-1/#dom-animationeffecttiming-iterationstart
-    // If an attempt is made to set this attribute to a value less than zero, a TypeError must
-    // be thrown and the value of the iterationStart attribute left unchanged.
-    if (iterationStart < 0)
-        return Exception { TypeError };
-
-    if (m_iterationStart == iterationStart)
-        return { };
-
-    m_iterationStart = iterationStart;
-    propertyDidChange();
-
-    return { };
-}
-
-ExceptionOr<void> AnimationEffectTimingReadOnly::setIterations(double iterations)
-{
-    // https://drafts.csswg.org/web-animations-1/#dom-animationeffecttiming-iterations
-    // If an attempt is made to set this attribute to a value less than zero or a NaN value, a
-    // TypeError must be thrown and the value of the iterations attribute left unchanged.
-    if (iterations < 0 || std::isnan(iterations))
-        return Exception { TypeError };
-
-    if (m_iterations == iterations)
-        return { };
-        
-    m_iterations = iterations;
-    propertyDidChange();
-
-    return { };
-}
-
-Variant<double, String> AnimationEffectTimingReadOnly::bindingsDuration() const
-{
-    if (m_iterationDuration == 0_s)
-        return "auto";
-    return secondsToWebAnimationsAPITime(m_iterationDuration);
-}
-
-ExceptionOr<void> AnimationEffectTimingReadOnly::setBindingsDuration(Variant<double, String>&& duration)
-{
-    // https://drafts.csswg.org/web-animations-1/#dom-animationeffecttimingreadonly-duration
-    // The iteration duration which is a real number greater than or equal to zero (including positive infinity)
-    // representing the time taken to complete a single iteration of the animation effect.
-    // In this level of this specification, the string value auto is equivalent to zero. This is a forwards-compatiblity
-    // measure since a future level of this specification will introduce group effects where the auto value expands to
-    // include the duration of the child effects.
-
-    if (WTF::holds_alternative<double>(duration)) {
-        auto durationAsDouble = WTF::get<double>(duration);
-        if (durationAsDouble < 0 || std::isnan(durationAsDouble))
-            return Exception { TypeError };
-        setIterationDuration(Seconds::fromMilliseconds(durationAsDouble));
-        return { };
-    }
-
-    if (WTF::get<String>(duration) != "auto")
-        return Exception { TypeError };
-
-    setIterationDuration(0_s);
-
-    return { };
-}
-
-ExceptionOr<void> AnimationEffectTimingReadOnly::setEasing(const String& easing)
-{
-    auto timingFunctionResult = TimingFunction::createFromCSSText(easing);
-    if (timingFunctionResult.hasException())
-        return timingFunctionResult.releaseException();
-    setTimingFunction(timingFunctionResult.returnValue());
-    return { };
-}
-
-Seconds AnimationEffectTimingReadOnly::endTime() const
-{
-    // 3.5.3 The active interval
-    // https://drafts.csswg.org/web-animations-1/#end-time
-
-    // The end time of an animation effect is the result of evaluating max(start delay + active duration + end delay, 0).
-    auto endTime = m_delay + activeDuration() + m_endDelay;
-    return endTime > 0_s ? endTime : 0_s;
-}
-
-void AnimationEffectTimingReadOnly::setDelay(const Seconds& delay)
-{
-    if (m_delay == delay)
-        return;
-
-    m_delay = delay;
-    propertyDidChange();
-}
-
-void AnimationEffectTimingReadOnly::setEndDelay(const Seconds& endDelay)
-{
-    if (m_endDelay == endDelay)
-        return;
-
-    m_endDelay = endDelay;
-    propertyDidChange();
-}
-
-void AnimationEffectTimingReadOnly::setFill(FillMode fill)
-{
-    if (m_fill == fill)
-        return;
-
-    m_fill = fill;
-    propertyDidChange();
-}
-
-void AnimationEffectTimingReadOnly::setIterationDuration(const Seconds& duration)
-{
-    if (m_iterationDuration == duration)
-        return;
-
-    m_iterationDuration = duration;
-    propertyDidChange();
-}
-
-void AnimationEffectTimingReadOnly::setDirection(PlaybackDirection direction)
-{
-    if (m_direction == direction)
-        return;
-
-    m_direction = direction;
-    propertyDidChange();
-}
-
-void AnimationEffectTimingReadOnly::setTimingFunction(const RefPtr<TimingFunction>& timingFunction)
-{
-    m_timingFunction = timingFunction;
-    propertyDidChange();
-}
-
-Seconds AnimationEffectTimingReadOnly::activeDuration() const
-{
-    // 3.8.2. Calculating the active duration
-    // https://drafts.csswg.org/web-animations-1/#calculating-the-active-duration
-
-    // The active duration is calculated as follows:
-    // active duration = iteration duration × iteration count
-    // If either the iteration duration or iteration count are zero, the active duration is zero.
-    if (!m_iterationDuration || !m_iterations)
-        return 0_s;
-    return m_iterationDuration * m_iterations;
-}
-
-} // namespace WebCore
diff --git a/Source/WebCore/animation/AnimationEffectTimingReadOnly.h b/Source/WebCore/animation/AnimationEffectTimingReadOnly.h
deleted file mode 100644 (file)
index 6fb7a9a..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include "AnimationEffect.h"
-#include "ExceptionOr.h"
-#include "FillMode.h"
-#include "KeyframeEffectOptions.h"
-#include "PlaybackDirection.h"
-#include "TimingFunction.h"
-#include "WebAnimationUtilities.h"
-#include <wtf/Forward.h>
-#include <wtf/Ref.h>
-#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
-#include <wtf/Seconds.h>
-#include <wtf/Variant.h>
-
-namespace WebCore {
-
-class AnimationEffectTimingReadOnly : public RefCounted<AnimationEffectTimingReadOnly> {
-public:
-    static Ref<AnimationEffectTimingReadOnly> create();
-    ~AnimationEffectTimingReadOnly();
-
-    bool isAnimationEffectTiming() const { return m_classType == AnimationEffectTimingClass; }
-
-    void setEffect(AnimationEffect* effect) { m_effect = effect; }
-
-    ExceptionOr<void> setProperties(std::optional<Variant<double, KeyframeEffectOptions>>&&);
-    void copyPropertiesFromSource(AnimationEffectTimingReadOnly*);
-
-    double bindingsDelay() const { return secondsToWebAnimationsAPITime(m_delay); }
-    void setBindingsDelay(double delay) { setDelay(Seconds::fromMilliseconds(delay)); }
-
-    double bindingsEndDelay() const { return secondsToWebAnimationsAPITime(m_endDelay); }
-    void setBindingsEndDelay(double endDelay) { setEndDelay(Seconds::fromMilliseconds(endDelay)); }
-
-    Variant<double, String> bindingsDuration() const;
-    ExceptionOr<void> setBindingsDuration(Variant<double, String>&&);
-
-    Seconds delay() const { return m_delay; }
-    void setDelay(const Seconds&);
-
-    Seconds endDelay() const { return m_endDelay; }
-    void setEndDelay(const Seconds&);
-
-    FillMode fill() const { return m_fill; }
-    void setFill(FillMode);
-
-    double iterationStart() const { return m_iterationStart; }
-    ExceptionOr<void> setIterationStart(double);
-
-    double iterations() const { return m_iterations; }
-    ExceptionOr<void> setIterations(double);
-
-    Seconds iterationDuration() const { return m_iterationDuration; }
-    void setIterationDuration(const Seconds&);
-
-    PlaybackDirection direction() const { return m_direction; }
-    void setDirection(PlaybackDirection);
-
-    String easing() const { return m_timingFunction->cssText(); }
-    ExceptionOr<void> setEasing(const String&);
-
-    TimingFunction* timingFunction() const { return m_timingFunction.get(); }
-    void setTimingFunction(const RefPtr<TimingFunction>&);
-
-    Seconds endTime() const;
-    Seconds activeDuration() const;
-
-protected:
-    enum ClassType {
-        AnimationEffectTimingClass,
-        AnimationEffectTimingReadOnlyClass
-    };
-
-    ClassType classType() const { return m_classType; }
-
-    explicit AnimationEffectTimingReadOnly(ClassType);
-
-private:
-    void propertyDidChange();
-
-    ClassType m_classType;
-    AnimationEffect* m_effect;
-    Seconds m_delay { 0_s };
-    Seconds m_endDelay { 0_s };
-    FillMode m_fill { FillMode::Auto };
-    double m_iterationStart { 0 };
-    double m_iterations { 1 };
-    Seconds m_iterationDuration { 0_s };
-    PlaybackDirection m_direction { PlaybackDirection::Normal };
-    RefPtr<TimingFunction> m_timingFunction;
-
-};
-
-} // namespace WebCore
-
-#define SPECIALIZE_TYPE_TRAITS_ANIMATION_EFFECT_TIMING(ToValueTypeName, predicate) \
-SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::ToValueTypeName) \
-static bool isType(const WebCore::AnimationEffectTimingReadOnly& value) { return value.predicate; } \
-SPECIALIZE_TYPE_TRAITS_END()
diff --git a/Source/WebCore/animation/AnimationEffectTimingReadOnly.idl b/Source/WebCore/animation/AnimationEffectTimingReadOnly.idl
deleted file mode 100644 (file)
index d5f0183..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
-    EnabledAtRuntime=WebAnimations,
-    Exposed=Window,
-    CustomToJSObject
-] interface AnimationEffectTimingReadOnly {
-    [ImplementedAs=bindingsDelay] readonly attribute double delay;
-    [ImplementedAs=bindingsEndDelay] readonly attribute double endDelay;
-    readonly attribute FillMode fill;
-    readonly attribute double iterationStart;
-    readonly attribute unrestricted double iterations;
-    [MayThrowException, ImplementedAs=bindingsDuration] readonly attribute (unrestricted double or DOMString) duration;
-    readonly attribute PlaybackDirection direction;
-    readonly attribute DOMString easing;
-};
\ No newline at end of file
index 6b1779b..86b36c6 100644 (file)
@@ -55,43 +55,43 @@ void CSSAnimation::syncPropertiesWithBackingAnimation()
     suspendEffectInvalidation();
 
     auto& animation = backingAnimation();
-    auto* timing = effect()->timing();
+    auto* animationEffect = effect();
 
     switch (animation.fillMode()) {
     case AnimationFillMode::None:
-        timing->setFill(FillMode::None);
+        animationEffect->setFill(FillMode::None);
         break;
     case AnimationFillMode::Backwards:
-        timing->setFill(FillMode::Backwards);
+        animationEffect->setFill(FillMode::Backwards);
         break;
     case AnimationFillMode::Forwards:
-        timing->setFill(FillMode::Forwards);
+        animationEffect->setFill(FillMode::Forwards);
         break;
     case AnimationFillMode::Both:
-        timing->setFill(FillMode::Both);
+        animationEffect->setFill(FillMode::Both);
         break;
     }
 
     switch (animation.direction()) {
     case Animation::AnimationDirectionNormal:
-        timing->setDirection(PlaybackDirection::Normal);
+        animationEffect->setDirection(PlaybackDirection::Normal);
         break;
     case Animation::AnimationDirectionAlternate:
-        timing->setDirection(PlaybackDirection::Alternate);
+        animationEffect->setDirection(PlaybackDirection::Alternate);
         break;
     case Animation::AnimationDirectionReverse:
-        timing->setDirection(PlaybackDirection::Reverse);
+        animationEffect->setDirection(PlaybackDirection::Reverse);
         break;
     case Animation::AnimationDirectionAlternateReverse:
-        timing->setDirection(PlaybackDirection::AlternateReverse);
+        animationEffect->setDirection(PlaybackDirection::AlternateReverse);
         break;
     }
 
     auto iterationCount = animation.iterationCount();
-    timing->setIterations(iterationCount == Animation::IterationCountInfinite ? std::numeric_limits<double>::infinity() : iterationCount);
+    animationEffect->setIterations(iterationCount == Animation::IterationCountInfinite ? std::numeric_limits<double>::infinity() : iterationCount);
 
-    timing->setDelay(Seconds(animation.delay()));
-    timing->setIterationDuration(Seconds(animation.duration()));
+    animationEffect->setDelay(Seconds(animation.delay()));
+    animationEffect->setIterationDuration(Seconds(animation.duration()));
 
     // Synchronize the play state
     if (animation.playState() == AnimationPlayState::Playing && playState() == WebAnimation::PlayState::Paused) {
index 57c0744..865114c 100644 (file)
@@ -61,15 +61,14 @@ void CSSTransition::setTimingProperties(Seconds delay, Seconds duration)
     suspendEffectInvalidation();
 
     // This method is only called from CSSTransition::create() where we're guaranteed to have an effect.
-    ASSERT(effect());
-
-    auto* timing = effect()->timing();
+    auto* animationEffect = effect();
+    ASSERT(animationEffect);
 
     // In order for CSS Transitions to be seeked backwards, they need to have their fill mode set to backwards
     // such that the original CSS value applied prior to the transition is used for a negative current time.
-    timing->setFill(FillMode::Backwards);
-    timing->setDelay(delay);
-    timing->setIterationDuration(duration);
+    animationEffect->setFill(FillMode::Backwards);
+    animationEffect->setDelay(delay);
+    animationEffect->setIterationDuration(duration);
 
     unsuspendEffectInvalidation();
 }
index 46cb289..87a7523 100644 (file)
@@ -27,7 +27,6 @@
 #include "DeclarativeAnimation.h"
 
 #include "Animation.h"
-#include "AnimationEffectTimingReadOnly.h"
 #include "AnimationEvent.h"
 #include "Element.h"
 #include "EventNames.h"
@@ -250,9 +249,8 @@ void DeclarativeAnimation::invalidateDOMEvents(Seconds elapsedTime)
     bool isBefore = currentPhase == AnimationEffect::Phase::Before;
     bool isIdle = currentPhase == AnimationEffect::Phase::Idle;
 
-    auto* effectTiming = animationEffect ? animationEffect->timing() : nullptr;
-    auto intervalStart = effectTiming ? std::max(0_s, std::min(-effectTiming->delay(), effectTiming->activeDuration())) : 0_s;
-    auto intervalEnd = effectTiming ? std::max(0_s, std::min(effectTiming->endTime() - effectTiming->delay(), effectTiming->activeDuration())) : 0_s;
+    auto intervalStart = animationEffect ? std::max(0_s, std::min(-animationEffect->delay(), animationEffect->activeDuration())) : 0_s;
+    auto intervalEnd = animationEffect ? std::max(0_s, std::min(animationEffect->endTime() - animationEffect->delay(), animationEffect->activeDuration())) : 0_s;
 
     if (is<CSSAnimation>(this)) {
         // https://drafts.csswg.org/css-animations-2/#events
@@ -267,7 +265,7 @@ void DeclarativeAnimation::invalidateDOMEvents(Seconds elapsedTime)
             auto iterationBoundary = iteration;
             if (m_previousIteration > iteration)
                 iterationBoundary++;
-            auto elapsedTime = effectTiming ? effectTiming->iterationDuration() * (iterationBoundary - effectTiming->iterationStart()) : 0_s;
+            auto elapsedTime = animationEffect ? animationEffect->iterationDuration() * (iterationBoundary - animationEffect->iterationStart()) : 0_s;
             enqueueDOMEvent(eventNames().animationiterationEvent, elapsedTime);
         } else if (wasActive && isAfter)
             enqueueDOMEvent(eventNames().animationendEvent, intervalEnd);
index 5d9d5b5..3dd945d 100644 (file)
@@ -33,6 +33,7 @@
 #include "DOMWindow.h"
 #include "DeclarativeAnimation.h"
 #include "Document.h"
+#include "DocumentAnimationScheduler.h"
 #include "GraphicsLayer.h"
 #include "KeyframeEffect.h"
 #include "Microtasks.h"
index 739b4c9..3f5d6e6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2017-2018 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -23,7 +23,9 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-dictionary EffectTiming {
+[
+    JSGenerateToJSObject
+] dictionary EffectTiming {
     double delay = 0;
     double endDelay = 0;
     FillMode fill = "auto";
index 884fb92..34069f5 100644 (file)
@@ -27,7 +27,6 @@
 #include "KeyframeEffect.h"
 
 #include "Animation.h"
-#include "AnimationEffectTiming.h"
 #include "CSSAnimation.h"
 #include "CSSComputedStyleDeclaration.h"
 #include "CSSKeyframeRule.h"
@@ -466,11 +465,32 @@ static inline ExceptionOr<void> processPropertyIndexedKeyframes(ExecState& state
 
 ExceptionOr<Ref<KeyframeEffect>> KeyframeEffect::create(ExecState& state, Element* target, Strong<JSObject>&& keyframes, std::optional<Variant<double, KeyframeEffectOptions>>&& options)
 {
-    auto keyframeEffect = adoptRef(*new KeyframeEffect(AnimationEffectTiming::create(), target));
+    auto keyframeEffect = adoptRef(*new KeyframeEffect(target));
+
+    if (options) {
+        OptionalEffectTiming timing;
+        auto optionsValue = options.value();
+        if (WTF::holds_alternative<double>(optionsValue)) {
+            Variant<double, String> duration = WTF::get<double>(optionsValue);
+            timing.duration = duration;
+        } else {
+            auto keyframeEffectOptions = WTF::get<KeyframeEffectOptions>(optionsValue);
+            timing = {
+                keyframeEffectOptions.delay,
+                keyframeEffectOptions.endDelay,
+                keyframeEffectOptions.fill,
+                keyframeEffectOptions.iterationStart,
+                keyframeEffectOptions.iterations,
+                keyframeEffectOptions.duration,
+                keyframeEffectOptions.direction,
+                keyframeEffectOptions.easing
+            };
+        }
 
-    auto setPropertiesResult = keyframeEffect->timing()->setProperties(WTFMove(options));
-    if (setPropertiesResult.hasException())
-        return setPropertiesResult.releaseException();
+        auto updateTimingResult = keyframeEffect->updateTiming(timing);
+        if (updateTimingResult.hasException())
+            return updateTimingResult.releaseException();
+    }
 
     auto processKeyframesResult = keyframeEffect->processKeyframes(state, WTFMove(keyframes));
     if (processKeyframesResult.hasException())
@@ -481,19 +501,18 @@ ExceptionOr<Ref<KeyframeEffect>> KeyframeEffect::create(ExecState& state, Elemen
 
 ExceptionOr<Ref<KeyframeEffect>> KeyframeEffect::create(JSC::ExecState&, Ref<KeyframeEffect>&& source)
 {
-    auto keyframeEffect = adoptRef(*new KeyframeEffect(AnimationEffectTiming::create(), nullptr));
+    auto keyframeEffect = adoptRef(*new KeyframeEffect(nullptr));
     keyframeEffect->copyPropertiesFromSource(WTFMove(source));
     return WTFMove(keyframeEffect);
 }
 
 Ref<KeyframeEffect> KeyframeEffect::create(const Element& target)
 {
-    return adoptRef(*new KeyframeEffect(AnimationEffectTiming::create(), const_cast<Element*>(&target)));
+    return adoptRef(*new KeyframeEffect(const_cast<Element*>(&target)));
 }
 
-KeyframeEffect::KeyframeEffect(Ref<AnimationEffectTiming>&& timing, Element* target)
-    : AnimationEffect(WTFMove(timing))
-    , m_target(target)
+KeyframeEffect::KeyframeEffect(Element* target)
+    : m_target(target)
     , m_blendingKeyframes(emptyString())
 {
 }
@@ -518,7 +537,14 @@ void KeyframeEffect::copyPropertiesFromSource(Ref<KeyframeEffect>&& source)
     }
     m_parsedKeyframes = WTFMove(parsedKeyframes);
 
-    timing()->copyPropertiesFromSource(source->timing());
+    setFill(source->fill());
+    setDelay(source->delay());
+    setEndDelay(source->endDelay());
+    setDirection(source->direction());
+    setIterations(source->iterations());
+    setTimingFunction(source->timingFunction());
+    setIterationStart(source->iterationStart());
+    setIterationDuration(source->iterationDuration());
 
     KeyframeList keyframeList("keyframe-effect-" + createCanonicalUUIDString());
     for (auto& keyframe : source->m_blendingKeyframes.keyframes()) {
@@ -1163,8 +1189,8 @@ void KeyframeEffect::setAnimatedPropertiesInStyle(RenderStyle& targetStyle, doub
         //     passing interval distance as the input progress.
         auto transformedDistance = intervalDistance;
         if (startKeyframeIndex) {
-            if (auto iterationDuration = timing()->iterationDuration()) {
-                auto rangeDuration = (endOffset - startOffset) * iterationDuration.seconds();
+            if (auto duration = iterationDuration()) {
+                auto rangeDuration = (endOffset - startOffset) * duration.seconds();
                 if (auto* timingFunction = timingFunctionForKeyframeAtIndex(startKeyframeIndex.value()))
                     transformedDistance = timingFunction->transformTime(intervalDistance, rangeDuration);
             }
@@ -1292,7 +1318,7 @@ void KeyframeEffect::applyPendingAcceleratedActions()
     auto* compositedRenderer = downcast<RenderBoxModelObject>(renderer);
 
     // To simplify the code we use a default of 0s for an unresolved current time since for a Stop action that is acceptable.
-    auto timeOffset = animation()->currentTime().value_or(0_s).seconds() - timing()->delay().seconds();
+    auto timeOffset = animation()->currentTime().value_or(0_s).seconds() - delay().seconds();
 
     for (const auto& action : pendingAcceleratedActions) {
         switch (action) {
@@ -1327,14 +1353,13 @@ Ref<const Animation> KeyframeEffect::backingAnimationForCompositedRenderer() con
 
     // FIXME: The iterationStart and endDelay AnimationEffectTiming properties do not have
     // corresponding Animation properties.
-    auto effectTiming = timing();
     auto animation = Animation::create();
-    animation->setDuration(effectTiming->iterationDuration().seconds());
-    animation->setDelay(effectTiming->delay().seconds());
-    animation->setIterationCount(effectTiming->iterations());
-    animation->setTimingFunction(effectTiming->timingFunction()->clone());
+    animation->setDuration(iterationDuration().seconds());
+    animation->setDelay(delay().seconds());
+    animation->setIterationCount(iterations());
+    animation->setTimingFunction(timingFunction()->clone());
 
-    switch (effectTiming->fill()) {
+    switch (fill()) {
     case FillMode::None:
     case FillMode::Auto:
         animation->setFillMode(AnimationFillMode::None);
@@ -1350,7 +1375,7 @@ Ref<const Animation> KeyframeEffect::backingAnimationForCompositedRenderer() con
         break;
     }
 
-    switch (effectTiming->direction()) {
+    switch (direction()) {
     case PlaybackDirection::Normal:
         animation->setDirection(Animation::AnimationDirectionNormal);
         break;
index a950b04..8912453 100644 (file)
@@ -26,7 +26,6 @@
 #pragma once
 
 #include "AnimationEffect.h"
-#include "AnimationEffectTiming.h"
 #include "CSSPropertyBlendingClient.h"
 #include "CompositeOperation.h"
 #include "EffectTiming.h"
@@ -137,7 +136,7 @@ public:
     bool forceLayoutIfNeeded();
 
 private:
-    KeyframeEffect(Ref<AnimationEffectTiming>&&, Element*);
+    KeyframeEffect(Element*);
 
     enum class AcceleratedAction { Play, Pause, Seek, Stop };
 
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017-2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
 
 #pragma once
 
-#include "AnimationEffectTimingReadOnly.h"
-#include "ExceptionOr.h"
 #include "FillMode.h"
 #include "PlaybackDirection.h"
-#include "TimingFunction.h"
-#include "WebAnimationUtilities.h"
-#include <wtf/Forward.h>
-#include <wtf/Ref.h>
-#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
-#include <wtf/Seconds.h>
 #include <wtf/Variant.h>
+#include <wtf/text/WTFString.h>
 
 namespace WebCore {
 
-class AnimationEffectTiming final : public AnimationEffectTimingReadOnly {
-public:
-    static Ref<AnimationEffectTiming> create();
-    ~AnimationEffectTiming();
-
-private:
-    AnimationEffectTiming();
+struct OptionalEffectTiming {
+    std::optional<double> delay;
+    std::optional<double> endDelay;
+    std::optional<FillMode> fill;
+    std::optional<double> iterationStart;
+    std::optional<double> iterations;
+    std::optional<Variant<double, String>> duration;
+    std::optional<PlaybackDirection> direction;
+    String easing;
 };
 
 } // namespace WebCore
-
-SPECIALIZE_TYPE_TRAITS_ANIMATION_EFFECT_TIMING(AnimationEffectTiming, isAnimationEffectTiming());
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017-2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * 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()
-    : AnimationEffectTimingReadOnly(AnimationEffectTimingClass)
-{
-}
-
-AnimationEffectTiming::~AnimationEffectTiming()
-{
-}
-
-} // namespace WebCore
+dictionary OptionalEffectTiming {
+    double delay;
+    double endDelay;
+    FillMode fill;
+    double iterationStart;
+    unrestricted double iterations;
+    (unrestricted double or DOMString) duration;
+    PlaybackDirection direction;
+    DOMString easing;
+};
index 1420c6a..bdb3189 100644 (file)
@@ -27,7 +27,6 @@
 #include "WebAnimation.h"
 
 #include "AnimationEffect.h"
-#include "AnimationEffectTimingReadOnly.h"
 #include "AnimationPlaybackEvent.h"
 #include "AnimationTimeline.h"
 #include "Document.h"
@@ -90,7 +89,7 @@ void WebAnimation::unsuspendEffectInvalidation()
     --m_suspendCount;
 }
 
-void WebAnimation::effectTimingPropertiesDidChange()
+void WebAnimation::effectTimingDidChange()
 {
     timingDidChange(DidSeek::No, SynchronouslyNotify::Yes);
 }
@@ -476,7 +475,7 @@ Seconds WebAnimation::effectEndTime() const
 {
     // The target effect end of an animation is equal to the end time of the animation's target effect.
     // If the animation has no target effect, the target effect end is zero.
-    return m_effect ? m_effect->timing()->endTime() : 0_s;
+    return m_effect ? m_effect->endTime() : 0_s;
 }
 
 void WebAnimation::cancel()
index 56e059f..05be950 100644 (file)
@@ -109,7 +109,7 @@ public:
     void applyPendingAcceleratedActions();
 
     bool isRelevant() const { return m_isRelevant; }
-    void effectTimingPropertiesDidChange();
+    void effectTimingDidChange();
     void suspendEffectInvalidation();
     void unsuspendEffectInvalidation();
     void setSuspended(bool);
diff --git a/Source/WebCore/bindings/js/JSAnimationEffectTimingReadOnlyCustom.cpp b/Source/WebCore/bindings/js/JSAnimationEffectTimingReadOnlyCustom.cpp
deleted file mode 100644 (file)
index 949ef13..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2018 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "JSAnimationEffectTimingReadOnly.h"
-
-#include "AnimationEffectTiming.h"
-#include "JSAnimationEffectTiming.h"
-#include "JSDOMBinding.h"
-
-using namespace JSC;
-
-namespace WebCore {
-
-JSValue toJSNewlyCreated(ExecState*, JSDOMGlobalObject* globalObject, Ref<AnimationEffectTimingReadOnly>&& value)
-{
-    if (value->isAnimationEffectTiming())
-        return createWrapper<AnimationEffectTiming>(globalObject, WTFMove(value));
-    return createWrapper<AnimationEffectTimingReadOnly>(globalObject, WTFMove(value));
-}
-
-JSValue toJS(ExecState* state, JSDOMGlobalObject* globalObject, AnimationEffectTimingReadOnly& value)
-{
-    return wrap(state, globalObject, value);
-}
-
-} // namespace WebCore
index 1157f35..7969ec5 100644 (file)
@@ -33,8 +33,6 @@ namespace WebCore {
 #define WEBCORE_COMMON_PRIVATE_IDENTIFIERS_EACH_PROPERTY_NAME(macro) \
     macro(Animation) \
     macro(AnimationEffect) \
-    macro(AnimationEffectTiming) \
-    macro(AnimationEffectTimingReadOnly) \
     macro(AnimationPlaybackEvent) \
     macro(AnimationTimeline) \
     macro(ApplePaySession) \