⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 176480 in webkit


Ignore:
Timestamp:
Nov 21, 2014, 3:53:13 PM (12 years ago)
Author:
timothy_horton@apple.com
Message:

REGRESSION (r176415): Can get stuck, unable to invoke any DataDetectors popovers
https://bugs.webkit.org/show_bug.cgi?id=138955
<rdar://problem/19056442>

Reviewed by Anders Carlsson.

  • UIProcess/API/mac/WKView.mm:

(-[WKView mouseDown:]):

  • UIProcess/mac/WKActionMenuController.h:
  • UIProcess/mac/WKActionMenuController.mm:

(-[WKActionMenuController wkView:willHandleMouseDown:]):
(-[WKActionMenuController didCloseMenu:withEvent:]):
(-[WKActionMenuController menuNeedsUpdate:]):
Keep track of whether we have called shouldUseActionsWithContext: on a
DDActionContext; if we get a mouseDown without having seen didCloseMenu:
(and thus don't properly pair the shouldUseActionsWithContext: with a didUseActions),
tear down the old DDActionContext before proceeding.

Location:
trunk/Source/WebKit2
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r176477 r176480  
     12014-11-21  Tim Horton  <timothy_horton@apple.com>
     2
     3        REGRESSION (r176415): Can get stuck, unable to invoke any DataDetectors popovers
     4        https://bugs.webkit.org/show_bug.cgi?id=138955
     5        <rdar://problem/19056442>
     6
     7        Reviewed by Anders Carlsson.
     8
     9        * UIProcess/API/mac/WKView.mm:
     10        (-[WKView mouseDown:]):
     11        * UIProcess/mac/WKActionMenuController.h:
     12        * UIProcess/mac/WKActionMenuController.mm:
     13        (-[WKActionMenuController wkView:willHandleMouseDown:]):
     14        (-[WKActionMenuController didCloseMenu:withEvent:]):
     15        (-[WKActionMenuController menuNeedsUpdate:]):
     16        Keep track of whether we have called shouldUseActionsWithContext: on a
     17        DDActionContext; if we get a mouseDown without having seen didCloseMenu:
     18        (and thus don't properly pair the shouldUseActionsWithContext: with a didUseActions),
     19        tear down the old DDActionContext before proceeding.
     20
    1212014-11-21  Tim Horton  <timothy_horton@apple.com>
    222
  • trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm

    r176462 r176480  
    12571257    [self _setMouseDownEvent:event];
    12581258    _data->_ignoringMouseDraggedEvents = NO;
     1259    [_data->_actionMenuController wkView:self willHandleMouseDown:event];
    12591260    [self mouseDownInternal:event];
    12601261}
  • trunk/Source/WebKit2/UIProcess/mac/WKActionMenuController.h

    r176429 r176480  
    6969    BOOL _isShowingTextIndicator;
    7070    BOOL _shouldKeepPreviewPopoverOpen;
     71    BOOL _hasActivatedActionContext;
    7172
    7273#if WK_API_ENABLED
     
    8384- (void)willOpenMenu:(NSMenu *)menu withEvent:(NSEvent *)event;
    8485- (void)didCloseMenu:(NSMenu *)menu withEvent:(NSEvent *)event;
     86- (void)wkView:(WKView *)wkView willHandleMouseDown:(NSEvent *)event;
    8587
    8688- (void)didPerformActionMenuHitTest:(const WebKit::ActionMenuHitTestResult&)hitTestResult userData:(API::Object*)userData;
  • trunk/Source/WebKit2/UIProcess/mac/WKActionMenuController.mm

    r176477 r176480  
    164164}
    165165
     166- (void)wkView:(WKView *)wkView willHandleMouseDown:(NSEvent *)event
     167{
     168    if (_type == kWKActionMenuDataDetectedItem && _currentActionContext && _hasActivatedActionContext) {
     169        [getDDActionsManagerClass() didUseActions];
     170        _hasActivatedActionContext = NO;
     171    }
     172}
     173
    166174- (void)prepareForMenu:(NSMenu *)menu withEvent:(NSEvent *)event
    167175{
     
    233241        return;
    234242
    235     if (_type == kWKActionMenuDataDetectedItem) {
    236         if (_currentActionContext)
    237             [getDDActionsManagerClass() didUseActions];
     243    if (_type == kWKActionMenuDataDetectedItem && _currentActionContext && _hasActivatedActionContext) {
     244        [getDDActionsManagerClass() didUseActions];
     245        _hasActivatedActionContext = NO;
    238246    }
    239247
     
    780788        [self _updateActionMenuItems];
    781789
    782     if (_type == kWKActionMenuDataDetectedItem && _currentActionContext && ![getDDActionsManagerClass() shouldUseActionsWithContext:_currentActionContext.get()]) {
    783         [menu cancelTracking];
    784         [menu removeAllItems];
     790    if (_type == kWKActionMenuDataDetectedItem && _currentActionContext) {
     791        _hasActivatedActionContext = YES;
     792        if (![getDDActionsManagerClass() shouldUseActionsWithContext:_currentActionContext.get()]) {
     793            [menu cancelTracking];
     794            [menu removeAllItems];
     795        }
    785796    }
    786797}
Note: See TracChangeset for help on using the changeset viewer.