getElementById fails to find xml:id identified elements
It looks like WebKit currently has no support for xml:id. It looks pretty simple to add:
We'll need to build a few test cases with errors and checking for id normalization, etc.
Test cases I can think of that we would need:
1. Test null:id vs. xml:id, which wins when both are defined?
2. Test multiple xml:id's (the parser will throw an error, i'm pretty sure)
3. Test xml:id in HTML (we should probably ignore it)
4. Text xml:id attribute normalization
a. get the value via js (getAttribute, getAttributeNS, other ways?), which are normalized?
b. set the value via js, see that it's properly normalized
c. use getElementById to find normalized names. should getElementById normalize its args?
5. Possibly test lookup across documents. an HTML document embedding an XML document, calling objectElement.contentDocument.getElementById() how is normalization handled, etc.
I think that's all we need to start with. Writing those test cases will probably take longer than adding the support into Element.cpp, and adding the attribute name into xmlnames.in. :)
It's possible that Hixie or others have already made some of the tests we might need. Heck, the W3c might even have a test suite for xml:id (I kinda doubt it).
There is actually a test suite!
We'd need to import that with any implementation patch.
important to note that the W3C tests link to these other tests from Opera:
And there are these from Hixie:
http://annevankesteren.nl/test/xml/xml-id/ and these are form Anne!
I didn't see that Eric had already noted the link to Anne's tests. Oops.
Please note that HTML5 doesn't even mention xml:id (unlike xml:lang). Firefox 2.0 and 3.0 nightly don't pass these tests either.
It doesn't look entirely obvious that we should implement xml:id support. And if we do, we need to analyze all the controversy around it!
See also: bug 12971.
The official consensus between Maciej, Alexey and I is that we're not interested in implementing xml:id in WebKit at this time.
It is unfortunate that SVG 1.2 has recommended xml:id (then again, SVG 1.2 has done lots of other unfortunate things as well).
I'll communicate our disinterest to my WICD connections.
Mass moving XML DOM bugs to the "DOM" Component.