Changeset 214649 in webkit


Ignore:
Timestamp:
Mar 30, 2017, 7:08:07 PM (8 years ago)
Author:
Simon Fraser
Message:

Ensure that Node::willBeDeletedFrom() always removes touch event handlers from the document
https://bugs.webkit.org/show_bug.cgi?id=170323
rdar://problem/23647630

Reviewed by Chris Dumez.

There are two instances where nodes are registered as touch event handlers without
having normal touch event listeners: slider thumb elements, and elements with overflow scrolling,
on iOS.

For such nodes, hasEventTargetData() will be false, but we want to ensure
that they are removed from the Document's touchEventHandler set, so move the
call to document.removeTouchEventHandler() outside of the conditional block.

This should be cheap in most cases when the touchEventHandler is empty.

  • dom/Node.cpp:

(WebCore::Node::willBeDeletedFrom):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r214648 r214649  
     12017-03-30  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Ensure that Node::willBeDeletedFrom() always removes touch event handlers from the document
     4        https://bugs.webkit.org/show_bug.cgi?id=170323
     5        rdar://problem/23647630
     6
     7        Reviewed by Chris Dumez.
     8
     9        There are two instances where nodes are registered as touch event handlers without
     10        having normal touch event listeners: slider thumb elements, and elements with overflow scrolling,
     11        on iOS.
     12
     13        For such nodes, hasEventTargetData() will be false, but we want to ensure
     14        that they are removed from the Document's touchEventHandler set, so move the
     15        call to document.removeTouchEventHandler() outside of the conditional block.
     16
     17        This should be cheap in most cases when the touchEventHandler is empty.
     18
     19        * dom/Node.cpp:
     20        (WebCore::Node::willBeDeletedFrom):
     21
    1222017-03-30  Simon Fraser  <simon.fraser@apple.com>
    223
  • trunk/Source/WebCore/dom/Node.cpp

    r214648 r214649  
    310310#if ENABLE(TOUCH_EVENTS) && PLATFORM(IOS)
    311311        document.removeTouchEventListener(this, true);
    312         document.removeTouchEventHandler(this, true);
    313312#else
    314313        // FIXME: This should call didRemoveTouchEventHandler().
    315314#endif
    316315    }
     316
     317#if ENABLE(TOUCH_EVENTS) && PLATFORM(IOS)
     318    document.removeTouchEventHandler(this, true);
     319#endif
    317320
    318321    if (AXObjectCache* cache = document.existingAXObjectCache())
Note: See TracChangeset for help on using the changeset viewer.