[patch] working out namespaces/css issues (was xml+css borken in head)
David Faure
dfaure at klaralvdalens-datakonsult.se
Sat Oct 25 13:37:02 BST 2003
On Friday 24 October 2003 17:46, Germain Garand wrote:
> Le Vendredi 24 Octobre 2003 12:03, David Faure a écrit :
> >
> > The only thing is that we chose m_htmlCompat instead of m_xhtml to make it
> > more obvious that html-compat is the legacy special case.
> > With that idea in mind, I changed htmltags.c to list tags lowercase instead
> > of uppercase.
>
> yes, that would be much cleaner!
OK I'll do that then.
> > Another difference is that you assigned xhtml the namespace 1, whereas
> > in the branch I was still using 0 for it. But that makes sense I guess.
> > In my patch for the branch it wasn't necessary, because m_htmlCompat
> > would distinguish between html and xhtml elements anyway. Hmm so why do
> > you need it? Well of course code-wise it allows to do everything in
> > getId()..... (in my patch I had removed the htmlMode-dependent
> > case-sensitive comparisons from tagId().
>
> IIRC the point was: if the user requests an element in the XHTML namespace,
> and the element isn't a registered XHTML element, then it will be created as
> an XML element that needs to remember it's namespace (vs. e.g. no namespace
> at all, which is allowed). The bool would be fine as well, but I just
> preferred not to special-case those so pure, so innocent, XML elements :)
Yes. But adding the bool to HTMLElementImpl makes it 8 bit bigger - if not 16
or 32 due to alignment issues. Adding the bool to NodeImpl doesn't eat any
memory since there's a bitfield with 2 bits available there.
> Now that you say it, a big drawback of that approach is the cssstyleselector
> would need to apply non-namespaced CSS to those elements, and it won't do so
> because they are in namespace 1...
> So percolating the bool down to NodeImpl might be the best solution, at the
> end of the day...
OK, it looks like everything tells us it would be better there.
> > Did you forget to copy m_xhtml in cloneNode? This isn't covered by the
> > testcases, so I'm not sure. Same problems with importNode (which I don't
> > understand why it's not calling cloneNode). But that's something else.
>
> oh yes, you are right, I overlooked that
Oh cloneNode doesn't even keep the namespace in HEAD. It does in branch...
--
David Faure -- faure at kde.org, dfaure at klaralvdalens-datakonsult.se
Qt/KDE/KOffice developer
Klarälvdalens Datakonsult AB, Platform-independent software solutions
More information about the kfm-devel
mailing list