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).
* 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.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176415
268f45cc-cd09-0410-ab3c-
d52691b4dbfc