[patch] working out namespaces/css issues (was xml+css borken in head)

Germain Garand germain at ebooksfrance.org
Fri Oct 24 16:46:42 BST 2003


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!

> 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 :)
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...

>
> 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 

> Please commit, and if you agree I'll turn m_xhtml into m_htmlCompat (and
> change htmltags.c to lowercase? Better move away from legacy stuff...)

Of course! That looks excellent...
I'll commit as soon as I've written the *#!@ ChangeLog :)





More information about the kfm-devel mailing list