Re: a:hover and a:active and named anchors

Coises wrote:
> I'm going to guess that what that principle means (I don't recall the
> original statement, if I ever heard it) is that the determination of which
> *elements* may be matched by a given a selector cannot depend on the CSS
> properties of (any) elements.
> This does not apply to pseudo-classes and pseudo-elements, though.  For
> example, in CSS2, the ":first-line" pseudo-element can apply only to a
> block-level element; but whether an element is block-level or inline-level
> is dependent on the "display" property.

Pseudo-elements are a case of where a property ('display') on another element 
(the block) causes a new element (in this case, pseudo-element) to be generated. 
This then causes the new element to find which rules match it.

The CSS model is applied on a per-element basis, in document order, like this:

For each element:
    1. Find all rules matching the element or pseudo-element.
    2. Apply all the relevant properties.
    3. If this has created any new elements or pseudo-elements, add them to the
       list of elements to process.

Step 2 cannot affect step 1 of the same element or pseudo-element.

Note that 'display' doesn't actually change which rules match '::first-line' -- 
the same rules match, it's just a matter of whether the styling system does 
anything with those rules or not (i.e. whether the first-line exists or not.)

> While it is a technical distinction, the suggested "dynamic" property
> doesn't change which *elements* a selector might match

It does, because...

 > it changes which
> dynamic pseudo-classes can actually be triggered by external changes.

...that's the same thing.

> There is precedent for this in an existing  CSS3 working draft; see:
> (the "user-input" property determines whether an element can take
> the :active state).  An analogous infinite loop is noted and disallowed.

That property will not appear in the final version of this spec. It was an error.

Ian Hickson                                      )\._.,--....,'``.    fL
"meow"                                          /,   _.. \   _\  ;`._ ,.                         `._.-(,_..'--(,_..'`-.;.'

Received on Thursday, 1 August 2002 05:09:54 UTC