summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/CSS
diff options
context:
space:
mode:
authorKenneth Myhra <kennethmyhra@gmail.com>2023-02-14 20:30:43 +0100
committerLinus Groh <mail@linusgroh.de>2023-02-18 00:52:47 +0100
commit719839b8822bcfb6fac3ea21ad427f1e7ae0da5e (patch)
tree500fc830351d17605ccb056a14ab0f38b8e29536 /Userland/Libraries/LibWeb/CSS
parent57c34e6325144b49bc7d8b3a03ea7ffd7f0cc46f (diff)
downloadserenity-719839b8822bcfb6fac3ea21ad427f1e7ae0da5e.zip
LibWeb: Make factory method of CSS::StyleSheetList fallible
Diffstat (limited to 'Userland/Libraries/LibWeb/CSS')
-rw-r--r--Userland/Libraries/LibWeb/CSS/StyleSheetList.cpp4
-rw-r--r--Userland/Libraries/LibWeb/CSS/StyleSheetList.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/StyleSheetList.cpp b/Userland/Libraries/LibWeb/CSS/StyleSheetList.cpp
index a770b76307..b73ae1cc93 100644
--- a/Userland/Libraries/LibWeb/CSS/StyleSheetList.cpp
+++ b/Userland/Libraries/LibWeb/CSS/StyleSheetList.cpp
@@ -45,10 +45,10 @@ void StyleSheetList::remove_sheet(CSSStyleSheet& sheet)
m_document.invalidate_style();
}
-StyleSheetList* StyleSheetList::create(DOM::Document& document)
+WebIDL::ExceptionOr<JS::NonnullGCPtr<StyleSheetList>> StyleSheetList::create(DOM::Document& document)
{
auto& realm = document.realm();
- return realm.heap().allocate<StyleSheetList>(realm, document).release_allocated_value_but_fixme_should_propagate_errors();
+ return MUST_OR_THROW_OOM(realm.heap().allocate<StyleSheetList>(realm, document));
}
StyleSheetList::StyleSheetList(DOM::Document& document)
diff --git a/Userland/Libraries/LibWeb/CSS/StyleSheetList.h b/Userland/Libraries/LibWeb/CSS/StyleSheetList.h
index b80226af15..05d661249e 100644
--- a/Userland/Libraries/LibWeb/CSS/StyleSheetList.h
+++ b/Userland/Libraries/LibWeb/CSS/StyleSheetList.h
@@ -15,7 +15,7 @@ class StyleSheetList : public Bindings::LegacyPlatformObject {
WEB_PLATFORM_OBJECT(StyleSheetList, Bindings::LegacyPlatformObject);
public:
- static StyleSheetList* create(DOM::Document& document);
+ static WebIDL::ExceptionOr<JS::NonnullGCPtr<StyleSheetList>> create(DOM::Document& document);
void add_sheet(CSSStyleSheet&);
void remove_sheet(CSSStyleSheet&);