A few questions

Nicolas Deschildre nicolasdchd at ifrance.com
Tue May 6 19:02:10 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...

So adding the root Node with all the Nodes added to it to the Document
object at the end make khtml render only one time (and thus make it load
much faster)?
BTW, what DOM::Node::applyChanges() does?

Another problem, the much important of all: 
DOM::Node::setNodeValue() speed : everytime you type a char, this
function is called : the problem is that it is quite long and typing
text very fast (keep a key pressed) make the text to take up to 20
second to appears (all the text appears in 1 time; on my celeron 633, it
use 100 % CPU) This could be improved by delayed synchronization on
quanta side, but if i take the old kafka without any synchronization it
is still a bit slow (one or two second for typing very fast).
This is not a real problem as kafka could work with that, but i wanted
to be sure that there is no faster solution that setNodeValue(), and if
this method could be improved (i don't know khtml internal, i'm
supposing that the best has already be done, but i just wanted to be
sure...)

> 
> > 
> > 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)?

I'm trying to edit Text nodes, and nothing appears... BTW, have you a
solution for the Attr too?

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

I get this message only when clicking on a submit button. I'll try to
filter it out.

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





More information about the kfm-devel mailing list