Files
ladybird/Tests/LibWeb/Layout/input/css-counters/dynamic-counter-style-insert-rule.html
Andreas Kling e2e3c7fcdf LibWeb: Rebuild counter style cache lazily
Stop rebuilding the counter style cache from every style update.
That made unrelated restyles pay the full counter-style cost even when
no relevant stylesheet state had changed.

Dirty the cache when stylesheet rule caches are invalidated and rebuild
it on the first counter-style lookup instead. Also make cold cache
rebuilds include user stylesheets.

Add regression tests covering insertRule() and replaceSync() updates
that should make newly defined counter styles take effect.
2026-04-05 12:34:28 +02:00

12 lines
299 B
HTML

<!doctype html>
<style id="style">
div::after {
content: counter(a, dynamic-counter-style);
}
</style>
<div style="counter-reset: a 5"></div>
<script>
style.sheet.insertRule("@counter-style dynamic-counter-style { symbols: \"*\"; }", 0);
document.body.offsetWidth;
</script>