diff --git a/Userland/Libraries/LibWeb/CSS/FontFaceSet.cpp b/Userland/Libraries/LibWeb/CSS/FontFaceSet.cpp index 281f744eb52..cfd0dcafd5c 100644 --- a/Userland/Libraries/LibWeb/CSS/FontFaceSet.cpp +++ b/Userland/Libraries/LibWeb/CSS/FontFaceSet.cpp @@ -97,6 +97,18 @@ WebIDL::CallbackType* FontFaceSet::onloading() return event_handler_attribute(HTML::EventNames::loading); } +// https://drafts.csswg.org/css-font-loading/#dom-fontfaceset-onloadingdone +void FontFaceSet::set_onloadingdone(WebIDL::CallbackType* event_handler) +{ + set_event_handler_attribute(HTML::EventNames::loadingdone, event_handler); +} + +// https://drafts.csswg.org/css-font-loading/#dom-fontfaceset-onloadingdone +WebIDL::CallbackType* FontFaceSet::onloadingdone() +{ + return event_handler_attribute(HTML::EventNames::loadingdone); +} + // https://drafts.csswg.org/css-font-loading/#dom-fontfaceset-load JS::ThrowCompletionOr> FontFaceSet::load(String const&, String const&) { diff --git a/Userland/Libraries/LibWeb/CSS/FontFaceSet.h b/Userland/Libraries/LibWeb/CSS/FontFaceSet.h index db385a9a14a..a4bc69a4734 100644 --- a/Userland/Libraries/LibWeb/CSS/FontFaceSet.h +++ b/Userland/Libraries/LibWeb/CSS/FontFaceSet.h @@ -33,6 +33,8 @@ public: void set_onloading(WebIDL::CallbackType*); WebIDL::CallbackType* onloading(); + void set_onloadingdone(WebIDL::CallbackType*); + WebIDL::CallbackType* onloadingdone(); JS::ThrowCompletionOr> load(String const& font, String const& text); diff --git a/Userland/Libraries/LibWeb/CSS/FontFaceSet.idl b/Userland/Libraries/LibWeb/CSS/FontFaceSet.idl index 36c703f4354..3633e81b948 100644 --- a/Userland/Libraries/LibWeb/CSS/FontFaceSet.idl +++ b/Userland/Libraries/LibWeb/CSS/FontFaceSet.idl @@ -26,7 +26,7 @@ interface FontFaceSet : EventTarget { // events for when loading state changes attribute EventHandler onloading; - [FIXME] attribute EventHandler onloadingdone; + attribute EventHandler onloadingdone; [FIXME] attribute EventHandler onloadingerror; // check and start loads if appropriate diff --git a/Userland/Libraries/LibWeb/HTML/EventNames.h b/Userland/Libraries/LibWeb/HTML/EventNames.h index 3255dac5687..83347232711 100644 --- a/Userland/Libraries/LibWeb/HTML/EventNames.h +++ b/Userland/Libraries/LibWeb/HTML/EventNames.h @@ -66,6 +66,7 @@ namespace Web::HTML::EventNames { __ENUMERATE_HTML_EVENT(loadeddata) \ __ENUMERATE_HTML_EVENT(loadedmetadata) \ __ENUMERATE_HTML_EVENT(loading) \ + __ENUMERATE_HTML_EVENT(loadingdone) \ __ENUMERATE_HTML_EVENT(loadstart) \ __ENUMERATE_HTML_EVENT(message) \ __ENUMERATE_HTML_EVENT(messageerror) \