Force events should not require preventDefault in order to fire
authorbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Apr 2015 18:25:25 +0000 (18:25 +0000)
committerbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Apr 2015 18:25:25 +0000 (18:25 +0000)
commitbd28bdf7e0fa26504421cc16b255e1f45f86125c
treeb3d3170b443d9c755c4037fbb4a01e709011d8a4
parent5d77fc62a1ca9b8527d72e958ee2c50497ca3641
Force events should not require preventDefault in order to fire
https://bugs.webkit.org/show_bug.cgi?id=143503
-and corresponding-
rdar://problem/20458916

Reviewed by Tim Horton.

Source/WebCore:

Since these events will fire whether or not preventDefault was set on the
willBegin event, we should make sure we only send them when there are registered
event listeners. These are new events, so we don’t want to spam the vast majority
of web content that doesn’t use them yet.
* dom/Document.cpp:
(WebCore::Document::addListenerTypeIfNeeded):
* dom/Document.h:
* dom/Element.cpp:
(WebCore::Element::dispatchMouseForceWillBegin):
(WebCore::Element::dispatchMouseForceChanged):
(WebCore::Element::dispatchMouseForceDown):
(WebCore::Element::dispatchMouseForceUp):
(WebCore::Element::dispatchMouseForceClick):
(WebCore::Element::dispatchMouseForceCancelled):

Source/WebKit2:

We no longer need m_lastActionMenuHitTestPreventsDefault since we’ll always
dispatch the events to Element.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performActionMenuHitTestAtLocation):
(WebKit::WebPage::inputDeviceForceDidChange):
(WebKit::WebPage::immediateActionDidCancel):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@182556 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/dom/Element.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm