Re: [css3-images] CSS element reference identifier

On Sun, Feb 5, 2012 at 10:26 AM, L. David Baron <dbaron@dbaron.org> wrote:
> http://dev.w3.org/csswg/css3-images/#element-reference
> (Overview.html revision 1.269) says the following:
>
>  # (CSS does not define how an element acquires a CSS element
>  # reference identifier; that is determined by the host language.)
>
> I think this should have more useful text.  For example, it could
> say:
>
>  For example, for [HTML5], see the definition of CSSElementMap at
>  <a>...</a>.
>
> Even better, it could perhaps even define the behavior for HTML, but
> allow other languages to define different behavior.
>
> I think specifying features in CSS that require the host language to
> define something, without giving any hint as to what happens for the
> common use case, is a bad idea.  It makes it hard for readers of the
> specification to figure out how to use the language, and it has the
> potential to create a gap between specifications that's never filled
> in.

Elika and I were recently discussing this, and realized that having
the element reference identifier use the current grammar (as a bare
IDENT) is future-hostile, as we plan to eventually extend it to accept
arbitrary selectors, and IDENTs collide with tagname selectors.

So, I'm changing it to just accept id selectors, and will instead
define that the CSSElementMap is consulted for ids if one isn't found
in the document.  Should it check the map before or after the
document?  I think -moz-element() currently consults its map first.

Question - if no element is matched, or if there's a cycle, the spec
currently defines that it represents a transparent image.  Should I
instead define that it's a generic failed image, so that one can use
image() to do fallback based on that?

~TJ

Received on Monday, 6 February 2012 09:15:38 UTC