mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:37:34 +00:00
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.
This commit is contained in:
parent
8de7e49a56
commit
a2ccb00e1d
37 changed files with 159 additions and 146 deletions
|
@ -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)
|
||||
{
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue