[Web Animations] Make imported/mozilla/css-animations/test_event-dispatch.html pass...
authorgraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Mar 2018 21:33:53 +0000 (21:33 +0000)
committergraouts@webkit.org <graouts@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Mar 2018 21:33:53 +0000 (21:33 +0000)
commitf42875e10f112cf05ff03b61b212ef72fb88af53
treeb7cd588acf2925d9f93076c6772ac46869de114a
parent3fc5c75182056f29a0f9ffec88dd2dc1227652e6
[Web Animations] Make imported/mozilla/css-animations/test_event-dispatch.html pass reliably
https://bugs.webkit.org/show_bug.cgi?id=183845

Reviewed by Dean Jackson.

LayoutTests/imported/mozilla:

Add test expectations for previously crashing tests, update other expectations with progressions, including
the two event dispatch tests which now pass all assertions.

* css-animations/test_animation-finish-expected.txt:
* css-animations/test_animation-pausing-expected.txt:
* css-animations/test_animation-playstate-expected.txt:
* css-animations/test_animation-ready-expected.txt:
* css-animations/test_animation-starttime-expected.txt:
* css-animations/test_event-dispatch-expected.txt:
* css-animations/test_event-order-expected.txt:
* css-animations/test_setting-effect-expected.txt: Added.
* css-transitions/test_animation-cancel-expected.txt:
* css-transitions/test_animation-computed-timing-expected.txt:
* css-transitions/test_animation-currenttime-expected.txt:
* css-transitions/test_animation-pausing-expected.txt:
* css-transitions/test_animation-starttime-expected.txt:
* css-transitions/test_event-dispatch-expected.txt:
* css-transitions/test_setting-effect-expected.txt: Added.

Source/WebCore:

Finish the work to get DOM events for CSS Animations and CSS Transitions dispatching as specified.

* animation/AnimationEffectReadOnly.cpp: Move timeEpsilon to be shared as part of WebAnimationUtilities.h since we now need it in
WebAnimation::timeToNextRequiredTick().
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::updateCSSAnimationsForElement): We add a pre-emptive return clause when we know that the AnimationList
for previous and current styles are a match.
* animation/CSSTransition.cpp:
(WebCore::CSSTransition::matchesBackingAnimationAndStyles const): Ensure we have a valid effect before downcasting it.
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::initialize): We need to call pause() for declarative animations that aren't playing so that the animation's
playState is set correctly and the animation is not idle.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::updateAnimationSchedule): We no longer need to pass the current time to timeToNextRequiredTick() since the method has
been reworked to use the animation's current time, which is based on the timeline's current time.
(WebCore::DocumentTimeline::updateAnimations): Avoid creating a copy when iterating over pending hardware animations.
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::stylesWouldYieldNewCSSTransitionsBlendingKeyframes const): We should never generate new blending keyframes if the
old and new styles contain the same value, since there would be no transition between two equal values, and we should only look at whether the new
style value and the recorded target value differ to determine if new blending keyframes are necessary.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::timeToNextRequiredTick const): We correct our scheduling code which was shown to be broken in several of the newly-imported
Mozilla tests. Any running animation is now scheduled to invalidate again on the next tick, and we use timeEpsilon from WebAnimationUtilities.h to
correctly check if we're right at the active threshold, when we also invalidate on the next tick. If our current time is negative, in other words
when the animation has not yet started, we schedule this animation's next tick to be the negative of that value. In all other cases, no invalidation
needs to be scheduled.
* animation/WebAnimation.h: We move updateFinishedState() to private since this method is not actually used outside of WebAnimation.cpp.
* animation/WebAnimationUtilities.h: Move timeEpsilon to be shared as part of WebAnimationUtilities.h.

LayoutTests:

A couple of crashing tests no longer crash and a couple are now reliably passing.

* TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229864 268f45cc-cd09-0410-ab3c-d52691b4dbfc
28 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/imported/mozilla/ChangeLog
LayoutTests/imported/mozilla/css-animations/test_animation-finish-expected.txt
LayoutTests/imported/mozilla/css-animations/test_animation-pausing-expected.txt
LayoutTests/imported/mozilla/css-animations/test_animation-playstate-expected.txt
LayoutTests/imported/mozilla/css-animations/test_animation-ready-expected.txt
LayoutTests/imported/mozilla/css-animations/test_animation-starttime-expected.txt
LayoutTests/imported/mozilla/css-animations/test_event-dispatch-expected.txt
LayoutTests/imported/mozilla/css-animations/test_event-order-expected.txt
LayoutTests/imported/mozilla/css-animations/test_setting-effect-expected.txt [new file with mode: 0644]
LayoutTests/imported/mozilla/css-transitions/test_animation-cancel-expected.txt
LayoutTests/imported/mozilla/css-transitions/test_animation-computed-timing-expected.txt
LayoutTests/imported/mozilla/css-transitions/test_animation-currenttime-expected.txt
LayoutTests/imported/mozilla/css-transitions/test_animation-pausing-expected.txt
LayoutTests/imported/mozilla/css-transitions/test_animation-starttime-expected.txt
LayoutTests/imported/mozilla/css-transitions/test_event-dispatch-expected.txt
LayoutTests/imported/mozilla/css-transitions/test_setting-effect-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/animation/AnimationEffectReadOnly.cpp
Source/WebCore/animation/AnimationTimeline.cpp
Source/WebCore/animation/CSSTransition.cpp
Source/WebCore/animation/DeclarativeAnimation.cpp
Source/WebCore/animation/DocumentTimeline.cpp
Source/WebCore/animation/KeyframeEffectReadOnly.cpp
Source/WebCore/animation/WebAnimation.cpp
Source/WebCore/animation/WebAnimation.h
Source/WebCore/animation/WebAnimationUtilities.h