Re: [csswg-drafts] [css-shadow-parts] consider moving part-mapping to style rules

> Wouldn't such a request might already be raised for components wanting to know when a composed component changed it's parts?

That can be easily done if this were DOM API because then detecting any change to whether a given element is exposed as a part or not is very fast & easy. Detecting whether a arbitrary set of selectors would match or cease to match an element is **extremely expensive** operation. This is why modern browser engines match selectors lazily when updating the styles.

> Isn't this already the case with `animationstart` and `transitionstart`?

`animationstart` and `transitionstart` are different because they're async events, and the browser already has to know when an animation or a transition starts (in order to start the animation or the transition). Also, CSS animations doesn't start until the next painting / rendering happens, and the browser engine already has to update the style in those cases so detecting whether a given element has an animation or not is virtually cost-free.

-- 
GitHub Notification of comment by rniwa
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2904#issuecomment-410548945 using your GitHub account

Received on Sunday, 5 August 2018 21:21:40 UTC