Searching for 'await' on the ECMA262 specification is very janky, and profiler says mutation + layout (due to ToC change causing recalculation of the whole list-item counter list, which is ~35k elements)
Categories
(Core :: Layout: Generated Content, Lists, and Counters, defect, P3)
Tracking
()
People
(Reporter: mgaudet, Unassigned)
References
(Regression)
Details
(Keywords: regression)
STR: Visit https://tc39.es/ecma262/ and do in page search for await, then hit cmd-g for next result repeatedly. Huge janks every once and a while (also curiously the number of matches will change from "more than 1000" to 1 repeatedly)
Profile: https://share.firefox.dev/4vm9hW7
Menu.prototype.revealInToc seems relevant.
I will note I have 1PW installed which I've previously seen being an issue with mutation observers.
Comment 1•4 months ago
|
||
Uhhh so I guess it's this code or equivalent?
That code is rather bad, modifying styles and calling getBoundingClientRect in a loop :)
Comment 2•4 months ago
|
||
Where is spec.css? This is hitting basically a full counter rebuild every loop iteration...
Updated•4 months ago
|
Comment 4•4 months ago
|
||
Ok, I can reproduce locally. It's not about await in particular but about revealing large parts of the TOC. I don't see off-hand why that would trigger a full counter recalc...
| Reporter | ||
Comment 5•4 months ago
|
||
(In reply to Emilio Cobos Álvarez [:emilio] from comment #3)
I guess it's this
That seems likely (t.b.h I've never edited spec CSS outside of putting comic sans as an inline style to make sure people didn't take my vague gesturing at spec text too seriously)
If the CSS is bad though, I'm sure an issue at https://github.com/tc39/ecma262/issues/ could also get that sorted
Comment 6•4 months ago
|
||
So I took a look, and the counter is list-item. The list item counter list has ~35k elements, and each time we're inserting a counter (by showing part of the TOC) we end up hitting this codepath.
That goes back all the way to the initial implementation of CSS counters in bug 3247... But we started using it for lists in bug 1706346.
We are going to need have a better story for counter invalidation. Inserting a reset node should only invalidate its scope.
Comment 7•4 months ago
|
||
Set release status flags based on info from the regressing bug 1706346
Updated•4 months ago
|
Updated•3 months ago
|
Description
•