1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-28 21:22:08 +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:
Andrew Kaster 2022-09-24 16:34:04 -06:00 committed by Linus Groh
parent 8de7e49a56
commit a2ccb00e1d
37 changed files with 159 additions and 146 deletions

View file

@ -5,6 +5,8 @@
*/
#include <LibGfx/Rect.h>
#include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/Bindings/ScreenPrototype.h>
#include <LibWeb/CSS/Screen.h>
#include <LibWeb/DOM/Document.h>
#include <LibWeb/Page/Page.h>
@ -20,7 +22,7 @@ Screen::Screen(HTML::Window& window)
: PlatformObject(window.realm())
, m_window(window)
{
set_prototype(&window.cached_web_prototype("Screen"));
set_prototype(&Bindings::ensure_web_prototype<Bindings::ScreenPrototype>(window.realm(), "Screen"));
}
void Screen::visit_edges(Cell::Visitor& visitor)