KHTML: Namespace handling
Lars Knoll
lars at trolltech.com
Wed Jun 25 11:04:00 BST 2003
> On Wednesday 25 June 2003 04:39, Dirk Mueller wrote:
> > Nope, thats wrong. While there was certainly a few bugs in the
> > implementation, searching by ID is enough. the non-NS variants of the
> > methods were masking out the namespace part, so that they would match ids
> > with same local name but different namespaces. Thats what the IdMask code
> > was for btw.
>
> So you make sure that foo:localname and bar:localname will get
> assigned the same ID (in the non-NS part of the ID field)?
AFAIK yes. Namespace support in the CSS parser (which is there, just not
enabled because of the problems with the new code Dirk described) does also
rely on same names getting same ids.
> Is it correct to say that the tagnames without namespace (like those passed
> to getElementsByTagName()) are equivalent to tags with an empty prefix?
> And/or to tags with an empty namespaceURI? Does that also mean they
> have 0 in the NS part of the ID field (the upper 16 bits)?
Yes, they do have 0 in there. At least as long as no one declares a default
namespace, in which case the upper part gets the id of that namespace.
Cheers,
Lars
> OK, so the next step is to make 3.1-branch pass the regression test (thanks
> for that test, Peter). Hopefully my getElementsByTagNameNS() fix is a step
> in that direction :)
More information about the kfm-devel
mailing list