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

LibWeb: Make StyleSheetList GC-allocated

This commit is contained in:
Andreas Kling 2022-08-07 13:29:49 +02:00
parent 5d60212076
commit 5366924f11
14 changed files with 68 additions and 37 deletions

View file

@ -279,7 +279,7 @@ NonnullRefPtr<Document> Document::create(AK::URL const& url)
Document::Document(const AK::URL& url)
: ParentNode(*this, NodeType::DOCUMENT_NODE)
, m_style_computer(make<CSS::StyleComputer>(*this))
, m_style_sheets(CSS::StyleSheetList::create(*this))
, m_style_sheets(JS::make_handle(CSS::StyleSheetList::create(*this)))
, m_url(url)
, m_window(HTML::Window::create_with_document(*this))
, m_implementation(DOMImplementation::create({}, *this))
@ -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;
}