- From: Emilio Cobos Álvarez <notifications@github.com>
- Date: Wed, 05 Aug 2020 03:55:11 -0700
- To: w3c/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Wednesday, 5 August 2020 10:55:23 UTC
The performance issue is that it increments the amount of subtrees in which every node needs to go look for rules that affect to them. Right now the logic goes like: if you're slotted, traverse your slots and collect rules in their shadow trees as needed. [This is the code](https://searchfox.org/mozilla-central/rev/a315a1a0f09550e23e4590a77e74f36543315da3/servo/components/style/rule_collector.rs#264) fwiw. This is nice because the complexity of styling the element depends directly on the complexity of the shadow trees that you're building, and it only affects slotted nodes. If you want to allow combinators past slotted then every node would need to look at its ancestor and prev-sibling chain and look at which ones of them are slotted, then do that process for all their slots. Then, on top, you also need to change the general selector-matching code so that selectors that do _not_ contain slotted selectors don't match if you're not in the right shadow tree. That's a cost that you pay for all elements, regardless of whether you use Shadow DOM or `::slotted`, and is probably just not going to fly. -- 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/889#issuecomment-669125973
Received on Wednesday, 5 August 2020 10:55:23 UTC