RESOLVED FIXED 148384
Wheel events stop propagating when target element is removed from DOM
https://bugs.webkit.org/show_bug.cgi?id=148384
Summary Wheel events stop propagating when target element is removed from DOM
Brent Fulgham
Reported 2015-08-24 11:57:06 PDT
When listening to the ‘wheel’ or ‘mousewheel’ event on the document, if the event’s original target element is removed from the DOM the wheel event is no longer dispatched. 1. Add a listener for ‘wheel’ on the document that removes the target of the event from the DOM. Have this happen after the element moves a specific amount or a certain number of events is received. 2. Scroll on the page (over the relevant element) 3. Keep scrolling You will observe that the DOM event is no longer dispatched.
Attachments
Patch (2.54 KB, patch)
2015-08-24 12:01 PDT, Brent Fulgham
no flags
Patch (3.57 KB, patch)
2015-08-24 15:46 PDT, Brent Fulgham
no flags
Patch (11.22 KB, patch)
2015-08-24 17:35 PDT, Brent Fulgham
hyatt: review+
Brent Fulgham
Comment 1 2015-08-24 11:57:48 PDT
Brent Fulgham
Comment 2 2015-08-24 12:01:31 PDT
Tim Horton
Comment 3 2015-08-24 12:08:02 PDT
Comment on attachment 259762 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=259762&action=review > Source/WebCore/page/mac/EventHandlerMac.mm:919 > + return false; Frames can be removed... > Source/WebCore/page/mac/EventHandlerMac.mm:922 > + return true; Anonymous nodes can't be scrollable? (probably true) > Source/WebCore/page/mac/EventHandlerMac.mm:925 > + return true; What if a node is moved around in the DOM? (removed and reinserted before we get here) Is that OK?
Brent Fulgham
Comment 4 2015-08-24 14:00:15 PDT
Comment on attachment 259762 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=259762&action=review >> Source/WebCore/page/mac/EventHandlerMac.mm:925 >> + return true; > > What if a node is moved around in the DOM? (removed and reinserted before we get here) Is that OK? It does seem like it would be a problem if we removed a node from one scrolling container, and inserted it into a new location. In that case, even with this code, we would start our event handling with this "migrated" node. Maybe it would be better to just break the caching state in Element::removedFrom.
Brent Fulgham
Comment 5 2015-08-24 15:46:01 PDT
Brent Fulgham
Comment 6 2015-08-24 17:35:06 PDT
Dave Hyatt
Comment 7 2015-08-25 10:54:02 PDT
Comment on attachment 259797 [details] Patch r=me
Brent Fulgham
Comment 8 2015-08-25 11:03:12 PDT
Note You need to log in before you can comment on or make changes to this bug.