Bug 16505
Summary: | getElementById fails to find xml:id identified elements (xml:id support) | ||
---|---|---|---|
Product: | WebKit | Reporter: | Eric Seidel (no email) <eric> |
Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED WONTFIX | ||
Severity: | Normal | CC: | ap, cdumez, gavin.sharp, jchaffraix, kai, sam, timur.mehrvarz, webdev |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | Mac | ||
OS: | OS X 10.4 | ||
URL: | http://www.w3.org/2004/CDF/TestSuite/WICD_CDR_WP1/test-DOM-L3-core-subset-ext-getAttr.xhtml | ||
Bug Depends on: | |||
Bug Blocks: | 15836 |
Eric Seidel (no email)
getElementById fails to find xml:id identified elements
http://www.w3.org/2004/CDF/TestSuite/WICD_CDR_WP1/test-DOM-L3-core-subset-ext-getAttr.xhtml
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Eric Seidel (no email)
It looks like WebKit currently has no support for xml:id. It looks pretty simple to add:
http://www.w3.org/TR/xml-id/
We'll need to build a few test cases with errors and checking for id normalization, etc.
Eric Seidel (no email)
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).
Eric Seidel (no email)
There is actually a test suite!
http://www.w3.org/XML/2005/01/xml-id/
We'd need to import that with any implementation patch.
Eric Seidel (no email)
important to note that the W3C tests link to these other tests from Opera:
http://annevankesteren.nl/test/xml/xml-id/
Eric Seidel (no email)
And there are these from Hixie:
http://www.hixie.ch/tests/adhoc/xml/id/
Sam Weinig
http://annevankesteren.nl/test/xml/xml-id/ and these are form Anne!
Sam Weinig
I didn't see that Eric had already noted the link to Anne's tests. Oops.
Alexey Proskuryakov
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.
Eric Seidel (no email)
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).
http://www.w3.org/TR/SVGMobile12/struct.html#xmlIDAttribute
I'll communicate our disinterest to my WICD connections.
Lucas Forschler
Mass moving XML DOM bugs to the "DOM" Component.