On 10/16/20 11:32 PM, Rune Lillesveen wrote:> I think the main concern
was actually performance of dir="auto" without > introducing a cache for
element directionality, since that requires a > subtree traversal for
each resolution.> > Based on  from the previous intent, it seems
Gecko caches the result.
It's not so much a cache (as in the nth-child kind of cache that all
browsers have) fwiw, it's more of a "Gecko keeps the directionality of
the DOM up-to-date on DOM mutations". In particular, we keep two node
bits for the dir pseudo-class. There are a couple bits to make
dir=auto and directionality computation efficient and such too, much
like the existing Blink bits in the ComputedStyle...
It seems Blink right now stores dir=auto information in style for some
reason, which looks really odd/sketchy (and heh, it seems esprehn@
Regarding Shadow DOM, the behavior in Gecko is a bit more subtle than
walking the shadow-including parent chain (specially wrt slotting), but
we believe it is the right one based on the discussions in , and
was implemented in  and  (and there are some WPT tests for that).