mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:57:44 +00:00
LibWeb: Invalidate style after CSSStyleSheet.{insert,remove}Rule()
When rules are inserted or removed via the CSSOM API, we now invalidate document style to ensure that any changes made are reflected. 1% progression on ACID3. :^)
This commit is contained in:
parent
0e758b4da8
commit
a13079f757
5 changed files with 36 additions and 2 deletions
|
@ -12,6 +12,7 @@ namespace Web::CSS {
|
|||
void StyleSheetList::add_sheet(NonnullRefPtr<CSSStyleSheet> sheet)
|
||||
{
|
||||
VERIFY(!m_sheets.contains_slow(sheet));
|
||||
sheet->set_style_sheet_list({}, this);
|
||||
m_sheets.append(move(sheet));
|
||||
|
||||
++m_generation;
|
||||
|
@ -20,6 +21,7 @@ void StyleSheetList::add_sheet(NonnullRefPtr<CSSStyleSheet> sheet)
|
|||
|
||||
void StyleSheetList::remove_sheet(CSSStyleSheet& sheet)
|
||||
{
|
||||
sheet.set_style_sheet_list({}, nullptr);
|
||||
m_sheets.remove_first_matching([&](auto& entry) { return &*entry == &sheet; });
|
||||
|
||||
++m_generation;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue