mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01: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
|
|
@ -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 New Issue
Block a user