Title: [176570] trunk/Source/WebKit2
- Revision
- 176570
- Author
- [email protected]
- Date
- 2014-11-28 14:10:24 -0800 (Fri, 28 Nov 2014)
Log 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:.
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (176569 => 176570)
--- trunk/Source/WebKit2/ChangeLog 2014-11-28 22:09:01 UTC (rev 176569)
+++ trunk/Source/WebKit2/ChangeLog 2014-11-28 22:10:24 UTC (rev 176570)
@@ -1,3 +1,21 @@
+2014-11-28 Tim Horton <[email protected]>
+
+ 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:.
+
2014-11-26 Timothy Horton <[email protected]>
DataDetectors PageOverlay callbacks are never called
Modified: trunk/Source/WebKit2/UIProcess/mac/WKActionMenuController.mm (176569 => 176570)
--- trunk/Source/WebKit2/UIProcess/mac/WKActionMenuController.mm 2014-11-28 22:09:01 UTC (rev 176569)
+++ trunk/Source/WebKit2/UIProcess/mac/WKActionMenuController.mm 2014-11-28 22:10:24 UTC (rev 176570)
@@ -63,6 +63,7 @@
- (BOOL)_canAddMediaToPhotos;
- (void)_showTextIndicator;
- (void)_hideTextIndicator;
+- (void)_clearActionMenuState;
@end
@interface WKView (WKDeprecatedSPI)
@@ -218,10 +219,7 @@
- (void)wkView:(WKView *)wkView willHandleMouseDown:(NSEvent *)event
{
- if (_type == kWKActionMenuDataDetectedItem && _currentActionContext && _hasActivatedActionContext) {
- [getDDActionsManagerClass() didUseActions];
- _hasActivatedActionContext = NO;
- }
+ [self _clearActionMenuState];
}
- (void)prepareForMenu:(NSMenu *)menu withEvent:(NSEvent *)event
@@ -293,20 +291,26 @@
if (menu != _wkView.actionMenu)
return;
+ [_previewPopover setBehavior:NSPopoverBehaviorTransient];
+ if (!_shouldKeepPreviewPopoverOpen)
+ [self _clearPreviewPopover];
+
+ [self _clearActionMenuState];
+}
+
+- (void)_clearActionMenuState
+{
if (_type == kWKActionMenuDataDetectedItem && _currentActionContext && _hasActivatedActionContext) {
[getDDActionsManagerClass() didUseActions];
_hasActivatedActionContext = NO;
}
- [_previewPopover setBehavior:NSPopoverBehaviorTransient];
- if (!_shouldKeepPreviewPopoverOpen)
- [self _clearPreviewPopover];
-
_state = ActionMenuState::None;
_hitTestResult = ActionMenuHitTestResult();
_type = kWKActionMenuNone;
_sharingServicePicker = nil;
_currentActionContext = nil;
+ _userData = nil;
}
- (void)didPerformActionMenuHitTest:(const ActionMenuHitTestResult&)hitTestResult userData:(API::Object*)userData
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes