mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 15:16:14 +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:
committed by
Linus Groh
parent
8de7e49a56
commit
a2ccb00e1d
@@ -5,6 +5,8 @@
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/Bindings/MediaQueryListPrototype.h>
|
||||
#include <LibWeb/CSS/MediaQueryList.h>
|
||||
#include <LibWeb/DOM/Document.h>
|
||||
#include <LibWeb/DOM/EventDispatcher.h>
|
||||
@@ -23,7 +25,7 @@ MediaQueryList::MediaQueryList(DOM::Document& document, NonnullRefPtrVector<Medi
|
||||
, m_document(document)
|
||||
, m_media(move(media))
|
||||
{
|
||||
set_prototype(&document.window().cached_web_prototype("MediaQueryList"));
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::MediaQueryListPrototype>(document.realm(), "MediaQueryList"));
|
||||
evaluate();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user