mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 15:45:25 +00:00
LibWeb/DOM: Don't assume that Animations have an associated effect
Fixes a crash on: - css/css-transitions/CSSTransition-effect.tentative.html
This commit is contained in:
committed by
Andreas Kling
parent
42a8effae5
commit
9585aeafda
@@ -4741,6 +4741,10 @@ void Document::update_animations_and_send_events(Optional<double> const& timesta
|
||||
|
||||
// 6. Perform a stable sort of the animation events in events to dispatch as follows:
|
||||
auto sort_events_by_composite_order = [](auto const& a, auto const& b) {
|
||||
if (!a.animation->effect())
|
||||
return true;
|
||||
if (!b.animation->effect())
|
||||
return false;
|
||||
auto& a_effect = verify_cast<Animations::KeyframeEffect>(*a.animation->effect());
|
||||
auto& b_effect = verify_cast<Animations::KeyframeEffect>(*b.animation->effect());
|
||||
return Animations::KeyframeEffect::composite_order(a_effect, b_effect) < 0;
|
||||
|
||||
Reference in New Issue
Block a user