mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 13:36:13 +03:00
LibWeb/CSS: Implement FontFaceSet.onloadingerror
This commit is contained in:
parent
e56e09b820
commit
bbd82265e1
Notes:
sideshowbarker
2024-07-17 03:19:14 +09:00
Author: https://github.com/jamierocks Commit: https://github.com/LadybirdBrowser/ladybird/commit/bbd82265e1 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/85
@ -109,6 +109,18 @@ WebIDL::CallbackType* FontFaceSet::onloadingdone()
|
||||
return event_handler_attribute(HTML::EventNames::loadingdone);
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/css-font-loading/#dom-fontfaceset-onloadingerror
|
||||
void FontFaceSet::set_onloadingerror(WebIDL::CallbackType* event_handler)
|
||||
{
|
||||
set_event_handler_attribute(HTML::EventNames::loadingerror, event_handler);
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/css-font-loading/#dom-fontfaceset-onloadingerror
|
||||
WebIDL::CallbackType* FontFaceSet::onloadingerror()
|
||||
{
|
||||
return event_handler_attribute(HTML::EventNames::loadingerror);
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/css-font-loading/#dom-fontfaceset-load
|
||||
JS::ThrowCompletionOr<JS::NonnullGCPtr<JS::Promise>> FontFaceSet::load(String const&, String const&)
|
||||
{
|
||||
|
@ -35,6 +35,8 @@ public:
|
||||
WebIDL::CallbackType* onloading();
|
||||
void set_onloadingdone(WebIDL::CallbackType*);
|
||||
WebIDL::CallbackType* onloadingdone();
|
||||
void set_onloadingerror(WebIDL::CallbackType*);
|
||||
WebIDL::CallbackType* onloadingerror();
|
||||
|
||||
JS::ThrowCompletionOr<JS::NonnullGCPtr<JS::Promise>> load(String const& font, String const& text);
|
||||
|
||||
|
@ -27,7 +27,7 @@ interface FontFaceSet : EventTarget {
|
||||
// events for when loading state changes
|
||||
attribute EventHandler onloading;
|
||||
attribute EventHandler onloadingdone;
|
||||
[FIXME] attribute EventHandler onloadingerror;
|
||||
attribute EventHandler onloadingerror;
|
||||
|
||||
// check and start loads if appropriate
|
||||
// and fulfill promise when all loads complete
|
||||
|
@ -67,6 +67,7 @@ namespace Web::HTML::EventNames {
|
||||
__ENUMERATE_HTML_EVENT(loadedmetadata) \
|
||||
__ENUMERATE_HTML_EVENT(loading) \
|
||||
__ENUMERATE_HTML_EVENT(loadingdone) \
|
||||
__ENUMERATE_HTML_EVENT(loadingerror) \
|
||||
__ENUMERATE_HTML_EVENT(loadstart) \
|
||||
__ENUMERATE_HTML_EVENT(message) \
|
||||
__ENUMERATE_HTML_EVENT(messageerror) \
|
||||
|
Loading…
Reference in New Issue
Block a user