In DOM3, there are three namespace lookup functions added to the Node interface: * lookupNamespaceURI * lookupPrefix * isDefaultNamespace These should be implemented
Created attachment 4690 [details] Implement functions
Comment on attachment 4690 [details] Implement functions We talked about this at length over IRC. Looks good. It's nice that we can just copy this directly from the spec... r=me. A couple things you could fix before landing: A couple of the lines could be condensed using: if (Foo *foo = bar()) foo->doFoo(); isDefaultNamespace's element functionality should be implemented in terms of lookupNamespaceURI to prevent repeating ourselves. (if it has no prefix, check the namespace, if it does, look it up and check it). + if (!namespaceURI().isNull() && namespaceURI() == _namespaceURI && + !prefix().isNull() && originalElement->lookupNamespaceURI(prefix()) == _namespaceURI) + return prefix(); should just be: if (_namespaceURI.isNull()) return DOMString(); if (namespaceURI() == _namespaceURI && originalElement->lookupNamespaceURI(prefix()) == _namespaceURI) return prefix();
I've committed this patch, but I haven't yet fixed isDefaultNamespace to use lookupNamespaceURI yet.
Mass moving XML DOM bugs to the "DOM" Component.