Changeset 183614 in webkit


Ignore:
Timestamp:
Apr 29, 2015 9:15:11 PM (9 years ago)
Author:
Simon Fraser
Message:

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.
Location:
trunk
Files:
5 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r183612 r183614  
     12015-04-29  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Crash at WebCore::Document::absoluteRegionForEventTargets
     4        https://bugs.webkit.org/show_bug.cgi?id=144426
     5        rdar://problem/20502166
     6
     7        Reviewed by Tim Horton.
     8
     9        Test that disconnects a frame with a wheel event handler then GCs, and one that
     10        disconnects are reconnects. In both case, the parent document should have zero
     11        wheel event handlers registered on it.
     12
     13        * fast/events/wheelevent-in-frame-expected.txt: Added.
     14        * fast/events/wheelevent-in-frame.html: Added.
     15        * fast/events/wheelevent-in-reattached-frame-expected.txt: Added.
     16        * fast/events/wheelevent-in-reattached-frame.html: Added.
     17
    1182015-04-29  Joseph Pecoraro  <pecoraro@apple.com>
    219
  • trunk/Source/WebCore/ChangeLog

    r183613 r183614  
     12015-04-29  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Crash at WebCore::Document::absoluteRegionForEventTargets
     4        https://bugs.webkit.org/show_bug.cgi?id=144426
     5        rdar://problem/20502166
     6
     7        Reviewed by Tim Horton.
     8
     9        When a frame had wheel event handlers, we would register the document itself
     10        as a handler in its parent document. This is problematic, because there's not
     11        code path that removes it when the frame is destroyed.
     12       
     13        It turns out we don't need to do this at all; the non-fast scrollable region
     14        already takes handlers in subframes into account.
     15
     16        Tests: fast/events/wheelevent-in-frame.html
     17               fast/events/wheelevent-in-reattached-frame.html
     18
     19        * dom/Document.cpp:
     20        (WebCore::Document::didAddWheelEventHandler):
     21        (WebCore::Document::didRemoveWheelEventHandler):
     22
    1232015-04-29  Eric Carlson  <eric.carlson@apple.com>
    224
  • trunk/Source/WebCore/dom/Document.cpp

    r183609 r183614  
    59505950    m_wheelEventTargets->add(&node);
    59515951
    5952     if (Document* parent = parentDocument()) {
    5953         parent->didAddWheelEventHandler(*this);
    5954         return;
    5955     }
    5956 
    59575952    wheelEventHandlersChanged();
    59585953
     
    59795974    if (!removeHandlerFromSet(*m_wheelEventTargets, node, removal))
    59805975        return;
    5981 
    5982     if (Document* parent = parentDocument()) {
    5983         parent->didRemoveWheelEventHandler(*this);
    5984         return;
    5985     }
    59865976
    59875977    wheelEventHandlersChanged();
Note: See TracChangeset for help on using the changeset viewer.