Title: [176150] trunk/Source/WebKit2
- Revision
- 176150
- Author
- timothy_hor...@apple.com
- Date
- 2014-11-14 17:58:52 -0800 (Fri, 14 Nov 2014)
Log Message
Remove pre-[DDActionContext contextForView:...] fallback path
https://bugs.webkit.org/show_bug.cgi?id=138735
<rdar://problem/18982046>
Reviewed by Simon Fraser.
* UIProcess/mac/WKActionMenuController.mm:
(-[WKActionMenuController willOpenMenu:withEvent:]):
(-[WKActionMenuController didCloseMenu:withEvent:]):
(-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
(hasDataDetectorsCompletionAPI): Deleted.
Remove the now-unnecessary fallback path.
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (176149 => 176150)
--- trunk/Source/WebKit2/ChangeLog 2014-11-15 00:36:00 UTC (rev 176149)
+++ trunk/Source/WebKit2/ChangeLog 2014-11-15 01:58:52 UTC (rev 176150)
@@ -1,5 +1,20 @@
2014-11-14 Tim Horton <timothy_hor...@apple.com>
+ Remove pre-[DDActionContext contextForView:...] fallback path
+ https://bugs.webkit.org/show_bug.cgi?id=138735
+ <rdar://problem/18982046>
+
+ Reviewed by Simon Fraser.
+
+ * UIProcess/mac/WKActionMenuController.mm:
+ (-[WKActionMenuController willOpenMenu:withEvent:]):
+ (-[WKActionMenuController didCloseMenu:withEvent:]):
+ (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
+ (hasDataDetectorsCompletionAPI): Deleted.
+ Remove the now-unnecessary fallback path.
+
+2014-11-14 Tim Horton <timothy_hor...@apple.com>
+
Frequent crashes under actionContextForResultAtPoint
https://bugs.webkit.org/show_bug.cgi?id=138761
<rdar://problem/18990684>
Modified: trunk/Source/WebKit2/UIProcess/mac/WKActionMenuController.mm (176149 => 176150)
--- trunk/Source/WebKit2/UIProcess/mac/WKActionMenuController.mm 2014-11-15 00:36:00 UTC (rev 176149)
+++ trunk/Source/WebKit2/UIProcess/mac/WKActionMenuController.mm 2014-11-15 01:58:52 UTC (rev 176150)
@@ -54,15 +54,6 @@
SOFT_LINK_FRAMEWORK_IN_UMBRELLA(Quartz, ImageKit)
SOFT_LINK_CLASS(ImageKit, IKSlideshow)
-static bool hasDataDetectorsCompletionAPI() {
- static bool hasCompletionAPI;
- static dispatch_once_t onceToken;
- dispatch_once(&onceToken, ^{
- hasCompletionAPI = [getDDActionsManagerClass() respondsToSelector:@selector(shouldUseActionsWithContext:)] && [getDDActionsManagerClass() respondsToSelector:@selector(didUseActions)];
- });
- return hasCompletionAPI;
-}
-
using namespace WebCore;
using namespace WebKit;
@@ -201,17 +192,13 @@
return;
if (_type == kWKActionMenuDataDetectedItem) {
- if (_currentActionContext && hasDataDetectorsCompletionAPI()) {
- if (![getDDActionsManagerClass() shouldUseActionsWithContext:_currentActionContext.get()]) {
- [menu cancelTracking];
- return;
- }
+ if (_currentActionContext && ![getDDActionsManagerClass() shouldUseActionsWithContext:_currentActionContext.get()]) {
+ [menu cancelTracking];
+ return;
}
- if (menu.numberOfItems == 1) {
+ if (menu.numberOfItems == 1)
_page->clearSelection();
- if (!hasDataDetectorsCompletionAPI())
- [self _showTextIndicator];
- } else
+ else
_page->selectLastActionMenuRange();
return;
}
@@ -234,13 +221,8 @@
return;
if (_type == kWKActionMenuDataDetectedItem) {
- if (hasDataDetectorsCompletionAPI()) {
- if (_currentActionContext)
- [getDDActionsManagerClass() didUseActions];
- } else {
- if (menu.numberOfItems > 1)
- [self _hideTextIndicator];
- }
+ if (_currentActionContext)
+ [getDDActionsManagerClass() didUseActions];
}
if (!_shouldKeepPreviewPopoverOpen)
@@ -588,28 +570,18 @@
if (!actionContext)
return @[ ];
- if (hasDataDetectorsCompletionAPI()) {
- // Ref our WebPageProxy for use in the blocks below.
- RefPtr<WebPageProxy> page = _page;
- _currentActionContext = [actionContext contextForView:_wkView altMode:YES interactionStartedHandler:^() {
- page->send(Messages::WebPage::DataDetectorsDidPresentUI());
- } interactionChangedHandler:^() {
- [self _showTextIndicator];
- page->send(Messages::WebPage::DataDetectorsDidChangeUI());
- } interactionStoppedHandler:^() {
- [self _hideTextIndicator];
- page->send(Messages::WebPage::DataDetectorsDidHideUI());
- }];
- } else {
- _currentActionContext = actionContext;
+ // Ref our WebPageProxy for use in the blocks below.
+ RefPtr<WebPageProxy> page = _page;
+ _currentActionContext = [actionContext contextForView:_wkView altMode:YES interactionStartedHandler:^() {
+ page->send(Messages::WebPage::DataDetectorsDidPresentUI());
+ } interactionChangedHandler:^() {
+ [self _showTextIndicator];
+ page->send(Messages::WebPage::DataDetectorsDidChangeUI());
+ } interactionStoppedHandler:^() {
+ [self _hideTextIndicator];
+ page->send(Messages::WebPage::DataDetectorsDidHideUI());
+ }];
- [_currentActionContext setCompletionHandler:^() {
- [self _hideTextIndicator];
- }];
-
- [_currentActionContext setForActionMenuContent:YES];
- }
-
[_currentActionContext setHighlightFrame:[_wkView.window convertRectToScreen:[_wkView convertRect:_hitTestResult.detectedDataBoundingBox toView:nil]]];
return [[getDDActionsManagerClass() sharedManager] menuItemsForResult:[_currentActionContext mainResult] actionContext:_currentActionContext.get()];
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes