Shadow DOM Imperative API proposal #1 vs <content select/slot>

Wilson Page attempted to implement <content select> (with microtask
observers as a timing solution for the time being) to see whether that
proposal was workable:

  https://gist.github.com/wilsonpage/d5520bd8d22327633e33

Compared to how <content select> is implemented in #2 this looks
rather jarring and we're not even sure whether it's correct.

If someone could confirm whether it's correct or provide a complete
solution I'd like to add it to the overall proposal page so that the
proposals can be more easily compared:

https://github.com/w3c/webcomponents/blob/gh-pages/proposals/Imperative-API-for-Node-Distribution-in-Shadow-DOM.md

We should also provide a <content slot> implementation for the various
solutions to see whether they can meet that proposal. Though I think
as <content slot> was originally proposed the solution with #1 would
get equally complex due to having to do recursive unwrapping of
<content> elements in script. And the solution with #2 would be
equally simple.

(I updated that page quite significantly by the way to clarify #1 a
bit, make #2 more readable, and also added some alternative solutions
to the timing problem.)


-- 
https://annevankesteren.nl/

Received on Friday, 1 May 2015 15:16:17 UTC