Title: [183021] trunk/Source
Revision
183021
Author
bda...@apple.com
Date
2015-04-20 12:03:00 -0700 (Mon, 20 Apr 2015)

Log Message

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.

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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (183020 => 183021)


--- trunk/Source/WebCore/ChangeLog	2015-04-20 18:48:41 UTC (rev 183020)
+++ trunk/Source/WebCore/ChangeLog	2015-04-20 19:03:00 UTC (rev 183021)
@@ -1,3 +1,37 @@
+2015-04-20  Beth Dakin  <bda...@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.fra...@apple.com>
 
         Setting inline style to the same value it already has triggers a style recalc

Modified: trunk/Source/WebCore/dom/Document.cpp (183020 => 183021)


--- trunk/Source/WebCore/dom/Document.cpp	2015-04-20 18:48:41 UTC (rev 183020)
+++ trunk/Source/WebCore/dom/Document.cpp	2015-04-20 19:03:00 UTC (rev 183021)
@@ -4020,10 +4020,6 @@
         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&)

Modified: trunk/Source/WebCore/dom/Document.h (183020 => 183021)


--- trunk/Source/WebCore/dom/Document.h	2015-04-20 18:48:41 UTC (rev 183020)
+++ trunk/Source/WebCore/dom/Document.h	2015-04-20 19:03:00 UTC (rev 183021)
@@ -775,9 +775,7 @@
         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); }

Modified: trunk/Source/WebCore/dom/Document.idl (183020 => 183021)


--- trunk/Source/WebCore/dom/Document.idl	2015-04-20 18:48:41 UTC (rev 183020)
+++ trunk/Source/WebCore/dom/Document.idl	2015-04-20 19:03:00 UTC (rev 183021)
@@ -301,9 +301,7 @@
     [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;

Modified: trunk/Source/WebCore/dom/Element.cpp (183020 => 183021)


--- trunk/Source/WebCore/dom/Element.cpp	2015-04-20 18:48:41 UTC (rev 183020)
+++ trunk/Source/WebCore/dom/Element.cpp	2015-04-20 19:03:00 UTC (rev 183021)
@@ -2260,53 +2260,11 @@
         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)

Modified: trunk/Source/WebCore/dom/Element.h (183020 => 183021)


--- trunk/Source/WebCore/dom/Element.h	2015-04-20 18:48:41 UTC (rev 183020)
+++ trunk/Source/WebCore/dom/Element.h	2015-04-20 19:03:00 UTC (rev 183021)
@@ -469,8 +469,6 @@
     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);

Modified: trunk/Source/WebCore/dom/Element.idl (183020 => 183021)


--- trunk/Source/WebCore/dom/Element.idl	2015-04-20 18:48:41 UTC (rev 183020)
+++ trunk/Source/WebCore/dom/Element.idl	2015-04-20 19:03:00 UTC (rev 183021)
@@ -258,9 +258,7 @@
     [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;

Modified: trunk/Source/WebCore/dom/EventNames.h (183020 => 183021)


--- trunk/Source/WebCore/dom/EventNames.h	2015-04-20 18:48:41 UTC (rev 183020)
+++ trunk/Source/WebCore/dom/EventNames.h	2015-04-20 19:03:00 UTC (rev 183021)
@@ -233,9 +233,7 @@
     macro(webkitkeyadded) \
     macro(webkitkeyerror) \
     macro(webkitkeymessage) \
-    macro(webkitmouseforcecancelled) \
     macro(webkitmouseforcechanged) \
-    macro(webkitmouseforceclick) \
     macro(webkitmouseforcedown) \
     macro(webkitmouseforcewillbegin) \
     macro(webkitmouseforceup) \

Modified: trunk/Source/WebCore/html/HTMLAttributeNames.in (183020 => 183021)


--- trunk/Source/WebCore/html/HTMLAttributeNames.in	2015-04-20 18:48:41 UTC (rev 183020)
+++ trunk/Source/WebCore/html/HTMLAttributeNames.in	2015-04-20 19:03:00 UTC (rev 183021)
@@ -270,9 +270,7 @@
 onwebkitkeyadded
 onwebkitkeyerror
 onwebkitkeymessage
-onwebkitmouseforcecancelled
 onwebkitmouseforcechanged
-onwebkitmouseforceclick
 onwebkitmouseforcedown
 onwebkitmouseforceup
 onwebkitmouseforcewillbegin

Modified: trunk/Source/WebCore/html/HTMLBodyElement.cpp (183020 => 183021)


--- trunk/Source/WebCore/html/HTMLBodyElement.cpp	2015-04-20 18:48:41 UTC (rev 183020)
+++ trunk/Source/WebCore/html/HTMLBodyElement.cpp	2015-04-20 19:03:00 UTC (rev 183021)
@@ -123,9 +123,7 @@
         &onscrollAttr,
         &onstorageAttr,
         &onunloadAttr,
-        &onwebkitmouseforcecancelledAttr,
         &onwebkitmouseforcechangedAttr,
-        &onwebkitmouseforceclickAttr,
         &onwebkitmouseforcedownAttr,
         &onwebkitmouseforceupAttr,
         &onwebkitmouseforcewillbeginAttr,

Modified: trunk/Source/WebCore/html/HTMLBodyElement.idl (183020 => 183021)


--- trunk/Source/WebCore/html/HTMLBodyElement.idl	2015-04-20 18:48:41 UTC (rev 183020)
+++ trunk/Source/WebCore/html/HTMLBodyElement.idl	2015-04-20 19:03:00 UTC (rev 183021)
@@ -45,9 +45,7 @@
     [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;

Modified: trunk/Source/WebCore/html/HTMLElement.cpp (183020 => 183021)


--- trunk/Source/WebCore/html/HTMLElement.cpp	2015-04-20 18:48:41 UTC (rev 183020)
+++ trunk/Source/WebCore/html/HTMLElement.cpp	2015-04-20 19:03:00 UTC (rev 183021)
@@ -337,9 +337,7 @@
         &onwebkitkeyaddedAttr,
         &onwebkitkeyerrorAttr,
         &onwebkitkeymessageAttr,
-        &onwebkitmouseforcecancelledAttr,
         &onwebkitmouseforcechangedAttr,
-        &onwebkitmouseforceclickAttr,
         &onwebkitmouseforcedownAttr,
         &onwebkitmouseforcewillbeginAttr,
         &onwebkitmouseforceupAttr,

Modified: trunk/Source/WebCore/page/DOMWindow.idl (183020 => 183021)


--- trunk/Source/WebCore/page/DOMWindow.idl	2015-04-20 18:48:41 UTC (rev 183020)
+++ trunk/Source/WebCore/page/DOMWindow.idl	2015-04-20 19:03:00 UTC (rev 183021)
@@ -285,9 +285,7 @@
     [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;

Modified: trunk/Source/WebKit2/ChangeLog (183020 => 183021)


--- trunk/Source/WebKit2/ChangeLog	2015-04-20 18:48:41 UTC (rev 183020)
+++ trunk/Source/WebKit2/ChangeLog	2015-04-20 19:03:00 UTC (rev 183021)
@@ -1,3 +1,15 @@
+2015-04-20  Beth Dakin  <bda...@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_hor...@apple.com>
 
         Implement immediate action support for tel: and mailto: URLs

Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm (183020 => 183021)


--- trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm	2015-04-20 18:48:41 UTC (rev 183020)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm	2015-04-20 19:03:00 UTC (rev 183021)
@@ -1149,12 +1149,6 @@
 void WebPage::immediateActionDidCancel()
 {
     m_page->mainFrame().eventHandler().setImmediateActionStage(ImmediateActionStage::ActionCancelled);
-
-    Element* element = m_lastActionMenuHitTestResult.innerElement();
-    if (!element)
-        return;
-
-    element->dispatchMouseForceCancelled();
 }
 
 void WebPage::immediateActionDidComplete()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to