haikuwebkit/LayoutTests/webanimations/partly-accelerated-transiti...

30 lines
860 B
HTML
Raw Permalink Normal View History

Remove the legacy animation code https://bugs.webkit.org/show_bug.cgi?id=216608 Reviewed by Dean Jackson. Source/WebCore: We remove the legacy animation code found in Source/WebCore/page/animation/, save for CSSPropertyAnimation which is also used by the new Web Animations engine and now moved to Source/WebCore/animation/. Since we now have a single animation engine, the runtime flags to optionally enable the Web Animations engine are not needed anymore and removed as well. We also remove some testing utilities and some RenderLayerBacking methods specific to accelerated transitions which the new animation engine does not use. * CMakeLists.txt: * Headers.cmake: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * animation/Animatable.idl: * animation/AnimationEffect.idl: * animation/AnimationPlaybackEvent.idl: * animation/AnimationPlaybackEventInit.idl: * animation/AnimationTimeline.idl: * animation/CSSAnimation.idl: * animation/CSSPropertyAnimation.cpp: Renamed from Source/WebCore/page/animation/CSSPropertyAnimation.cpp. (WebCore::PropertyWrapperVisitedAffectedColor::PropertyWrapperVisitedAffectedColor): * animation/CSSPropertyAnimation.h: Renamed from Source/WebCore/page/animation/CSSPropertyAnimation.h. * animation/CSSTransition.idl: * animation/DocumentAnimations.idl: * animation/DocumentOrShadowRootAnimations.idl: * animation/DocumentTimeline.idl: * animation/KeyframeEffect.idl: * animation/WebAnimation.idl: * animation/WebAnimationTypes.h: * css/CSSComputedStyleDeclaration.cpp: (WebCore::computeRenderStyleForProperty): * dom/Document.cpp: (WebCore::Document::resolveStyle): (WebCore::Document::didBecomeCurrentDocumentInFrame): (WebCore::Document::willBeRemovedFromFrame): (WebCore::Document::implicitClose): (WebCore::Document::resume): * dom/Element.cpp: (WebCore::Element::removedFromAncestor): * dom/PseudoElement.cpp: (WebCore::PseudoElement::clearHostElement): * history/CachedFrame.cpp: (WebCore::CachedFrame::destroy): * page/Frame.cpp: (WebCore::Frame::Frame): (WebCore::Frame::clearTimers): (WebCore::Frame::resumeActiveDOMObjectsAndAnimations): * page/Frame.h: * page/FrameView.cpp: (WebCore::FrameView::didDestroyRenderTree): (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive): * page/FrameViewLayoutContext.cpp: (WebCore::FrameViewLayoutContext::layout): * page/Page.cpp: (WebCore::Page::handleLowModePowerChange): (WebCore::Page::setIsVisibleInternal): (WebCore::Page::hiddenPageCSSAnimationSuspensionStateChanged): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setWebAnimationsEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::webAnimationsEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setWebAnimationsCSSIntegrationEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::webAnimationsCSSIntegrationEnabled const): Deleted. * page/animation/AnimationBase.cpp: Removed. * page/animation/AnimationBase.h: Removed. * page/animation/CSSAnimationController.cpp: Removed. * page/animation/CSSAnimationController.h: Removed. * page/animation/CSSAnimationControllerPrivate.h: Removed. * page/animation/CompositeAnimation.cpp: Removed. * page/animation/CompositeAnimation.h: Removed. * page/animation/ImplicitAnimation.cpp: Removed. * page/animation/ImplicitAnimation.h: Removed. * page/animation/KeyframeAnimation.cpp: Removed. * page/animation/KeyframeAnimation.h: Removed. * platform/graphics/GraphicsLayer.h: * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::isKeyframe): (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): * rendering/RenderElement.cpp: (WebCore::RenderElement::animatedStyle): * rendering/RenderElement.h: (WebCore::RenderElement::startTransition): Deleted. (WebCore::RenderElement::transitionPaused): Deleted. (WebCore::RenderElement::transitionFinished): Deleted. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::currentTransform const): (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateGeometry): (WebCore::RenderLayerBacking::notifyAnimationStarted): (WebCore::RenderLayerBacking::startTransition): Deleted. (WebCore::RenderLayerBacking::transitionPaused): Deleted. (WebCore::RenderLayerBacking::transitionFinished): Deleted. * rendering/RenderLayerBacking.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::flushPendingLayerChanges): (WebCore::RenderLayerCompositor::updateCompositingLayers): (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const): (WebCore::RenderLayerCompositor::isRunningTransformAnimation const): * rendering/RenderLayerModelObject.cpp: (WebCore::RenderLayerModelObject::startTransition): Deleted. (WebCore::RenderLayerModelObject::transitionPaused): Deleted. (WebCore::RenderLayerModelObject::transitionFinished): Deleted. * rendering/RenderLayerModelObject.h: * rendering/RenderObject.h: (WebCore::RenderObject::legacyAnimation const): Deleted. * rendering/updating/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::tearDownRenderers): * style/StyleAdjuster.cpp: * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::createAnimatedElementUpdate): * testing/InternalSettings.cpp: (WebCore::InternalSettings::webAnimationsCSSIntegrationEnabled): Deleted. * testing/InternalSettings.h: * testing/InternalSettings.idl: * testing/Internals.cpp: (WebCore::Internals::numberOfActiveAnimations const): (WebCore::Internals::animationsAreSuspended const): (WebCore::Internals::animationsInterval const): (WebCore::Internals::suspendAnimations const): (WebCore::Internals::resumeAnimations const): (WebCore::Internals::acceleratedAnimationsForElement): (WebCore::Internals::numberOfAnimationTimelineInvalidations const): (WebCore::Internals::pauseAnimationAtTimeOnElement): Deleted. (WebCore::Internals::pauseAnimationAtTimeOnPseudoElement): Deleted. (WebCore::Internals::pauseTransitionAtTimeOnElement): Deleted. (WebCore::Internals::pauseTransitionAtTimeOnPseudoElement): Deleted. * testing/Internals.h: * testing/Internals.idl: Source/WebKit: Since we now have a single animation engine, the runtime flags to optionally enable the Web Animations engine are not needed anymore and are now removed. * Shared/WebPreferencesExperimental.yaml: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetWebAnimationsEnabled): Deleted. (WKPreferencesGetWebAnimationsEnabled): Deleted. (WKPreferencesSetWebAnimationsCSSIntegrationEnabled): Deleted. (WKPreferencesGetWebAnimationsCSSIntegrationEnabled): Deleted. * UIProcess/API/C/WKPreferencesRefPrivate.h: * UIProcess/API/Cocoa/WKPreferences.mm: (-[WKPreferences _setWebAnimationsCSSIntegrationEnabled:]): Deleted. (-[WKPreferences _webAnimationsCSSIntegrationEnabled]): Deleted. * UIProcess/API/Cocoa/WKPreferencesPrivate.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): (WebKit::InjectedBundle::setWebAnimationsEnabled): Deleted. (WebKit::InjectedBundle::setWebAnimationsCSSIntegrationEnabled): Deleted. * WebProcess/InjectedBundle/InjectedBundle.h: Source/WebKitLegacy/mac: Since we now have a single animation engine, the runtime flags to optionally enable the Web Animations engine are not needed anymore and are now removed. * WebView/WebPreferenceKeysPrivate.h: * WebView/WebPreferences.mm: (+[WebPreferences initialize]): (-[WebPreferences webAnimationsEnabled]): Deleted. (-[WebPreferences setWebAnimationsEnabled:]): Deleted. (-[WebPreferences webAnimationsCSSIntegrationEnabled]): Deleted. (-[WebPreferences setWebAnimationsCSSIntegrationEnabled:]): Deleted. * WebView/WebPreferencesPrivate.h: * WebView/WebView.mm: (-[WebView _preferencesChanged:]): Source/WebKitLegacy/win: Since we now have a single animation engine, the runtime flags to optionally enable the Web Animations engine are not needed anymore and are now removed. * Interfaces/IWebFramePrivate.idl: * Interfaces/IWebPreferencesPrivate.idl: * WebFrame.cpp: (WebFrame::resumeAnimations): Deleted. (WebFrame::suspendAnimations): Deleted. (WebFrame::pauseAnimation): Deleted. (WebFrame::pauseTransition): Deleted. (WebFrame::numberOfActiveAnimations): Deleted. * WebFrame.h: * WebPreferenceKeysPrivate.h: * WebPreferences.cpp: (WebPreferences::initializeDefaultSettings): (WebPreferences::webAnimationsCSSIntegrationEnabled): Deleted. (WebPreferences::setWebAnimationsCSSIntegrationEnabled): Deleted. (WebPreferences::setWebAnimationsEnabled): Deleted. (WebPreferences::webAnimationsEnabled): Deleted. * WebPreferences.h: * WebView.cpp: (WebView::notifyPreferencesChanged): Tools: Since we now have a single animation engine, the runtime flags to optionally enable the Web Animations engine are not needed anymore and are now removed. * DumpRenderTree/TestOptions.cpp: (TestOptions::TestOptions): (TestOptions::webViewIsCompatibleWithOptions const): * DumpRenderTree/TestOptions.h: * DumpRenderTree/mac/DumpRenderTree.mm: (enableExperimentalFeatures): (setWebPreferencesForTestOptions): * DumpRenderTree/win/DumpRenderTree.cpp: (enableExperimentalFeatures): (setWebPreferencesForTestOptions): LayoutTests: Remove any use of now-removed testing methods and some runtime flags from layout tests. * animations/legacy-encoding-timing-function.html: * animations/resources/animation-test-helpers.js: (pauseAnimationAtTimeOnElement): * http/tests/contentextensions/css-display-none-keyframe.html: * imported/blink/transitions/resources/opacity-transform-transitions-inside-iframe-inner.html: Removed. * transitions/background-position-transitions.html: * transitions/background-transitions.html: * transitions/blendmode-transitions.html: * transitions/border-radius-transition.html: * transitions/clip-path-path-transitions.html: * transitions/clip-path-transitions.html: * transitions/clip-transition.html: * transitions/color-transition-all.html: * transitions/color-transition-premultiplied.html: * transitions/color-transition-rounding.html: * transitions/cross-fade-background-image.html: * transitions/cross-fade-border-image.html: * transitions/cubic-bezier-overflow-color.html: * transitions/cubic-bezier-overflow-length.html: * transitions/cubic-bezier-overflow-shadow.html: * transitions/cubic-bezier-overflow-svg-length.html: * transitions/cubic-bezier-overflow-transform.html: * transitions/default-timing-function.html: * transitions/delay.html: * transitions/flex-transitions.html: * transitions/font-family-during-transition.html: * transitions/frames-timing-function.html: * transitions/interrupted-all-transition.html: * transitions/longhand-vs-shorthand-initial.html: * transitions/mask-transitions.html: * transitions/min-max-width-height-transitions.html: * transitions/mismatched-shadow-styles.html: * transitions/mismatched-shadow-transitions.html: * transitions/mixed-type.html: * transitions/move-after-transition.html: * transitions/multiple-background-size-transitions.html: * transitions/multiple-background-transitions.html: * transitions/multiple-mask-transitions.html: * transitions/multiple-shadow-transitions.html: * transitions/negative-delay.html: * transitions/opacity-transition-zindex.html: * transitions/resources/transition-test-helpers.js: * transitions/shape-outside-transitions.html: * transitions/shorthand-border-transitions.html: * transitions/shorthand-transitions.html: * transitions/steps-timing-function.html: * transitions/svg-layout-transition.html: * transitions/svg-text-shadow-transition.html: * transitions/svg-transitions.html: * transitions/text-indent-transition.html: * transitions/transform-op-list-match.html: * transitions/transform-op-list-no-match.html: * transitions/transition-end-event-rendering.html: * transitions/transition-hit-test-transform.html: * transitions/transition-hit-test.html: * transitions/transition-in-delay-phase.html: * transitions/transition-on-element-with-content.html: * transitions/transition-shorthand-delay.html: * transitions/transition-timing-function.html: * transitions/transition-to-from-auto.html: * transitions/transition-to-from-undefined.html: * transitions/visited-link-color.html: * transitions/zero-duration-in-list.html: * transitions/zero-duration-with-non-zero-delay-start.html: * webanimations/accelerated-animation-interruption-display-none.html: * webanimations/accelerated-animation-removal-upon-transition-completion.html: * webanimations/accelerated-animation-suspension.html: * webanimations/accelerated-transition-by-removing-property.html: * webanimations/accessing-current-time-after-clearing-css-animation-effect.html: * webanimations/accessing-current-time-after-finished-css-animation-target-removal.html: * webanimations/css-animation-effect-target-change-and-animation-removal-crash.html: * webanimations/css-animation-effect-target-change-and-get-keyframes-crash.html: * webanimations/css-animations.html: * webanimations/css-transition-in-flight-reversal-accelerated.html: * webanimations/empty-keyframes-crash.html: * webanimations/partly-accelerated-transition-by-removing-property.html: * webanimations/setting-css-animation-none-after-clearing-effect.html: * webanimations/setting-css-animation-timing-property-via-style-after-clearing-effect.html: Canonical link: https://commits.webkit.org/229462@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267188 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-17 12:39:28 +00:00
<!DOCTYPE html>
[Web Animations] REGRESSION: transition added immediately after element creation doesn't work https://bugs.webkit.org/show_bug.cgi?id=187942 Reviewed by Dean Jackson. Source/WebCore: Tests: webanimations/accelerated-transition-by-removing-property.html webanimations/partly-accelerated-transition-by-removing-property.html The Style::TreeResolver::createAnimatedElementUpdate() function expected a flag to be set that indicates that running animations on an element should yield a change in composited state for that element's layer. We did not have code accounting for this flag in the Web Animations engine. We now have a resolveAnimationsForElement() method on DocumentTimeline which looks at all animations resolved on the element and see if all of them are running accelerated and whether at least one of them is pending. In that case, we set the shouldRecompositeLayer flag in createAnimatedElementUpdate() to true which guarantees the element's layer will have a backing when we attempt to start the animation in KeyframeEffectReadOnly::applyPendingAcceleratedActions() where we would have previously failed to have layer-backed renderer to perform an accelerated animation on (under certain circumstances, see test). * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::resolveAnimationsForElement): * animation/DocumentTimeline.h: * animation/KeyframeEffectReadOnly.h: (WebCore::KeyframeEffectReadOnly::hasPendingAcceleratedAction const): * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::createAnimatedElementUpdate): LayoutTests: Creating a new test that runs a transition based on an explicit value being removed in favor of the implicit value of a property that can be accelerated. To check that we indeed run the animation, we have a cache that covers the entire range of interpolated values except for the start and end values and wait 100ms after creating the transition to end the test. Prior to this patch, the element would be at its start value and a 1px red line would show to the right of the cache. With this patch, the red line is hidden by the cache as it's animated. We also add a test that checks that we do not create a composited layer when several transitions, with only one being potentially accelerated, target the same element. * webanimations/accelerated-transition-by-removing-property-expected.html: Added. * webanimations/accelerated-transition-by-removing-property.html: Added. * webanimations/partly-accelerated-transition-by-removing-property-expected.txt: Added. * webanimations/partly-accelerated-transition-by-removing-property.html: Added. Canonical link: https://commits.webkit.org/203195@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234250 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-07-26 08:33:31 +00:00
<body>
<pre id="results"></pre>
[Web Animations] Animations should run accelerated even if other animations targeting the same element are not accelerated https://bugs.webkit.org/show_bug.cgi?id=206890 <rdar://problem/58961750> Reviewed by Simon Fraser. Source/WebCore: Test: webanimations/width-and-opacity-separate-animation-yields-compositing.html In the Web Animations implementation, when an element has some animated properties that can be accelerated and some that cannot be, we would never run accelerated animations at all. However, in the "legacy" animation engine, we would animate properties that can be acclerated if possible. We now attempt to run accelerated animations provided at least one animation is accelerated. To do that, we now keep track of whether none, some or all of the animated properties of a given KeyframeEffect are accelerated using the new m_acceleratedPropertiesState instance variable. We compute this property when creating the blending keyframes for the effect. Then, as time progresses and the effect is resolved, updateAcceleratedActions() is called and we simply use the effect's phase to determine whether we need to enqueue actions to start, pause, seek or end accelerated animations. This is an improvement over how this method used to work since we would run accelerated animations while in their delay phase, which did not match the "legacy" animation engine's behavior. We've also removed the single method that provided the accelerated characteristics of a KeyframeEffect, isAccelerated(), with a few more methods: - isRunningAccelerated(): the effect is currently running accelerated animations. - isAboutToRunAccelerated(): the effect has pending accelerated actions that should make it run accelerated animations when accelerated actions are updated next. - isCompletelyAccelerated(): the effect animates only accelerated properties. - isCurrentlyAffectingProperty(property, accelerated): the effect is currently animating the given property, with the option to specify whether that animation is accelerated. We use this information in a few new places. If an effect returns true for either isRunningAccelerated() or isAboutToRunAccelerated() when Element::applyKeyframeEffects() is called, we set the AnimationImpact::RequiresRecomposite flag. In RenderLayerCompositor::requiresCompositingForAnimation(), if an effect returns true for isCurrentlyAffectingProperty() with the accelerated flag set to true, the method returns true, matching the logic used by the "legacy" animation engine. All in all, this better aligns the behavior of the "legacy" and Web Animations engines to run accelerated animations in the same circumstances. * animation/AnimationTimeline.cpp: (WebCore::AnimationTimeline::updateCSSTransitionsForElementAndProperty): Use KeyframeEfffect::isRunningAccelerated() instead of KeyframeEffect::isAccelerated(). * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::isRunningAcceleratedAnimationOnRenderer const): Use KeyframeEffect::isCurrentlyAffectingProperty() instead of checking both isRunningAccelerated() and manually looking at the effect's animated properties. * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::setBlendingKeyframes): Call computeAcceleratedPropertiesState() instead of the now-defunct computeShouldRunAccelerated(). (WebCore::KeyframeEffect::apply): Keep track of the newly computed phase so that we may use it in the new isCurrentlyAffectingProperty() without having to recompute it on each call. (WebCore::KeyframeEffect::isCurrentlyAffectingProperty const): Indicates whether a given property is currently animated (active phase) with the option to specify whether that animation is accelerated. (WebCore::KeyframeEffect::computeAcceleratedPropertiesState): Compute whether none, some or all of the animated properties of the given effect can be accelerated. (WebCore::KeyframeEffect::updateAcceleratedActions): Use the phase to determine which accelerated actions to enqueue. (WebCore::KeyframeEffect::animationDidSeek): Use the new m_isRunningAccelerated state to determine whether the animation is presently running accelerated. (WebCore::KeyframeEffect::animationWasCanceled): Use the new m_isRunningAccelerated state to determine whether the animation is presently running accelerated. (WebCore::KeyframeEffect::animationSuspensionStateDidChange): Use the new m_isRunningAccelerated state to determine whether the animation is presently running accelerated. (WebCore::KeyframeEffect::applyPendingAcceleratedActions): * animation/KeyframeEffect.h: (WebCore::KeyframeEffect::isRunningAccelerated const): (WebCore::KeyframeEffect::isAboutToRunAccelerated const): (WebCore::KeyframeEffect::isCompletelyAccelerated const): * animation/KeyframeEffectStack.cpp: (WebCore::KeyframeEffectStack::isCurrentlyAffectingProperty const): Indicates whether any of the effects in the stack animates a given property, with the option to specify whether the animation should be accelerated. * animation/KeyframeEffectStack.h: * animation/WebAnimation.cpp: (WebCore::WebAnimation::effectTargetDidChange): Ensure we schedule an animation update if an effect is no longer animating a given element or newly animating an element, to ensure that replaced animations may be removed. (WebCore::WebAnimation::isCompletelyAccelerated const): Convenience function to call isCompletelyAccelerated() on the animation's effect. (WebCore::WebAnimation::computeRelevance): Check the replaced state when computing relevance. (WebCore::WebAnimation::timeToNextTick const): Schedule an immediate update if a given animation is not _completely_ accelerated. * animation/WebAnimation.h: * dom/Element.cpp: (WebCore::Element::keyframeEffectStack const): (WebCore::Element::applyKeyframeEffects): Set the AnimationImpact::RequiresRecomposite flag when the animation is either currently running accelerated or expected to be in the next accelerated animation update. * dom/Element.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const): Use the same logic as for the "legacy" animation engine to determine whether an animation requires compositing using the new KeyframeEffect::isCurrentlyAffectingProperty() method. (WebCore::RenderLayerCompositor::isRunningTransformAnimation const): Refactor some code to use the new KeyframeEffect::isCurrentlyAffectingProperty() method. LayoutTests: Update some tests that assumed a mix of accelerated and non-accelerated properties would not yield accelerated animations. We also make some WK1-specific expectation due to compositing being disabled when opacity is the only potentially-accelerated property to be animated. * platform/mac-wk1/imported/w3c/web-platform-tests/css/css-color/animation/opacity-interpolation-expected.txt: Added. * platform/mac-wk1/webanimations/opacity-animation-yields-compositing-expected.txt: Added. * platform/mac-wk1/webanimations/opacity-animation-yields-compositing-span-expected.txt: Added. * platform/mac-wk1/webanimations/partly-accelerated-transition-by-removing-property-expected.txt: Added. * platform/mac-wk1/webanimations/width-and-opacity-separate-animation-yields-compositing-expected.txt: Added. * webanimations/left-and-opacity-animation-yields-no-compositing-expected.txt: Removed. * webanimations/partly-accelerated-transition-by-removing-property-expected.txt: * webanimations/width-and-opacity-separate-animation-yields-compositing-expected.txt: Added. * webanimations/width-and-opacity-separate-animation-yields-compositing.html: Renamed from LayoutTests/webanimations/left-and-opacity-animation-yields-no-compositing.html. * webanimations/width-and-opacity-separate-animation-yields-no-compositing-expected.txt: Removed. * webanimations/width-and-opacity-separate-animation-yields-no-compositing.html: Removed. Canonical link: https://commits.webkit.org/219975@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255383 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-29 22:11:51 +00:00
<div id="target" style="position: absolute; top: 0; left: 0; width: 100px; height: 100px; background-color: black;"></div>
[Web Animations] REGRESSION: transition added immediately after element creation doesn't work https://bugs.webkit.org/show_bug.cgi?id=187942 Reviewed by Dean Jackson. Source/WebCore: Tests: webanimations/accelerated-transition-by-removing-property.html webanimations/partly-accelerated-transition-by-removing-property.html The Style::TreeResolver::createAnimatedElementUpdate() function expected a flag to be set that indicates that running animations on an element should yield a change in composited state for that element's layer. We did not have code accounting for this flag in the Web Animations engine. We now have a resolveAnimationsForElement() method on DocumentTimeline which looks at all animations resolved on the element and see if all of them are running accelerated and whether at least one of them is pending. In that case, we set the shouldRecompositeLayer flag in createAnimatedElementUpdate() to true which guarantees the element's layer will have a backing when we attempt to start the animation in KeyframeEffectReadOnly::applyPendingAcceleratedActions() where we would have previously failed to have layer-backed renderer to perform an accelerated animation on (under certain circumstances, see test). * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::resolveAnimationsForElement): * animation/DocumentTimeline.h: * animation/KeyframeEffectReadOnly.h: (WebCore::KeyframeEffectReadOnly::hasPendingAcceleratedAction const): * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::createAnimatedElementUpdate): LayoutTests: Creating a new test that runs a transition based on an explicit value being removed in favor of the implicit value of a property that can be accelerated. To check that we indeed run the animation, we have a cache that covers the entire range of interpolated values except for the start and end values and wait 100ms after creating the transition to end the test. Prior to this patch, the element would be at its start value and a 1px red line would show to the right of the cache. With this patch, the red line is hidden by the cache as it's animated. We also add a test that checks that we do not create a composited layer when several transitions, with only one being potentially accelerated, target the same element. * webanimations/accelerated-transition-by-removing-property-expected.html: Added. * webanimations/accelerated-transition-by-removing-property.html: Added. * webanimations/partly-accelerated-transition-by-removing-property-expected.txt: Added. * webanimations/partly-accelerated-transition-by-removing-property.html: Added. Canonical link: https://commits.webkit.org/203195@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234250 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-07-26 08:33:31 +00:00
<script>
if (window.testRunner) {
testRunner.waitUntilDone();
testRunner.dumpAsText();
}
const target = document.getElementById("target");
target.style.opacity = "0.5";
target.style.marginLeft = "100px";
setTimeout(() => {
target.style.removeProperty("opacity");
target.style.removeProperty("margin-left");
target.style.transitionProperty = "margin-left opacity";
target.style.transitionDuration = "1s";
requestAnimationFrame(() => {
if (window.internals)
document.getElementById("results").innerText = internals.layerTreeAsText(document);
if (window.testRunner)
testRunner.notifyDone();
});
});
</script>
</body>