[Bug 15954] [Shadow]: The dilemma of document DOM tree mutations

https://www.w3.org/Bugs/Public/show_bug.cgi?id=15954

--- Comment #6 from Tab Atkins Jr. <jackalmage@gmail.com> 2012-03-01 00:05:04 UTC ---
Okay, sketch for the overlay idea.

In early brainstorming discussions, we had an idea for letting shadow DOM
expose only certain elements to outer-document selectors, by tagging an element
with a @pseudo attribute (taking a string) which makes it selectable in the
outer document with a selector like ".fancyComponent::pseudo(string)".

Let's work with that idea.  Each shadow root gets access to an object that maps
strings to elements.  The elements can be from anywhere, shadow or light DOM. 
The ::pseudo() pseudo-element lets you select elements via this map.  Light DOM
elements, however, only match *if they were grabbed by a <content> in that
component's shadow*.

This would solve the use-case nicely without having to pollute the light DOM or
rely on hacky selector-editting.  Just grab, in JS, the currently selected tab
and pane.  Stash both of them into the map under, say, "current-tab" and
"current-pane".  They're then easily selectable.  When the user changes the
active tab, just assign the new elements to the map, and it all works
automatically with no cleanup necessary.

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Thursday, 1 March 2012 00:06:06 UTC