1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:57:35 +00:00

LibWeb: Make StyleSheet and CSSStyleSheet GC-allocated

This commit is contained in:
Andreas Kling 2022-08-07 13:14:54 +02:00
parent 0fe923e355
commit 5d60212076
21 changed files with 166 additions and 96 deletions

View file

@ -1610,7 +1610,7 @@ void Document::evaluate_media_rules()
{
bool any_media_queries_changed_match_state = false;
for (auto& style_sheet : style_sheets().sheets()) {
if (style_sheet.evaluate_media_queries(window()))
if (style_sheet->evaluate_media_queries(window()))
any_media_queries_changed_match_state = true;
}
@ -1837,4 +1837,11 @@ void Document::set_window(Badge<HTML::BrowsingContext>, HTML::Window& window)
m_window = window;
}
Bindings::WindowObject& Document::preferred_window_object() const
{
if (m_window && m_window->wrapper())
return const_cast<Bindings::WindowObject&>(*m_window->wrapper());
return Bindings::main_thread_internal_window_object();
}
}