Bug 146740 - khtml/kjs: onmouseover/out events do not trigger when javascript updates elements
Summary: khtml/kjs: onmouseover/out events do not trigger when javascript updates elem...
Status: RESOLVED REMIND
Alias: None
Product: konqueror
Classification: Applications
Component: khtml (show other bugs)
Version: 3.5
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-13 14:23 UTC by Antti S. Lankila
Modified: 2008-04-25 22:57 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Antti S. Lankila 2007-06-13 14:23:12 UTC
Version:            (using KDE KDE 3.5.6)
Installed from:    Ubuntu Packages
OS:                Linux

There is a test case here, which isn't very minimized, but it can be used to show the problem:

http://bel.fi/~alankila/mahjong-khtml-bug/trunk/html/hands.html

in this form, there are a set of mah-jongg tiles that can be drag'n'dropped on the slots on the left. onmouseover/out events are used to do tile highlighting.

While dragging the element, shake the mouse vigorously over the pile of tiles. If you do not have enough CPU power or have fast enough mouse, the pointer sometimes leaves the element that is being dragged around, and the "onmouseover" event triggers for a tile that the mouse cursor momentarily moves upon. Also, onmouseout is fired for the dragged tile.

However, corresponding onmouseout event does not trigger when the JS code that updates the tile moves the element back under the cursor. Neither does the onmouseover event. The end result is that tiles in the pile end up highlighted, and the dragged tile, on the other hand, loses its highlight.

There is another shared bug that triggers also on Opera and Firefox, which involves a tile that is dropped in the drop areas. When the tile is dropped, I call tile.parentNode.removeChild(tile) which removes the tile from the DOM tree. This should be an implied "onmouseout" event: in a sense, the element is no longer under the pointer.

Next, I update the tile position and reparent it to a new element. When the element appears again, potentially under the cursor, both firefox and opera detect this as onmouseover event. Konqueror does not; it is necessary to leave the element before the onmouseover will trigger. In case of Opera, it is necessary to move the mouse a little (still staying on top of the element) before the onmouseover will fire; on firefox it fires shortly after the element appeared again on its own.

I'd like to have the following behaviour:

1. parent.removeNode(child) should trigger onmouseout event when the element vanishes from under the pointer.

2. If the element is moved with javascript under the pointer, or appendChild()'ed under the cursor, then onmouseout() should be triggered for elements that are no longer under the pointer due to the new element, while onmouseover() should be triggered for the element that moved under the cursor.
Comment 1 A. Spehr 2008-04-25 22:57:53 UTC
This all seems to be working now in ~4.0.3 rev784777
You have lots of nice commentary, so if I missed something, please reopen.