LibWeb: Invalidate document style when media rules are changed

This ensures that new media rules are always produce the correct result
when evaluated.
This commit is contained in:
Tim Ledbetter 2025-04-03 17:20:13 +01:00 committed by Jelle Raaijmakers
parent 1659381362
commit c941170e5a
Notes: github-actions[bot] 2025-04-04 08:11:48 +00:00
4 changed files with 2110 additions and 0 deletions

View file

@ -329,6 +329,7 @@ void CSSStyleSheet::remove_owning_document_or_shadow_root(DOM::Node& document_or
void CSSStyleSheet::invalidate_owners(DOM::StyleInvalidationReason reason)
{
m_did_match = {};
for (auto& document_or_shadow_root : m_owning_documents_or_shadow_roots) {
document_or_shadow_root->invalidate_style(reason);
document_or_shadow_root->document().style_computer().invalidate_rule_cache();