Re: Need a better way to reach into the shadow DOM subtree

Oh and just to clarify, I'm strongly opposed to a selector for crossing shadow boundaries.  The idea behind components is that you should be encapsulating the details of the implementation. If you want to expose pieces of the component for styling by authors, then pseudo-elements are a better choice, since they keep the internals of the component implementation hidden.  For example there may be all sorts of intermediate shadow cruft in between the explicit element and the exposed portions of the control that you want to allow author styling on.  I don't think the tree structure of that component should be something an author should even have to think about, and all of the objects inside the component should not be accessible to authors.  Exposing parts of your component to author styling should be a conscious choice on the part of the component creator.

dave
(hyatt@apple.com)

On Apr 11, 2011, at 2:59 PM, David Hyatt wrote:

> On Apr 11, 2011, at 2:50 PM, Dimitri Glazkov wrote:
> 
>> video::-webkit-timeline:disabled { /* ... */ }
>> 
>> How do we fix this? Tab suggests a new combinator selector like:
> 
> Just keep using pseudo-elements, but lift all the silly restrictions placed on them, e.g., that they have to be the rightmost selector.  The issue isn't with pseudo-elements.  The issue is with the restrictions placed on pseudo-element usage that don't need to be there.
> 
> Note that WebKit already has its own pseudo-element extensions that deliberately violate this rule, e.g., all of the scrollbar parts, which support states like hover/active/disabled using rules just like what you've described above.
> 
> dave
> (hyatt@apple.com)
> 
> 

Received on Monday, 11 April 2011 20:12:26 UTC