LibWeb: Note what's causing a style invalidation to happen

You can now build with STYLE_INVALIDATION_DEBUG and get a debug stream
of reasons why style invalidations are happening and where.

I've rewritten this code many times, so instead of throwing it away once
again, I figured we should at least have it behind a flag.
This commit is contained in:
Andreas Kling 2024-09-04 10:01:08 +02:00 committed by Andreas Kling
commit ddbfac38b0
Notes: github-actions[bot] 2024-09-08 07:46:37 +00:00
20 changed files with 92 additions and 38 deletions

View file

@ -114,7 +114,7 @@ void CSSStyleRule::set_selector_text(StringView selector_text)
if (auto* sheet = parent_style_sheet()) {
if (auto style_sheet_list = sheet->style_sheet_list()) {
style_sheet_list->document().style_computer().invalidate_rule_cache();
style_sheet_list->document_or_shadow_root().invalidate_style();
style_sheet_list->document_or_shadow_root().invalidate_style(DOM::StyleInvalidationReason::SetSelectorText);
}
}
}