Last Comment Bug 246604 - lookupNamespaceURI should probably be aware of xml prefix
: lookupNamespaceURI should probably be aware of xml prefix
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM: Core & HTML (show other bugs)
: Trunk
: x86 All
: -- minor (vote)
: ---
Assigned To: Alex Vincent [:WeirdAl]
:
:
Mentors:
http://lxr.mozilla.org/seamonkey/sour...
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-06-13 15:58 PDT by Alex Vincent [:WeirdAl]
Modified: 2008-07-31 02:39 PDT (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
special-case xml, xmlns prefixes (1.29 KB, patch)
2005-10-15 23:26 PDT, Alex Vincent [:WeirdAl]
peterv: review+
peterv: superreview+
Details | Diff | Splinter Review

Description Alex Vincent [:WeirdAl] 2004-06-13 15:58:05 PDT
The xml attribute prefix (for example, xml:lang) is fairly well-known, but 
Mozilla's lookupNamespaceURI method doesn't know about it.  Thus, to call 
aNode.lookupNamespaceURI("xml") would require that we explicitly declare the 
XML namespace.

We have a similar problem with aNode.lookupNamespaceURI("xmlns").  These are 
namespaces that are not going to change, and our DOM code shouldn't have to 
walk up the tree of nodes to find the right values... :)
Comment 1 Boris Zbarsky [:bz] (still a bit busy) 2004-07-13 02:00:58 PDT
This is a performance enhancement, right?  Since "xmlns" and "xml" don't have
associated namespace URIs (due to the fact that they are not actually
namespaces)....
Comment 2 Hixie (not reading bugmail) 2004-07-13 02:18:00 PDT
They do have associated namespace URIs.
   xml     http://www.w3.org/XML/1998/namespace
   xmlns   http://www.w3.org/2000/xmlns/
See: http://www.w3.org/TR/xml-names11/#xmlReserved
Comment 3 Peter Van der Beken [:peterv] 2004-07-13 03:25:11 PDT
Note that the lookup algorithm is specified in
http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/namespaces-algorithms.html#lookupNamespaceURIAlgo
That said, I never understood why that doesn't special-case xml and xmlns. DOM
Level 3 XPath ended up special-casing xml:
http://www.w3.org/TR/2004/NOTE-DOM-Level-3-XPath-20040226/xpath.html#XPathEvaluator-createNSResolver
Comment 4 Alex Vincent [:WeirdAl] 2005-10-15 23:26:05 PDT
Created attachment 199716 [details] [diff] [review]
special-case xml, xmlns prefixes

javascript:alert(document.lookupNamespaceURI("xml") + "\n" +
document.lookupNamespaceURI("xmlns"))
Comment 5 Alex Vincent [:WeirdAl] 2005-11-30 19:31:03 PST
fixed with checkin by timeless

Note You need to log in before you can comment on or make changes to this bug.