Re: [w3c/webcomponents] ::slotted() should full support complex selector!! (#745)

> * `::slotted(ul) > li`, while reasonable, would slow down stuff, I'd think.

How much slower? Is there data recorded somewhere? It would be very helpful and appreciated if browser authors would show data along with these performance hypotheses, rather than throwing out ideas with no visible and useful performance data.

End users have already outlined the use cases.

---

As an example, SVG may not be suitable for first-person shooter graphics, but SVG is certainly useful for other use cases within its performance constraints.

In that same light, the usefulness of `::slotted(.foo) > .bar` far-outweighs (in my opinion) the performance cost for the vast majority of use cases.

Web developers should re-running any selectors unnecessarily, for example avoid running them in an animation frame loop over and over (unless that perf hit has no impact on the final outcome).

The browser can also cache results for the CSS engine and only invalidate on DOM changes (and users should _definitely_ avoid relying on DOM tree structure changes for animation purposes, but again it really depends on the use case and even the slowest DOM manipulation can be fast enough for many cases).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/745#issuecomment-668922849

Received on Wednesday, 5 August 2020 01:41:37 UTC