Should remove mouseForceClick and mouseForceCancelled from DOM force events
authorbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 20 Apr 2015 19:03:00 +0000 (19:03 +0000)
committerbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 20 Apr 2015 19:03:00 +0000 (19:03 +0000)
https://bugs.webkit.org/show_bug.cgi?id=143904
-and corresponding-
rdar://problem/20578842

Reviewed by Dan Bernstein.

Source/WebCore:

After more thought and discussion, we decided to remove mouseForceClick and
mouseForceCancelled from DOM force events. mouseForceClick is confusing and
redundant. mouseForceCancelled is confusing as it is currently implemented, and
all of its functionality can be filled by exisiting events such as mouseup,
mouseout, etc.

* dom/Document.cpp:
(WebCore::Document::addListenerTypeIfNeeded):
* dom/Document.h:
* dom/Document.idl:
* dom/Element.cpp:
(WebCore::Element::dispatchMouseForceWillBegin):
(WebCore::Element::dispatchMouseForceClick): Deleted.
(WebCore::Element::dispatchMouseForceCancelled): Deleted.
* dom/Element.h:
* dom/Element.idl:
* dom/EventNames.h:
* html/HTMLAttributeNames.in:
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::createWindowEventHandlerNameMap):
* html/HTMLBodyElement.idl:
* html/HTMLElement.cpp:
(WebCore::HTMLElement::createEventHandlerNameMap):
* page/DOMWindow.idl:

Source/WebKit2:

* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::immediateActionDidCancel):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183021 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 files changed:
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/dom/Document.idl
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/Element.h
Source/WebCore/dom/Element.idl
Source/WebCore/dom/EventNames.h
Source/WebCore/html/HTMLAttributeNames.in
Source/WebCore/html/HTMLBodyElement.cpp
Source/WebCore/html/HTMLBodyElement.idl
Source/WebCore/html/HTMLElement.cpp
Source/WebCore/page/DOMWindow.idl
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm

index 8120f41..d472142 100644 (file)
@@ -1,3 +1,37 @@
+2015-04-20  Beth Dakin  <bdakin@apple.com>
+
+        Should remove mouseForceClick and mouseForceCancelled from DOM force events
+        https://bugs.webkit.org/show_bug.cgi?id=143904
+        -and corresponding-
+        rdar://problem/20578842
+
+        Reviewed by Dan Bernstein.
+
+        After more thought and discussion, we decided to remove mouseForceClick and 
+        mouseForceCancelled from DOM force events. mouseForceClick is confusing and 
+        redundant. mouseForceCancelled is confusing as it is currently implemented, and 
+        all of its functionality can be filled by exisiting events such as mouseup, 
+        mouseout, etc.
+
+        * dom/Document.cpp:
+        (WebCore::Document::addListenerTypeIfNeeded):
+        * dom/Document.h:
+        * dom/Document.idl:
+        * dom/Element.cpp:
+        (WebCore::Element::dispatchMouseForceWillBegin):
+        (WebCore::Element::dispatchMouseForceClick): Deleted.
+        (WebCore::Element::dispatchMouseForceCancelled): Deleted.
+        * dom/Element.h:
+        * dom/Element.idl:
+        * dom/EventNames.h:
+        * html/HTMLAttributeNames.in:
+        * html/HTMLBodyElement.cpp:
+        (WebCore::HTMLBodyElement::createWindowEventHandlerNameMap):
+        * html/HTMLBodyElement.idl:
+        * html/HTMLElement.cpp:
+        (WebCore::HTMLElement::createEventHandlerNameMap):
+        * page/DOMWindow.idl:
+
 2015-04-20  Simon Fraser  <simon.fraser@apple.com>
 
         Setting inline style to the same value it already has triggers a style recalc
index 1cf2853..a3e63b6 100644 (file)
@@ -4020,10 +4020,6 @@ void Document::addListenerTypeIfNeeded(const AtomicString& eventType)
         addListenerType(FORCEDOWN_LISTENER);
     else if (eventType == eventNames().webkitmouseforceupEvent)
         addListenerType(FORCEUP_LISTENER);
-    else if (eventType == eventNames().webkitmouseforceclickEvent)
-        addListenerType(FORCECLICK_LISTENER);
-    else if (eventType == eventNames().webkitmouseforcecancelledEvent)
-        addListenerType(FORCECANCELLED_LISTENER);
 }
 
 CSSStyleDeclaration* Document::getOverrideStyle(Element*, const String&)
index e39a7a4..0b9e68c 100644 (file)
@@ -775,9 +775,7 @@ public:
         FORCEWILLBEGIN_LISTENER              = 1 << 13,
         FORCECHANGED_LISTENER                = 1 << 14,
         FORCEDOWN_LISTENER                   = 1 << 15,
-        FORCEUP_LISTENER                     = 1 << 16,
-        FORCECLICK_LISTENER                  = 1 << 17,
-        FORCECANCELLED_LISTENER              = 1 << 18
+        FORCEUP_LISTENER                     = 1 << 16
     };
 
     bool hasListenerType(ListenerType listenerType) const { return (m_listenerTypes & listenerType); }
index db3bd89..4bb6be5 100644 (file)
     [NotEnumerable, Conditional=WILL_REVEAL_EDGE_EVENTS] attribute EventHandler onwebkitwillrevealright;
     [NotEnumerable, Conditional=WILL_REVEAL_EDGE_EVENTS] attribute EventHandler onwebkitwillrevealtop;
 
-    [NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforcecancelled;
     [NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforcechanged;
-    [NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforceclick;
     [NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforcedown;
     [NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforceup;
     [NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforcewillbegin;
index cb5b442..fd1adea 100644 (file)
@@ -2260,53 +2260,11 @@ bool Element::dispatchMouseForceWillBegin()
         return true;
     return false;
 }
-
-void Element::dispatchMouseForceClick()
-{
-    if (!document().hasListenerType(Document::FORCECLICK_LISTENER))
-        return;
-
-    Frame* frame = document().frame();
-    if (!frame)
-        return;
-
-    PlatformMouseEvent platformMouseEvent(frame->eventHandler().lastKnownMousePosition(), frame->eventHandler().lastKnownMouseGlobalPosition(), NoButton, PlatformEvent::NoType, 1, false, false, false, false, WTF::currentTime(), ForceAtForceClick);
-    RefPtr<MouseEvent> mouseForceClickEvent =  MouseEvent::create(eventNames().webkitmouseforceclickEvent, document().defaultView(), platformMouseEvent, 0, nullptr);
-
-    mouseForceClickEvent->setTarget(this);
-    dispatchEvent(mouseForceClickEvent);
-}
-
-void Element::dispatchMouseForceCancelled()
-{
-    if (!document().hasListenerType(Document::FORCECANCELLED_LISTENER))
-        return;
-
-    Frame* frame = document().frame();
-    if (!frame)
-        return;
-
-    PlatformMouseEvent platformMouseEvent(frame->eventHandler().lastKnownMousePosition(), frame->eventHandler().lastKnownMouseGlobalPosition(), NoButton, PlatformEvent::NoType, 1, false, false, false, false, WTF::currentTime(), 0);
-    RefPtr<MouseEvent> mouseForceCancelledEvent =  MouseEvent::create(eventNames().webkitmouseforcecancelledEvent, document().defaultView(), platformMouseEvent, 0, nullptr);
-
-    mouseForceCancelledEvent->setTarget(this);
-    dispatchEvent(mouseForceCancelledEvent);
-}
-
-#else // #if ENABLE(MOUSE_FORCE_EVENTS)
-
+#else
 bool Element::dispatchMouseForceWillBegin()
 {
     return false;
 }
-
-void Element::dispatchMouseForceClick()
-{
-}
-
-void Element::dispatchMouseForceCancelled()
-{
-}
 #endif // #if ENABLE(MOUSE_FORCE_EVENTS)
 
 void Element::mergeWithNextTextNode(Text& node, ExceptionCode& ec)
index 3b073d9..dbf3b6c 100644 (file)
@@ -469,8 +469,6 @@ public:
     virtual void dispatchBlurEvent(RefPtr<Element>&& newFocusedElement);
 
     WEBCORE_EXPORT bool dispatchMouseForceWillBegin();
-    WEBCORE_EXPORT void dispatchMouseForceClick();
-    WEBCORE_EXPORT void dispatchMouseForceCancelled();
 
     virtual bool willRecalcStyle(Style::Change);
     virtual void didRecalcStyle(Style::Change);
index 317eea5..b84c886 100644 (file)
     [NotEnumerable, Conditional=WILL_REVEAL_EDGE_EVENTS] attribute EventHandler onwebkitwillrevealright;
     [NotEnumerable, Conditional=WILL_REVEAL_EDGE_EVENTS] attribute EventHandler onwebkitwillrevealtop;
 
-    [NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforcecancelled;
     [NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforcechanged;
-    [NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforceclick;
     [NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforcedown;
     [NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforcewillbegin;
     [NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforceup;
index 545e16e..220e0fc 100644 (file)
@@ -233,9 +233,7 @@ namespace WebCore {
     macro(webkitkeyadded) \
     macro(webkitkeyerror) \
     macro(webkitkeymessage) \
-    macro(webkitmouseforcecancelled) \
     macro(webkitmouseforcechanged) \
-    macro(webkitmouseforceclick) \
     macro(webkitmouseforcedown) \
     macro(webkitmouseforcewillbegin) \
     macro(webkitmouseforceup) \
index abfd669..0a321eb 100644 (file)
@@ -270,9 +270,7 @@ onwebkitfullscreenerror
 onwebkitkeyadded
 onwebkitkeyerror
 onwebkitkeymessage
-onwebkitmouseforcecancelled
 onwebkitmouseforcechanged
-onwebkitmouseforceclick
 onwebkitmouseforcedown
 onwebkitmouseforceup
 onwebkitmouseforcewillbegin
index 6d47691..4df6e2b 100644 (file)
@@ -123,9 +123,7 @@ HTMLElement::EventHandlerNameMap HTMLBodyElement::createWindowEventHandlerNameMa
         &onscrollAttr,
         &onstorageAttr,
         &onunloadAttr,
-        &onwebkitmouseforcecancelledAttr,
         &onwebkitmouseforcechangedAttr,
-        &onwebkitmouseforceclickAttr,
         &onwebkitmouseforcedownAttr,
         &onwebkitmouseforceupAttr,
         &onwebkitmouseforcewillbeginAttr,
index 5971335..124325e 100644 (file)
@@ -45,9 +45,7 @@ interface HTMLBodyElement : HTMLElement {
     [NotEnumerable, WindowEventHandler] attribute EventHandler onstorage;
     [NotEnumerable, WindowEventHandler] attribute EventHandler onunload;
 
-    [NotEnumerable, WindowEventHandler, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforcecancelled;
     [NotEnumerable, WindowEventHandler, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforcechanged;
-    [NotEnumerable, WindowEventHandler, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforceclick;
     [NotEnumerable, WindowEventHandler, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforcedown;
     [NotEnumerable, WindowEventHandler, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforcewillbegin;
     [NotEnumerable, WindowEventHandler, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforceup;
index ae2c5df..a661237 100644 (file)
@@ -337,9 +337,7 @@ HTMLElement::EventHandlerNameMap HTMLElement::createEventHandlerNameMap()
         &onwebkitkeyaddedAttr,
         &onwebkitkeyerrorAttr,
         &onwebkitkeymessageAttr,
-        &onwebkitmouseforcecancelledAttr,
         &onwebkitmouseforcechangedAttr,
-        &onwebkitmouseforceclickAttr,
         &onwebkitmouseforcedownAttr,
         &onwebkitmouseforcewillbeginAttr,
         &onwebkitmouseforceupAttr,
index 2a0b2fa..87bf07b 100644 (file)
     [NotEnumerable, Conditional=WILL_REVEAL_EDGE_EVENTS] attribute EventHandler onwebkitwillrevealright;
     [NotEnumerable, Conditional=WILL_REVEAL_EDGE_EVENTS] attribute EventHandler onwebkitwillrevealtop;
 
-    [NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforcecancelled;
     [NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforcechanged;
-    [NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforceclick;
     [NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforcedown;
     [NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforceup;
     [NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforcewillbegin;
index fa8216b..d095553 100644 (file)
@@ -1,3 +1,15 @@
+2015-04-20  Beth Dakin  <bdakin@apple.com>
+
+        Should remove mouseForceClick and mouseForceCancelled from DOM force events
+        https://bugs.webkit.org/show_bug.cgi?id=143904
+        -and corresponding-
+        rdar://problem/20578842
+
+        Reviewed by Dan Bernstein.
+
+        * WebProcess/WebPage/mac/WebPageMac.mm:
+        (WebKit::WebPage::immediateActionDidCancel):
+
 2015-04-20  Tim Horton  <timothy_horton@apple.com>
 
         Implement immediate action support for tel: and mailto: URLs
index 44243a7..e0648da 100644 (file)
@@ -1149,12 +1149,6 @@ void WebPage::immediateActionDidUpdate()
 void WebPage::immediateActionDidCancel()
 {
     m_page->mainFrame().eventHandler().setImmediateActionStage(ImmediateActionStage::ActionCancelled);
-
-    Element* element = m_lastActionMenuHitTestResult.innerElement();
-    if (!element)
-        return;
-
-    element->dispatchMouseForceCancelled();
 }
 
 void WebPage::immediateActionDidComplete()