Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4623d94c854c0884e3d10484b0bcf580e6d07096
      
https://github.com/WebKit/WebKit/commit/4623d94c854c0884e3d10484b0bcf580e6d07096
  Author: Antoine Quint <[email protected]>
  Date:   2022-11-16 (Wed, 16 Nov 2022)

  Changed paths:
    M 
LayoutTests/imported/w3c/web-platform-tests/web-animations/timing-model/timelines/update-and-send-events-expected.txt
    M Source/WebCore/animation/AnimationEventBase.cpp
    M Source/WebCore/animation/AnimationEventBase.h
    M Source/WebCore/animation/AnimationPlaybackEvent.cpp
    M Source/WebCore/animation/AnimationPlaybackEvent.h
    M Source/WebCore/animation/CSSAnimation.cpp
    M Source/WebCore/animation/CSSAnimation.h
    M Source/WebCore/animation/CSSTransition.cpp
    M Source/WebCore/animation/CSSTransition.h
    M Source/WebCore/animation/DeclarativeAnimation.cpp
    M Source/WebCore/animation/DeclarativeAnimation.h
    M Source/WebCore/animation/DocumentTimeline.cpp
    M Source/WebCore/animation/DocumentTimeline.h
    M Source/WebCore/animation/DocumentTimelinesController.cpp
    M Source/WebCore/animation/WebAnimation.cpp
    M Source/WebCore/animation/WebAnimation.h
    M Source/WebCore/animation/WebAnimationUtilities.cpp
    M Source/WebCore/animation/WebAnimationUtilities.h
    M Source/WebCore/dom/AnimationEvent.cpp
    M Source/WebCore/dom/AnimationEvent.h
    M Source/WebCore/dom/TransitionEvent.cpp
    M Source/WebCore/dom/TransitionEvent.h

  Log Message:
  -----------
  [web-animations] 
web-animations/timing-model/timelines/update-and-send-events.html is a unique 
failure
https://bugs.webkit.org/show_bug.cgi?id=191187

Reviewed by Dean Jackson.

We implement the animation sorting behavior specified by the Web Animations 
spec as part of
the "update animations and send events" procedure.

We used to sort events by the timeline time at the point when they were 
created, but the spec
says to sort them by their scheduled event time which is specific to each time 
of Web Animations
event (AnimationPlaybackEvent): "finish", "cancel" and "remove".

Since the "timeline time" is only relevant to AnimationPlaybackEvent, we move 
it from AnimationEventBase
to that interface, and add a new scheduledTime property as well.

Then, in updateAnimationsAndSendEvents(), we now use the 
compareAnimationEventsByCompositeOrder()
function to sort the events. First, we sort AnimationPlaybackEvent events among 
themselves by their
relative "scheduled event time" when they don't match, and when they do by the 
type of animation
related to the event (CSS Transitions, then CSS Animations and finally 
script-originated animations).
Second, we sort TransitionEvent events and third (and last), AnimationEvent 
events. Those events are
always sorted to retain the order in which they were enqueued.

Finally, we refactored TransitionEvent and AnimationEvent to no longer expect a 
timeline time and to
set the related WebAnimation object first to match the argument order of 
AnimationEventBase.

* 
LayoutTests/imported/w3c/web-platform-tests/web-animations/timing-model/timelines/update-and-send-events-expected.txt:
* Source/WebCore/animation/AnimationEventBase.cpp:
(WebCore::AnimationEventBase::AnimationEventBase):
* Source/WebCore/animation/AnimationEventBase.h:
(WebCore::AnimationEventBase::create):
(WebCore::AnimationEventBase::timelineTime const): Deleted.
* Source/WebCore/animation/AnimationPlaybackEvent.cpp:
(WebCore::AnimationPlaybackEvent::AnimationPlaybackEvent):
(WebCore::AnimationPlaybackEvent::bindingsTimelineTime const):
* Source/WebCore/animation/AnimationPlaybackEvent.h:
* Source/WebCore/animation/CSSAnimation.cpp:
(WebCore::CSSAnimation::createEvent):
* Source/WebCore/animation/CSSAnimation.h:
* Source/WebCore/animation/CSSTransition.cpp:
(WebCore::CSSTransition::createEvent):
* Source/WebCore/animation/CSSTransition.h:
* Source/WebCore/animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::enqueueDOMEvent):
* Source/WebCore/animation/DeclarativeAnimation.h:
* Source/WebCore/animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::removeReplacedAnimations):
(WebCore::DocumentTimeline::convertTimelineTimeToOriginRelativeTime const):
* Source/WebCore/animation/DocumentTimeline.h:
* Source/WebCore/animation/DocumentTimelinesController.cpp:
(WebCore::DocumentTimelinesController::updateAnimationsAndSendEvents):
* Source/WebCore/animation/WebAnimation.cpp:
(WebCore::WebAnimation::cancel):
(WebCore::WebAnimation::enqueueAnimationPlaybackEvent):
(WebCore::WebAnimation::finishNotificationSteps):
(WebCore::WebAnimation::convertAnimationTimeToTimelineTime const):
* Source/WebCore/animation/WebAnimation.h:
* Source/WebCore/animation/WebAnimationUtilities.cpp:
(WebCore::compareAnimationEventsByCompositeOrder):
* Source/WebCore/animation/WebAnimationUtilities.h:
* Source/WebCore/dom/AnimationEvent.cpp:
(WebCore::AnimationEvent::AnimationEvent):
* Source/WebCore/dom/AnimationEvent.h:
* Source/WebCore/dom/TransitionEvent.cpp:
(WebCore::TransitionEvent::TransitionEvent):
* Source/WebCore/dom/TransitionEvent.h:

Canonical link: https://commits.webkit.org/256771@main


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to