Title: [176636] branches/safari-600.3-branch/Source
- Revision
- 176636
- Author
- [email protected]
- Date
- 2014-12-02 06:22:31 -0800 (Tue, 02 Dec 2014)
Log Message
Merge r176415. rdar://problem/18950441
Modified Paths
Diff
Modified: branches/safari-600.3-branch/Source/WebKit/mac/ChangeLog (176635 => 176636)
--- branches/safari-600.3-branch/Source/WebKit/mac/ChangeLog 2014-12-02 14:14:53 UTC (rev 176635)
+++ branches/safari-600.3-branch/Source/WebKit/mac/ChangeLog 2014-12-02 14:22:31 UTC (rev 176636)
@@ -1,5 +1,25 @@
2014-12-02 Dana Burkart <[email protected]>
+ Merge r176415. rdar://problem/18950441
+
+ 2014-11-20 Tim Horton <[email protected]>
+
+ Cancel DataDetectors menu earlier if we know it can't be presented
+ https://bugs.webkit.org/show_bug.cgi?id=138922
+ <rdar://problem/18950441>
+
+ Reviewed by Beth Dakin.
+
+ * WebView/WebActionMenuController.mm:
+ (-[WebActionMenuController prepareForMenu:withEvent:]):
+ Move our call to shouldUseActionsWithContext earlier, to menuNeedsUpdate,
+ and use a bigger hammer (removeAllItems).
+
+ (-[WebActionMenuController willOpenMenu:withEvent:]):
+ If we end up with a menu with no items, don't change selection or anything.
+
+2014-12-02 Dana Burkart <[email protected]>
+
Merge r176412. rdar://problem/18904600
2014-11-20 Beth Dakin <[email protected]>
Modified: branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebActionMenuController.mm (176635 => 176636)
--- branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebActionMenuController.mm 2014-12-02 14:14:53 UTC (rev 176635)
+++ branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebActionMenuController.mm 2014-12-02 14:22:31 UTC (rev 176636)
@@ -151,6 +151,11 @@
for (NSMenuItem *item in menuItems)
[actionMenu addItem:item];
+
+ if (_type == WebActionMenuDataDetectedItem && _currentActionContext && ![getDDActionsManagerClass() shouldUseActionsWithContext:_currentActionContext.get()]) {
+ [menu cancelTracking];
+ [menu removeAllItems];
+ }
}
- (BOOL)isMenuForTextContent
@@ -183,12 +188,10 @@
if (menu != _webView.actionMenu)
return;
+ if (!menu.numberOfItems)
+ return;
+
if (_type == WebActionMenuDataDetectedItem) {
- if (![getDDActionsManagerClass() shouldUseActionsWithContext:_currentActionContext.get()]) {
- [menu cancelTracking];
- return;
- }
-
if (menu.numberOfItems == 1)
[[_webView _selectedOrMainFrame] _clearSelection];
else
Modified: branches/safari-600.3-branch/Source/WebKit2/ChangeLog (176635 => 176636)
--- branches/safari-600.3-branch/Source/WebKit2/ChangeLog 2014-12-02 14:14:53 UTC (rev 176635)
+++ branches/safari-600.3-branch/Source/WebKit2/ChangeLog 2014-12-02 14:22:31 UTC (rev 176636)
@@ -1,5 +1,25 @@
2014-12-02 Dana Burkart <[email protected]>
+ Merge r176415. rdar://problem/18950441
+
+ 2014-11-20 Tim Horton <[email protected]>
+
+ Cancel DataDetectors menu earlier if we know it can't be presented
+ https://bugs.webkit.org/show_bug.cgi?id=138922
+ <rdar://problem/18950441>
+
+ Reviewed by Beth Dakin.
+
+ * UIProcess/mac/WKActionMenuController.mm:
+ (-[WKActionMenuController willOpenMenu:withEvent:]):
+ If we end up with a menu with no items, don't change selection or anything.
+
+ (-[WKActionMenuController menuNeedsUpdate:]):
+ Move our call to shouldUseActionsWithContext earlier, to menuNeedsUpdate,
+ and use a bigger hammer (removeAllItems).
+
+2014-12-02 Dana Burkart <[email protected]>
+
Merge r176414. rdar://problem/19042207
2014-11-20 Tim Horton <[email protected]>
Modified: branches/safari-600.3-branch/Source/WebKit2/UIProcess/mac/WKActionMenuController.mm (176635 => 176636)
--- branches/safari-600.3-branch/Source/WebKit2/UIProcess/mac/WKActionMenuController.mm 2014-12-02 14:14:53 UTC (rev 176635)
+++ branches/safari-600.3-branch/Source/WebKit2/UIProcess/mac/WKActionMenuController.mm 2014-12-02 14:22:31 UTC (rev 176636)
@@ -192,11 +192,10 @@
if (menu != _wkView.actionMenu)
return;
+ if (!menu.numberOfItems)
+ return;
+
if (_type == kWKActionMenuDataDetectedItem) {
- if (_currentActionContext && ![getDDActionsManagerClass() shouldUseActionsWithContext:_currentActionContext.get()]) {
- [menu cancelTracking];
- return;
- }
if (menu.numberOfItems == 1)
_page->clearSelection();
else
@@ -726,6 +725,11 @@
if (_state != ActionMenuState::Ready)
[self _updateActionMenuItems];
+
+ if (_type == kWKActionMenuDataDetectedItem && _currentActionContext && ![getDDActionsManagerClass() shouldUseActionsWithContext:_currentActionContext.get()]) {
+ [menu cancelTracking];
+ [menu removeAllItems];
+ }
}
- (void)menu:(NSMenu *)menu willHighlightItem:(NSMenuItem *)item
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes