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

Changeset 176570 in webkit


Ignore:
Timestamp:
Nov 28, 2014, 2:10:24 PM (12 years ago)
Author:
timothy_horton@apple.com
Message:

Stale userData is handed to WKView _actionMenuItemsForHitTestResult under prepareForMenu
https://bugs.webkit.org/show_bug.cgi?id=139069
<rdar://problem/19075587>

Reviewed by Sam Weinig.

  • UIProcess/mac/WKActionMenuController.mm:

(-[WKActionMenuController wkView:willHandleMouseDown:]):
(-[WKActionMenuController didCloseMenu:withEvent:]):
(-[WKActionMenuController _clearActionMenuState]):
Previously, _userData was not being cleared in didCloseMenu, so a subsequent
action menu invocation would end up sending stale userData to _actionMenuItemsForHitTestResult.

Additionally, factor all of the cleanup code out into _clearActionMenuState,
and call it from both wkView:willHandleMouseDown: and didCloseMenu:withEvent:.

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r176569 r176570  
     12014-11-28  Tim Horton  <timothy_horton@apple.com>
     2
     3        Stale userData is handed to WKView _actionMenuItemsForHitTestResult under prepareForMenu
     4        https://bugs.webkit.org/show_bug.cgi?id=139069
     5        <rdar://problem/19075587>
     6
     7        Reviewed by Sam Weinig.
     8
     9        * UIProcess/mac/WKActionMenuController.mm:
     10        (-[WKActionMenuController wkView:willHandleMouseDown:]):
     11        (-[WKActionMenuController didCloseMenu:withEvent:]):
     12        (-[WKActionMenuController _clearActionMenuState]):
     13        Previously, _userData was not being cleared in didCloseMenu, so a subsequent
     14        action menu invocation would end up sending stale userData to _actionMenuItemsForHitTestResult.
     15
     16        Additionally, factor all of the cleanup code out into _clearActionMenuState,
     17        and call it from both wkView:willHandleMouseDown: and didCloseMenu:withEvent:.
     18
    1192014-11-26  Timothy Horton  <timothy_horton@apple.com>
    220
  • trunk/Source/WebKit2/UIProcess/mac/WKActionMenuController.mm

    r176511 r176570  
    6464- (void)_showTextIndicator;
    6565- (void)_hideTextIndicator;
     66- (void)_clearActionMenuState;
    6667@end
    6768
     
    219220- (void)wkView:(WKView *)wkView willHandleMouseDown:(NSEvent *)event
    220221{
    221     if (_type == kWKActionMenuDataDetectedItem && _currentActionContext && _hasActivatedActionContext) {
    222         [getDDActionsManagerClass() didUseActions];
    223         _hasActivatedActionContext = NO;
    224     }
     222    [self _clearActionMenuState];
    225223}
    226224
     
    294292        return;
    295293
     294    [_previewPopover setBehavior:NSPopoverBehaviorTransient];
     295    if (!_shouldKeepPreviewPopoverOpen)
     296        [self _clearPreviewPopover];
     297
     298    [self _clearActionMenuState];
     299}
     300
     301- (void)_clearActionMenuState
     302{
    296303    if (_type == kWKActionMenuDataDetectedItem && _currentActionContext && _hasActivatedActionContext) {
    297304        [getDDActionsManagerClass() didUseActions];
    298305        _hasActivatedActionContext = NO;
    299306    }
    300 
    301     [_previewPopover setBehavior:NSPopoverBehaviorTransient];
    302     if (!_shouldKeepPreviewPopoverOpen)
    303         [self _clearPreviewPopover];
    304307
    305308    _state = ActionMenuState::None;
     
    308311    _sharingServicePicker = nil;
    309312    _currentActionContext = nil;
     313    _userData = nil;
    310314}
    311315
Note: See TracChangeset for help on using the changeset viewer.