As a very rough first stab at improving the overhead measured in bug 1365682, we can at least stop using the parallelism for everything other than StyleDocument calls, which eliminates all the small traversals. Especially with lazy frame construction, most styling of new content ends running off of ProcessPendingRestyles anyway. It's not perfect, because we may still have some large subtrees that we miss parallelizing, and we could have trivial 1-element restyles in ProcessPendingRestyles. But it's still better than what we have now, and Talos shows that it's quite a bit better than what we have now. We can continue to tweak, but I want to get this into the tree as a starting point to improve our numbers.
Created attachment 8868682 [details] [diff] [review] Only use the parallel traversal when traversing from the root. v1