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

List:       kfm-devel
Subject:    Re: khtml component
From:       Simon Hausmann <hausmann () kde ! org>
Date:       2001-05-31 15:01:47
[Download RAW message or body]

On Wed, May 30, 2001 at 02:45:31PM +0100, Ben Blaukopf wrote:
> Hi Simon,
> 
> Firstly, I've been playing with implementing access keys. Since I view
> access keys as a document property rather than an individual node
> property, I've made each node, as it parses the access key field,
> register itself with the document under that access key. The khtmlview
> then queries the document to find out how to handle a particular key
> press. I've done a test implementation and it seems to work fine - I
> just wanted to check this was the correct design before I implement it
> properly. 

Great! CC'ing to kfm-devel, that's where the khtml hackers reside :-)
 
> Also, I'm looking in detail at the Konqueror code, and have got a
> particular problem with understanding one section. As far as I understand
> the mechanism for handling mouse events, the coordinates get passed to
> the root node with a prepareMouseEvent function call which finds out which
> node the mouse is over, and then the event is dispatched to that node.
> 
> I've quoted the relevant bit of iterating code below. What I don't get
> is that the code iterates over every node, even when a match has been
> found. Surely the code could break out of the loop as soon as the correct
> child node had been identified?

I believe such an optimization would break the execution of javascript 
on* events under certain circumstances.

Bye,
 Simon 
 
> file: khtml/xml/dom_elementimpl.cpp
> -----------------------------------
> bool ElementImpl::prepareMouseEvent( int _x, int _y,
>                                      int _tx, int _ty,
>                                      MouseEvent *ev) {
> ....
> 
> 
> // Line 651
>     NodeImpl *child = firstChild();
>     while(child != 0) {
>         if(child->prepareMouseEvent(_x, _y, _tx, _ty, ev))
>             inside = true;
>         child = child->nextSibling();
>     }                                                                                      
> 
> -------------
> 
> 
> 

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

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