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

List:       kde-devel
Subject:    Re: khtmlw --> khtml? (fwd)
From:       weis () stud ! uni-frankfurt ! de
Date:       1998-11-10 11:43:23
[Download RAW message or body]

Hi,

this mail is forwarded ferom tzhe khtml developers to keep you posted.


-------------------------------------------------------------------

Hi Lars, Hi Torben,

Yesterday I managed to split things up in khtml. I did my best to break
all kinds of compatibility. 

Some notes:

) The lib-version is 1.0, it has been 2.0 for 3 days, but I think it is
nice to start again from 1.

) Only khtml.h and khtmlview.h are exported. You might want to delete
the other (not longer exported) header-files from your default include
directories.

) HTMLImage::cacheImage() doesn't work/exist any more. Use
KHTMLWidget::preloadImage() instead.

) I broke image-maps :(

) parsedURLs and parsedTargets are still in khtml.h but can be removed
altogether I guess.

) khtmlparser stores strings (like parsed URLs) in memory provided by
the tokenizer. This memory is deallocated in one big sweep when the
tokenizer is being reset. Calling 'delete' on such memory will lead to
"Bad Things (tm)". I guess parsedURLs and parsedTargets were originally
introduced for the same purpose.

A lifetime chart of the various objects types:

   KHTMLWidget	    HTMLToken     KHTMLParser       
HTMLClue&HTMLObject-tree

// first page
        begin -->     new
	
        write -->    write

        parse ----------------->     new
          |
          v
      timerEvent -------------->   parseBody  --->       new & insert in
tree
          |
          v
       stopParser ------------->    delete
	
// New page:
        begin ------------------------------------> delete all objects
in tree
          +---->    delete
          +---->      new  
	 

The root of the object tree is KHTMLWidget::Clue. HTMLParser puts Clues
and Objects
in the object tree. When parsing is done (as well when it still busy)
KHTMLWidget's paint function 'just' paints the object tree by calling
Clue->print. The tree is then painted recursevily. (Basically this
hasn't changed, it is only that by using seperate objects for the
parsing and the painting, the distinction becomes more clear)

Feel free to redesign khtml's API now. 

Cheers,

Waldo Bastian
bastian@kde.org

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

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