Re: Custom dynamic properties

On Fri, Sep 17, 2010 at 10:54 AM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> On 9/17/10 1:42 PM, Tab Atkins Jr. wrote:
>>
>> What difference do you think there is between pseudoclasses and
>> attribute selectors?  Other than the fact that they refer to different
>> things, they're fairly similar.
>
> Pseudo classes can be defined arbitrarily, in general, whereas what
> attribute selectors can do is very restricted.
>
> For example, there's no sane way to write an attribute selector for "tables
> with a nonzero border attribute" (in the sense that affects HTML rendering).
>  One could define a pseudo-class that does that, though.

Right, that would be the "refer to different things" part.  ^_^

>> :enabled and :disabled were presumably introduced for parsimony with
>> the other input-state-based pseudoclasses.  It's also easier to write
>> them than [disabled] and :not([disabled])
>
> :disabled and [disabled] will match different sets of elements, in general.
>
> :disabled and :not(:enabled) will match different sets of elements, in
> general.
>
> See http://www.w3.org/TR/2004/CR-css3-ui-20040511/ section 6.6.4.1 paragraph
> 3 second sentence:
>
>  In a typical document most elements will be neither :enabled nor
>  :disabled.

Argh, right.  Yeah, only input elements, typically, can be enabled or disabled.

~TJ

Received on Friday, 17 September 2010 20:09:23 UTC