Crash at WebCore::Document::absoluteRegionForEventTargets
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Apr 2015 04:15:11 +0000 (04:15 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Apr 2015 04:15:11 +0000 (04:15 +0000)
commit444a266459136548f432c6d2ef1c8cd079ee1063
tree8e2f15e3d93894cce7fda91523cafa53f3f68686
parent6df2ffd185bac9258096a7090864ea73751d5ab0
Crash at WebCore::Document::absoluteRegionForEventTargets
https://bugs.webkit.org/show_bug.cgi?id=144426
rdar://problem/20502166

Reviewed by Tim Horton.

Source/WebCore:

When a frame had wheel event handlers, we would register the document itself
as a handler in its parent document. This is problematic, because there's not
code path that removes it when the frame is destroyed.

It turns out we don't need to do this at all; the non-fast scrollable region
already takes handlers in subframes into account.

Tests: fast/events/wheelevent-in-frame.html
       fast/events/wheelevent-in-reattached-frame.html

* dom/Document.cpp:
(WebCore::Document::didAddWheelEventHandler):
(WebCore::Document::didRemoveWheelEventHandler):

LayoutTests:

Test that disconnects a frame with a wheel event handler then GCs, and one that
disconnects are reconnects. In both case, the parent document should have zero
wheel event handlers registered on it.

* fast/events/wheelevent-in-frame-expected.txt: Added.
* fast/events/wheelevent-in-frame.html: Added.
* fast/events/wheelevent-in-reattached-frame-expected.txt: Added.
* fast/events/wheelevent-in-reattached-frame.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/events/resources/wheel-event-handler-on-document.html [new file with mode: 0644]
LayoutTests/fast/events/wheelevent-in-frame-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/wheelevent-in-frame.html [new file with mode: 0644]
LayoutTests/fast/events/wheelevent-in-reattached-frame-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/wheelevent-in-reattached-frame.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp