mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 20:59:16 +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:
parent
42a8effae5
commit
9585aeafda
Notes:
github-actions[bot]
2024-12-28 10:51:37 +00:00
Author: https://github.com/LucasChollet
Commit: 9585aeafda
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3071
4 changed files with 586 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue