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

Re: CSS selectors and xml:id

From: Ian Hickson <ian@hixie.ch>
Date: Sun, 8 May 2005 16:29:05 +0000 (UTC)
To: Bjoern Hoehrmann <derhoermi@gmx.net>
Cc: Chris Lilley <chris@w3.org>, www-style@w3.org, public-xml-core-wg@w3.org
Message-ID: <Pine.LNX.4.61.0505081619450.20097@dhalsim.dreamhost.com>

On Sun, 8 May 2005, Bjoern Hoehrmann wrote:
> http://annevankesteren.nl/test/xml/xml-id/001.xml
> http://annevankesteren.nl/test/xml/xml-id/002.xml
>   -> These tests do not make much sense to me.

They are not valid XHTML, but the tests themselves seem correct to me. 
(Behaviour in XHTML1 is arguably undefined but in the WHATWG proposals for 
HTML5 and its XML cousin the above tests would have well-defined behaviour 
that results in green backgrounds and no red.)

> http://annevankesteren.nl/test/xml/xml-id/003.xml
> http://annevankesteren.nl/test/xml/xml-id/004.xml
>   -> the style sheets are invalid and background:lime is not
>      part of them, any implementation that passes the tests
>      is broken

I beg to differ; the XML Stylesheet PIs in those tests seem quite correct 
to me. Could you elaborate?

> http://annevankesteren.nl/test/xml/xml-id/005.html
> http://annevankesteren.nl/test/xml/xml-id/006.html
> http://annevankesteren.nl/test/xml/xml-id/a.html
>   -> these are not HTML documents, any random behavior would be
>      conforming.

While true for HTML4, the proposals for HTML5 would (after the DOCTYPE 
line was updated) define required behaviour for those documents.

> [...] So I somewhat fail to see the relevance of these tests.

Since in the real world Web browsers are required to implement 
interoperable error handling behaviour much as that that will be described 
for the HTML5 WHATWG proposals, I would say these tests are at worse 
theoretically premature, and certainly not irrelevant.

> Could you propose text that should be added? There seem to be lots of 
> cross-technology and error handling issues here as xml:id does not 
> define its integration into deployed architecture, defining this for CSS 
> such that xml:id processing is consistent everywhere seems a bit 
> challenging. I guess you want similar statements regarding xml:lang 
> aswell?

I agree with Bjoern here. It should be the responsibility of the defining 
language (xml:id in this case) to define the semantics of its attributes. 
CSS should only have to say "ID selectors match elements that have the 
specified IDs", without normatively stating how elements get IDs.

The alternative would be for CSS to list every possible way of getting an 
ID onto an element (<html:* id="">, <svg:* id="">, xml:id="", DTDs, 
Schemas, the DOM3 Core methods, etc), and then have this list repeated 
every other place that needed to know about IDs (e.g. the definition of 
<html:label for="", the getElementById() method, the text/html fragment 
identifier definition, and so on and so forth).

Quite obviously, keeping all these places up to date every time a new 
mechanism is introduced is not scalable.

Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Sunday, 8 May 2005 16:29:22 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:18 UTC