Changeset 175635 in webkit


Ignore:
Timestamp:
Nov 5, 2014 12:48:37 PM (9 years ago)
Author:
commit-queue@webkit.org
Message:

Disable action menus on page previews
https://bugs.webkit.org/show_bug.cgi?id=138431

Patch by Conrad Shultz <Conrad Shultz> on 2014-11-05
Reviewed by Anders Carlsson.

  • UIProcess/API/mac/WKView.mm:

(-[WKView _shouldIgnoreMouseEvents]):
Renamed from -shouldIgnoreMouseEvents since this isn't actually public.
(-[WKView swipeWithEvent:]):
(-[WKView mouseMoved:]):
(-[WKView mouseDown:]):
(-[WKView mouseUp:]):
(-[WKView mouseDragged:]):
Updated to reflect method rename.
(-[WKView shouldIgnoreMouseEvents]): Deleted.

  • UIProcess/API/mac/WKViewInternal.h:

Expose -_shouldIgnoreMouseEvents.

  • UIProcess/mac/WKActionMenuController.mm:

(-[WKActionMenuController prepareForMenu:withEvent:]):
Cancel the menu if the presenting WKView should ignore mouse events.

Location:
trunk/Source/WebKit2
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r175632 r175635  
     12014-11-05  Conrad Shultz  <conrad_shultz@apple.com>
     2
     3        Disable action menus on page previews
     4        https://bugs.webkit.org/show_bug.cgi?id=138431
     5
     6        Reviewed by Anders Carlsson.
     7
     8        * UIProcess/API/mac/WKView.mm:
     9        (-[WKView _shouldIgnoreMouseEvents]):
     10        Renamed from -shouldIgnoreMouseEvents since this isn't actually public.
     11        (-[WKView swipeWithEvent:]):
     12        (-[WKView mouseMoved:]):
     13        (-[WKView mouseDown:]):
     14        (-[WKView mouseUp:]):
     15        (-[WKView mouseDragged:]):
     16        Updated to reflect method rename.
     17        (-[WKView shouldIgnoreMouseEvents]): Deleted.
     18
     19        * UIProcess/API/mac/WKViewInternal.h:
     20        Expose -_shouldIgnoreMouseEvents.
     21
     22        * UIProcess/mac/WKActionMenuController.mm:
     23        (-[WKActionMenuController prepareForMenu:withEvent:]):
     24        Cancel the menu if the presenting WKView should ignore mouse events.
     25
    1262014-11-05  Beth Dakin  <bdakin@apple.com>
    227
  • trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm

    r175630 r175635  
    10971097// Events
    10981098
    1099 - (BOOL)shouldIgnoreMouseEvents
     1099- (BOOL)_shouldIgnoreMouseEvents
    11001100{
    11011101    // FIXME: This check is surprisingly specific. Are there any other cases where we need to block mouse events?
     
    11521152    - (void)Selector:(NSEvent *)theEvent \
    11531153    { \
    1154         if ([self shouldIgnoreMouseEvents]) \
     1154        if (self._shouldIgnoreMouseEvents) \
    11551155            return; \
    11561156        if (NSTextInputContext *context = [self inputContext]) { \
     
    11721172    - (void)Selector:(NSEvent *)theEvent \
    11731173    { \
    1174         if ([self shouldIgnoreMouseEvents]) \
     1174        if (self._shouldIgnoreMouseEvents) \
    11751175            return; \
    11761176        if ([[self inputContext] handleEvent:theEvent]) { \
     
    12241224- (void)swipeWithEvent:(NSEvent *)event
    12251225{
    1226     if ([self shouldIgnoreMouseEvents])
     1226    if (self._shouldIgnoreMouseEvents)
    12271227        return;
    12281228
     
    12421242- (void)mouseMoved:(NSEvent *)event
    12431243{
    1244     if ([self shouldIgnoreMouseEvents])
     1244    if (self._shouldIgnoreMouseEvents)
    12451245        return;
    12461246
     
    12541254- (void)mouseDown:(NSEvent *)event
    12551255{
    1256     if ([self shouldIgnoreMouseEvents])
     1256    if (self._shouldIgnoreMouseEvents)
    12571257        return;
    12581258
     
    12641264- (void)mouseUp:(NSEvent *)event
    12651265{
    1266     if ([self shouldIgnoreMouseEvents])
     1266    if (self._shouldIgnoreMouseEvents)
    12671267        return;
    12681268
     
    12731273- (void)mouseDragged:(NSEvent *)event
    12741274{
    1275     if ([self shouldIgnoreMouseEvents])
     1275    if (self._shouldIgnoreMouseEvents)
    12761276        return;
    12771277
  • trunk/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h

    r175610 r175635  
    110110- (BOOL)_suppressVisibilityUpdates;
    111111
     112- (BOOL)_shouldIgnoreMouseEvents;
     113
    112114- (void)_didFirstVisuallyNonEmptyLayoutForMainFrame;
    113115- (void)_didFinishLoadForMainFrame;
  • trunk/Source/WebKit2/UIProcess/mac/WKActionMenuController.mm

    r175632 r175635  
    142142        return;
    143143
     144    if (_wkView._shouldIgnoreMouseEvents) {
     145        [menu cancelTracking];
     146        return;
     147    }
     148
    144149    _page->performActionMenuHitTestAtLocation([_wkView convertPoint:event.locationInWindow fromView:nil]);
    145150
Note: See TracChangeset for help on using the changeset viewer.