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

@ -9,14 +9,13 @@
namespace Web::CSS {
void StyleSheetList::add_sheet(NonnullRefPtr<CSSStyleSheet> sheet)
void StyleSheetList::add_sheet(CSSStyleSheet& sheet)
{
VERIFY(!m_sheets.contains_slow(sheet));
sheet->set_style_sheet_list({}, this);
m_sheets.append(sheet);
sheet.set_style_sheet_list({}, this);
m_sheets.append(JS::make_handle(sheet));
m_document.style_computer().invalidate_rule_cache();
m_document.style_computer().load_fonts_from_sheet(*sheet);
m_document.style_computer().load_fonts_from_sheet(sheet);
m_document.invalidate_style();
}