mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-22 17:24:48 -05:00
LibWeb/Animations: Don't try to associate animations to null timelines
The input to `set_timeline` is user controlled, it can be null.
This commit is contained in:
parent
55b4a983a7
commit
c2165fb6b8
Notes:
github-actions[bot]
2024-12-25 16:15:31 +00:00
Author: https://github.com/LucasChollet Commit: https://github.com/LadybirdBrowser/ladybird/commit/c2165fb6b87 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3024
1 changed files with 2 additions and 3 deletions
|
@ -99,8 +99,6 @@ void Animation::set_effect(GC::Ptr<AnimationEffect> new_effect)
|
|||
// https://www.w3.org/TR/web-animations-1/#animation-set-the-timeline-of-an-animation
|
||||
void Animation::set_timeline(GC::Ptr<AnimationTimeline> new_timeline)
|
||||
{
|
||||
// Setting this attribute updates the object’s timeline using the procedure to set the timeline of an animation.
|
||||
|
||||
// 1. Let old timeline be the current timeline of animation, if any.
|
||||
auto old_timeline = m_timeline;
|
||||
|
||||
|
@ -112,7 +110,8 @@ void Animation::set_timeline(GC::Ptr<AnimationTimeline> new_timeline)
|
|||
if (m_timeline)
|
||||
m_timeline->disassociate_with_animation(*this);
|
||||
m_timeline = new_timeline;
|
||||
m_timeline->associate_with_animation(*this);
|
||||
if (m_timeline)
|
||||
m_timeline->associate_with_animation(*this);
|
||||
|
||||
// 4. If the start time of animation is resolved, make animation’s hold time unresolved.
|
||||
if (m_start_time.has_value())
|
||||
|
|
Loading…
Reference in a new issue