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

Re: [CSS21] Multiple IDs

From: Ian Hickson <ian@hixie.ch>
Date: Sun, 28 Aug 2005 20:12:06 +0000 (UTC)
To: Chris Lilley <chris@w3.org>
Cc: www-style@w3.org
Message-ID: <Pine.LNX.4.62.0508281906550.27381@dhalsim.dreamhost.com>

On Thu, 25 Aug 2005, Chris Lilley wrote:
> 
> The features at risk lists multiple IDs "Because implementations are not 
> expected to support multiple IDs per element soon, this feature may be 
> made informative. " http://www.w3.org/TR/2005/WD-CSS21-20050613/#at-risk 
> Does this mean HTML implementations, or all implementations?

It means complete CSS 2.1 implementations.


> As the CSS 2.1 selectors chapter correctly states:
> 
>     If an element has multiple ID attributes, all of them must be
>     treated as IDs for that element for the purposes of the ID selector.
>     Such a situation could be reached using mixtures of xml:id [XMLID],
>     DOM3 Core [DOM-LEVEL-3-CORE], XML DTDs [XML10] and
>     namespace-specific knowledge.
>     http://www.w3.org/TR/CSS21/selector.html#id-selectors
> 
> In SVG 1.2, IDs could arise from any of these methods.

Indeed; all but one of those methods are independent of the markup 
language used.


> Why should CSS selectors give different results to getElementById?

Selectors have a completely different model than getElementById(), so I'm 
not entirely sure what you mean by this question. Specifically, gEBI maps 
an ID and a tree to an element (it searches a DOM for an element), whereas 
Selectors map an ID and an element to a boolean (they determine if an 
element has a particular ID).

If your question is asking whether an element that is found using 
getElementById() might not match a selector that uses the same ID, the 
answer is it always would.


> Why does CSS 2.1 propose to tolerate this variability and inconsistency, 
> whereby compliant implementations can fail on a simple #foo selector?

It doesn't. We are merely stating that if we do not get implementations of 
multiple IDs on one element, that we will not test multiple IDs on one 
element, since otherwise we would not be able to exit CR, despite the CSS 
features themselves being implemented.

That is, we do not wish to prevent ourselves from exiting CR merely 
because unrelated specifications are not implemented.


> Removal of the wording on multiple ID attributes limits the suitability 
> of CSS 2.1 to SVG and CDF. SVG and CDF WGs request that this 
> functionality remain in the draft and be tested for in the test suite.

It will be. We are only going to remove the sentence if there are no 
mostly complete implementations of CSS2.1 that support those other 
technologies that allow for multiple IDs.

Please let us know if this alleviates your concerns.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Sunday, 28 August 2005 20:12:19 GMT

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