From kfm-devel Mon Aug 16 09:14:35 1999 From: Lars Knoll Date: Mon, 16 Aug 1999 09:14:35 +0000 To: kfm-devel Subject: changes in KHTML X-MARC-Message: https://marc.info/?l=kfm-devel&m=93489518402924 Hi, as some of you might have noticed, I checked the rewrite of khtml I've done in the last month into CVS. Since it's (very) far from being complete and stable, I've checked it into a seperate branch in kdelibs. You can get it by 'cvs co -r khtml_to_dom kdelibs/khtml'. I've rewritten khtml, to use DOM Level1 (see http://www.w3.org) for it's internal document representation. The reason is mainly, that this is IMO the only way, to be able to add javascript support to khtml. Many (most) things are still not working, so don't expect too much from this version. I'll just give a short description of what I've done so far: * Dom: The dom corresponds to the HTML DOM Level1 as defined by the w3c. It's still not complete (HTMLCollection is for example still missing), but already in a pretty useable state. The DOM is implemented as classes using automatic memory management (each class in the DOM holds a pointer to a class implementing the functionality, the implementation uses reference counting to know, when it's not needed anymore). This has the advantage of preventing memory holes in for example the code implementing the javascript interface. However, khtml does internally use the implementations directly, for speed and efficiency reasons. The core dom is imlemented in the dom_*, html dom in the html_* files. I've added drawing functionality to the HTMLElements of the dom, so they can render themselves directly into the widget. Only block level elements draw themselves, the inline elements and text are rendered by the surrounding block level element. This makes it easier (at all possible) to implement bidirectional behaviour and aligned objects. The old khtmlobjects are not used at all anymore, but I've kept them in CVS for the moment, as I still want to reuse their code. The DOM does by the way use exceptions and namespaces, so khtml uses them too now. * tokenizer: The tokenizer didn't change too much, but instead of writing the tokenized stream into a buffer, it does now pass every token directly to the parser. * parser I rewrote it, since the parsing of the Attributes _has_ to be done now in the elements (through the DOM attributes can be set even after parsing for example by a script). It's much shorter now, and I wan't to implement some sort of DTD support there at some point. * probably some more things I forgot... I've added a short test program, since kbrowser isn't linked into the lib at the moment. You can also have a look at the files DESIGN for some more information, and at the TODO file for some infromation on what's already done/working and what still needs to be done. Comments, critics, flames anyone? Cheers, Lars