haikuwebkit/LayoutTests/webanimations/accelerated-transition-by-r...

1 line
112 B
HTML
Raw Permalink Normal View History

[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
<div style="position: absolute; top: 0; left: 1px; width: 798px; height: 100px; background-color: black;"></div>