diff options
author | Andrew Kaster <akaster@serenityos.org> | 2022-09-24 16:34:04 -0600 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-10-01 21:05:32 +0100 |
commit | a2ccb00e1da76b9b80fe1a804b5cbf87af91770f (patch) | |
tree | 480db40c05e54388c283b3166f4b8786a22c8a25 /Userland/Libraries/LibWeb/CSS/StyleSheetList.cpp | |
parent | 8de7e49a5648cdf084689a6b6cb49715f8ccad02 (diff) | |
download | serenity-a2ccb00e1da76b9b80fe1a804b5cbf87af91770f.zip |
LibWeb: Remove unecessary dependence on Window from CSS classes
These classes only needed Window to get at its realm. Pass a realm
directly to construct CSS classes.
Diffstat (limited to 'Userland/Libraries/LibWeb/CSS/StyleSheetList.cpp')
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/StyleSheetList.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/StyleSheetList.cpp b/Userland/Libraries/LibWeb/CSS/StyleSheetList.cpp index d2c0b8d759..b7c3fc791a 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleSheetList.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleSheetList.cpp @@ -5,6 +5,7 @@ */ #include <AK/QuickSort.h> +#include <LibWeb/Bindings/Intrinsics.h> #include <LibWeb/Bindings/StyleSheetListPrototype.h> #include <LibWeb/CSS/StyleSheetList.h> #include <LibWeb/DOM/Document.h> @@ -36,12 +37,12 @@ void StyleSheetList::remove_sheet(CSSStyleSheet& sheet) StyleSheetList* StyleSheetList::create(DOM::Document& document) { - auto& realm = document.window().realm(); + auto& realm = document.realm(); return realm.heap().allocate<StyleSheetList>(realm, document); } StyleSheetList::StyleSheetList(DOM::Document& document) - : Bindings::LegacyPlatformObject(document.window().cached_web_prototype("StyleSheetList")) + : Bindings::LegacyPlatformObject(Bindings::ensure_web_prototype<Bindings::StyleSheetListPrototype>(document.realm(), "StyleSheetList")) , m_document(document) { } |