I'm taking a closer look at my style recalculations, and it turns out the all CSS property is incredibly slow for no reason.
With no other CSS on the page, and a 4x CPU slowdown, I get ~14ms for a page of mine with ~200 elements on the page, which just this CSS:
*:where(:not(html, iframe, canvas, img, svg, video):not(svg *, symbol *)) {
all: unset;
display: revert;
}
If I exclude divs, like the following, my style recalculations drop to ~9ms:
*:where(:not(html, iframe, canvas, img, svg, video, div):not(svg *, symbol *)) {
all: unset;
display: revert;
}
If I also exclude spans, like the following, the time drops to ~4ms:
*:where(:not(html, iframe, canvas, img, svg, video, div, span):not(svg *, symbol *)) {
all: unset;
display: revert;
}
The crazy thing is that Chrome's user agent stylesheet, only sets display: block for div, and it doesn't even set anything for span.
So an insane amount of performance is being thrown out of the window for nothing really.
Possibly this should be taken into account, and some common elements, if not every element, should be special-cased and not be reset with all: unset.
I'm taking a closer look at my style recalculations, and it turns out the
allCSS property is incredibly slow for no reason.With no other CSS on the page, and a 4x CPU slowdown, I get ~14ms for a page of mine with ~200 elements on the page, which just this CSS:
If I exclude divs, like the following, my style recalculations drop to ~9ms:
If I also exclude spans, like the following, the time drops to ~4ms:
The crazy thing is that Chrome's user agent stylesheet, only sets
display: blockfordiv, and it doesn't even set anything forspan.So an insane amount of performance is being thrown out of the window for nothing really.
Possibly this should be taken into account, and some common elements, if not every element, should be special-cased and not be reset with
all: unset.