Skip to content
  • adamk@chromium.org's avatar
    Remove redundant TOUCH_LISTENER event type · af87202c
    adamk@chromium.org authored
    https://bugs.webkit.org/show_bug.cgi?id=94524
    
    Reviewed by Ryosuke Niwa.
    
    Source/WebCore:
    
    Code that needs to determine whether there are touch listeners
    can instead call Document::touchEventHandlerCount(), added in r107832.
    TOUCH_LISTENER didn't fit very well into the hasListenerType() model
    anyway, as there's not a 1:1 correspondance between the enum value and
    an event.
    
    * dom/Document.cpp:
    (WebCore::Document::addListenerTypeIfNeeded): Remove two bits of code:
    the bookkeeping for TOUCH_LISTENER, and the notification into
    ChromeClient (which is handled by calls to didAddTouchEventHandler in
    all the places that call addListenerTypeIfNeeded).
    (WebCore::Document::didRemoveTouchEventHandler): Remove bookkeeping for TOUCH_LISTENER.
    * dom/Document.h:
    * history/CachedFrame.cpp:
    (WebCore::CachedFrameBase::restore): Call touchEventHandlerCount instead of hasListenerType.
    * html/HTMLInputElement.cpp:
    (WebCore::HTMLInputElement::updateType): ditto
    * page/EventHandler.cpp:
    (WebCore::EventHandler::handleTouchEvent): ditto
    * page/Frame.cpp:
    (WebCore::Frame::setDocument): ditto
    * testing/Internals.cpp: Remove hasTouchEventListener method since its
    data source no longer exists.
    * testing/Internals.h: ditto
    (Internals):
    * testing/Internals.idl: ditto
    
    Source/WebKit/chromium:
    
    * src/WebPluginContainerImpl.cpp:
    (WebKit::WebPluginContainerImpl::setIsAcceptingTouchEvents): Remove
    bookkeeping for TOUCH_LISTENER.
    
    LayoutTests:
    
    Removed tests for hasTouchEventListener as they're redundant
    with tests for touchEventHandlerCount.
    
    * fast/events/touch/touch-handler-count-expected.txt:
    * fast/events/touch/touch-handler-count.html:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126080 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    af87202c