mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 01:37:39 +03:00
LibWeb: Add Animation event handler attributes
This commit is contained in:
parent
2dd5d0c310
commit
d2cfea5acc
Notes:
sideshowbarker
2024-07-17 09:48:50 +09:00
Author: https://github.com/mattco98 Commit: https://github.com/SerenityOS/serenity/commit/d2cfea5acc Pull-request: https://github.com/SerenityOS/serenity/pull/23317
@ -359,6 +359,42 @@ void Animation::set_replace_state(Bindings::AnimationReplaceState value)
|
||||
}
|
||||
}
|
||||
|
||||
// https://www.w3.org/TR/web-animations-1/#dom-animation-onfinish
|
||||
JS::GCPtr<WebIDL::CallbackType> Animation::onfinish()
|
||||
{
|
||||
return event_handler_attribute(HTML::EventNames::finish);
|
||||
}
|
||||
|
||||
// https://www.w3.org/TR/web-animations-1/#dom-animation-onfinish
|
||||
void Animation::set_onfinish(JS::GCPtr<WebIDL::CallbackType> event_handler)
|
||||
{
|
||||
set_event_handler_attribute(HTML::EventNames::finish, event_handler);
|
||||
}
|
||||
|
||||
// https://www.w3.org/TR/web-animations-1/#dom-animation-oncancel
|
||||
JS::GCPtr<WebIDL::CallbackType> Animation::oncancel()
|
||||
{
|
||||
return event_handler_attribute(HTML::EventNames::cancel);
|
||||
}
|
||||
|
||||
// https://www.w3.org/TR/web-animations-1/#dom-animation-oncancel
|
||||
void Animation::set_oncancel(JS::GCPtr<WebIDL::CallbackType> event_handler)
|
||||
{
|
||||
set_event_handler_attribute(HTML::EventNames::cancel, event_handler);
|
||||
}
|
||||
|
||||
// https://www.w3.org/TR/web-animations-1/#dom-animation-onremove
|
||||
JS::GCPtr<WebIDL::CallbackType> Animation::onremove()
|
||||
{
|
||||
return event_handler_attribute(HTML::EventNames::remove);
|
||||
}
|
||||
|
||||
// https://www.w3.org/TR/web-animations-1/#dom-animation-onremove
|
||||
void Animation::set_onremove(JS::GCPtr<WebIDL::CallbackType> event_handler)
|
||||
{
|
||||
set_event_handler_attribute(HTML::EventNames::remove, event_handler);
|
||||
}
|
||||
|
||||
// https://www.w3.org/TR/web-animations-1/#dom-animation-cancel
|
||||
void Animation::cancel()
|
||||
{
|
||||
|
@ -66,6 +66,13 @@ public:
|
||||
JS::NonnullGCPtr<JS::Object> finished() const { return *current_finished_promise()->promise(); }
|
||||
bool is_finished() const { return m_is_finished; }
|
||||
|
||||
JS::GCPtr<WebIDL::CallbackType> onfinish();
|
||||
void set_onfinish(JS::GCPtr<WebIDL::CallbackType>);
|
||||
JS::GCPtr<WebIDL::CallbackType> oncancel();
|
||||
void set_oncancel(JS::GCPtr<WebIDL::CallbackType>);
|
||||
JS::GCPtr<WebIDL::CallbackType> onremove();
|
||||
void set_onremove(JS::GCPtr<WebIDL::CallbackType>);
|
||||
|
||||
enum class AutoRewind {
|
||||
Yes,
|
||||
No,
|
||||
|
@ -20,9 +20,9 @@ interface Animation : EventTarget {
|
||||
readonly attribute Promise<Animation> ready;
|
||||
readonly attribute Promise<Animation> finished;
|
||||
|
||||
// FIXME: attribute EventHandler onfinish;
|
||||
// FIXME: attribute EventHandler oncancel;
|
||||
// FIXME: attribute EventHandler onremove;
|
||||
attribute EventHandler onfinish;
|
||||
attribute EventHandler oncancel;
|
||||
attribute EventHandler onremove;
|
||||
|
||||
undefined cancel();
|
||||
undefined finish();
|
||||
|
Loading…
Reference in New Issue
Block a user