mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:17:44 +00:00
LibWeb: Fire MediaQueryListEvents when an MQL's match-state changes
The HTML event loop does a check for MQL match-state changes and dispatches the events. This requires us to keep a list of MQLs on the Document.
This commit is contained in:
parent
1c829e0417
commit
050823bea7
10 changed files with 122 additions and 2 deletions
|
@ -285,7 +285,9 @@ NonnullRefPtr<CSS::CSSStyleDeclaration> Window::get_computed_style(DOM::Element&
|
|||
|
||||
NonnullRefPtr<CSS::MediaQueryList> Window::match_media(String media)
|
||||
{
|
||||
return CSS::MediaQueryList::create(associated_document(), parse_media_query_list(CSS::ParsingContext(associated_document()), media));
|
||||
auto media_query_list = CSS::MediaQueryList::create(associated_document(), parse_media_query_list(CSS::ParsingContext(associated_document()), media));
|
||||
associated_document().add_media_query_list(media_query_list);
|
||||
return media_query_list;
|
||||
}
|
||||
|
||||
RefPtr<CSS::StyleValue> Window::query_media_feature(FlyString const& name) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue