[Webkit-unassigned] [Bug 18930] mouseenter and mouseleave events not supported

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Sep 28 02:47:32 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=18930





--- Comment #29 from Allan Sandfeld Jensen <allan.jensen at digia.com>  2012-09-28 02:47:55 PST ---
(In reply to comment #28)
> (In reply to comment #22)
> > ...will not always working as might be expected for capture phase event listeners installed on ancestor elements (They will just have to rely on mouseover and mouseout instead).
> 
> That seems unacceptable to me.
> 
Okay, I thought it was a very clean and easily communicable limitation. It even has easy workaround for anybody who wants to use capture event listeners, they just need to add empty listeners to the elements they want events for. 

> (In reply to comment #24)
> I think the cleanest thing to do here is to define a custom dispatch. This way we can gather the ancestors once instead of once per ancestor. This custom dispatch can check if there is a listener too. In the case where there are no listeners we walk the ancestors once. In the case where there are listeners the dispatch will still be O(n^2) where n is the depth of the tree.

Checking the ancestors is not the only thing that cause O(n²) behaviour. There is also a Node::contains() check to avoid wrong mouseleave events.

My plan for a correct solution is to eventually move the handling to Document::updateHoverActiveState, which has a list of nodes whose hover state changes. The problem is that it currently operates in hittesting and not in event-handling, so it does not have access to all the mouse-event parameters it needs to dispatch a mouse event. 

To avoid iterating over all the ancestors again and again, we would need a mechanism to collect the ancestors for event dispatching once, and reuse it for several events.

The problem with all this is that it requires a few refactorings. The solution I posted here was a fast easy way to solve the problem with one clear and simple limitation, which can be used until we have a full implementation.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list