mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:47:45 +00:00
LibWeb: Implement window.matchMedia()
This commit is contained in:
parent
4155cc7ed5
commit
51da5d03da
4 changed files with 21 additions and 0 deletions
|
@ -195,4 +195,9 @@ NonnullRefPtr<CSS::CSSStyleDeclaration> Window::get_computed_style(DOM::Element&
|
|||
return CSS::CSSStyleDeclaration::create(move(properties), move(custom_properties));
|
||||
}
|
||||
|
||||
NonnullRefPtr<CSS::MediaQueryList> Window::match_media(String media)
|
||||
{
|
||||
return CSS::MediaQueryList::create(associated_document(), move(media));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include <AK/RefPtr.h>
|
||||
#include <LibWeb/Bindings/WindowObject.h>
|
||||
#include <LibWeb/Bindings/Wrappable.h>
|
||||
#include <LibWeb/CSS/MediaQueryList.h>
|
||||
#include <LibWeb/CSS/Screen.h>
|
||||
#include <LibWeb/DOM/Event.h>
|
||||
#include <LibWeb/DOM/EventTarget.h>
|
||||
|
@ -73,6 +74,7 @@ public:
|
|||
void set_current_event(Event* event) { m_current_event = event; }
|
||||
|
||||
NonnullRefPtr<CSS::CSSStyleDeclaration> get_computed_style(DOM::Element&) const;
|
||||
NonnullRefPtr<CSS::MediaQueryList> match_media(String);
|
||||
|
||||
private:
|
||||
explicit Window(Document&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue