Re: Overloading pseudo-elements seems bad

On Thu, 11 Aug 2011 04:30:12 +0200, Dimitri Glazkov <dglazkov@google.com>  
wrote:
> Tab just pointed out to me that another issue with using
> pseudo-elements is if we let developers just create their own, CSS3
> won't be able to add new pseudo-elements, paralyzed by fear of
> breaking the Web. The solutions are:
>
> 1) Only allow developers to use a strict set of names (which seems
> deficient, because we can't really invent all names for all purposes
> here)
> 2) Use some sort of a prefix
> 3) Invent a different method of conveying this information, like
> part(foo) that I suggested before.
> 4) <insert idea>

I think ::part(ident) or ::shadow(ident) is the best. That way parsing  
rules do not have to be changed (unknown pseudo-elements are dropped,  
currently violated by WebKit) and the purpose of the pseudo-elements when  
used in a style sheet is clear.

Alternatively we could have a new combinator for reaching into a shadow  
DOM of an element.

Either way the shadow DOM will need to clearly indicate which elements can  
be selected.


-- 
Anne van Kesteren
http://annevankesteren.nl/

Received on Saturday, 13 August 2011 10:30:38 UTC