mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-12 01:46:46 +02:00
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.
24 lines
509 B
HTML
24 lines
509 B
HTML
<!doctype html>
|
|
<div style="counter-reset: a 5"></div>
|
|
<script>
|
|
let sheet = new CSSStyleSheet();
|
|
sheet.replaceSync(`
|
|
div::after {
|
|
content: counter(a, dynamic-counter-style);
|
|
}
|
|
`);
|
|
document.adoptedStyleSheets = [sheet];
|
|
|
|
sheet.replaceSync(`
|
|
@counter-style dynamic-counter-style {
|
|
symbols: "*";
|
|
}
|
|
|
|
div::after {
|
|
content: counter(a, dynamic-counter-style);
|
|
}
|
|
`);
|
|
|
|
document.body.offsetWidth;
|
|
</script>
|