haikuwebkit/Source/WebCore/animation/KeyframeEffect.idl

63 lines
2.7 KiB
Plaintext
Raw Permalink Normal View History

[Web Animations] Add basic timing and target properties https://bugs.webkit.org/show_bug.cgi?id=178674 Patch by Antoine Quint <graouts@apple.com> on 2017-10-24 Reviewed by Dean Jackson. Source/WebCore: We add three new interfaces to expose enough properties to establish basic timing properties, a start time and duration, and the target of an animation. The startTime property is set on the Animation object, the target is set on the KeyframeEffect set as the effect property on the Animation object, and the duration is set on the AnimationEffectTiming set on the effect. Tests: webanimations/animation-effect-timing.html webanimations/animation-effect.html webanimations/animation-interface-effect-property.html webanimations/animation-interface-start-time-property.html webanimations/keyframe-effect-interface-timing-duration.html webanimations/keyframe-effect.html * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * animation/AnimationEffect.cpp: Copied from Source/WebCore/animation/WebAnimation.idl. (WebCore::AnimationEffect::AnimationEffect): (WebCore::AnimationEffect::~AnimationEffect): * animation/AnimationEffect.h: Copied from Source/WebCore/animation/WebAnimation.h. (WebCore::AnimationEffect::isKeyframeEffect const): (WebCore::AnimationEffect::timing const): (WebCore::AnimationEffect::classType const): * animation/AnimationEffect.idl: Copied from Source/WebCore/animation/WebAnimation.idl. * animation/AnimationEffectTiming.cpp: Copied from Source/WebCore/animation/WebAnimation.idl. (WebCore::AnimationEffectTiming::create): (WebCore::AnimationEffectTiming::AnimationEffectTiming): (WebCore::AnimationEffectTiming::~AnimationEffectTiming): * animation/AnimationEffectTiming.h: Copied from Source/WebCore/animation/WebAnimation.h. * animation/AnimationEffectTiming.idl: Copied from Source/WebCore/animation/WebAnimation.idl. * animation/KeyframeEffect.cpp: Copied from Source/WebCore/animation/WebAnimation.idl. (WebCore::KeyframeEffect::create): (WebCore::KeyframeEffect::KeyframeEffect): * animation/KeyframeEffect.h: Copied from Source/WebCore/animation/WebAnimation.h. * animation/KeyframeEffect.idl: Copied from Source/WebCore/animation/WebAnimation.idl. * animation/WebAnimation.cpp: (WebCore::WebAnimation::setEffect): * animation/WebAnimation.h: * animation/WebAnimation.idl: * bindings/js/JSAnimationEffectCustom.cpp: Copied from Source/WebCore/animation/WebAnimation.cpp. (WebCore::toJSNewlyCreated): (WebCore::toJS): * bindings/js/WebCoreBuiltinNames.h: LayoutTests: Add new tests to check the behavior of the newly exposed interfaces, constructors and properties. * webanimations/animation-effect-expected.txt: Added. * webanimations/animation-effect-timing-expected.txt: Added. * webanimations/animation-effect-timing.html: Added. * webanimations/animation-effect.html: Added. * webanimations/animation-interface-effect-property-expected.txt: Added. * webanimations/animation-interface-effect-property.html: Added. * webanimations/animation-interface-start-time-property-expected.txt: Added. * webanimations/animation-interface-start-time-property.html: Added. * webanimations/keyframe-effect-expected.txt: Added. * webanimations/keyframe-effect-interface-timing-duration-expected.txt: Added. * webanimations/keyframe-effect-interface-timing-duration.html: Added. * webanimations/keyframe-effect.html: Added. Canonical link: https://commits.webkit.org/194879@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223883 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-10-24 07:51:59 +00:00
/*
[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> Reviewed by Dean Jackson. The Web Animations API has been simplified by removing its various ReadOnly interfaces. In this patch, we make the following changes, not adding code but merely merging and renaming files: - AnimationEffectReadOnly and AnimationEffect are now a single AnimationEffect interface - KeyframeEffectReadOnly and KeyframeEffect are now a single KeyframeEffect interface - ComputedTimingProperties is now named ComputedEffectTiming - AnimationEffectTimingProperties is now named EffectTiming * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * animation/AnimationEffect.cpp: Renamed from Source/WebCore/animation/AnimationEffectReadOnly.cpp. (WebCore::AnimationEffect::~AnimationEffect): (WebCore::AnimationEffect::timingDidChange): (WebCore::AnimationEffect::localTime const): (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::directedProgress const): (WebCore::AnimationEffect::transformedProgress const): (WebCore::AnimationEffect::iterationProgress const): (WebCore::AnimationEffect::getComputedTiming): * animation/AnimationEffect.h: Renamed from Source/WebCore/animation/AnimationEffectReadOnly.h. (WebCore::AnimationEffect::isKeyframeEffect const): * animation/AnimationEffect.idl: Renamed from Source/WebCore/animation/AnimationEffectReadOnly.idl. * animation/AnimationEffectTimingReadOnly.cpp: * animation/AnimationEffectTimingReadOnly.h: (WebCore::AnimationEffectTimingReadOnly::setEffect): * animation/AnimationTimeline.cpp: (WebCore::AnimationTimeline::removeAnimation): (WebCore::AnimationTimeline::cssAnimationForElementAndProperty): * animation/CSSTransition.cpp: * animation/ComputedEffectTiming.h: Renamed from Source/WebCore/animation/ComputedTimingProperties.h. * animation/ComputedEffectTiming.idl: Renamed from Source/WebCore/animation/ComputedTimingProperties.idl. * animation/DeclarativeAnimation.cpp: (WebCore::DeclarativeAnimation::initialize): (WebCore::DeclarativeAnimation::flushPendingStyleChanges const): (WebCore::DeclarativeAnimation::phaseWithoutEffect const): (WebCore::DeclarativeAnimation::invalidateDOMEvents): * animation/DeclarativeAnimation.h: * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::getAnimations const): (WebCore::DocumentTimeline::transitionDidComplete): (WebCore::DocumentTimeline::computeExtentOfAnimation const): (WebCore::DocumentTimeline::isRunningAnimationOnRenderer const): (WebCore::DocumentTimeline::isRunningAcceleratedAnimationOnRenderer const): (WebCore::DocumentTimeline::animatedStyleForRenderer): (WebCore::DocumentTimeline::animationAcceleratedRunningStateDidChange): (WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement): (WebCore::DocumentTimeline::applyPendingAcceleratedAnimations): (WebCore::DocumentTimeline::resolveAnimationsForElement): * animation/EffectTiming.h: Renamed from Source/WebCore/animation/AnimationEffectTimingProperties.h. * animation/EffectTiming.idl: Renamed from Source/WebCore/animation/AnimationEffectTimingProperties.idl. * animation/KeyframeEffect.cpp: (WebCore::invalidateElement): (WebCore::CSSPropertyIDToIDLAttributeName): (WebCore::IDLAttributeNameToAnimationPropertyName): (WebCore::computeMissingKeyframeOffsets): (WebCore::processKeyframeLikeObject): (WebCore::processIterableKeyframes): (WebCore::processPropertyIndexedKeyframes): (WebCore::KeyframeEffect::create): (WebCore::KeyframeEffect::KeyframeEffect): (WebCore::KeyframeEffect::copyPropertiesFromSource): (WebCore::KeyframeEffect::getKeyframes): (WebCore::KeyframeEffect::processKeyframes): (WebCore::KeyframeEffect::updateBlendingKeyframes): (WebCore::KeyframeEffect::forceLayoutIfNeeded): (WebCore::KeyframeEffect::setBlendingKeyframes): (WebCore::KeyframeEffect::checkForMatchingTransformFunctionLists): (WebCore::KeyframeEffect::checkForMatchingFilterFunctionLists const): (WebCore::KeyframeEffect::checkForMatchingFilterFunctionLists): (WebCore::KeyframeEffect::checkForMatchingBackdropFilterFunctionLists): (WebCore::KeyframeEffect::checkForMatchingColorFilterFunctionLists): (WebCore::KeyframeEffect::computeDeclarativeAnimationBlendingKeyframes): (WebCore::KeyframeEffect::computeCSSAnimationBlendingKeyframes): (WebCore::KeyframeEffect::computeCSSTransitionBlendingKeyframes): (WebCore::KeyframeEffect::computedNeedsForcedLayout): (WebCore::KeyframeEffect::computeStackingContextImpact): (WebCore::KeyframeEffect::setTarget): (WebCore::KeyframeEffect::apply): (WebCore::KeyframeEffect::invalidate): (WebCore::KeyframeEffect::computeShouldRunAccelerated): (WebCore::KeyframeEffect::getAnimatedStyle): (WebCore::KeyframeEffect::setAnimatedPropertiesInStyle): (WebCore::KeyframeEffect::timingFunctionForKeyframeAtIndex): (WebCore::KeyframeEffect::updateAcceleratedAnimationState): (WebCore::KeyframeEffect::addPendingAcceleratedAction): (WebCore::KeyframeEffect::animationDidSeek): (WebCore::KeyframeEffect::animationSuspensionStateDidChange): (WebCore::KeyframeEffect::applyPendingAcceleratedActions): (WebCore::KeyframeEffect::backingAnimationForCompositedRenderer const): (WebCore::KeyframeEffect::renderer const): (WebCore::KeyframeEffect::currentStyle const): (WebCore::KeyframeEffect::computeExtentOfTransformAnimation const): (WebCore::containsRotation): (WebCore::KeyframeEffect::computeTransformedExtentViaTransformList const): (WebCore::KeyframeEffect::computeTransformedExtentViaMatrix const): * animation/KeyframeEffect.h: (WebCore::KeyframeEffect::ParsedKeyframe::ParsedKeyframe): (WebCore::KeyframeEffect::target const): (WebCore::KeyframeEffect::iterationComposite const): (WebCore::KeyframeEffect::composite const): (WebCore::KeyframeEffect::isRunningAccelerated const): (WebCore::KeyframeEffect::hasPendingAcceleratedAction const): (WebCore::KeyframeEffect::hasBlendingKeyframes const): (WebCore::KeyframeEffect::animatedProperties const): * animation/KeyframeEffect.idl: * animation/KeyframeEffectOptions.h: * animation/KeyframeEffectOptions.idl: * animation/KeyframeEffectReadOnly.cpp: Removed. * animation/KeyframeEffectReadOnly.h: Removed. * animation/KeyframeEffectReadOnly.idl: Removed. * animation/WebAnimation.cpp: (WebCore::WebAnimation::create): (WebCore::WebAnimation::setEffect): (WebCore::WebAnimation::setEffectInternal): (WebCore::WebAnimation::setTimeline): (WebCore::WebAnimation::applyPendingAcceleratedActions): (WebCore::WebAnimation::computeRelevance): * animation/WebAnimation.h: (WebCore::WebAnimation::effect const): * animation/WebAnimation.idl: * bindings/js/JSAnimationEffectCustom.cpp: Renamed from Source/WebCore/bindings/js/JSAnimationEffectReadOnlyCustom.cpp. (WebCore::toJSNewlyCreated): (WebCore::toJS): * bindings/js/JSWebAnimationCustom.cpp: (WebCore::constructJSWebAnimation): * bindings/js/WebCoreBuiltinNames.h: * dom/Document.cpp: Canonical link: https://commits.webkit.org/206101@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237852 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-11-06 11:15:15 +00:00
* Copyright (C) 2018 Apple Inc. All rights reserved.
[Web Animations] Add basic timing and target properties https://bugs.webkit.org/show_bug.cgi?id=178674 Patch by Antoine Quint <graouts@apple.com> on 2017-10-24 Reviewed by Dean Jackson. Source/WebCore: We add three new interfaces to expose enough properties to establish basic timing properties, a start time and duration, and the target of an animation. The startTime property is set on the Animation object, the target is set on the KeyframeEffect set as the effect property on the Animation object, and the duration is set on the AnimationEffectTiming set on the effect. Tests: webanimations/animation-effect-timing.html webanimations/animation-effect.html webanimations/animation-interface-effect-property.html webanimations/animation-interface-start-time-property.html webanimations/keyframe-effect-interface-timing-duration.html webanimations/keyframe-effect.html * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * animation/AnimationEffect.cpp: Copied from Source/WebCore/animation/WebAnimation.idl. (WebCore::AnimationEffect::AnimationEffect): (WebCore::AnimationEffect::~AnimationEffect): * animation/AnimationEffect.h: Copied from Source/WebCore/animation/WebAnimation.h. (WebCore::AnimationEffect::isKeyframeEffect const): (WebCore::AnimationEffect::timing const): (WebCore::AnimationEffect::classType const): * animation/AnimationEffect.idl: Copied from Source/WebCore/animation/WebAnimation.idl. * animation/AnimationEffectTiming.cpp: Copied from Source/WebCore/animation/WebAnimation.idl. (WebCore::AnimationEffectTiming::create): (WebCore::AnimationEffectTiming::AnimationEffectTiming): (WebCore::AnimationEffectTiming::~AnimationEffectTiming): * animation/AnimationEffectTiming.h: Copied from Source/WebCore/animation/WebAnimation.h. * animation/AnimationEffectTiming.idl: Copied from Source/WebCore/animation/WebAnimation.idl. * animation/KeyframeEffect.cpp: Copied from Source/WebCore/animation/WebAnimation.idl. (WebCore::KeyframeEffect::create): (WebCore::KeyframeEffect::KeyframeEffect): * animation/KeyframeEffect.h: Copied from Source/WebCore/animation/WebAnimation.h. * animation/KeyframeEffect.idl: Copied from Source/WebCore/animation/WebAnimation.idl. * animation/WebAnimation.cpp: (WebCore::WebAnimation::setEffect): * animation/WebAnimation.h: * animation/WebAnimation.idl: * bindings/js/JSAnimationEffectCustom.cpp: Copied from Source/WebCore/animation/WebAnimation.cpp. (WebCore::toJSNewlyCreated): (WebCore::toJS): * bindings/js/WebCoreBuiltinNames.h: LayoutTests: Add new tests to check the behavior of the newly exposed interfaces, constructors and properties. * webanimations/animation-effect-expected.txt: Added. * webanimations/animation-effect-timing-expected.txt: Added. * webanimations/animation-effect-timing.html: Added. * webanimations/animation-effect.html: Added. * webanimations/animation-interface-effect-property-expected.txt: Added. * webanimations/animation-interface-effect-property.html: Added. * webanimations/animation-interface-start-time-property-expected.txt: Added. * webanimations/animation-interface-start-time-property.html: Added. * webanimations/keyframe-effect-expected.txt: Added. * webanimations/keyframe-effect-interface-timing-duration-expected.txt: Added. * webanimations/keyframe-effect-interface-timing-duration.html: Added. * webanimations/keyframe-effect.html: Added. Canonical link: https://commits.webkit.org/194879@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223883 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-10-24 07:51:59 +00:00
*
* 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.
*/
[Web Animations] Add support for `pseudoElement` on `KeyframeEffect` and `KeyframeEffectOptions` https://bugs.webkit.org/show_bug.cgi?id=207290 <rdar://problem/59199003> Reviewed by Antti Koivisto. LayoutTests/imported/w3c: Mark 23 additional WPT tests as PASS. * web-platform-tests/css/css-animations/Document-getAnimations.tentative-expected.txt: * web-platform-tests/css/css-animations/Element-getAnimations.tentative-expected.txt: * web-platform-tests/css/css-transitions/Document-getAnimations.tentative-expected.txt: * web-platform-tests/web-animations/idlharness.window-expected.txt: * web-platform-tests/web-animations/interfaces/Animatable/animate-expected.txt: * web-platform-tests/web-animations/interfaces/Animation/commitStyles-expected.txt: * web-platform-tests/web-animations/interfaces/KeyframeEffect/style-change-events-expected.txt: * web-platform-tests/web-animations/interfaces/KeyframeEffect/target-expected.txt: Source/WebCore: We add the required IDL bindings such that JS-originated Web Animations can target pseudo-elements, either via the KeyframeEffect.pseudoElement property, or via the KeyframeEffectOptions.pseudoElement property, which is set on the object passed to the KeyframeEffect constrcutor and Element.animate(). This means that a PseudoElement can be targeted by an animation even if it's not been created through style resolution by virtue of a ::before or ::after selector and a "content" style rule. This means that when either the "target" or "pseudoElement" property of KeyframeEffect is set, we ensure a PseudoElement is created and set on the host element if required. And additionally, we ensure that during style resolution, animations are applied to such pseudo-elements with a new PseudoElement::isTargetedByKeyframeEffectRequiringPseudoElement() method that indicates that a JS-originated KeyframeEffect targets this pseudo-element. * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::create): Handle the new KeyframeEffectOptions.pseudoElement property in the KeyframeEffect constructor. (WebCore::KeyframeEffect::targetsPseudoElement const): Indicates whether this effect targets a pseudo-element and not a regular element or a null target. (WebCore::KeyframeEffect::targetElementOrPseudoElement const): Use the new targetsPseudoElement() method to determine whether a pseudo-element is targeted. We also remove an assertion that only made sense when m_pseudoId could only be set via a CSS-originated animation and another one when the only possible m_pseudoId values were PseudoId::Before and PseudoId::After. (WebCore::KeyframeEffect::setTarget): Call the new didChangeTargetElementOrPseudoElement() method if the provided value differs from the stored value for m_target. (WebCore::KeyframeEffect::pseudoElement const): Return the matching normalized string with a `::` prefix for m_pseudoId if the target is a pseudo-element. Note that PseudoElement::pseudoElementNameForEvents() will only return a string for "::before" and "::after" since we only know how to animate these pseudo-elements. (WebCore::KeyframeEffect::setPseudoElement): Determine a matching PseudoId, if any, for the provided string, and call the new didChangeTargetElementOrPseudoElement() method if the provided value differs from the stored value for m_pseudoId. (WebCore::KeyframeEffect::didChangeTargetElementOrPseudoElement): New method called when either m_target or m_pseudoId is changed such that we can ensure the required PseudoElement is created if the animation targets a pseudo-element. Then we run the same logic that we used to in KeyframeEffect::setTarget(). (WebCore::KeyframeEffect::requiresPseudoElement const): Indicates whether a PseudoElement must remain created for this KeyframeEffect, which is only necessary for JS-originated effects targeting a pseudo-element. * animation/KeyframeEffect.h: * animation/KeyframeEffect.idl: * animation/KeyframeEffectOptions.h: * animation/KeyframeEffectOptions.idl: * animation/KeyframeEffectStack.cpp: (WebCore::KeyframeEffectStack::requiresPseudoElement const): Indicates whether one or more JS-originated keyframe effects in the stack target the PseudoElement owning this stack. * animation/KeyframeEffectStack.h: * animation/WebAnimation.cpp: (WebCore::WebAnimation::commitStyles): Use KeyframeEffect::targetsPseudoElement() to determine whether the animation's effect's target is a pseudo-element, in which case we need to throw a NoModificationAllowedError exception. * dom/PseudoElement.cpp: (WebCore::PseudoElement::rendererIsNeeded): Return true also when one or more JS-originated keyframe effects in the stack target this pseudo-element. (WebCore::PseudoElement::isTargetedByKeyframeEffectRequiringPseudoElement): Return true when one or more JS-originated keyframe effects in the stack target this pseudo-element. * dom/PseudoElement.h: * rendering/updating/RenderTreeUpdaterGeneratedContent.cpp: (WebCore::createContentRenderers): Remove the assertion that the "content" property was set since it's valid for this function to now be called due to JS-originated keyframe effects targeting the given pseudo-element. Instead we add an assertion that there are such keyframe effects in case no "content" property was set. (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement): Only remove pseudo-elements if there are no JS-originated keyframe effects targeting the specified pseudo-element. * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::resolvePseudoStyle): Allow animated style resolution for pseudo-elements targeted by JS-originated keyframe effects. Canonical link: https://commits.webkit.org/223430@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@260139 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-15 17:39:57 +00:00
typedef USVString CSSOMString;
[Web Animations] Add basic timing and target properties https://bugs.webkit.org/show_bug.cgi?id=178674 Patch by Antoine Quint <graouts@apple.com> on 2017-10-24 Reviewed by Dean Jackson. Source/WebCore: We add three new interfaces to expose enough properties to establish basic timing properties, a start time and duration, and the target of an animation. The startTime property is set on the Animation object, the target is set on the KeyframeEffect set as the effect property on the Animation object, and the duration is set on the AnimationEffectTiming set on the effect. Tests: webanimations/animation-effect-timing.html webanimations/animation-effect.html webanimations/animation-interface-effect-property.html webanimations/animation-interface-start-time-property.html webanimations/keyframe-effect-interface-timing-duration.html webanimations/keyframe-effect.html * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * animation/AnimationEffect.cpp: Copied from Source/WebCore/animation/WebAnimation.idl. (WebCore::AnimationEffect::AnimationEffect): (WebCore::AnimationEffect::~AnimationEffect): * animation/AnimationEffect.h: Copied from Source/WebCore/animation/WebAnimation.h. (WebCore::AnimationEffect::isKeyframeEffect const): (WebCore::AnimationEffect::timing const): (WebCore::AnimationEffect::classType const): * animation/AnimationEffect.idl: Copied from Source/WebCore/animation/WebAnimation.idl. * animation/AnimationEffectTiming.cpp: Copied from Source/WebCore/animation/WebAnimation.idl. (WebCore::AnimationEffectTiming::create): (WebCore::AnimationEffectTiming::AnimationEffectTiming): (WebCore::AnimationEffectTiming::~AnimationEffectTiming): * animation/AnimationEffectTiming.h: Copied from Source/WebCore/animation/WebAnimation.h. * animation/AnimationEffectTiming.idl: Copied from Source/WebCore/animation/WebAnimation.idl. * animation/KeyframeEffect.cpp: Copied from Source/WebCore/animation/WebAnimation.idl. (WebCore::KeyframeEffect::create): (WebCore::KeyframeEffect::KeyframeEffect): * animation/KeyframeEffect.h: Copied from Source/WebCore/animation/WebAnimation.h. * animation/KeyframeEffect.idl: Copied from Source/WebCore/animation/WebAnimation.idl. * animation/WebAnimation.cpp: (WebCore::WebAnimation::setEffect): * animation/WebAnimation.h: * animation/WebAnimation.idl: * bindings/js/JSAnimationEffectCustom.cpp: Copied from Source/WebCore/animation/WebAnimation.cpp. (WebCore::toJSNewlyCreated): (WebCore::toJS): * bindings/js/WebCoreBuiltinNames.h: LayoutTests: Add new tests to check the behavior of the newly exposed interfaces, constructors and properties. * webanimations/animation-effect-expected.txt: Added. * webanimations/animation-effect-timing-expected.txt: Added. * webanimations/animation-effect-timing.html: Added. * webanimations/animation-effect.html: Added. * webanimations/animation-interface-effect-property-expected.txt: Added. * webanimations/animation-interface-effect-property.html: Added. * webanimations/animation-interface-start-time-property-expected.txt: Added. * webanimations/animation-interface-start-time-property.html: Added. * webanimations/keyframe-effect-expected.txt: Added. * webanimations/keyframe-effect-interface-timing-duration-expected.txt: Added. * webanimations/keyframe-effect-interface-timing-duration.html: Added. * webanimations/keyframe-effect.html: Added. Canonical link: https://commits.webkit.org/194879@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223883 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-10-24 07:51:59 +00:00
[
[Web Animations] Refactor AnimationEffect and KeyframeEffect into AnimationEffectReadOnly, KeyframeEffectReadOnly and KeyframeEffect https://bugs.webkit.org/show_bug.cgi?id=182608 Reviewed by Dean Jackson. LayoutTests/imported/w3c: Update WPT expectations with progressions and updated failure points for all tests that involved either AnimationEffectReadOnly or KeyframeEffectReadOnly. * web-platform-tests/web-animations/interfaces/Animation/constructor-expected.txt: * web-platform-tests/web-animations/interfaces/Animation/effect-expected.txt: * web-platform-tests/web-animations/interfaces/AnimationEffectTiming/idlharness-expected.txt: * web-platform-tests/web-animations/interfaces/Document/getAnimations-expected.txt: * web-platform-tests/web-animations/interfaces/KeyframeEffect/constructor-expected.txt: * web-platform-tests/web-animations/interfaces/KeyframeEffect/copy-constructor-expected.txt: * web-platform-tests/web-animations/interfaces/KeyframeEffect/idlharness-expected.txt: Source/WebCore: Currently, we have an AnimationEffect class with read-write members and a KeyframeEffect subclass with read-write members. The spec has an AnimationEffectReadOnly class, with read-only members, a KeyframeEffectReadOnly subclass, with read-only members, and then the KeyframeEffect subclass (of KeyframeEffectReadOnly) with read-write members. Likewise, currently we have an AnimationEffectTiming class with read-write members. While the spec has this class as well, it also specifies a read-only AnimationEffectTimingReadOnly superclass. In this patch we refactor the code to match the spec, which gives us a big boost in our WPT pass rate. The vast majority of the code is just copied from one class to another verbatim. The limited actual code changes, all related to the new subclassing, are: - AnimationEffectTimingReadOnly is not actually read-only as far as WebCore is concerned, it actually exposes setters for all of its properties, but the IDL for this class specifies all properties as read-only, so we match the spec. The reason for this is that it is necessary to be able to set members of an AnimationEffectTimingReadOnly object based on a Variant<double, KeyframeEffectOptions> provided to Element.animate() or the KeyframeEffectReadOnly and KeyframeEffect constructors, and the logic to handle properties in such dictionaries is the same as the logic required to set individual members in AnimationEffectTiming. So in essence, the sole role of AnimationTimingEffect is to provide an IDL interface with read-write members, but the parent class is itself read-write as far as WebCore is concerned. - AnimationEffectTimingReadOnly exposes a new setProperties() method which takes in a nullable Variant<double, KeyframeEffectOptions> so that code that was previously specific to KeyframeEffect can be factored into this method and both the constructors of KeyframeEffectReadOnly and KeyframeEffect can make use of it without code duplication. - The AnimationEffectReadOnly constructor now takes an AnimationEffectTimingReadOnly as input since that class and KeyframeEffectReadOnly expose an AnimationEffectTimingReadOnly object, while KeyframeEffect exposes an AnimationEffectTiming read-write object. This allows the KeyframeEffect constructor to provide the right object type. * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * animation/AnimationEffectReadOnly.cpp: Renamed from Source/WebCore/animation/AnimationEffect.cpp. (WebCore::AnimationEffectReadOnly::AnimationEffectReadOnly): (WebCore::AnimationEffectReadOnly::localTime const): (WebCore::AnimationEffectReadOnly::phase const): (WebCore::AnimationEffectReadOnly::activeTime const): (WebCore::AnimationEffectReadOnly::overallProgress const): (WebCore::AnimationEffectReadOnly::simpleIterationProgress const): (WebCore::AnimationEffectReadOnly::currentIteration const): (WebCore::AnimationEffectReadOnly::currentDirection const): (WebCore::AnimationEffectReadOnly::directedProgress const): (WebCore::AnimationEffectReadOnly::transformedProgress const): (WebCore::AnimationEffectReadOnly::iterationProgress const): (WebCore::AnimationEffectReadOnly::getComputedTiming): * animation/AnimationEffectReadOnly.h: Renamed from Source/WebCore/animation/AnimationEffect.h. (WebCore::AnimationEffectReadOnly::isKeyframeEffectReadOnly const): (WebCore::AnimationEffectReadOnly::timing const): * animation/AnimationEffectReadOnly.idl: Copied from Source/WebCore/animation/AnimationEffect.idl. * animation/AnimationEffectTiming.cpp: (WebCore::AnimationEffectTiming::AnimationEffectTiming): (WebCore::AnimationEffectTiming::setIterationStart): Deleted. (WebCore::AnimationEffectTiming::setIterations): Deleted. (WebCore::AnimationEffectTiming::bindingsDuration const): Deleted. (WebCore::AnimationEffectTiming::setBindingsDuration): Deleted. (WebCore::AnimationEffectTiming::endTime const): Deleted. (WebCore::AnimationEffectTiming::activeDuration const): Deleted. (WebCore::AnimationEffectTiming::setEasing): Deleted. * animation/AnimationEffectTiming.h: (): Deleted. * animation/AnimationEffectTiming.idl: * animation/AnimationEffectTimingReadOnly.cpp: Copied from Source/WebCore/animation/AnimationEffectTiming.cpp. (WebCore::AnimationEffectTimingReadOnly::create): (WebCore::AnimationEffectTimingReadOnly::AnimationEffectTimingReadOnly): (WebCore::AnimationEffectTimingReadOnly::~AnimationEffectTimingReadOnly): (WebCore::AnimationEffectTimingReadOnly::setProperties): (WebCore::AnimationEffectTimingReadOnly::setIterationStart): (WebCore::AnimationEffectTimingReadOnly::setIterations): (WebCore::AnimationEffectTimingReadOnly::bindingsDuration const): (WebCore::AnimationEffectTimingReadOnly::setBindingsDuration): (WebCore::AnimationEffectTimingReadOnly::setEasing): (WebCore::AnimationEffectTimingReadOnly::endTime const): (WebCore::AnimationEffectTimingReadOnly::activeDuration const): * animation/AnimationEffectTimingReadOnly.h: Copied from Source/WebCore/animation/AnimationEffectTiming.h. (WebCore::AnimationEffectTimingReadOnly::isAnimationEffectTiming const): (WebCore::AnimationEffectTimingReadOnly::bindingsDelay const): (WebCore::AnimationEffectTimingReadOnly::setBindingsDelay): (WebCore::AnimationEffectTimingReadOnly::bindingsEndDelay const): (WebCore::AnimationEffectTimingReadOnly::setBindingsEndDelay): (WebCore::AnimationEffectTimingReadOnly::delay const): (WebCore::AnimationEffectTimingReadOnly::setDelay): (WebCore::AnimationEffectTimingReadOnly::endDelay const): (WebCore::AnimationEffectTimingReadOnly::setEndDelay): (WebCore::AnimationEffectTimingReadOnly::fill const): (WebCore::AnimationEffectTimingReadOnly::setFill): (WebCore::AnimationEffectTimingReadOnly::iterationStart const): (WebCore::AnimationEffectTimingReadOnly::iterations const): (WebCore::AnimationEffectTimingReadOnly::iterationDuration const): (WebCore::AnimationEffectTimingReadOnly::setIterationDuration): (WebCore::AnimationEffectTimingReadOnly::direction const): (WebCore::AnimationEffectTimingReadOnly::setDirection): (WebCore::AnimationEffectTimingReadOnly::easing const): (WebCore::AnimationEffectTimingReadOnly::timingFunction const): (WebCore::AnimationEffectTimingReadOnly::classType const): * animation/AnimationEffectTimingReadOnly.idl: Renamed from Source/WebCore/animation/AnimationEffect.idl. * animation/AnimationTimeline.h: * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::create): (WebCore::KeyframeEffect::KeyframeEffect): (WebCore::IDLAttributeNameToAnimationPropertyName): Deleted. (WebCore::CSSPropertyIDToIDLAttributeName): Deleted. (WebCore::computeMissingKeyframeOffsets): Deleted. (WebCore::processIterableKeyframes): Deleted. (WebCore::processKeyframeLikeObject): Deleted. (WebCore::processPropertyIndexedKeyframes): Deleted. (WebCore::KeyframeEffect::getKeyframes): Deleted. (WebCore::KeyframeEffect::processKeyframes): Deleted. (WebCore::KeyframeEffect::computeStackingContextImpact): Deleted. (WebCore::KeyframeEffect::apply): Deleted. (WebCore::KeyframeEffect::shouldRunAccelerated): Deleted. (WebCore::KeyframeEffect::getAnimatedStyle): Deleted. (WebCore::KeyframeEffect::setAnimatedPropertiesInStyle): Deleted. (WebCore::KeyframeEffect::startOrStopAccelerated): Deleted. (WebCore::KeyframeEffect::renderer const): Deleted. (WebCore::KeyframeEffect::currentStyle const): Deleted. * animation/KeyframeEffect.h: * animation/KeyframeEffect.idl: * animation/KeyframeEffectReadOnly.cpp: Copied from Source/WebCore/animation/KeyframeEffect.cpp. (WebCore::IDLAttributeNameToAnimationPropertyName): (WebCore::CSSPropertyIDToIDLAttributeName): (WebCore::computeMissingKeyframeOffsets): (WebCore::processIterableKeyframes): (WebCore::processKeyframeLikeObject): (WebCore::processPropertyIndexedKeyframes): (WebCore::KeyframeEffectReadOnly::create): (WebCore::KeyframeEffectReadOnly::KeyframeEffectReadOnly): (WebCore::KeyframeEffectReadOnly::getKeyframes): (WebCore::KeyframeEffectReadOnly::processKeyframes): (WebCore::KeyframeEffectReadOnly::computeStackingContextImpact): (WebCore::KeyframeEffectReadOnly::apply): (WebCore::KeyframeEffectReadOnly::shouldRunAccelerated): (WebCore::KeyframeEffectReadOnly::getAnimatedStyle): (WebCore::KeyframeEffectReadOnly::setAnimatedPropertiesInStyle): (WebCore::KeyframeEffectReadOnly::startOrStopAccelerated): (WebCore::KeyframeEffectReadOnly::renderer const): (WebCore::KeyframeEffectReadOnly::currentStyle const): * animation/KeyframeEffectReadOnly.h: Copied from Source/WebCore/animation/KeyframeEffect.h. (WebCore::KeyframeEffectReadOnly::~KeyframeEffectReadOnly): (WebCore::KeyframeEffectReadOnly::target const): (WebCore::KeyframeEffectReadOnly::iterationComposite const): (WebCore::KeyframeEffectReadOnly::composite const): (WebCore::KeyframeEffectReadOnly::isRunningAccelerated const): * animation/KeyframeEffectReadOnly.idl: Copied from Source/WebCore/animation/KeyframeEffect.idl. * animation/WebAnimation.cpp: (WebCore::WebAnimation::create): (WebCore::WebAnimation::setEffect): * animation/WebAnimation.h: * animation/WebAnimation.idl: * bindings/js/JSAnimationEffectReadOnlyCustom.cpp: Copied from Source/WebCore/bindings/js/JSAnimationEffectCustom.cpp. (WebCore::toJSNewlyCreated): (WebCore::toJS): * bindings/js/JSAnimationEffectTimingReadOnlyCustom.cpp: Renamed from Source/WebCore/bindings/js/JSAnimationEffectCustom.cpp. (WebCore::toJSNewlyCreated): (WebCore::toJS): * bindings/js/JSCustomEventCustom.cpp: (WebCore::JSCustomEvent::detail const): Fix an error introduced in webkit.org/b/179591. * bindings/js/JSWebAnimationCustom.cpp: (WebCore::constructJSWebAnimation): * bindings/js/WebCoreBuiltinNames.h: Canonical link: https://commits.webkit.org/198463@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228333 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-09 19:11:32 +00:00
Exposed=Window,
[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> Reviewed by Dean Jackson. The Web Animations API has been simplified by removing its various ReadOnly interfaces. In this patch, we make the following changes, not adding code but merely merging and renaming files: - AnimationEffectReadOnly and AnimationEffect are now a single AnimationEffect interface - KeyframeEffectReadOnly and KeyframeEffect are now a single KeyframeEffect interface - ComputedTimingProperties is now named ComputedEffectTiming - AnimationEffectTimingProperties is now named EffectTiming * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * animation/AnimationEffect.cpp: Renamed from Source/WebCore/animation/AnimationEffectReadOnly.cpp. (WebCore::AnimationEffect::~AnimationEffect): (WebCore::AnimationEffect::timingDidChange): (WebCore::AnimationEffect::localTime const): (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::directedProgress const): (WebCore::AnimationEffect::transformedProgress const): (WebCore::AnimationEffect::iterationProgress const): (WebCore::AnimationEffect::getComputedTiming): * animation/AnimationEffect.h: Renamed from Source/WebCore/animation/AnimationEffectReadOnly.h. (WebCore::AnimationEffect::isKeyframeEffect const): * animation/AnimationEffect.idl: Renamed from Source/WebCore/animation/AnimationEffectReadOnly.idl. * animation/AnimationEffectTimingReadOnly.cpp: * animation/AnimationEffectTimingReadOnly.h: (WebCore::AnimationEffectTimingReadOnly::setEffect): * animation/AnimationTimeline.cpp: (WebCore::AnimationTimeline::removeAnimation): (WebCore::AnimationTimeline::cssAnimationForElementAndProperty): * animation/CSSTransition.cpp: * animation/ComputedEffectTiming.h: Renamed from Source/WebCore/animation/ComputedTimingProperties.h. * animation/ComputedEffectTiming.idl: Renamed from Source/WebCore/animation/ComputedTimingProperties.idl. * animation/DeclarativeAnimation.cpp: (WebCore::DeclarativeAnimation::initialize): (WebCore::DeclarativeAnimation::flushPendingStyleChanges const): (WebCore::DeclarativeAnimation::phaseWithoutEffect const): (WebCore::DeclarativeAnimation::invalidateDOMEvents): * animation/DeclarativeAnimation.h: * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::getAnimations const): (WebCore::DocumentTimeline::transitionDidComplete): (WebCore::DocumentTimeline::computeExtentOfAnimation const): (WebCore::DocumentTimeline::isRunningAnimationOnRenderer const): (WebCore::DocumentTimeline::isRunningAcceleratedAnimationOnRenderer const): (WebCore::DocumentTimeline::animatedStyleForRenderer): (WebCore::DocumentTimeline::animationAcceleratedRunningStateDidChange): (WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement): (WebCore::DocumentTimeline::applyPendingAcceleratedAnimations): (WebCore::DocumentTimeline::resolveAnimationsForElement): * animation/EffectTiming.h: Renamed from Source/WebCore/animation/AnimationEffectTimingProperties.h. * animation/EffectTiming.idl: Renamed from Source/WebCore/animation/AnimationEffectTimingProperties.idl. * animation/KeyframeEffect.cpp: (WebCore::invalidateElement): (WebCore::CSSPropertyIDToIDLAttributeName): (WebCore::IDLAttributeNameToAnimationPropertyName): (WebCore::computeMissingKeyframeOffsets): (WebCore::processKeyframeLikeObject): (WebCore::processIterableKeyframes): (WebCore::processPropertyIndexedKeyframes): (WebCore::KeyframeEffect::create): (WebCore::KeyframeEffect::KeyframeEffect): (WebCore::KeyframeEffect::copyPropertiesFromSource): (WebCore::KeyframeEffect::getKeyframes): (WebCore::KeyframeEffect::processKeyframes): (WebCore::KeyframeEffect::updateBlendingKeyframes): (WebCore::KeyframeEffect::forceLayoutIfNeeded): (WebCore::KeyframeEffect::setBlendingKeyframes): (WebCore::KeyframeEffect::checkForMatchingTransformFunctionLists): (WebCore::KeyframeEffect::checkForMatchingFilterFunctionLists const): (WebCore::KeyframeEffect::checkForMatchingFilterFunctionLists): (WebCore::KeyframeEffect::checkForMatchingBackdropFilterFunctionLists): (WebCore::KeyframeEffect::checkForMatchingColorFilterFunctionLists): (WebCore::KeyframeEffect::computeDeclarativeAnimationBlendingKeyframes): (WebCore::KeyframeEffect::computeCSSAnimationBlendingKeyframes): (WebCore::KeyframeEffect::computeCSSTransitionBlendingKeyframes): (WebCore::KeyframeEffect::computedNeedsForcedLayout): (WebCore::KeyframeEffect::computeStackingContextImpact): (WebCore::KeyframeEffect::setTarget): (WebCore::KeyframeEffect::apply): (WebCore::KeyframeEffect::invalidate): (WebCore::KeyframeEffect::computeShouldRunAccelerated): (WebCore::KeyframeEffect::getAnimatedStyle): (WebCore::KeyframeEffect::setAnimatedPropertiesInStyle): (WebCore::KeyframeEffect::timingFunctionForKeyframeAtIndex): (WebCore::KeyframeEffect::updateAcceleratedAnimationState): (WebCore::KeyframeEffect::addPendingAcceleratedAction): (WebCore::KeyframeEffect::animationDidSeek): (WebCore::KeyframeEffect::animationSuspensionStateDidChange): (WebCore::KeyframeEffect::applyPendingAcceleratedActions): (WebCore::KeyframeEffect::backingAnimationForCompositedRenderer const): (WebCore::KeyframeEffect::renderer const): (WebCore::KeyframeEffect::currentStyle const): (WebCore::KeyframeEffect::computeExtentOfTransformAnimation const): (WebCore::containsRotation): (WebCore::KeyframeEffect::computeTransformedExtentViaTransformList const): (WebCore::KeyframeEffect::computeTransformedExtentViaMatrix const): * animation/KeyframeEffect.h: (WebCore::KeyframeEffect::ParsedKeyframe::ParsedKeyframe): (WebCore::KeyframeEffect::target const): (WebCore::KeyframeEffect::iterationComposite const): (WebCore::KeyframeEffect::composite const): (WebCore::KeyframeEffect::isRunningAccelerated const): (WebCore::KeyframeEffect::hasPendingAcceleratedAction const): (WebCore::KeyframeEffect::hasBlendingKeyframes const): (WebCore::KeyframeEffect::animatedProperties const): * animation/KeyframeEffect.idl: * animation/KeyframeEffectOptions.h: * animation/KeyframeEffectOptions.idl: * animation/KeyframeEffectReadOnly.cpp: Removed. * animation/KeyframeEffectReadOnly.h: Removed. * animation/KeyframeEffectReadOnly.idl: Removed. * animation/WebAnimation.cpp: (WebCore::WebAnimation::create): (WebCore::WebAnimation::setEffect): (WebCore::WebAnimation::setEffectInternal): (WebCore::WebAnimation::setTimeline): (WebCore::WebAnimation::applyPendingAcceleratedActions): (WebCore::WebAnimation::computeRelevance): * animation/WebAnimation.h: (WebCore::WebAnimation::effect const): * animation/WebAnimation.idl: * bindings/js/JSAnimationEffectCustom.cpp: Renamed from Source/WebCore/bindings/js/JSAnimationEffectReadOnlyCustom.cpp. (WebCore::toJSNewlyCreated): (WebCore::toJS): * bindings/js/JSWebAnimationCustom.cpp: (WebCore::constructJSWebAnimation): * bindings/js/WebCoreBuiltinNames.h: * dom/Document.cpp: Canonical link: https://commits.webkit.org/206101@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237852 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-11-06 11:15:15 +00:00
JSGenerateToNativeObject,
] interface KeyframeEffect : AnimationEffect {
[WebIDL] Remove need for [MayThrowException] on constructors and legacy factory functions https://bugs.webkit.org/show_bug.cgi?id=216442 Reviewed by Darin Adler. Deduce implementation potentially throwing by using the existing overload of toJSNewlyCreated that conditionally checks for exceptions based on the return type. constexpr IsExceptionOr to maintain existing optimizations around conditional calls to RETURN_IF_EXCEPTION. * bindings/scripts/CodeGeneratorJS.pm: (GenerateConstructorDefinition): Update code generation to output code that can handle constructors that return either ExceptionOr or not. Maintain existing static assertion that the underlying return type is a Ref<> using std::conditional_t predicated on IsExceptionOr and maintain the existing optimization to not check for an exception after toJSNewlyCreated if one could not have been made by again utilizing IsExceptionOr. * bindings/scripts/IDLAttributes.json: Remove [LegacyFactoryFunctionMayThrowException] now that it is not needed. * Modules/applepay/ApplePaySession.idl: * Modules/encryptedmedia/legacy/WebKitMediaKeys.idl: * Modules/fetch/FetchHeaders.idl: * Modules/fetch/FetchRequest.idl: * Modules/fetch/FetchResponse.idl: * Modules/mediarecorder/MediaRecorder.idl: * Modules/mediastream/RTCIceCandidate.idl: * Modules/mediastream/RTCPeerConnection.idl: * Modules/paymentrequest/MerchantValidationEvent.idl: * Modules/paymentrequest/PaymentRequest.idl: * Modules/webaudio/AnalyserNode.idl: * Modules/webaudio/AudioBuffer.idl: * Modules/webaudio/AudioBufferSourceNode.idl: * Modules/webaudio/AudioContext.idl: * Modules/webaudio/BiquadFilterNode.idl: * Modules/webaudio/ChannelMergerNode.idl: * Modules/webaudio/ChannelSplitterNode.idl: * Modules/webaudio/ConstantSourceNode.idl: * Modules/webaudio/ConvolverNode.idl: * Modules/webaudio/DelayNode.idl: * Modules/webaudio/DynamicsCompressorNode.idl: * Modules/webaudio/GainNode.idl: * Modules/webaudio/IIRFilterNode.idl: * Modules/webaudio/MediaElementAudioSourceNode.idl: * Modules/webaudio/MediaStreamAudioDestinationNode.idl: * Modules/webaudio/MediaStreamAudioSourceNode.idl: * Modules/webaudio/OfflineAudioContext.idl: * Modules/webaudio/OscillatorNode.idl: * Modules/webaudio/PannerNode.idl: * Modules/webaudio/PeriodicWave.idl: * Modules/webaudio/StereoPannerNode.idl: * Modules/webaudio/WaveShaperNode.idl: * Modules/webaudio/WebKitAudioContext.idl: * Modules/webaudio/WebKitOfflineAudioContext.idl: * Modules/websockets/WebSocket.idl: * Modules/webxr/WebXRRigidTransform.idl: * Modules/webxr/WebXRWebGLLayer.idl: * animation/KeyframeEffect.idl: * css/DOMMatrix.idl: * css/DOMMatrixReadOnly.idl: * css/WebKitCSSMatrix.idl: * dom/StaticRange.idl: * dom/TextDecoder.idl: * dom/TextDecoderStreamDecoder.idl: * html/DOMURL.idl: * html/HTMLOptionElement.h: * html/HTMLOptionElement.idl: * html/ImageData.idl: * html/URLSearchParams.idl: * html/track/TextTrackCue.idl: * page/EventSource.idl: * page/IntersectionObserver.idl: * workers/Worker.idl: Remove all uses of [LegacyFactoryFunctionMayThrowException] and [MayThrowException] on constructors. * html/HTMLAudioElement.cpp: (WebCore::HTMLAudioElement::createForLegacyFactoryFunction): (WebCore::HTMLAudioElement::createForJSConstructor): Deleted. * html/HTMLAudioElement.h: * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::createForLegacyFactoryFunction): (WebCore::HTMLImageElement::createForJSConstructor): Deleted. * html/HTMLImageElement.h: * html/HTMLOptionElement.cpp: (WebCore::HTMLOptionElement::createForLegacyFactoryFunction): (WebCore::HTMLOptionElement::createForJSConstructor): Deleted. Renamed createForJSConstructor to createForLegacyFactoryFunction to better match current WebIDL terminology. * bindings/scripts/test/JS/JSExposedToWorkerAndWindow.cpp: (WebCore::JSExposedToWorkerAndWindowConstructor::construct): * bindings/scripts/test/JS/JSTestEventConstructor.cpp: (WebCore::JSTestEventConstructorConstructor::construct): * bindings/scripts/test/JS/JSTestInterface.cpp: (WebCore::JSTestInterfaceConstructor::construct): * bindings/scripts/test/JS/JSTestLegacyFactoryFunction.cpp: (WebCore::JSTestLegacyFactoryFunctionLegacyFactoryFunction::construct): * bindings/scripts/test/JS/JSTestNode.cpp: (WebCore::JSTestNodeConstructor::construct): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::JSTestObjConstructor::construct): * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: (WebCore::constructJSTestOverloadedConstructors1): (WebCore::constructJSTestOverloadedConstructors2): (WebCore::constructJSTestOverloadedConstructors3): (WebCore::constructJSTestOverloadedConstructors4): (WebCore::constructJSTestOverloadedConstructors5): * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp: (WebCore::constructJSTestOverloadedConstructorsWithSequence1): (WebCore::constructJSTestOverloadedConstructorsWithSequence2): * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp: (WebCore::JSTestPromiseRejectionEventConstructor::construct): * bindings/scripts/test/JS/JSTestTypedefs.cpp: (WebCore::JSTestTypedefsConstructor::construct): * bindings/scripts/test/TestLegacyFactoryFunction.idl: Update tests/expectations. Canonical link: https://commits.webkit.org/229297@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267007 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-14 00:00:42 +00:00
[CallWith=GlobalObject] constructor(Element? target, object? keyframes, optional (unrestricted double or KeyframeEffectOptions) options);
[CallWith=GlobalObject] constructor(KeyframeEffect source);
Use constructor operations in WebIDL https://bugs.webkit.org/show_bug.cgi?id=201397 Reviewed by Eric Carlson. Add support for constructor syntax in WebIDL (https://heycam.github.io/webidl/#idl-constructors) - [Constructor(...)] extended attributes become constructor(...) operations - [JSBuiltinConstructor] becomes [JSBuiltin] constructor(...) - [CustomConstructor] becomes [Custom] constructor(...) - [ConstructorMayThrowException] becomes [MayThrowException] constructor(...) and can now be unique per-overload - [ConstructorCallWith=Foo] becomes [CallWith=Foo] constructor(...) and can now also be unique per-overload This change leaves NamedConstructor as is, but a subsequent change will replace it with the specified LegacyFactoryFunction extended attribute. * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.idl: * Modules/applepay/ApplePayError.idl: * Modules/applepay/ApplePaySession.idl: * Modules/applepay/ApplePaySetup.idl: * Modules/async-clipboard/ClipboardItem.idl: * Modules/encryptedmedia/MediaKeyMessageEvent.idl: * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.idl: * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.idl: * Modules/encryptedmedia/legacy/WebKitMediaKeys.idl: * Modules/fetch/FetchHeaders.idl: * Modules/fetch/FetchRequest.idl: * Modules/fetch/FetchResponse.idl: * Modules/gamepad/GamepadEvent.idl: * Modules/highlight/HighlightMap.idl: * Modules/highlight/HighlightRangeGroup.idl: * Modules/indexeddb/IDBVersionChangeEvent.idl: * Modules/mediarecorder/BlobEvent.idl: * Modules/mediarecorder/MediaRecorder.idl: * Modules/mediarecorder/MediaRecorderErrorEvent.idl: * Modules/mediasession/MediaRemoteControls.idl: * Modules/mediasession/MediaSession.idl: * Modules/mediasource/MediaSource.idl: * Modules/mediastream/MediaStream.idl: * Modules/mediastream/MediaStreamTrackEvent.idl: * Modules/mediastream/OverconstrainedError.idl: * Modules/mediastream/OverconstrainedErrorEvent.idl: * Modules/mediastream/RTCDTMFToneChangeEvent.idl: * Modules/mediastream/RTCDataChannelEvent.idl: * Modules/mediastream/RTCIceCandidate.idl: * Modules/mediastream/RTCPeerConnection.idl: * Modules/mediastream/RTCPeerConnectionIceEvent.idl: * Modules/mediastream/RTCSessionDescription.idl: * Modules/mediastream/RTCTrackEvent.idl: * Modules/notifications/Notification.idl: * Modules/paymentrequest/MerchantValidationEvent.idl: * Modules/paymentrequest/PaymentMethodChangeEvent.idl: * Modules/paymentrequest/PaymentRequest.idl: * Modules/paymentrequest/PaymentRequestUpdateEvent.idl: * Modules/pictureinpicture/EnterPictureInPictureEvent.idl: * Modules/speech/SpeechSynthesisUtterance.idl: * Modules/streams/ByteLengthQueuingStrategy.idl: * Modules/streams/CountQueuingStrategy.idl: * Modules/streams/ReadableByteStreamController.idl: * Modules/streams/ReadableStream.idl: * Modules/streams/ReadableStreamBYOBReader.idl: * Modules/streams/ReadableStreamBYOBRequest.idl: * Modules/streams/ReadableStreamDefaultController.idl: * Modules/streams/ReadableStreamDefaultReader.idl: * Modules/streams/WritableStream.idl: * Modules/webaudio/AudioContext.idl: * Modules/webaudio/OfflineAudioContext.idl: * Modules/webgpu/GPUOutOfMemoryError.idl: * Modules/webgpu/GPUUncapturedErrorEvent.idl: * Modules/webgpu/GPUValidationError.idl: * Modules/websockets/CloseEvent.idl: * Modules/websockets/WebSocket.idl: * Modules/webxr/WebXRRigidTransform.idl: * Modules/webxr/WebXRWebGLLayer.idl: * Modules/webxr/XRInputSourceEvent.idl: * Modules/webxr/XRInputSourcesChangeEvent.idl: * Modules/webxr/XRReferenceSpaceEvent.idl: * Modules/webxr/XRSessionEvent.idl: * animation/AnimationPlaybackEvent.idl: * animation/DocumentTimeline.idl: * animation/KeyframeEffect.idl: * animation/WebAnimation.idl: * bindings/scripts/CodeGeneratorJS.pm: (ShouldGenerateToJSDeclaration): (GetFullyQualifiedImplementationCallName): (GenerateParametersCheck): (GetConstructorTemplateClassName): (GenerateConstructorDefinition): (GenerateConstructorHelperMethods): (HasCustomConstructor): (IsConstructable): (HasJSBuiltinConstructor): (AddJSBuiltinIncludesIfNeeded): (IsJSBuiltinConstructor): Deleted. * bindings/scripts/IDLAttributes.json: * bindings/scripts/IDLParser.pm: (assertExtendedAttributesValidForContext): (copyExtendedAttributes): (cloneOperation): (applyTypedefs): (parseInterfaceMember): (parseConstructor): (parseExtendedAttributeRest): (applyMemberList): (applyExtendedAttributeList): * bindings/scripts/test/JS/JSTestInterface.cpp: * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: (WebCore::JSTestNamedConstructorConstructor::initializeProperties): (WebCore::JSTestNamedConstructorNamedConstructor::construct): (WebCore::JSTestNamedConstructorNamedConstructor::initializeProperties): * bindings/scripts/test/TestClassWithJSBuiltinConstructor.idl: * bindings/scripts/test/TestEventConstructor.idl: * bindings/scripts/test/TestInterface.idl: * bindings/scripts/test/TestJSBuiltinConstructor.idl: * bindings/scripts/test/TestNamedConstructor.idl: * bindings/scripts/test/TestNode.idl: * bindings/scripts/test/TestObj.idl: * bindings/scripts/test/TestOverloadedConstructors.idl: * bindings/scripts/test/TestOverloadedConstructorsWithSequence.idl: * bindings/scripts/test/TestPromiseRejectionEvent.idl: * bindings/scripts/test/TestTypedefs.idl: * css/DOMMatrix.idl: * css/DOMMatrixReadOnly.idl: * css/FontFace.idl: * css/FontFaceSet.idl: * css/MediaQueryListEvent.idl: * css/WebKitCSSMatrix.idl: * css/typedom/TypedOMCSSUnitValue.idl: * css/typedom/TypedOMCSSUnparsedValue.idl: * dom/AbortController.idl: * dom/AnimationEvent.idl: * dom/BeforeLoadEvent.idl: * dom/ClipboardEvent.idl: * dom/Comment.idl: * dom/CompositionEvent.idl: * dom/CustomEvent.idl: * dom/DOMException.idl: * dom/DOMPoint.idl: * dom/DOMPointReadOnly.idl: * dom/DOMQuad.idl: * dom/DOMRect.idl: * dom/DOMRectReadOnly.idl: * dom/Document.idl: * dom/DocumentFragment.idl: * dom/DragEvent.idl: * dom/ErrorEvent.idl: * dom/Event.idl: * dom/EventTarget.idl: * dom/FocusEvent.idl: * dom/HashChangeEvent.idl: * dom/InputEvent.idl: * dom/KeyboardEvent.idl: * dom/MessageChannel.idl: * dom/MessageEvent.idl: * dom/MouseEvent.idl: * dom/MutationObserver.idl: * dom/OverflowEvent.idl: * dom/PageTransitionEvent.idl: * dom/PointerEvent.idl: * dom/PopStateEvent.idl: * dom/ProgressEvent.idl: * dom/PromiseRejectionEvent.idl: * dom/Range.idl: * dom/SecurityPolicyViolationEvent.idl: * dom/StaticRange.idl: * dom/Text.idl: * dom/TextDecoder.idl: * dom/TextEncoder.idl: * dom/TransitionEvent.idl: * dom/UIEvent.idl: * dom/WebKitAnimationEvent.idl: * dom/WebKitTransitionEvent.idl: * dom/WheelEvent.idl: * fileapi/Blob.idl: * fileapi/File.idl: * fileapi/FileReader.idl: * fileapi/FileReaderSync.idl: * html/DOMFormData.idl: * html/DOMURL.idl: * html/HTMLElement.idl: * html/HTMLOptionElement.idl: * html/ImageData.idl: * html/MediaController.idl: * html/MediaEncryptedEvent.idl: * html/OffscreenCanvas.idl: * html/URLSearchParams.idl: * html/canvas/Path2D.idl: * html/canvas/WebGLContextEvent.idl: * html/track/DataCue.idl: * html/track/TextTrackCue.idl: * html/track/TrackEvent.idl: * html/track/VTTCue.idl: * html/track/VTTRegion.idl: * page/EventSource.idl: * page/IntersectionObserver.idl: * page/IntersectionObserverEntry.idl: * page/PerformanceObserver.idl: * page/ResizeObserver.idl: * page/UndoItem.idl: * page/WebKitPoint.idl: * storage/StorageEvent.idl: * workers/Worker.idl: * workers/service/ExtendableEvent.idl: * workers/service/ExtendableMessageEvent.idl: * workers/service/FetchEvent.idl: * xml/DOMParser.idl: * xml/XMLHttpRequest.idl: * xml/XMLSerializer.idl: * xml/XPathEvaluator.idl: * xml/XSLTProcessor.idl: Canonical link: https://commits.webkit.org/226091@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@263160 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-06-17 16:56:19 +00:00
[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> Reviewed by Dean Jackson. The Web Animations API has been simplified by removing its various ReadOnly interfaces. In this patch, we make the following changes, not adding code but merely merging and renaming files: - AnimationEffectReadOnly and AnimationEffect are now a single AnimationEffect interface - KeyframeEffectReadOnly and KeyframeEffect are now a single KeyframeEffect interface - ComputedTimingProperties is now named ComputedEffectTiming - AnimationEffectTimingProperties is now named EffectTiming * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * animation/AnimationEffect.cpp: Renamed from Source/WebCore/animation/AnimationEffectReadOnly.cpp. (WebCore::AnimationEffect::~AnimationEffect): (WebCore::AnimationEffect::timingDidChange): (WebCore::AnimationEffect::localTime const): (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::directedProgress const): (WebCore::AnimationEffect::transformedProgress const): (WebCore::AnimationEffect::iterationProgress const): (WebCore::AnimationEffect::getComputedTiming): * animation/AnimationEffect.h: Renamed from Source/WebCore/animation/AnimationEffectReadOnly.h. (WebCore::AnimationEffect::isKeyframeEffect const): * animation/AnimationEffect.idl: Renamed from Source/WebCore/animation/AnimationEffectReadOnly.idl. * animation/AnimationEffectTimingReadOnly.cpp: * animation/AnimationEffectTimingReadOnly.h: (WebCore::AnimationEffectTimingReadOnly::setEffect): * animation/AnimationTimeline.cpp: (WebCore::AnimationTimeline::removeAnimation): (WebCore::AnimationTimeline::cssAnimationForElementAndProperty): * animation/CSSTransition.cpp: * animation/ComputedEffectTiming.h: Renamed from Source/WebCore/animation/ComputedTimingProperties.h. * animation/ComputedEffectTiming.idl: Renamed from Source/WebCore/animation/ComputedTimingProperties.idl. * animation/DeclarativeAnimation.cpp: (WebCore::DeclarativeAnimation::initialize): (WebCore::DeclarativeAnimation::flushPendingStyleChanges const): (WebCore::DeclarativeAnimation::phaseWithoutEffect const): (WebCore::DeclarativeAnimation::invalidateDOMEvents): * animation/DeclarativeAnimation.h: * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::getAnimations const): (WebCore::DocumentTimeline::transitionDidComplete): (WebCore::DocumentTimeline::computeExtentOfAnimation const): (WebCore::DocumentTimeline::isRunningAnimationOnRenderer const): (WebCore::DocumentTimeline::isRunningAcceleratedAnimationOnRenderer const): (WebCore::DocumentTimeline::animatedStyleForRenderer): (WebCore::DocumentTimeline::animationAcceleratedRunningStateDidChange): (WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement): (WebCore::DocumentTimeline::applyPendingAcceleratedAnimations): (WebCore::DocumentTimeline::resolveAnimationsForElement): * animation/EffectTiming.h: Renamed from Source/WebCore/animation/AnimationEffectTimingProperties.h. * animation/EffectTiming.idl: Renamed from Source/WebCore/animation/AnimationEffectTimingProperties.idl. * animation/KeyframeEffect.cpp: (WebCore::invalidateElement): (WebCore::CSSPropertyIDToIDLAttributeName): (WebCore::IDLAttributeNameToAnimationPropertyName): (WebCore::computeMissingKeyframeOffsets): (WebCore::processKeyframeLikeObject): (WebCore::processIterableKeyframes): (WebCore::processPropertyIndexedKeyframes): (WebCore::KeyframeEffect::create): (WebCore::KeyframeEffect::KeyframeEffect): (WebCore::KeyframeEffect::copyPropertiesFromSource): (WebCore::KeyframeEffect::getKeyframes): (WebCore::KeyframeEffect::processKeyframes): (WebCore::KeyframeEffect::updateBlendingKeyframes): (WebCore::KeyframeEffect::forceLayoutIfNeeded): (WebCore::KeyframeEffect::setBlendingKeyframes): (WebCore::KeyframeEffect::checkForMatchingTransformFunctionLists): (WebCore::KeyframeEffect::checkForMatchingFilterFunctionLists const): (WebCore::KeyframeEffect::checkForMatchingFilterFunctionLists): (WebCore::KeyframeEffect::checkForMatchingBackdropFilterFunctionLists): (WebCore::KeyframeEffect::checkForMatchingColorFilterFunctionLists): (WebCore::KeyframeEffect::computeDeclarativeAnimationBlendingKeyframes): (WebCore::KeyframeEffect::computeCSSAnimationBlendingKeyframes): (WebCore::KeyframeEffect::computeCSSTransitionBlendingKeyframes): (WebCore::KeyframeEffect::computedNeedsForcedLayout): (WebCore::KeyframeEffect::computeStackingContextImpact): (WebCore::KeyframeEffect::setTarget): (WebCore::KeyframeEffect::apply): (WebCore::KeyframeEffect::invalidate): (WebCore::KeyframeEffect::computeShouldRunAccelerated): (WebCore::KeyframeEffect::getAnimatedStyle): (WebCore::KeyframeEffect::setAnimatedPropertiesInStyle): (WebCore::KeyframeEffect::timingFunctionForKeyframeAtIndex): (WebCore::KeyframeEffect::updateAcceleratedAnimationState): (WebCore::KeyframeEffect::addPendingAcceleratedAction): (WebCore::KeyframeEffect::animationDidSeek): (WebCore::KeyframeEffect::animationSuspensionStateDidChange): (WebCore::KeyframeEffect::applyPendingAcceleratedActions): (WebCore::KeyframeEffect::backingAnimationForCompositedRenderer const): (WebCore::KeyframeEffect::renderer const): (WebCore::KeyframeEffect::currentStyle const): (WebCore::KeyframeEffect::computeExtentOfTransformAnimation const): (WebCore::containsRotation): (WebCore::KeyframeEffect::computeTransformedExtentViaTransformList const): (WebCore::KeyframeEffect::computeTransformedExtentViaMatrix const): * animation/KeyframeEffect.h: (WebCore::KeyframeEffect::ParsedKeyframe::ParsedKeyframe): (WebCore::KeyframeEffect::target const): (WebCore::KeyframeEffect::iterationComposite const): (WebCore::KeyframeEffect::composite const): (WebCore::KeyframeEffect::isRunningAccelerated const): (WebCore::KeyframeEffect::hasPendingAcceleratedAction const): (WebCore::KeyframeEffect::hasBlendingKeyframes const): (WebCore::KeyframeEffect::animatedProperties const): * animation/KeyframeEffect.idl: * animation/KeyframeEffectOptions.h: * animation/KeyframeEffectOptions.idl: * animation/KeyframeEffectReadOnly.cpp: Removed. * animation/KeyframeEffectReadOnly.h: Removed. * animation/KeyframeEffectReadOnly.idl: Removed. * animation/WebAnimation.cpp: (WebCore::WebAnimation::create): (WebCore::WebAnimation::setEffect): (WebCore::WebAnimation::setEffectInternal): (WebCore::WebAnimation::setTimeline): (WebCore::WebAnimation::applyPendingAcceleratedActions): (WebCore::WebAnimation::computeRelevance): * animation/WebAnimation.h: (WebCore::WebAnimation::effect const): * animation/WebAnimation.idl: * bindings/js/JSAnimationEffectCustom.cpp: Renamed from Source/WebCore/bindings/js/JSAnimationEffectReadOnlyCustom.cpp. (WebCore::toJSNewlyCreated): (WebCore::toJS): * bindings/js/JSWebAnimationCustom.cpp: (WebCore::constructJSWebAnimation): * bindings/js/WebCoreBuiltinNames.h: * dom/Document.cpp: Canonical link: https://commits.webkit.org/206101@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237852 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-11-06 11:15:15 +00:00
attribute Element? target;
[WebIDL] Remove the need to specify [MayThrowException] https://bugs.webkit.org/show_bug.cgi?id=180019 Reviewed by Darin Adler and Chris Dumez. Removes the need to specify [MayThrowException] by deducing it from the bound signature's return value. Any function returning an ExceptionOr is one that throws. In most cases, this was already handled by toJS<>(..., impl.func()), which had overloads for the case that the value was an ExceptionOr. The cases this didn't work for were funtions that returned void, as toJS<>(..., impl.func()) would not compile. To work around this, toJS<>() can now take a lambda as its value, and can determine via the lambda's return type if it needs to throw. For instance, an IDL operation like: [MayThrowException] undefined func(); used to generate a bindings body that looked like the following : auto& impl = castedThis->wrapped(); throwScope.release(); propagateException(*lexicalGlobalObject, throwScope, impl.func()); return JSValue::encode(jsUndefined()); will now generate a bindings body that looks like: auto& impl = castedThis->wrapped(); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLUndefined>(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.func(); }))); which closely mirrors a non-undefined return operation. This wrapped lambda form is only used for operations returning undefined or promises, as those are the only functions that can return void, but it would be correct to use them for all types, if not a bit more noisy and perhaps a tiny compile time cost. NOTE: The use of `-> decltype(auto)` explicit return type on the lambda is required to perfectly forward reference types, such as those used by owned promises. Otherwise, a copy constructor is invoked. In addition to supporting all operations, this also removes the requirement to annotate named and indexed getters/setters. This mostly just means always defining a throw scope, but for named getters it also meant adding a new helper, `visibleNamedPropertyItemAccessorFunctor` which constructors the item accessor functor for the `accessVisibleNamedProperty` algorithm rather than hard coding it in the generator. Due to increased use of toJS, the code generator is now checking more return types (via AddToImplIncludesForIDLType) so the code generator was able to find a few invalid return types (e.g. use of Promise<bool> rather than Promise<boolean>, etc.) and these have been fixed and will be an error going forward. Would be a nice improvement to the code generator to do type checking up front, rather than as a side effect of code generation, but we will leave that for another day. * bindings/js/JSDOMAbstractOperations.h: (WebCore::visibleNamedPropertyItemAccessorFunctor): Added. Moves the getterFunctor lambda creation from the GenerateNamedGetterLambda subroutine in CodeGeneratorJS.pm, but uses deduction and constexpr to determine if the getter throws. (WebCore::accessVisibleNamedProperty): Rename Functor to ItemAccessor to make it a bit more clear what the type does. * bindings/js/JSDOMConvertBase.h: (WebCore::toJS): (WebCore::toJSNewlyCreated): Replace SFINAE-based overloading of toJS/toJSNewlyCreated with constexpr based conditionals and add the ability to pass in a functor rather than value. If a functor is used, additional code paths for void and ExpectionOr<void> are added which explicitly return jsUndefined(). * bindings/js/JSDOMConvertDate.cpp: Remove incorrect comment about ExecStates that hasn't applied for a while. * bindings/js/JSDOMConvertSequences.h: Fix comment, replacing ExecState with JSGlobalObject. This has been wrong for a while, and this is just a drive by fix. * bindings/js/JSDOMExceptionHandling.h: (WebCore::invokeFunctorPropagatingExceptionIfNecessary): Use an explicit else as part of the constexpr expression to ensure the functor is not called, even in debug builds. * bindings/js/JSDOMPromiseDeferred.cpp: (WebCore::createDeferredPromise): Deleted. * bindings/js/JSDOMPromiseDeferred.h: Remove unused createDeferredPromise function. * bindings/scripts/CodeGeneratorJS.pm: (AddMapLikeAttributesAndOperationIfNeeded): (AddSetLikeAttributesAndOperationIfNeeded): Fix return type of mapped clear operation to be `any` rather than `undefined` to match the implementation, which returns a JSValue (e.g. `any`). This is now required as we actually look at the return type via deduction and need it to match. (GenerateNamedGetterLambda): Replace most of the implementation with a call to the new `visibleNamedPropertyItemAccessorFunctor` helper which returns a lambda with the correct behavior depending on the return type of the inner lambda passed. (GenerateGetOwnPropertySlot): (GenerateGetOwnPropertySlotByIndex): (GenerateAttributeGetterBodyDefinition): Match most other parts of the generator and always create a throw scope. (GenerateOperationDefinition): Remove explicit call to propagateException now that toJS() will handle that for us. (GenerateParametersCheck): Remove explicit call to propagateException now that toJS() will handle that for us. (GenerateImplementationFunctionCall): Simplify by using invokeFunctorPropagatingExceptionIfNecessary helper for the "returnArgumentName" case and relying on toJS handling the other cases. (NativeToJSValueMayThrow): Add operation to the list of things that might always throw. (NativeToJSValue): Use the lambda wrapped version of toJS for undefined and promise types, which might both return void and thus require it. To keep most code unchanged, and avoid unnecessary compiler work, we only use the wrapped version when it might be necessary. If it turns out to be cheep enough, it might make sense to always use this form for simplicity. (NeedsExplicitPropagateExceptionCall): Deleted. * bindings/scripts/IDLAttributes.json: Remove MayThrowException. * dom/Element.idl: * dom/Element.h: (WebCore::Element::removeAttributeForBindings): (WebCore::Element::removeAttributeNSForBindings): Add bindings specific versions of `removeAttribute` and `removeAttributeNS` which have a void return type (rather than the bool used by the main implementation) as it is now a requirement that that the bound functions signature match the IDL. * Modules/cache/DOMCache.idl: Use the correct interface name, `FetchRequest`, not `Request`. * Modules/cache/DOMCacheStorage.idl: Use the correct interface name, `DOMCache`, not `Cache`. * Modules/encryptedmedia/MediaKeySession.idl: * Modules/encryptedmedia/MediaKeys.idl: * dom/Document+StorageAccess.idl: * page/Navigator+IsLoggedIn.idl: Use the correct IDL type, `boolean`, not `bool`. * dom/AbortSignal.idl: Update whenSignalAborted to match the return type of implementation, which is `boolean`, not `undefined`. * testing/ServiceWorkerInternals.idl: Use the correct interface name, `FetchResponse`, not `Response`. * workers/service/ServiceWorkerClients.idl: Use the correct interface names, `ServiceWorkerClient`, not `Client`, and `ServiceWorkerWindowClient`, not `WindowClient`. * workers/service/ServiceWorkerWindowClient.idl: Use the correct interface names, `ServiceWorkerWindowClient`, not `WindowClient`. * Modules/applepay/ApplePaySession.idl: * Modules/beacon/Navigator+Beacon.idl: * Modules/cache/DOMWindow+Caches.idl: * Modules/encryptedmedia/legacy/WebKitMediaKeySession.idl: * Modules/encryptedmedia/legacy/WebKitMediaKeys.idl: * Modules/fetch/FetchHeaders.idl: * Modules/fetch/FetchRequest.idl: * Modules/fetch/FetchResponse.idl: * Modules/indexeddb/IDBCursor.idl: * Modules/indexeddb/IDBDatabase.idl: * Modules/indexeddb/IDBFactory.idl: * Modules/indexeddb/IDBIndex.idl: * Modules/indexeddb/IDBKeyRange.idl: * Modules/indexeddb/IDBObjectStore.idl: * Modules/indexeddb/IDBTransaction.idl: * Modules/mediarecorder/MediaRecorder.idl: * Modules/mediasession/MediaMetadata.idl: * Modules/mediasession/MediaSession.idl: * Modules/mediasource/MediaSource.idl: * Modules/mediasource/SourceBuffer.idl: * Modules/mediastream/RTCDTMFSender.idl: * Modules/mediastream/RTCDataChannel.idl: * Modules/mediastream/RTCPeerConnection.idl: * Modules/mediastream/RTCRtpReceiver+Transform.idl: * Modules/mediastream/RTCRtpSFrameTransform.idl: * Modules/mediastream/RTCRtpScriptTransformer.idl: * Modules/mediastream/RTCRtpSender+Transform.idl: * Modules/mediastream/RTCRtpSender.idl: * Modules/mediastream/RTCRtpTransceiver.idl: * Modules/paymentrequest/MerchantValidationEvent.idl: * Modules/paymentrequest/PaymentRequestUpdateEvent.idl: * Modules/speech/SpeechRecognition.idl: * Modules/webaudio/AudioBuffer.idl: * Modules/webaudio/AudioBufferSourceNode.idl: * Modules/webaudio/AudioContext.idl: * Modules/webaudio/AudioListener.idl: * Modules/webaudio/AudioNode.idl: * Modules/webaudio/AudioParam.idl: * Modules/webaudio/AudioScheduledSourceNode.idl: * Modules/webaudio/AudioWorkletGlobalScope.idl: * Modules/webaudio/AudioWorkletProcessor.idl: * Modules/webaudio/BaseAudioContext.idl: * Modules/webaudio/BiquadFilterNode.idl: * Modules/webaudio/IIRFilterNode.idl: * Modules/webaudio/PannerNode.idl: * Modules/webaudio/WebKitAudioBufferSourceNode.idl: * Modules/webaudio/WebKitAudioContext.idl: * Modules/webdatabase/SQLResultSetRowList.idl: * Modules/webdatabase/SQLTransaction.idl: * Modules/websockets/WebSocket.idl: * Modules/webxr/WebXRFrame.idl: * Modules/webxr/WebXRReferenceSpace.idl: * Modules/webxr/WebXRSession.idl: * Modules/webxr/WebXRWebGLLayer.idl: * animation/Animatable.idl: * animation/AnimationEffect.idl: * animation/KeyframeEffect.idl: * animation/WebAnimation.idl: * css/CSSGroupingRule.idl: * css/CSSStyleDeclaration.idl: * css/CSSStyleSheet.idl: * css/DOMCSSNamespace+CSSPropertiesandValues.idl: * css/DOMMatrix.idl: * css/DOMMatrixReadOnly.idl: * css/DeprecatedCSSOMPrimitiveValue.idl: * css/FontFaceSet.idl: * css/MediaList.idl: * dom/CharacterData.idl: * dom/ChildNode.idl: * dom/CustomElementRegistry.idl: * dom/DOMImplementation.idl: * dom/DOMPointReadOnly.idl: * dom/DataTransferItemList.idl: * dom/Document+HTML.idl: * dom/Document.idl: * dom/Element+DOMParsing.idl: * dom/Element+PointerEvents.idl: * dom/EventTarget.idl: * dom/MessagePort.idl: * dom/MutationObserver.idl: * dom/NamedNodeMap.idl: * dom/Node.idl: * dom/NodeIterator.idl: * dom/ParentNode.idl: * dom/Range+DOMParsing.idl: * dom/Range.idl: * dom/Text.idl: * dom/TextDecoder.idl: * dom/TextDecoderStreamDecoder.idl: * dom/TreeWalker.idl: * fileapi/Blob.idl: * fileapi/FileReader.idl: * fileapi/FileReaderSync.idl: * html/DOMTokenList.idl: * html/HTMLCanvasElement.idl: * html/HTMLDialogElement.idl: * html/HTMLEmbedElement.idl: * html/HTMLFrameElement.idl: * html/HTMLIFrameElement.idl: * html/HTMLInputElement.idl: * html/HTMLMediaElement.idl: * html/HTMLObjectElement.idl: * html/HTMLOptionsCollection.idl: * html/HTMLSelectElement.idl: * html/HTMLTableElement.idl: * html/HTMLTableRowElement.idl: * html/HTMLTableSectionElement.idl: * html/HTMLTextAreaElement.idl: * html/HTMLVideoElement.idl: * html/OffscreenCanvas.idl: * html/TimeRanges.idl: * html/canvas/CanvasDrawImage.idl: * html/canvas/CanvasFillStrokeStyles.idl: * html/canvas/CanvasGradient.idl: * html/canvas/CanvasImageData.idl: * html/canvas/CanvasPath.idl: * html/canvas/CanvasPattern.idl: * html/canvas/CanvasTransform.idl: * html/canvas/ImageBitmapRenderingContext.idl: * html/canvas/Path2D.idl: * html/canvas/WebGL2RenderingContext.idl: * html/canvas/WebGLRenderingContextBase.idl: * html/track/TextTrack.idl: * inspector/InspectorAuditAccessibilityObject.idl: * inspector/InspectorAuditDOMObject.idl: * inspector/InspectorAuditResourcesObject.idl: * loader/appcache/DOMApplicationCache.idl: * page/Crypto.idl: * page/DOMSelection.idl: * page/DOMWindow.idl: * page/History.idl: * page/Location.idl: * page/NavigatorServiceWorker.idl: * page/Performance+UserTiming.idl: * page/PerformanceObserver.idl: * page/UndoManager.idl: * page/UserMessageHandler.idl: * page/WindowOrWorkerGlobalScope.idl: * storage/Storage.idl: * svg/SVGAngle.idl: * svg/SVGGeometryElement.idl: * svg/SVGGraphicsElement.idl: * svg/SVGLength.idl: * svg/SVGLengthList.idl: * svg/SVGMatrix.idl: * svg/SVGNumberList.idl: * svg/SVGPathSegList.idl: * svg/SVGPointList.idl: * svg/SVGStringList.idl: * svg/SVGTextContentElement.idl: * svg/SVGTransform.idl: * svg/SVGTransformList.idl: * testing/InternalSettings.idl: * testing/Internals.idl: * workers/DedicatedWorkerGlobalScope.idl: * workers/Worker.idl: * workers/WorkerGlobalScope.idl: * workers/service/ExtendableEvent.idl: * workers/service/FetchEvent.idl: * workers/service/ServiceWorker.idl: * workers/service/ServiceWorkerClient.idl: * worklets/PaintWorkletGlobalScope.idl: * xml/DOMParser.idl: * xml/XMLHttpRequest.idl: * xml/XPathEvaluatorBase.idl: * xml/XPathExpression.idl: * xml/XPathResult.idl: Remove use of [MayThrowException]. * bindings/scripts/test/JS/*: Remove uses of [MayThrowException] in the tests and update all the test results. Canonical link: https://commits.webkit.org/235627@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274832 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-23 00:49:01 +00:00
attribute CSSOMString? pseudoElement;
[EnabledBySetting=WebAnimationsCompositeOperations] attribute IterationCompositeOperation iterationComposite;
[EnabledBySetting=WebAnimationsCompositeOperations] attribute CompositeOperation composite;
[Web Animations] Ensure calling Web Animations APIs override future CSS Animations style properties https://bugs.webkit.org/show_bug.cgi?id=210988 Reviewed by Dean Jackson. LayoutTests/imported/w3c: Mark all WPT tests related to Web Animations APIs overrides for CSS Animations as PASS, save for one failing assertion which is caused by AnimationTimeline::updateCSSAnimations() not updating the animation when the underlying @keyframes rule changed. This is due to Animation::animationsMatch() not checking on the actual keyframes, tracked by webkit.org/b/210989. * web-platform-tests/css/css-animations/AnimationEffect-updateTiming.tentative-expected.txt: * web-platform-tests/css/css-animations/CSSAnimation-effect.tentative-expected.txt: * web-platform-tests/css/css-animations/CSSAnimation-pausing.tentative-expected.txt: * web-platform-tests/css/css-animations/KeyframeEffect-setKeyframes.tentative-expected.txt: Source/WebCore: The CSS Animations Level 2 spec specifies how the Web Animations APIs and the CSS Animations style properties should interact in https://drafts.csswg.org/css-animations-2/#animations. This patch implements the specified behavior and this is reflected by progress on the relevant WPT tests. The gist of this change is that once a Web Animations API is called on an animation created using CSS Animations, any changes made to related CSS Animations style properties on the target element will be ignored so that the overrides applied via the Web Animations API remain in effect. For instance, calling pause() or play() in a way that changes the playback state of the CSS Animation will mean that future changes to the CSS animation-play-state property are ignored. To do this we make more IDL properties and methods use dedicated methods to distinguish between the bindings entry-point and internal usage of the same methods to integrate the behavior only when the API itself is being used. * animation/AnimationEffect.cpp: (WebCore::AnimationEffect::getBindingsTiming const): Ensure we flush styles when animation.effect.getTiming() is called. (WebCore::AnimationEffect::getBindingsComputedTiming const): Ensure we flush styles when animation.effect.getComputedTiming() is called. (WebCore::AnimationEffect::bindingsUpdateTiming): Notify the associated CSSAnimation object, if any, when animation.effect.updateTiming() is called such that the CSSAnimation may apply the relevant overrides. * animation/AnimationEffect.h: * animation/AnimationEffect.idl: * animation/CSSAnimation.cpp: (WebCore::CSSAnimation::syncPropertiesWithBackingAnimation): Only apply new values of CSS Animations style properties if there are no overrides for them resulting from calling related Web Animations APIs. (WebCore::CSSAnimation::bindingsPlay): Mark animation-play-state as overridden if play() is called. (WebCore::CSSAnimation::bindingsPause): Mark animation-play-state as overridden if pause() is called. (WebCore::CSSAnimation::setBindingsEffect): Mark all animation style properties, except for animation-name and animation-play-state as overridden if animation.effect is set. (WebCore::CSSAnimation::setBindingsStartTime): Mark animation-play-state as overridden if animation.startTime is set. (WebCore::CSSAnimation::bindingsReverse): Mark animation-play-state as overridden if reverse() is called. (WebCore::CSSAnimation::effectTimingWasUpdatedUsingBindings): Mark each CSS property associated with a key found on the timing object passed to animation.effect.updateTiming() as overridden. (WebCore::CSSAnimation::effectKeyframesWereSetUsingBindings): Mark animation-timing-function as overridden if animation.effect.setKeyframes() is called. * animation/CSSAnimation.h: * animation/DeclarativeAnimation.cpp: (WebCore::DeclarativeAnimation::bindingsStartTime const): (WebCore::DeclarativeAnimation::setBindingsStartTime): (WebCore::DeclarativeAnimation::startTime const): Deleted. (WebCore::DeclarativeAnimation::setStartTime): Deleted. * animation/DeclarativeAnimation.h: * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::getBindingsKeyframes): Ensure we flush styles when animation.effect.getKeyframes() is called. (WebCore::KeyframeEffect::getKeyframes): Only use the CSS-originated animation path if we don't have JS-originated keyframes. (WebCore::KeyframeEffect::setBindingsKeyframes): Notify the associated CSSAnimation object, if any, when animation.effect.setKeyframes() is called such that the CSSAnimation may apply the relevant overrides. (WebCore::KeyframeEffect::processKeyframes): Correctly return early if part of the processing yields an exception. * animation/KeyframeEffect.h: * animation/KeyframeEffect.idl: * animation/WebAnimation.cpp: (WebCore::WebAnimation::setBindingsEffect): (WebCore::WebAnimation::setBindingsStartTime): (WebCore::WebAnimation::bindingsReverse): * animation/WebAnimation.h: (WebCore::WebAnimation::bindingsEffect const): (WebCore::WebAnimation::bindingsStartTime const): * animation/WebAnimation.idl: Canonical link: https://commits.webkit.org/223879@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@260671 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-04-24 21:42:50 +00:00
[CallWith=GlobalObject, ImplementedAs=getBindingsKeyframes] sequence<object> getKeyframes();
[WebIDL] Remove the need to specify [MayThrowException] https://bugs.webkit.org/show_bug.cgi?id=180019 Reviewed by Darin Adler and Chris Dumez. Removes the need to specify [MayThrowException] by deducing it from the bound signature's return value. Any function returning an ExceptionOr is one that throws. In most cases, this was already handled by toJS<>(..., impl.func()), which had overloads for the case that the value was an ExceptionOr. The cases this didn't work for were funtions that returned void, as toJS<>(..., impl.func()) would not compile. To work around this, toJS<>() can now take a lambda as its value, and can determine via the lambda's return type if it needs to throw. For instance, an IDL operation like: [MayThrowException] undefined func(); used to generate a bindings body that looked like the following : auto& impl = castedThis->wrapped(); throwScope.release(); propagateException(*lexicalGlobalObject, throwScope, impl.func()); return JSValue::encode(jsUndefined()); will now generate a bindings body that looks like: auto& impl = castedThis->wrapped(); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLUndefined>(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.func(); }))); which closely mirrors a non-undefined return operation. This wrapped lambda form is only used for operations returning undefined or promises, as those are the only functions that can return void, but it would be correct to use them for all types, if not a bit more noisy and perhaps a tiny compile time cost. NOTE: The use of `-> decltype(auto)` explicit return type on the lambda is required to perfectly forward reference types, such as those used by owned promises. Otherwise, a copy constructor is invoked. In addition to supporting all operations, this also removes the requirement to annotate named and indexed getters/setters. This mostly just means always defining a throw scope, but for named getters it also meant adding a new helper, `visibleNamedPropertyItemAccessorFunctor` which constructors the item accessor functor for the `accessVisibleNamedProperty` algorithm rather than hard coding it in the generator. Due to increased use of toJS, the code generator is now checking more return types (via AddToImplIncludesForIDLType) so the code generator was able to find a few invalid return types (e.g. use of Promise<bool> rather than Promise<boolean>, etc.) and these have been fixed and will be an error going forward. Would be a nice improvement to the code generator to do type checking up front, rather than as a side effect of code generation, but we will leave that for another day. * bindings/js/JSDOMAbstractOperations.h: (WebCore::visibleNamedPropertyItemAccessorFunctor): Added. Moves the getterFunctor lambda creation from the GenerateNamedGetterLambda subroutine in CodeGeneratorJS.pm, but uses deduction and constexpr to determine if the getter throws. (WebCore::accessVisibleNamedProperty): Rename Functor to ItemAccessor to make it a bit more clear what the type does. * bindings/js/JSDOMConvertBase.h: (WebCore::toJS): (WebCore::toJSNewlyCreated): Replace SFINAE-based overloading of toJS/toJSNewlyCreated with constexpr based conditionals and add the ability to pass in a functor rather than value. If a functor is used, additional code paths for void and ExpectionOr<void> are added which explicitly return jsUndefined(). * bindings/js/JSDOMConvertDate.cpp: Remove incorrect comment about ExecStates that hasn't applied for a while. * bindings/js/JSDOMConvertSequences.h: Fix comment, replacing ExecState with JSGlobalObject. This has been wrong for a while, and this is just a drive by fix. * bindings/js/JSDOMExceptionHandling.h: (WebCore::invokeFunctorPropagatingExceptionIfNecessary): Use an explicit else as part of the constexpr expression to ensure the functor is not called, even in debug builds. * bindings/js/JSDOMPromiseDeferred.cpp: (WebCore::createDeferredPromise): Deleted. * bindings/js/JSDOMPromiseDeferred.h: Remove unused createDeferredPromise function. * bindings/scripts/CodeGeneratorJS.pm: (AddMapLikeAttributesAndOperationIfNeeded): (AddSetLikeAttributesAndOperationIfNeeded): Fix return type of mapped clear operation to be `any` rather than `undefined` to match the implementation, which returns a JSValue (e.g. `any`). This is now required as we actually look at the return type via deduction and need it to match. (GenerateNamedGetterLambda): Replace most of the implementation with a call to the new `visibleNamedPropertyItemAccessorFunctor` helper which returns a lambda with the correct behavior depending on the return type of the inner lambda passed. (GenerateGetOwnPropertySlot): (GenerateGetOwnPropertySlotByIndex): (GenerateAttributeGetterBodyDefinition): Match most other parts of the generator and always create a throw scope. (GenerateOperationDefinition): Remove explicit call to propagateException now that toJS() will handle that for us. (GenerateParametersCheck): Remove explicit call to propagateException now that toJS() will handle that for us. (GenerateImplementationFunctionCall): Simplify by using invokeFunctorPropagatingExceptionIfNecessary helper for the "returnArgumentName" case and relying on toJS handling the other cases. (NativeToJSValueMayThrow): Add operation to the list of things that might always throw. (NativeToJSValue): Use the lambda wrapped version of toJS for undefined and promise types, which might both return void and thus require it. To keep most code unchanged, and avoid unnecessary compiler work, we only use the wrapped version when it might be necessary. If it turns out to be cheep enough, it might make sense to always use this form for simplicity. (NeedsExplicitPropagateExceptionCall): Deleted. * bindings/scripts/IDLAttributes.json: Remove MayThrowException. * dom/Element.idl: * dom/Element.h: (WebCore::Element::removeAttributeForBindings): (WebCore::Element::removeAttributeNSForBindings): Add bindings specific versions of `removeAttribute` and `removeAttributeNS` which have a void return type (rather than the bool used by the main implementation) as it is now a requirement that that the bound functions signature match the IDL. * Modules/cache/DOMCache.idl: Use the correct interface name, `FetchRequest`, not `Request`. * Modules/cache/DOMCacheStorage.idl: Use the correct interface name, `DOMCache`, not `Cache`. * Modules/encryptedmedia/MediaKeySession.idl: * Modules/encryptedmedia/MediaKeys.idl: * dom/Document+StorageAccess.idl: * page/Navigator+IsLoggedIn.idl: Use the correct IDL type, `boolean`, not `bool`. * dom/AbortSignal.idl: Update whenSignalAborted to match the return type of implementation, which is `boolean`, not `undefined`. * testing/ServiceWorkerInternals.idl: Use the correct interface name, `FetchResponse`, not `Response`. * workers/service/ServiceWorkerClients.idl: Use the correct interface names, `ServiceWorkerClient`, not `Client`, and `ServiceWorkerWindowClient`, not `WindowClient`. * workers/service/ServiceWorkerWindowClient.idl: Use the correct interface names, `ServiceWorkerWindowClient`, not `WindowClient`. * Modules/applepay/ApplePaySession.idl: * Modules/beacon/Navigator+Beacon.idl: * Modules/cache/DOMWindow+Caches.idl: * Modules/encryptedmedia/legacy/WebKitMediaKeySession.idl: * Modules/encryptedmedia/legacy/WebKitMediaKeys.idl: * Modules/fetch/FetchHeaders.idl: * Modules/fetch/FetchRequest.idl: * Modules/fetch/FetchResponse.idl: * Modules/indexeddb/IDBCursor.idl: * Modules/indexeddb/IDBDatabase.idl: * Modules/indexeddb/IDBFactory.idl: * Modules/indexeddb/IDBIndex.idl: * Modules/indexeddb/IDBKeyRange.idl: * Modules/indexeddb/IDBObjectStore.idl: * Modules/indexeddb/IDBTransaction.idl: * Modules/mediarecorder/MediaRecorder.idl: * Modules/mediasession/MediaMetadata.idl: * Modules/mediasession/MediaSession.idl: * Modules/mediasource/MediaSource.idl: * Modules/mediasource/SourceBuffer.idl: * Modules/mediastream/RTCDTMFSender.idl: * Modules/mediastream/RTCDataChannel.idl: * Modules/mediastream/RTCPeerConnection.idl: * Modules/mediastream/RTCRtpReceiver+Transform.idl: * Modules/mediastream/RTCRtpSFrameTransform.idl: * Modules/mediastream/RTCRtpScriptTransformer.idl: * Modules/mediastream/RTCRtpSender+Transform.idl: * Modules/mediastream/RTCRtpSender.idl: * Modules/mediastream/RTCRtpTransceiver.idl: * Modules/paymentrequest/MerchantValidationEvent.idl: * Modules/paymentrequest/PaymentRequestUpdateEvent.idl: * Modules/speech/SpeechRecognition.idl: * Modules/webaudio/AudioBuffer.idl: * Modules/webaudio/AudioBufferSourceNode.idl: * Modules/webaudio/AudioContext.idl: * Modules/webaudio/AudioListener.idl: * Modules/webaudio/AudioNode.idl: * Modules/webaudio/AudioParam.idl: * Modules/webaudio/AudioScheduledSourceNode.idl: * Modules/webaudio/AudioWorkletGlobalScope.idl: * Modules/webaudio/AudioWorkletProcessor.idl: * Modules/webaudio/BaseAudioContext.idl: * Modules/webaudio/BiquadFilterNode.idl: * Modules/webaudio/IIRFilterNode.idl: * Modules/webaudio/PannerNode.idl: * Modules/webaudio/WebKitAudioBufferSourceNode.idl: * Modules/webaudio/WebKitAudioContext.idl: * Modules/webdatabase/SQLResultSetRowList.idl: * Modules/webdatabase/SQLTransaction.idl: * Modules/websockets/WebSocket.idl: * Modules/webxr/WebXRFrame.idl: * Modules/webxr/WebXRReferenceSpace.idl: * Modules/webxr/WebXRSession.idl: * Modules/webxr/WebXRWebGLLayer.idl: * animation/Animatable.idl: * animation/AnimationEffect.idl: * animation/KeyframeEffect.idl: * animation/WebAnimation.idl: * css/CSSGroupingRule.idl: * css/CSSStyleDeclaration.idl: * css/CSSStyleSheet.idl: * css/DOMCSSNamespace+CSSPropertiesandValues.idl: * css/DOMMatrix.idl: * css/DOMMatrixReadOnly.idl: * css/DeprecatedCSSOMPrimitiveValue.idl: * css/FontFaceSet.idl: * css/MediaList.idl: * dom/CharacterData.idl: * dom/ChildNode.idl: * dom/CustomElementRegistry.idl: * dom/DOMImplementation.idl: * dom/DOMPointReadOnly.idl: * dom/DataTransferItemList.idl: * dom/Document+HTML.idl: * dom/Document.idl: * dom/Element+DOMParsing.idl: * dom/Element+PointerEvents.idl: * dom/EventTarget.idl: * dom/MessagePort.idl: * dom/MutationObserver.idl: * dom/NamedNodeMap.idl: * dom/Node.idl: * dom/NodeIterator.idl: * dom/ParentNode.idl: * dom/Range+DOMParsing.idl: * dom/Range.idl: * dom/Text.idl: * dom/TextDecoder.idl: * dom/TextDecoderStreamDecoder.idl: * dom/TreeWalker.idl: * fileapi/Blob.idl: * fileapi/FileReader.idl: * fileapi/FileReaderSync.idl: * html/DOMTokenList.idl: * html/HTMLCanvasElement.idl: * html/HTMLDialogElement.idl: * html/HTMLEmbedElement.idl: * html/HTMLFrameElement.idl: * html/HTMLIFrameElement.idl: * html/HTMLInputElement.idl: * html/HTMLMediaElement.idl: * html/HTMLObjectElement.idl: * html/HTMLOptionsCollection.idl: * html/HTMLSelectElement.idl: * html/HTMLTableElement.idl: * html/HTMLTableRowElement.idl: * html/HTMLTableSectionElement.idl: * html/HTMLTextAreaElement.idl: * html/HTMLVideoElement.idl: * html/OffscreenCanvas.idl: * html/TimeRanges.idl: * html/canvas/CanvasDrawImage.idl: * html/canvas/CanvasFillStrokeStyles.idl: * html/canvas/CanvasGradient.idl: * html/canvas/CanvasImageData.idl: * html/canvas/CanvasPath.idl: * html/canvas/CanvasPattern.idl: * html/canvas/CanvasTransform.idl: * html/canvas/ImageBitmapRenderingContext.idl: * html/canvas/Path2D.idl: * html/canvas/WebGL2RenderingContext.idl: * html/canvas/WebGLRenderingContextBase.idl: * html/track/TextTrack.idl: * inspector/InspectorAuditAccessibilityObject.idl: * inspector/InspectorAuditDOMObject.idl: * inspector/InspectorAuditResourcesObject.idl: * loader/appcache/DOMApplicationCache.idl: * page/Crypto.idl: * page/DOMSelection.idl: * page/DOMWindow.idl: * page/History.idl: * page/Location.idl: * page/NavigatorServiceWorker.idl: * page/Performance+UserTiming.idl: * page/PerformanceObserver.idl: * page/UndoManager.idl: * page/UserMessageHandler.idl: * page/WindowOrWorkerGlobalScope.idl: * storage/Storage.idl: * svg/SVGAngle.idl: * svg/SVGGeometryElement.idl: * svg/SVGGraphicsElement.idl: * svg/SVGLength.idl: * svg/SVGLengthList.idl: * svg/SVGMatrix.idl: * svg/SVGNumberList.idl: * svg/SVGPathSegList.idl: * svg/SVGPointList.idl: * svg/SVGStringList.idl: * svg/SVGTextContentElement.idl: * svg/SVGTransform.idl: * svg/SVGTransformList.idl: * testing/InternalSettings.idl: * testing/Internals.idl: * workers/DedicatedWorkerGlobalScope.idl: * workers/Worker.idl: * workers/WorkerGlobalScope.idl: * workers/service/ExtendableEvent.idl: * workers/service/FetchEvent.idl: * workers/service/ServiceWorker.idl: * workers/service/ServiceWorkerClient.idl: * worklets/PaintWorkletGlobalScope.idl: * xml/DOMParser.idl: * xml/XMLHttpRequest.idl: * xml/XPathEvaluatorBase.idl: * xml/XPathExpression.idl: * xml/XPathResult.idl: Remove use of [MayThrowException]. * bindings/scripts/test/JS/*: Remove uses of [MayThrowException] in the tests and update all the test results. Canonical link: https://commits.webkit.org/235627@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274832 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-23 00:49:01 +00:00
[CallWith=GlobalObject, ImplementedAs=setBindingsKeyframes] undefined setKeyframes(object? keyframes);
[Web Animations] Add basic timing and target properties https://bugs.webkit.org/show_bug.cgi?id=178674 Patch by Antoine Quint <graouts@apple.com> on 2017-10-24 Reviewed by Dean Jackson. Source/WebCore: We add three new interfaces to expose enough properties to establish basic timing properties, a start time and duration, and the target of an animation. The startTime property is set on the Animation object, the target is set on the KeyframeEffect set as the effect property on the Animation object, and the duration is set on the AnimationEffectTiming set on the effect. Tests: webanimations/animation-effect-timing.html webanimations/animation-effect.html webanimations/animation-interface-effect-property.html webanimations/animation-interface-start-time-property.html webanimations/keyframe-effect-interface-timing-duration.html webanimations/keyframe-effect.html * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * animation/AnimationEffect.cpp: Copied from Source/WebCore/animation/WebAnimation.idl. (WebCore::AnimationEffect::AnimationEffect): (WebCore::AnimationEffect::~AnimationEffect): * animation/AnimationEffect.h: Copied from Source/WebCore/animation/WebAnimation.h. (WebCore::AnimationEffect::isKeyframeEffect const): (WebCore::AnimationEffect::timing const): (WebCore::AnimationEffect::classType const): * animation/AnimationEffect.idl: Copied from Source/WebCore/animation/WebAnimation.idl. * animation/AnimationEffectTiming.cpp: Copied from Source/WebCore/animation/WebAnimation.idl. (WebCore::AnimationEffectTiming::create): (WebCore::AnimationEffectTiming::AnimationEffectTiming): (WebCore::AnimationEffectTiming::~AnimationEffectTiming): * animation/AnimationEffectTiming.h: Copied from Source/WebCore/animation/WebAnimation.h. * animation/AnimationEffectTiming.idl: Copied from Source/WebCore/animation/WebAnimation.idl. * animation/KeyframeEffect.cpp: Copied from Source/WebCore/animation/WebAnimation.idl. (WebCore::KeyframeEffect::create): (WebCore::KeyframeEffect::KeyframeEffect): * animation/KeyframeEffect.h: Copied from Source/WebCore/animation/WebAnimation.h. * animation/KeyframeEffect.idl: Copied from Source/WebCore/animation/WebAnimation.idl. * animation/WebAnimation.cpp: (WebCore::WebAnimation::setEffect): * animation/WebAnimation.h: * animation/WebAnimation.idl: * bindings/js/JSAnimationEffectCustom.cpp: Copied from Source/WebCore/animation/WebAnimation.cpp. (WebCore::toJSNewlyCreated): (WebCore::toJS): * bindings/js/WebCoreBuiltinNames.h: LayoutTests: Add new tests to check the behavior of the newly exposed interfaces, constructors and properties. * webanimations/animation-effect-expected.txt: Added. * webanimations/animation-effect-timing-expected.txt: Added. * webanimations/animation-effect-timing.html: Added. * webanimations/animation-effect.html: Added. * webanimations/animation-interface-effect-property-expected.txt: Added. * webanimations/animation-interface-effect-property.html: Added. * webanimations/animation-interface-start-time-property-expected.txt: Added. * webanimations/animation-interface-start-time-property.html: Added. * webanimations/keyframe-effect-expected.txt: Added. * webanimations/keyframe-effect-interface-timing-duration-expected.txt: Added. * webanimations/keyframe-effect-interface-timing-duration.html: Added. * webanimations/keyframe-effect.html: Added. Canonical link: https://commits.webkit.org/194879@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223883 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-10-24 07:51:59 +00:00
};
[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> Reviewed by Dean Jackson. The Web Animations API has been simplified by removing its various ReadOnly interfaces. In this patch, we make the following changes, not adding code but merely merging and renaming files: - AnimationEffectReadOnly and AnimationEffect are now a single AnimationEffect interface - KeyframeEffectReadOnly and KeyframeEffect are now a single KeyframeEffect interface - ComputedTimingProperties is now named ComputedEffectTiming - AnimationEffectTimingProperties is now named EffectTiming * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * animation/AnimationEffect.cpp: Renamed from Source/WebCore/animation/AnimationEffectReadOnly.cpp. (WebCore::AnimationEffect::~AnimationEffect): (WebCore::AnimationEffect::timingDidChange): (WebCore::AnimationEffect::localTime const): (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::directedProgress const): (WebCore::AnimationEffect::transformedProgress const): (WebCore::AnimationEffect::iterationProgress const): (WebCore::AnimationEffect::getComputedTiming): * animation/AnimationEffect.h: Renamed from Source/WebCore/animation/AnimationEffectReadOnly.h. (WebCore::AnimationEffect::isKeyframeEffect const): * animation/AnimationEffect.idl: Renamed from Source/WebCore/animation/AnimationEffectReadOnly.idl. * animation/AnimationEffectTimingReadOnly.cpp: * animation/AnimationEffectTimingReadOnly.h: (WebCore::AnimationEffectTimingReadOnly::setEffect): * animation/AnimationTimeline.cpp: (WebCore::AnimationTimeline::removeAnimation): (WebCore::AnimationTimeline::cssAnimationForElementAndProperty): * animation/CSSTransition.cpp: * animation/ComputedEffectTiming.h: Renamed from Source/WebCore/animation/ComputedTimingProperties.h. * animation/ComputedEffectTiming.idl: Renamed from Source/WebCore/animation/ComputedTimingProperties.idl. * animation/DeclarativeAnimation.cpp: (WebCore::DeclarativeAnimation::initialize): (WebCore::DeclarativeAnimation::flushPendingStyleChanges const): (WebCore::DeclarativeAnimation::phaseWithoutEffect const): (WebCore::DeclarativeAnimation::invalidateDOMEvents): * animation/DeclarativeAnimation.h: * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::getAnimations const): (WebCore::DocumentTimeline::transitionDidComplete): (WebCore::DocumentTimeline::computeExtentOfAnimation const): (WebCore::DocumentTimeline::isRunningAnimationOnRenderer const): (WebCore::DocumentTimeline::isRunningAcceleratedAnimationOnRenderer const): (WebCore::DocumentTimeline::animatedStyleForRenderer): (WebCore::DocumentTimeline::animationAcceleratedRunningStateDidChange): (WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement): (WebCore::DocumentTimeline::applyPendingAcceleratedAnimations): (WebCore::DocumentTimeline::resolveAnimationsForElement): * animation/EffectTiming.h: Renamed from Source/WebCore/animation/AnimationEffectTimingProperties.h. * animation/EffectTiming.idl: Renamed from Source/WebCore/animation/AnimationEffectTimingProperties.idl. * animation/KeyframeEffect.cpp: (WebCore::invalidateElement): (WebCore::CSSPropertyIDToIDLAttributeName): (WebCore::IDLAttributeNameToAnimationPropertyName): (WebCore::computeMissingKeyframeOffsets): (WebCore::processKeyframeLikeObject): (WebCore::processIterableKeyframes): (WebCore::processPropertyIndexedKeyframes): (WebCore::KeyframeEffect::create): (WebCore::KeyframeEffect::KeyframeEffect): (WebCore::KeyframeEffect::copyPropertiesFromSource): (WebCore::KeyframeEffect::getKeyframes): (WebCore::KeyframeEffect::processKeyframes): (WebCore::KeyframeEffect::updateBlendingKeyframes): (WebCore::KeyframeEffect::forceLayoutIfNeeded): (WebCore::KeyframeEffect::setBlendingKeyframes): (WebCore::KeyframeEffect::checkForMatchingTransformFunctionLists): (WebCore::KeyframeEffect::checkForMatchingFilterFunctionLists const): (WebCore::KeyframeEffect::checkForMatchingFilterFunctionLists): (WebCore::KeyframeEffect::checkForMatchingBackdropFilterFunctionLists): (WebCore::KeyframeEffect::checkForMatchingColorFilterFunctionLists): (WebCore::KeyframeEffect::computeDeclarativeAnimationBlendingKeyframes): (WebCore::KeyframeEffect::computeCSSAnimationBlendingKeyframes): (WebCore::KeyframeEffect::computeCSSTransitionBlendingKeyframes): (WebCore::KeyframeEffect::computedNeedsForcedLayout): (WebCore::KeyframeEffect::computeStackingContextImpact): (WebCore::KeyframeEffect::setTarget): (WebCore::KeyframeEffect::apply): (WebCore::KeyframeEffect::invalidate): (WebCore::KeyframeEffect::computeShouldRunAccelerated): (WebCore::KeyframeEffect::getAnimatedStyle): (WebCore::KeyframeEffect::setAnimatedPropertiesInStyle): (WebCore::KeyframeEffect::timingFunctionForKeyframeAtIndex): (WebCore::KeyframeEffect::updateAcceleratedAnimationState): (WebCore::KeyframeEffect::addPendingAcceleratedAction): (WebCore::KeyframeEffect::animationDidSeek): (WebCore::KeyframeEffect::animationSuspensionStateDidChange): (WebCore::KeyframeEffect::applyPendingAcceleratedActions): (WebCore::KeyframeEffect::backingAnimationForCompositedRenderer const): (WebCore::KeyframeEffect::renderer const): (WebCore::KeyframeEffect::currentStyle const): (WebCore::KeyframeEffect::computeExtentOfTransformAnimation const): (WebCore::containsRotation): (WebCore::KeyframeEffect::computeTransformedExtentViaTransformList const): (WebCore::KeyframeEffect::computeTransformedExtentViaMatrix const): * animation/KeyframeEffect.h: (WebCore::KeyframeEffect::ParsedKeyframe::ParsedKeyframe): (WebCore::KeyframeEffect::target const): (WebCore::KeyframeEffect::iterationComposite const): (WebCore::KeyframeEffect::composite const): (WebCore::KeyframeEffect::isRunningAccelerated const): (WebCore::KeyframeEffect::hasPendingAcceleratedAction const): (WebCore::KeyframeEffect::hasBlendingKeyframes const): (WebCore::KeyframeEffect::animatedProperties const): * animation/KeyframeEffect.idl: * animation/KeyframeEffectOptions.h: * animation/KeyframeEffectOptions.idl: * animation/KeyframeEffectReadOnly.cpp: Removed. * animation/KeyframeEffectReadOnly.h: Removed. * animation/KeyframeEffectReadOnly.idl: Removed. * animation/WebAnimation.cpp: (WebCore::WebAnimation::create): (WebCore::WebAnimation::setEffect): (WebCore::WebAnimation::setEffectInternal): (WebCore::WebAnimation::setTimeline): (WebCore::WebAnimation::applyPendingAcceleratedActions): (WebCore::WebAnimation::computeRelevance): * animation/WebAnimation.h: (WebCore::WebAnimation::effect const): * animation/WebAnimation.idl: * bindings/js/JSAnimationEffectCustom.cpp: Renamed from Source/WebCore/bindings/js/JSAnimationEffectReadOnlyCustom.cpp. (WebCore::toJSNewlyCreated): (WebCore::toJS): * bindings/js/JSWebAnimationCustom.cpp: (WebCore::constructJSWebAnimation): * bindings/js/WebCoreBuiltinNames.h: * dom/Document.cpp: Canonical link: https://commits.webkit.org/206101@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237852 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-11-06 11:15:15 +00:00
dictionary BasePropertyIndexedKeyframe {
(sequence<double?> or double?) offset = [];
(sequence<DOMString> or DOMString) easing = [];
(sequence<CompositeOperationOrAuto> or CompositeOperationOrAuto) composite = [];
[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> Reviewed by Dean Jackson. The Web Animations API has been simplified by removing its various ReadOnly interfaces. In this patch, we make the following changes, not adding code but merely merging and renaming files: - AnimationEffectReadOnly and AnimationEffect are now a single AnimationEffect interface - KeyframeEffectReadOnly and KeyframeEffect are now a single KeyframeEffect interface - ComputedTimingProperties is now named ComputedEffectTiming - AnimationEffectTimingProperties is now named EffectTiming * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * animation/AnimationEffect.cpp: Renamed from Source/WebCore/animation/AnimationEffectReadOnly.cpp. (WebCore::AnimationEffect::~AnimationEffect): (WebCore::AnimationEffect::timingDidChange): (WebCore::AnimationEffect::localTime const): (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::directedProgress const): (WebCore::AnimationEffect::transformedProgress const): (WebCore::AnimationEffect::iterationProgress const): (WebCore::AnimationEffect::getComputedTiming): * animation/AnimationEffect.h: Renamed from Source/WebCore/animation/AnimationEffectReadOnly.h. (WebCore::AnimationEffect::isKeyframeEffect const): * animation/AnimationEffect.idl: Renamed from Source/WebCore/animation/AnimationEffectReadOnly.idl. * animation/AnimationEffectTimingReadOnly.cpp: * animation/AnimationEffectTimingReadOnly.h: (WebCore::AnimationEffectTimingReadOnly::setEffect): * animation/AnimationTimeline.cpp: (WebCore::AnimationTimeline::removeAnimation): (WebCore::AnimationTimeline::cssAnimationForElementAndProperty): * animation/CSSTransition.cpp: * animation/ComputedEffectTiming.h: Renamed from Source/WebCore/animation/ComputedTimingProperties.h. * animation/ComputedEffectTiming.idl: Renamed from Source/WebCore/animation/ComputedTimingProperties.idl. * animation/DeclarativeAnimation.cpp: (WebCore::DeclarativeAnimation::initialize): (WebCore::DeclarativeAnimation::flushPendingStyleChanges const): (WebCore::DeclarativeAnimation::phaseWithoutEffect const): (WebCore::DeclarativeAnimation::invalidateDOMEvents): * animation/DeclarativeAnimation.h: * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::getAnimations const): (WebCore::DocumentTimeline::transitionDidComplete): (WebCore::DocumentTimeline::computeExtentOfAnimation const): (WebCore::DocumentTimeline::isRunningAnimationOnRenderer const): (WebCore::DocumentTimeline::isRunningAcceleratedAnimationOnRenderer const): (WebCore::DocumentTimeline::animatedStyleForRenderer): (WebCore::DocumentTimeline::animationAcceleratedRunningStateDidChange): (WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement): (WebCore::DocumentTimeline::applyPendingAcceleratedAnimations): (WebCore::DocumentTimeline::resolveAnimationsForElement): * animation/EffectTiming.h: Renamed from Source/WebCore/animation/AnimationEffectTimingProperties.h. * animation/EffectTiming.idl: Renamed from Source/WebCore/animation/AnimationEffectTimingProperties.idl. * animation/KeyframeEffect.cpp: (WebCore::invalidateElement): (WebCore::CSSPropertyIDToIDLAttributeName): (WebCore::IDLAttributeNameToAnimationPropertyName): (WebCore::computeMissingKeyframeOffsets): (WebCore::processKeyframeLikeObject): (WebCore::processIterableKeyframes): (WebCore::processPropertyIndexedKeyframes): (WebCore::KeyframeEffect::create): (WebCore::KeyframeEffect::KeyframeEffect): (WebCore::KeyframeEffect::copyPropertiesFromSource): (WebCore::KeyframeEffect::getKeyframes): (WebCore::KeyframeEffect::processKeyframes): (WebCore::KeyframeEffect::updateBlendingKeyframes): (WebCore::KeyframeEffect::forceLayoutIfNeeded): (WebCore::KeyframeEffect::setBlendingKeyframes): (WebCore::KeyframeEffect::checkForMatchingTransformFunctionLists): (WebCore::KeyframeEffect::checkForMatchingFilterFunctionLists const): (WebCore::KeyframeEffect::checkForMatchingFilterFunctionLists): (WebCore::KeyframeEffect::checkForMatchingBackdropFilterFunctionLists): (WebCore::KeyframeEffect::checkForMatchingColorFilterFunctionLists): (WebCore::KeyframeEffect::computeDeclarativeAnimationBlendingKeyframes): (WebCore::KeyframeEffect::computeCSSAnimationBlendingKeyframes): (WebCore::KeyframeEffect::computeCSSTransitionBlendingKeyframes): (WebCore::KeyframeEffect::computedNeedsForcedLayout): (WebCore::KeyframeEffect::computeStackingContextImpact): (WebCore::KeyframeEffect::setTarget): (WebCore::KeyframeEffect::apply): (WebCore::KeyframeEffect::invalidate): (WebCore::KeyframeEffect::computeShouldRunAccelerated): (WebCore::KeyframeEffect::getAnimatedStyle): (WebCore::KeyframeEffect::setAnimatedPropertiesInStyle): (WebCore::KeyframeEffect::timingFunctionForKeyframeAtIndex): (WebCore::KeyframeEffect::updateAcceleratedAnimationState): (WebCore::KeyframeEffect::addPendingAcceleratedAction): (WebCore::KeyframeEffect::animationDidSeek): (WebCore::KeyframeEffect::animationSuspensionStateDidChange): (WebCore::KeyframeEffect::applyPendingAcceleratedActions): (WebCore::KeyframeEffect::backingAnimationForCompositedRenderer const): (WebCore::KeyframeEffect::renderer const): (WebCore::KeyframeEffect::currentStyle const): (WebCore::KeyframeEffect::computeExtentOfTransformAnimation const): (WebCore::containsRotation): (WebCore::KeyframeEffect::computeTransformedExtentViaTransformList const): (WebCore::KeyframeEffect::computeTransformedExtentViaMatrix const): * animation/KeyframeEffect.h: (WebCore::KeyframeEffect::ParsedKeyframe::ParsedKeyframe): (WebCore::KeyframeEffect::target const): (WebCore::KeyframeEffect::iterationComposite const): (WebCore::KeyframeEffect::composite const): (WebCore::KeyframeEffect::isRunningAccelerated const): (WebCore::KeyframeEffect::hasPendingAcceleratedAction const): (WebCore::KeyframeEffect::hasBlendingKeyframes const): (WebCore::KeyframeEffect::animatedProperties const): * animation/KeyframeEffect.idl: * animation/KeyframeEffectOptions.h: * animation/KeyframeEffectOptions.idl: * animation/KeyframeEffectReadOnly.cpp: Removed. * animation/KeyframeEffectReadOnly.h: Removed. * animation/KeyframeEffectReadOnly.idl: Removed. * animation/WebAnimation.cpp: (WebCore::WebAnimation::create): (WebCore::WebAnimation::setEffect): (WebCore::WebAnimation::setEffectInternal): (WebCore::WebAnimation::setTimeline): (WebCore::WebAnimation::applyPendingAcceleratedActions): (WebCore::WebAnimation::computeRelevance): * animation/WebAnimation.h: (WebCore::WebAnimation::effect const): * animation/WebAnimation.idl: * bindings/js/JSAnimationEffectCustom.cpp: Renamed from Source/WebCore/bindings/js/JSAnimationEffectReadOnlyCustom.cpp. (WebCore::toJSNewlyCreated): (WebCore::toJS): * bindings/js/JSWebAnimationCustom.cpp: (WebCore::constructJSWebAnimation): * bindings/js/WebCoreBuiltinNames.h: * dom/Document.cpp: Canonical link: https://commits.webkit.org/206101@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237852 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-11-06 11:15:15 +00:00
};
dictionary BaseKeyframe {
double? offset = null;
DOMString easing = "linear";
CompositeOperationOrAuto composite = "auto";
[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> Reviewed by Dean Jackson. The Web Animations API has been simplified by removing its various ReadOnly interfaces. In this patch, we make the following changes, not adding code but merely merging and renaming files: - AnimationEffectReadOnly and AnimationEffect are now a single AnimationEffect interface - KeyframeEffectReadOnly and KeyframeEffect are now a single KeyframeEffect interface - ComputedTimingProperties is now named ComputedEffectTiming - AnimationEffectTimingProperties is now named EffectTiming * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * animation/AnimationEffect.cpp: Renamed from Source/WebCore/animation/AnimationEffectReadOnly.cpp. (WebCore::AnimationEffect::~AnimationEffect): (WebCore::AnimationEffect::timingDidChange): (WebCore::AnimationEffect::localTime const): (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::directedProgress const): (WebCore::AnimationEffect::transformedProgress const): (WebCore::AnimationEffect::iterationProgress const): (WebCore::AnimationEffect::getComputedTiming): * animation/AnimationEffect.h: Renamed from Source/WebCore/animation/AnimationEffectReadOnly.h. (WebCore::AnimationEffect::isKeyframeEffect const): * animation/AnimationEffect.idl: Renamed from Source/WebCore/animation/AnimationEffectReadOnly.idl. * animation/AnimationEffectTimingReadOnly.cpp: * animation/AnimationEffectTimingReadOnly.h: (WebCore::AnimationEffectTimingReadOnly::setEffect): * animation/AnimationTimeline.cpp: (WebCore::AnimationTimeline::removeAnimation): (WebCore::AnimationTimeline::cssAnimationForElementAndProperty): * animation/CSSTransition.cpp: * animation/ComputedEffectTiming.h: Renamed from Source/WebCore/animation/ComputedTimingProperties.h. * animation/ComputedEffectTiming.idl: Renamed from Source/WebCore/animation/ComputedTimingProperties.idl. * animation/DeclarativeAnimation.cpp: (WebCore::DeclarativeAnimation::initialize): (WebCore::DeclarativeAnimation::flushPendingStyleChanges const): (WebCore::DeclarativeAnimation::phaseWithoutEffect const): (WebCore::DeclarativeAnimation::invalidateDOMEvents): * animation/DeclarativeAnimation.h: * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::getAnimations const): (WebCore::DocumentTimeline::transitionDidComplete): (WebCore::DocumentTimeline::computeExtentOfAnimation const): (WebCore::DocumentTimeline::isRunningAnimationOnRenderer const): (WebCore::DocumentTimeline::isRunningAcceleratedAnimationOnRenderer const): (WebCore::DocumentTimeline::animatedStyleForRenderer): (WebCore::DocumentTimeline::animationAcceleratedRunningStateDidChange): (WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement): (WebCore::DocumentTimeline::applyPendingAcceleratedAnimations): (WebCore::DocumentTimeline::resolveAnimationsForElement): * animation/EffectTiming.h: Renamed from Source/WebCore/animation/AnimationEffectTimingProperties.h. * animation/EffectTiming.idl: Renamed from Source/WebCore/animation/AnimationEffectTimingProperties.idl. * animation/KeyframeEffect.cpp: (WebCore::invalidateElement): (WebCore::CSSPropertyIDToIDLAttributeName): (WebCore::IDLAttributeNameToAnimationPropertyName): (WebCore::computeMissingKeyframeOffsets): (WebCore::processKeyframeLikeObject): (WebCore::processIterableKeyframes): (WebCore::processPropertyIndexedKeyframes): (WebCore::KeyframeEffect::create): (WebCore::KeyframeEffect::KeyframeEffect): (WebCore::KeyframeEffect::copyPropertiesFromSource): (WebCore::KeyframeEffect::getKeyframes): (WebCore::KeyframeEffect::processKeyframes): (WebCore::KeyframeEffect::updateBlendingKeyframes): (WebCore::KeyframeEffect::forceLayoutIfNeeded): (WebCore::KeyframeEffect::setBlendingKeyframes): (WebCore::KeyframeEffect::checkForMatchingTransformFunctionLists): (WebCore::KeyframeEffect::checkForMatchingFilterFunctionLists const): (WebCore::KeyframeEffect::checkForMatchingFilterFunctionLists): (WebCore::KeyframeEffect::checkForMatchingBackdropFilterFunctionLists): (WebCore::KeyframeEffect::checkForMatchingColorFilterFunctionLists): (WebCore::KeyframeEffect::computeDeclarativeAnimationBlendingKeyframes): (WebCore::KeyframeEffect::computeCSSAnimationBlendingKeyframes): (WebCore::KeyframeEffect::computeCSSTransitionBlendingKeyframes): (WebCore::KeyframeEffect::computedNeedsForcedLayout): (WebCore::KeyframeEffect::computeStackingContextImpact): (WebCore::KeyframeEffect::setTarget): (WebCore::KeyframeEffect::apply): (WebCore::KeyframeEffect::invalidate): (WebCore::KeyframeEffect::computeShouldRunAccelerated): (WebCore::KeyframeEffect::getAnimatedStyle): (WebCore::KeyframeEffect::setAnimatedPropertiesInStyle): (WebCore::KeyframeEffect::timingFunctionForKeyframeAtIndex): (WebCore::KeyframeEffect::updateAcceleratedAnimationState): (WebCore::KeyframeEffect::addPendingAcceleratedAction): (WebCore::KeyframeEffect::animationDidSeek): (WebCore::KeyframeEffect::animationSuspensionStateDidChange): (WebCore::KeyframeEffect::applyPendingAcceleratedActions): (WebCore::KeyframeEffect::backingAnimationForCompositedRenderer const): (WebCore::KeyframeEffect::renderer const): (WebCore::KeyframeEffect::currentStyle const): (WebCore::KeyframeEffect::computeExtentOfTransformAnimation const): (WebCore::containsRotation): (WebCore::KeyframeEffect::computeTransformedExtentViaTransformList const): (WebCore::KeyframeEffect::computeTransformedExtentViaMatrix const): * animation/KeyframeEffect.h: (WebCore::KeyframeEffect::ParsedKeyframe::ParsedKeyframe): (WebCore::KeyframeEffect::target const): (WebCore::KeyframeEffect::iterationComposite const): (WebCore::KeyframeEffect::composite const): (WebCore::KeyframeEffect::isRunningAccelerated const): (WebCore::KeyframeEffect::hasPendingAcceleratedAction const): (WebCore::KeyframeEffect::hasBlendingKeyframes const): (WebCore::KeyframeEffect::animatedProperties const): * animation/KeyframeEffect.idl: * animation/KeyframeEffectOptions.h: * animation/KeyframeEffectOptions.idl: * animation/KeyframeEffectReadOnly.cpp: Removed. * animation/KeyframeEffectReadOnly.h: Removed. * animation/KeyframeEffectReadOnly.idl: Removed. * animation/WebAnimation.cpp: (WebCore::WebAnimation::create): (WebCore::WebAnimation::setEffect): (WebCore::WebAnimation::setEffectInternal): (WebCore::WebAnimation::setTimeline): (WebCore::WebAnimation::applyPendingAcceleratedActions): (WebCore::WebAnimation::computeRelevance): * animation/WebAnimation.h: (WebCore::WebAnimation::effect const): * animation/WebAnimation.idl: * bindings/js/JSAnimationEffectCustom.cpp: Renamed from Source/WebCore/bindings/js/JSAnimationEffectReadOnlyCustom.cpp. (WebCore::toJSNewlyCreated): (WebCore::toJS): * bindings/js/JSWebAnimationCustom.cpp: (WebCore::constructJSWebAnimation): * bindings/js/WebCoreBuiltinNames.h: * dom/Document.cpp: Canonical link: https://commits.webkit.org/206101@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237852 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-11-06 11:15:15 +00:00
};
[
JSGenerateToJSObject
] dictionary BaseComputedKeyframe {
double? offset = null;
double computedOffset;
DOMString easing = "linear";
CompositeOperationOrAuto composite = "auto";
[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> Reviewed by Dean Jackson. The Web Animations API has been simplified by removing its various ReadOnly interfaces. In this patch, we make the following changes, not adding code but merely merging and renaming files: - AnimationEffectReadOnly and AnimationEffect are now a single AnimationEffect interface - KeyframeEffectReadOnly and KeyframeEffect are now a single KeyframeEffect interface - ComputedTimingProperties is now named ComputedEffectTiming - AnimationEffectTimingProperties is now named EffectTiming * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * animation/AnimationEffect.cpp: Renamed from Source/WebCore/animation/AnimationEffectReadOnly.cpp. (WebCore::AnimationEffect::~AnimationEffect): (WebCore::AnimationEffect::timingDidChange): (WebCore::AnimationEffect::localTime const): (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::directedProgress const): (WebCore::AnimationEffect::transformedProgress const): (WebCore::AnimationEffect::iterationProgress const): (WebCore::AnimationEffect::getComputedTiming): * animation/AnimationEffect.h: Renamed from Source/WebCore/animation/AnimationEffectReadOnly.h. (WebCore::AnimationEffect::isKeyframeEffect const): * animation/AnimationEffect.idl: Renamed from Source/WebCore/animation/AnimationEffectReadOnly.idl. * animation/AnimationEffectTimingReadOnly.cpp: * animation/AnimationEffectTimingReadOnly.h: (WebCore::AnimationEffectTimingReadOnly::setEffect): * animation/AnimationTimeline.cpp: (WebCore::AnimationTimeline::removeAnimation): (WebCore::AnimationTimeline::cssAnimationForElementAndProperty): * animation/CSSTransition.cpp: * animation/ComputedEffectTiming.h: Renamed from Source/WebCore/animation/ComputedTimingProperties.h. * animation/ComputedEffectTiming.idl: Renamed from Source/WebCore/animation/ComputedTimingProperties.idl. * animation/DeclarativeAnimation.cpp: (WebCore::DeclarativeAnimation::initialize): (WebCore::DeclarativeAnimation::flushPendingStyleChanges const): (WebCore::DeclarativeAnimation::phaseWithoutEffect const): (WebCore::DeclarativeAnimation::invalidateDOMEvents): * animation/DeclarativeAnimation.h: * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::getAnimations const): (WebCore::DocumentTimeline::transitionDidComplete): (WebCore::DocumentTimeline::computeExtentOfAnimation const): (WebCore::DocumentTimeline::isRunningAnimationOnRenderer const): (WebCore::DocumentTimeline::isRunningAcceleratedAnimationOnRenderer const): (WebCore::DocumentTimeline::animatedStyleForRenderer): (WebCore::DocumentTimeline::animationAcceleratedRunningStateDidChange): (WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement): (WebCore::DocumentTimeline::applyPendingAcceleratedAnimations): (WebCore::DocumentTimeline::resolveAnimationsForElement): * animation/EffectTiming.h: Renamed from Source/WebCore/animation/AnimationEffectTimingProperties.h. * animation/EffectTiming.idl: Renamed from Source/WebCore/animation/AnimationEffectTimingProperties.idl. * animation/KeyframeEffect.cpp: (WebCore::invalidateElement): (WebCore::CSSPropertyIDToIDLAttributeName): (WebCore::IDLAttributeNameToAnimationPropertyName): (WebCore::computeMissingKeyframeOffsets): (WebCore::processKeyframeLikeObject): (WebCore::processIterableKeyframes): (WebCore::processPropertyIndexedKeyframes): (WebCore::KeyframeEffect::create): (WebCore::KeyframeEffect::KeyframeEffect): (WebCore::KeyframeEffect::copyPropertiesFromSource): (WebCore::KeyframeEffect::getKeyframes): (WebCore::KeyframeEffect::processKeyframes): (WebCore::KeyframeEffect::updateBlendingKeyframes): (WebCore::KeyframeEffect::forceLayoutIfNeeded): (WebCore::KeyframeEffect::setBlendingKeyframes): (WebCore::KeyframeEffect::checkForMatchingTransformFunctionLists): (WebCore::KeyframeEffect::checkForMatchingFilterFunctionLists const): (WebCore::KeyframeEffect::checkForMatchingFilterFunctionLists): (WebCore::KeyframeEffect::checkForMatchingBackdropFilterFunctionLists): (WebCore::KeyframeEffect::checkForMatchingColorFilterFunctionLists): (WebCore::KeyframeEffect::computeDeclarativeAnimationBlendingKeyframes): (WebCore::KeyframeEffect::computeCSSAnimationBlendingKeyframes): (WebCore::KeyframeEffect::computeCSSTransitionBlendingKeyframes): (WebCore::KeyframeEffect::computedNeedsForcedLayout): (WebCore::KeyframeEffect::computeStackingContextImpact): (WebCore::KeyframeEffect::setTarget): (WebCore::KeyframeEffect::apply): (WebCore::KeyframeEffect::invalidate): (WebCore::KeyframeEffect::computeShouldRunAccelerated): (WebCore::KeyframeEffect::getAnimatedStyle): (WebCore::KeyframeEffect::setAnimatedPropertiesInStyle): (WebCore::KeyframeEffect::timingFunctionForKeyframeAtIndex): (WebCore::KeyframeEffect::updateAcceleratedAnimationState): (WebCore::KeyframeEffect::addPendingAcceleratedAction): (WebCore::KeyframeEffect::animationDidSeek): (WebCore::KeyframeEffect::animationSuspensionStateDidChange): (WebCore::KeyframeEffect::applyPendingAcceleratedActions): (WebCore::KeyframeEffect::backingAnimationForCompositedRenderer const): (WebCore::KeyframeEffect::renderer const): (WebCore::KeyframeEffect::currentStyle const): (WebCore::KeyframeEffect::computeExtentOfTransformAnimation const): (WebCore::containsRotation): (WebCore::KeyframeEffect::computeTransformedExtentViaTransformList const): (WebCore::KeyframeEffect::computeTransformedExtentViaMatrix const): * animation/KeyframeEffect.h: (WebCore::KeyframeEffect::ParsedKeyframe::ParsedKeyframe): (WebCore::KeyframeEffect::target const): (WebCore::KeyframeEffect::iterationComposite const): (WebCore::KeyframeEffect::composite const): (WebCore::KeyframeEffect::isRunningAccelerated const): (WebCore::KeyframeEffect::hasPendingAcceleratedAction const): (WebCore::KeyframeEffect::hasBlendingKeyframes const): (WebCore::KeyframeEffect::animatedProperties const): * animation/KeyframeEffect.idl: * animation/KeyframeEffectOptions.h: * animation/KeyframeEffectOptions.idl: * animation/KeyframeEffectReadOnly.cpp: Removed. * animation/KeyframeEffectReadOnly.h: Removed. * animation/KeyframeEffectReadOnly.idl: Removed. * animation/WebAnimation.cpp: (WebCore::WebAnimation::create): (WebCore::WebAnimation::setEffect): (WebCore::WebAnimation::setEffectInternal): (WebCore::WebAnimation::setTimeline): (WebCore::WebAnimation::applyPendingAcceleratedActions): (WebCore::WebAnimation::computeRelevance): * animation/WebAnimation.h: (WebCore::WebAnimation::effect const): * animation/WebAnimation.idl: * bindings/js/JSAnimationEffectCustom.cpp: Renamed from Source/WebCore/bindings/js/JSAnimationEffectReadOnlyCustom.cpp. (WebCore::toJSNewlyCreated): (WebCore::toJS): * bindings/js/JSWebAnimationCustom.cpp: (WebCore::constructJSWebAnimation): * bindings/js/WebCoreBuiltinNames.h: * dom/Document.cpp: Canonical link: https://commits.webkit.org/206101@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237852 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-11-06 11:15:15 +00:00
};