Re: Styling by attribute-based association?

On Thu, 16 Oct 2008, Daniel Glazman wrote:
> Ian Hickson wrote:
> 
> > I agree that it should be up to the markup specs to define which of 
> > these state-based pseudo-classes should apply to which elements. 
> > Should we define a set of common terms so that specs can "interface" 
> > on this issue, or would it be better for specs to just name 
> > pseudo-classes explicitly?
> 
> I don't understand. Do you mean name the existing state pseudo-classes 
> or potentially name/define new ones? About the former, it's probably in 
> the markup language's hands ; the latter is clearly on CSS WG's radar.

I mean, should the specs say:

    HTML
    The input element represents a two-state control that represents the 
    element's checkedness state. If the element's checkedness state is 
    true, the control represents a positive selection, and if it is false, 
    a negative selection. While the element's checkedness state is true, 
    the element is *in a pseudo-checked state*.

    CSS
    The :checked pseudo-class matches elements that are *in a 
    pseudo-checked state*.

...or should the specs say:

    HTML
    The input element represents a two-state control that represents the 
    element's checkedness state. If the element's checkedness state is 
    true, the control represents a positive selection, and if it is false, 
    a negative selection. While the element's checkedness state is true, 
    the element *matches the :checked pseudo-class*.

    CSS
    The following pseudo-classes exist:
      :checked
      ...
    What they match is defined in other specifications.

The advantage of the former technique is that other specifications (e.g. 
XPath) can later come along and hook into the term we invent, thus keeping 
everything consistent. The advantage of the latter technique is that it is 
simpler for everyone to understand the implications of the requirements.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Thursday, 16 October 2008 21:33:13 UTC