W3C home > Mailing lists > Public > www-style@w3.org > August 2002

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

From: Ian Hickson <ian@hixie.ch>
Date: Thu, 01 Aug 2002 11:09:45 +0200
Message-ID: <3D48FAD9.5090203@hixie.ch>
To: www-style@w3.org

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:
>      http://www.w3.org/TR/2000/WD-css3-userint-20000216#user-input
> (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"                                          /,   _.. \   _\  ;`._ ,.
http://index.hixie.ch/                         `._.-(,_..'--(,_..'`-.;.'
Received on Thursday, 1 August 2002 05:09:54 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:15 GMT