Changeset 183021 in webkit


Ignore:
Timestamp:
Apr 20, 2015 12:03:00 PM (9 years ago)
Author:
Beth Dakin
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):

Location:
trunk/Source
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r183017 r183021  
     12015-04-20  Beth Dakin  <bdakin@apple.com>
     2
     3        Should remove mouseForceClick and mouseForceCancelled from DOM force events
     4        https://bugs.webkit.org/show_bug.cgi?id=143904
     5        -and corresponding-
     6        rdar://problem/20578842
     7
     8        Reviewed by Dan Bernstein.
     9
     10        After more thought and discussion, we decided to remove mouseForceClick and
     11        mouseForceCancelled from DOM force events. mouseForceClick is confusing and
     12        redundant. mouseForceCancelled is confusing as it is currently implemented, and
     13        all of its functionality can be filled by exisiting events such as mouseup,
     14        mouseout, etc.
     15
     16        * dom/Document.cpp:
     17        (WebCore::Document::addListenerTypeIfNeeded):
     18        * dom/Document.h:
     19        * dom/Document.idl:
     20        * dom/Element.cpp:
     21        (WebCore::Element::dispatchMouseForceWillBegin):
     22        (WebCore::Element::dispatchMouseForceClick): Deleted.
     23        (WebCore::Element::dispatchMouseForceCancelled): Deleted.
     24        * dom/Element.h:
     25        * dom/Element.idl:
     26        * dom/EventNames.h:
     27        * html/HTMLAttributeNames.in:
     28        * html/HTMLBodyElement.cpp:
     29        (WebCore::HTMLBodyElement::createWindowEventHandlerNameMap):
     30        * html/HTMLBodyElement.idl:
     31        * html/HTMLElement.cpp:
     32        (WebCore::HTMLElement::createEventHandlerNameMap):
     33        * page/DOMWindow.idl:
     34
    1352015-04-20  Simon Fraser  <simon.fraser@apple.com>
    236
  • trunk/Source/WebCore/dom/Document.cpp

    r183017 r183021  
    40214021    else if (eventType == eventNames().webkitmouseforceupEvent)
    40224022        addListenerType(FORCEUP_LISTENER);
    4023     else if (eventType == eventNames().webkitmouseforceclickEvent)
    4024         addListenerType(FORCECLICK_LISTENER);
    4025     else if (eventType == eventNames().webkitmouseforcecancelledEvent)
    4026         addListenerType(FORCECANCELLED_LISTENER);
    40274023}
    40284024
  • trunk/Source/WebCore/dom/Document.h

    r183017 r183021  
    776776        FORCECHANGED_LISTENER                = 1 << 14,
    777777        FORCEDOWN_LISTENER                   = 1 << 15,
    778         FORCEUP_LISTENER                     = 1 << 16,
    779         FORCECLICK_LISTENER                  = 1 << 17,
    780         FORCECANCELLED_LISTENER              = 1 << 18
     778        FORCEUP_LISTENER                     = 1 << 16
    781779    };
    782780
  • trunk/Source/WebCore/dom/Document.idl

    r182046 r183021  
    302302    [NotEnumerable, Conditional=WILL_REVEAL_EDGE_EVENTS] attribute EventHandler onwebkitwillrevealtop;
    303303
    304     [NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforcecancelled;
    305304    [NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforcechanged;
    306     [NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforceclick;
    307305    [NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforcedown;
    308306    [NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforceup;
  • trunk/Source/WebCore/dom/Element.cpp

    r182963 r183021  
    22612261    return false;
    22622262}
    2263 
    2264 void Element::dispatchMouseForceClick()
    2265 {
    2266     if (!document().hasListenerType(Document::FORCECLICK_LISTENER))
    2267         return;
    2268 
    2269     Frame* frame = document().frame();
    2270     if (!frame)
    2271         return;
    2272 
    2273     PlatformMouseEvent platformMouseEvent(frame->eventHandler().lastKnownMousePosition(), frame->eventHandler().lastKnownMouseGlobalPosition(), NoButton, PlatformEvent::NoType, 1, false, false, false, false, WTF::currentTime(), ForceAtForceClick);
    2274     RefPtr<MouseEvent> mouseForceClickEvent =  MouseEvent::create(eventNames().webkitmouseforceclickEvent, document().defaultView(), platformMouseEvent, 0, nullptr);
    2275 
    2276     mouseForceClickEvent->setTarget(this);
    2277     dispatchEvent(mouseForceClickEvent);
    2278 }
    2279 
    2280 void Element::dispatchMouseForceCancelled()
    2281 {
    2282     if (!document().hasListenerType(Document::FORCECANCELLED_LISTENER))
    2283         return;
    2284 
    2285     Frame* frame = document().frame();
    2286     if (!frame)
    2287         return;
    2288 
    2289     PlatformMouseEvent platformMouseEvent(frame->eventHandler().lastKnownMousePosition(), frame->eventHandler().lastKnownMouseGlobalPosition(), NoButton, PlatformEvent::NoType, 1, false, false, false, false, WTF::currentTime(), 0);
    2290     RefPtr<MouseEvent> mouseForceCancelledEvent =  MouseEvent::create(eventNames().webkitmouseforcecancelledEvent, document().defaultView(), platformMouseEvent, 0, nullptr);
    2291 
    2292     mouseForceCancelledEvent->setTarget(this);
    2293     dispatchEvent(mouseForceCancelledEvent);
    2294 }
    2295 
    2296 #else // #if ENABLE(MOUSE_FORCE_EVENTS)
    2297 
     2263#else
    22982264bool Element::dispatchMouseForceWillBegin()
    22992265{
    23002266    return false;
    2301 }
    2302 
    2303 void Element::dispatchMouseForceClick()
    2304 {
    2305 }
    2306 
    2307 void Element::dispatchMouseForceCancelled()
    2308 {
    23092267}
    23102268#endif // #if ENABLE(MOUSE_FORCE_EVENTS)
  • trunk/Source/WebCore/dom/Element.h

    r182963 r183021  
    470470
    471471    WEBCORE_EXPORT bool dispatchMouseForceWillBegin();
    472     WEBCORE_EXPORT void dispatchMouseForceClick();
    473     WEBCORE_EXPORT void dispatchMouseForceCancelled();
    474472
    475473    virtual bool willRecalcStyle(Style::Change);
  • trunk/Source/WebCore/dom/Element.idl

    r182046 r183021  
    259259    [NotEnumerable, Conditional=WILL_REVEAL_EDGE_EVENTS] attribute EventHandler onwebkitwillrevealtop;
    260260
    261     [NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforcecancelled;
    262261    [NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforcechanged;
    263     [NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforceclick;
    264262    [NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforcedown;
    265263    [NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforcewillbegin;
  • trunk/Source/WebCore/dom/EventNames.h

    r182141 r183021  
    234234    macro(webkitkeyerror) \
    235235    macro(webkitkeymessage) \
    236     macro(webkitmouseforcecancelled) \
    237236    macro(webkitmouseforcechanged) \
    238     macro(webkitmouseforceclick) \
    239237    macro(webkitmouseforcedown) \
    240238    macro(webkitmouseforcewillbegin) \
  • trunk/Source/WebCore/html/HTMLAttributeNames.in

    r181907 r183021  
    271271onwebkitkeyerror
    272272onwebkitkeymessage
    273 onwebkitmouseforcecancelled
    274273onwebkitmouseforcechanged
    275 onwebkitmouseforceclick
    276274onwebkitmouseforcedown
    277275onwebkitmouseforceup
  • trunk/Source/WebCore/html/HTMLBodyElement.cpp

    r182677 r183021  
    124124        &onstorageAttr,
    125125        &onunloadAttr,
    126         &onwebkitmouseforcecancelledAttr,
    127126        &onwebkitmouseforcechangedAttr,
    128         &onwebkitmouseforceclickAttr,
    129127        &onwebkitmouseforcedownAttr,
    130128        &onwebkitmouseforceupAttr,
  • trunk/Source/WebCore/html/HTMLBodyElement.idl

    r182046 r183021  
    4646    [NotEnumerable, WindowEventHandler] attribute EventHandler onunload;
    4747
    48     [NotEnumerable, WindowEventHandler, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforcecancelled;
    4948    [NotEnumerable, WindowEventHandler, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforcechanged;
    50     [NotEnumerable, WindowEventHandler, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforceclick;
    5149    [NotEnumerable, WindowEventHandler, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforcedown;
    5250    [NotEnumerable, WindowEventHandler, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforcewillbegin;
  • trunk/Source/WebCore/html/HTMLElement.cpp

    r182120 r183021  
    338338        &onwebkitkeyerrorAttr,
    339339        &onwebkitkeymessageAttr,
    340         &onwebkitmouseforcecancelledAttr,
    341340        &onwebkitmouseforcechangedAttr,
    342         &onwebkitmouseforceclickAttr,
    343341        &onwebkitmouseforcedownAttr,
    344342        &onwebkitmouseforcewillbeginAttr,
  • trunk/Source/WebCore/page/DOMWindow.idl

    r182046 r183021  
    286286    [NotEnumerable, Conditional=WILL_REVEAL_EDGE_EVENTS] attribute EventHandler onwebkitwillrevealtop;
    287287
    288     [NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforcecancelled;
    289288    [NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforcechanged;
    290     [NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforceclick;
    291289    [NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforcedown;
    292290    [NotEnumerable, Conditional=MOUSE_FORCE_EVENTS] attribute EventHandler onwebkitmouseforceup;
  • trunk/Source/WebKit2/ChangeLog

    r183019 r183021  
     12015-04-20  Beth Dakin  <bdakin@apple.com>
     2
     3        Should remove mouseForceClick and mouseForceCancelled from DOM force events
     4        https://bugs.webkit.org/show_bug.cgi?id=143904
     5        -and corresponding-
     6        rdar://problem/20578842
     7
     8        Reviewed by Dan Bernstein.
     9
     10        * WebProcess/WebPage/mac/WebPageMac.mm:
     11        (WebKit::WebPage::immediateActionDidCancel):
     12
    1132015-04-20  Tim Horton  <timothy_horton@apple.com>
    214
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm

    r182963 r183021  
    11501150{
    11511151    m_page->mainFrame().eventHandler().setImmediateActionStage(ImmediateActionStage::ActionCancelled);
    1152 
    1153     Element* element = m_lastActionMenuHitTestResult.innerElement();
    1154     if (!element)
    1155         return;
    1156 
    1157     element->dispatchMouseForceCancelled();
    11581152}
    11591153
Note: See TracChangeset for help on using the changeset viewer.