Skip to content

Commit 3721a1a

Browse files
mattco98ADKaster
authored andcommitted
LibWeb: Run update_finished_state when setting AnimationEffect's timing
This will need to a necessary style invalidation
1 parent 6d25bf3 commit 3721a1a

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

Userland/Libraries/LibWeb/Animations/Animation.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,11 @@ void Animation::notify_timeline_time_did_change()
509509
}
510510
}
511511

512+
void Animation::effect_timing_changed(Badge<AnimationEffect>)
513+
{
514+
update_finished_state(DidSeek::No, SynchronouslyNotify::Yes);
515+
}
516+
512517
// https://www.w3.org/TR/web-animations-1/#associated-effect-end
513518
double Animation::associated_effect_end() const
514519
{

Userland/Libraries/LibWeb/Animations/Animation.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ class Animation : public DOM::EventTarget {
6565
JS::GCPtr<DOM::Document> document_for_timing() const;
6666
void notify_timeline_time_did_change();
6767

68+
void effect_timing_changed(Badge<AnimationEffect>);
69+
6870
protected:
6971
Animation(JS::Realm&);
7072

Userland/Libraries/LibWeb/Animations/AnimationEffect.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@ WebIDL::ExceptionOr<void> AnimationEffect::update_timing(OptionalEffectTiming ti
151151
if (timing.easing.has_value())
152152
m_easing_function = timing.easing.value();
153153

154+
if (auto animation = m_associated_animation)
155+
animation->effect_timing_changed({});
156+
154157
return {};
155158
}
156159

0 commit comments

Comments
 (0)