1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 10: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:
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

@ -1709,7 +1709,7 @@ void Document::evaluate_media_queries_and_report_changes()
CSS::MediaQueryListEventInit init;
init.media = media_query_list->media();
init.matches = now_matches;
auto event = CSS::MediaQueryListEvent::create(window(), HTML::EventNames::change, init);
auto event = CSS::MediaQueryListEvent::create(realm(), HTML::EventNames::change, init);
event->set_is_trusted(true);
media_query_list->dispatch_event(*event);
}