LibWeb: Use correct event type for cancelled CSS transition

Previously we incorrectly dispatched a "animationstart" event instead of
a "transitioncancel" one
This commit is contained in:
Callum Law 2026-05-04 23:00:03 +12:00 committed by Sam Atkins
parent b0a818a476
commit 4fd1635b17
2 changed files with 13 additions and 13 deletions

View file

@ -3647,7 +3647,7 @@ void Document::dispatch_events_for_transition(GC::Ref<CSS::CSSTransition> transi
if (transition_phase == Phase::Idle) {
if (previous_phase != Phase::Idle && previous_phase != Phase::After)
dispatch_event(HTML::EventNames::animationstart, Interval::ActiveTime);
dispatch_event(HTML::EventNames::transitioncancel, Interval::ActiveTime);
}
transition->set_previous_phase(transition_phase);

View file

@ -2,22 +2,22 @@ Harness status: OK
Found 30 tests
12 Pass
18 Fail
22 Pass
8 Fail
Pass Idle -> Pending or Before
Pass Idle -> Before
Pass Idle or Pending -> Active
Pass Idle or Pending -> After
Fail Before -> Idle (display: none)
Fail Before -> Idle (Animation.timeline = null)
Pass Before -> Idle (Animation.timeline = null)
Pass Before -> Active
Pass Before -> After
Fail Active -> Idle, no delay (display: none)
Fail Active -> Idle, no delay (Animation.timeline = null)
Pass Active -> Idle, no delay (Animation.timeline = null)
Fail Active -> Idle, with positive delay (display: none)
Fail Active -> Idle, with positive delay (Animation.timeline = null)
Pass Active -> Idle, with positive delay (Animation.timeline = null)
Fail Active -> Idle, with negative delay (display: none)
Fail Active -> Idle, with negative delay (Animation.timeline = null)
Pass Active -> Idle, with negative delay (Animation.timeline = null)
Pass Active -> Before
Pass Active -> After
Pass After -> Before
@ -26,11 +26,11 @@ Pass Calculating the interval start and end time with negative start delay.
Fail Calculating the interval start and end time with negative end delay.
Fail Call Animation.cancel after canceling transition.
Fail Restart transition after canceling transition immediately
Fail Call Animation.cancel after restarting transition immediately
Fail Set timeline and play transition after clear the timeline
Fail Set null target effect after canceling the transition
Pass Call Animation.cancel after restarting transition immediately
Pass Set timeline and play transition after clear the timeline
Pass Set null target effect after canceling the transition
Fail Cancel the transition after clearing the target effect
Pass Cancel the transition after it finishes
Fail Replacing a running transition should get transitioncancel earlier than transitionrun and transitionstart
Fail Replacing two running transitions on the same target should get two transitioncancel events earlier than two transitionrun events, per transition generation
Fail Replacing a running transition and forcing to flush the style together should get the correct event order
Pass Replacing a running transition should get transitioncancel earlier than transitionrun and transitionstart
Pass Replacing two running transitions on the same target should get two transitioncancel events earlier than two transitionrun events, per transition generation
Pass Replacing a running transition and forcing to flush the style together should get the correct event order