A few questions

Peter Kelly pmk at kde.org
Sun May 4 02:30:11 BST 2003


On 3 May 2003, Nicolas Deschildre wrote:

> Hi,
> Still about kafka, i'd like to ask you some little things, mainly about
> khtml's internal:
> To build the DOM::Node tree, i use the Quanta tree, and for each Quanta
> Node, i create a DOM::Node and inserts it. This method is very slow (it
> takes 750 ms to load an 50 lines HTML file whereas khtml rendering is
> instantaneous) : i believe each time a DOM::Node is inserted, the
> rendering is updated and that is what make it very slow. Am i right?
> One solution could be do add all the child nodes to the root node first
> and then insert it in the tree (not yet tested)? Else, does one method
> exist to turn off/on rendering?

Whenever you add a node into the tree it calls setChanged() which marks it 
for updating the next time the DocumentImpl::updateRendering() is called 
rather than doing it automatically. Which reminds me, we still need a 
public method for this...

> 
> Have yo an idea why i couldn't insert "special" character like é, è,
> ù,... with the method DOM::Node::setNodeValue(QString); ??

What happens when you try to do this... does it replace the character with 
something else or not include it at all?
What type of node are you using this on (e.g. Attr or Text)?

> 
> How do i turn off buttons and links?? In fact, it is already turn off (i
> don't know how), but i get the message "Warning: Your data is about to
> be transmitted across the network unencrypted ...". It's not important,
> but if an method already exist to turn this off...

This may be beacuse you are overriding the mouse event methods in 
KHTMLPart. I'm not sure of a way to disable these other than filtering the 
events yourself. When do you get the message? You would have to presumably 
submit the form somehow for this to happen.

> 
> Does one method exists to create a DOM::Document object directly instead
> of using KHTMLPart::write("<html></html>"); ? It's not important, but
> just to know...

DOMImplementation::createDocument() is the best way to do this (however, 
this requires  you to have a handle to a DOMImplementation object which at 
present can only be obtained from another Document). Actually a document 
object is create whenever you declared a Document variable without a 
constructor, although looking at this now it doesn't really seem the 
proper behaviour compared to the other Node wrapper classes which don't do 
this.

Either way though, the document is not associated with a part so you can't 
display it. But as long as you are just manipulating it using the DOM 
methods it's ok.

> 
> Thanks very much for the answers
> ++
> Nicolas
> 
> _____________________________________________________________________
> Envie de discuter en "live" avec vos amis ? Télécharger MSN Messenger
> http://www.ifrance.com/_reloc/m la 1ère messagerie instantanée de France
> 

-- 
Peter Kelly
pmk at kde.org





More information about the kfm-devel mailing list