kdom and khtml integration

Andras Mantia amantia at kde.org
Sun Mar 5 21:32:57 GMT 2006


Hi,

Nikolas Zimmermann wrote:
>> What I was thinking is:
>> - parse the document with our own parser and create a KDOM based tree
> Hm, you probably need to parse additional stuff like PHP etc? Can you
> elaborate a bit more, how you reuse khtml's parsing/tokenizing in Quanta?
> (do you use it at all? or do you build two completely seperated trees)

Right now we use two trees, but we want to have only one. The parser will be
in Quanta, we will not reuse from KHTML, partly because we parse other
things, not only HTML, and partly because most of the time we parse a
document it is NOT valid HTML. From KDOM/KHTML we need a way to build the
tree from our parser and that this tree should be understandable by KHTML,
even if it has nodes with extra information or nodes with not HTML
information (those should be ignored, like the nodes for PHP code).

>> - the KDOM tree nodes must be extensible (they should be able to hold
>> extra information)
> That will definately be possible, just like the NodeImpl contains pointers
> to the RenderObject, we can also supply nodes with "UserData".

Yes, this is needed, as  - for example - we need some kind of information
about the position of the node in the document itself.

>> - KHTML should be able to render directly this KDOM tree (for VPL mode)
> If you want _one_ tree, then you need to let the html parsing/tokenizing
> create the tree. A custom parser can't help there?

I think it is the only solution. :-) Just that all methods needed to build
the KDOM tree from an external parser should be public.


> I'll promise to check out Quanta code myself after tomorrow (last exam!).
> That should help my understanding of your problems a lot :-)

Well, I'm not sure it will help a lot, as it was created without KHTML
integration in mind (just like KHTML was created without WYSIWYG mode in
mind), but this is what we want to change - on both sides. We plan to start
on the new parser really soon, you might be interested in the code at that
time. 

Andras
-- 
Quanta Plus developer - http://quanta.sourceforge.net
K Desktop Environment - http://www.kde.org






More information about the kfm-devel mailing list