diff --git a/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.cpp b/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.cpp index 7890656ccb..34895f99bd 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.cpp @@ -9,12 +9,13 @@ #include #include #include +#include namespace Web::CSS { -CSSFontFaceRule* CSSFontFaceRule::create(JS::Realm& realm, FontFace&& font_face) +WebIDL::ExceptionOr> CSSFontFaceRule::create(JS::Realm& realm, FontFace&& font_face) { - return realm.heap().allocate(realm, realm, move(font_face)).release_allocated_value_but_fixme_should_propagate_errors(); + return MUST_OR_THROW_OOM(realm.heap().allocate(realm, realm, move(font_face))); } CSSFontFaceRule::CSSFontFaceRule(JS::Realm& realm, FontFace&& font_face) diff --git a/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.h b/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.h index fe08427d46..ab6263bdfb 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.h +++ b/Userland/Libraries/LibWeb/CSS/CSSFontFaceRule.h @@ -16,7 +16,7 @@ class CSSFontFaceRule final : public CSSRule { WEB_PLATFORM_OBJECT(CSSFontFaceRule, CSSRule); public: - static CSSFontFaceRule* create(JS::Realm&, FontFace&&); + static WebIDL::ExceptionOr> create(JS::Realm&, FontFace&&); virtual ~CSSFontFaceRule() override = default; diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp index 9e43248edf..a0e6514595 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp @@ -5394,7 +5394,7 @@ CSSRule* Parser::parse_font_face_rule(TokenStream& tokens) unicode_range.empend(0x0u, 0x10FFFFu); } - return CSSFontFaceRule::create(m_context.realm(), FontFace { font_family.release_value(), move(src), move(unicode_range) }); + return CSSFontFaceRule::create(m_context.realm(), FontFace { font_family.release_value(), move(src), move(unicode_range) }).release_value_but_fixme_should_propagate_errors(); } Vector Parser::parse_font_face_src(TokenStream& component_values)