[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kfm-devel
Subject:    changes in KHTML
From:       Lars Knoll <Lars.Knoll () mpi-hd ! mpg ! de>
Date:       1999-08-16 9:14:35
[Download RAW message or body]

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:

<technical stuff>

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

</technical stuff>

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic