Title: [184471] branches/safari-601.1.32-branch/Source/WebKit2
- Revision
- 184471
- Author
- [email protected]
- Date
- 2015-05-18 07:21:37 -0700 (Mon, 18 May 2015)
Log Message
Merge r183978. rdar://problem/20635659
Modified Paths
Diff
Modified: branches/safari-601.1.32-branch/Source/WebKit2/ChangeLog (184470 => 184471)
--- branches/safari-601.1.32-branch/Source/WebKit2/ChangeLog 2015-05-18 13:54:28 UTC (rev 184470)
+++ branches/safari-601.1.32-branch/Source/WebKit2/ChangeLog 2015-05-18 14:21:37 UTC (rev 184471)
@@ -1,3 +1,32 @@
+2015-05-18 Matthew Hanson <[email protected]>
+
+ Merge r183978. rdar://problem/20635659
+
+ 2015-05-07 Conrad Shultz <[email protected]>
+
+ Don't register for Lookup notifications until needed
+ https://bugs.webkit.org/show_bug.cgi?id=144783
+
+ Reviewed by Tim Horton.
+
+ * UIProcess/API/mac/WKView.mm:
+ Add a WKViewData ivar to track whether we've already registered for popover notifications.
+ (-[WKView _prepareForDictionaryLookup]):
+ Added; moved notification registration from -[WKView initWithFrame:processPool:configuration:webView:.
+ (-[WKView initWithFrame:processPool:configuration:webView:]):
+ Move notification registration to -_prepareForDictionaryLookup.
+
+ * UIProcess/API/mac/WKViewInternal.h:
+ Expose -_prepareForDictionaryLookup.
+
+ * UIProcess/mac/PageClientImpl.mm:
+ (WebKit::PageClientImpl::didPerformDictionaryLookup):
+ Send -[WKView _prepareForDictionaryLookup].
+
+ * UIProcess/mac/WKImmediateActionController.mm:
+ (-[WKImmediateActionController _animationControllerForText]):
+ Ditto.
+
2015-05-13 Babak Shafiei <[email protected]>
Merge r183976.
Modified: branches/safari-601.1.32-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm (184470 => 184471)
--- branches/safari-601.1.32-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm 2015-05-18 13:54:28 UTC (rev 184470)
+++ branches/safari-601.1.32-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm 2015-05-18 14:21:37 UTC (rev 184471)
@@ -280,6 +280,8 @@
CGFloat _overrideDeviceScaleFactor;
+ BOOL _didRegisterForLookupPopoverCloseNotifications;
+
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
BOOL _automaticallyAdjustsContentInsets;
RetainPtr<WKActionMenuController> _actionMenuController;
@@ -2888,6 +2890,17 @@
_data->_page->viewStateDidChange(ViewState::IsVisible);
}
+- (void)_prepareForDictionaryLookup
+{
+ if (_data->_didRegisterForLookupPopoverCloseNotifications)
+ return;
+
+ _data->_didRegisterForLookupPopoverCloseNotifications = YES;
+
+ if (canLoadLUNotificationPopoverWillClose())
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_dictionaryLookupPopoverWillClose:) name:getLUNotificationPopoverWillClose() object:nil];
+}
+
- (void)_dictionaryLookupPopoverWillClose:(NSNotification *)notification
{
[self _clearTextIndicatorWithAnimation:TextIndicatorDismissalAnimation::None];
@@ -3832,9 +3845,6 @@
NSNotificationCenter* workspaceNotificationCenter = [[NSWorkspace sharedWorkspace] notificationCenter];
[workspaceNotificationCenter addObserver:self selector:@selector(_activeSpaceDidChange:) name:NSWorkspaceActiveSpaceDidChangeNotification object:nil];
- if (canLoadLUNotificationPopoverWillClose())
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_dictionaryLookupPopoverWillClose:) name:getLUNotificationPopoverWillClose() object:nil];
-
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
if ([self respondsToSelector:@selector(_setActionMenu:)]) {
RetainPtr<NSMenu> menu = adoptNS([[NSMenu alloc] init]);
Modified: branches/safari-601.1.32-branch/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h (184470 => 184471)
--- branches/safari-601.1.32-branch/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h 2015-05-18 13:54:28 UTC (rev 184470)
+++ branches/safari-601.1.32-branch/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h 2015-05-18 14:21:37 UTC (rev 184471)
@@ -140,6 +140,8 @@
@property (readonly) WKFullScreenWindowController *_fullScreenWindowController;
- (void)_closeFullScreenWindowController;
+- (void)_prepareForDictionaryLookup;
+
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
- (void)_didPerformActionMenuHitTest:(const WebKit::WebHitTestResult::Data&)hitTestResult forImmediateAction:(BOOL)forImmediateAction contentPreventsDefault:(BOOL)contentPreventsDefault userData:(API::Object*)userData;
#endif
Modified: branches/safari-601.1.32-branch/Source/WebKit2/UIProcess/mac/PageClientImpl.mm (184470 => 184471)
--- branches/safari-601.1.32-branch/Source/WebKit2/UIProcess/mac/PageClientImpl.mm 2015-05-18 13:54:28 UTC (rev 184470)
+++ branches/safari-601.1.32-branch/Source/WebKit2/UIProcess/mac/PageClientImpl.mm 2015-05-18 14:21:37 UTC (rev 184471)
@@ -593,6 +593,8 @@
RetainPtr<NSMutableDictionary> mutableOptions = adoptNS([(NSDictionary *)dictionaryPopupInfo.options.get() mutableCopy]);
+ [m_wkView _prepareForDictionaryLookup];
+
if (canLoadLUTermOptionDisableSearchTermIndicator() && dictionaryPopupInfo.textIndicator.contentImage) {
[m_wkView _setTextIndicator:*TextIndicator::create(dictionaryPopupInfo.textIndicator) withLifetime:TextIndicatorLifetime::Permanent];
[mutableOptions setObject:@YES forKey:getLUTermOptionDisableSearchTermIndicator()];
Modified: branches/safari-601.1.32-branch/Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm (184470 => 184471)
--- branches/safari-601.1.32-branch/Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm 2015-05-18 13:54:28 UTC (rev 184470)
+++ branches/safari-601.1.32-branch/Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm 2015-05-18 14:21:37 UTC (rev 184471)
@@ -467,6 +467,8 @@
if (!dictionaryPopupInfo.attributedString.string)
return nil;
+ [_wkView _prepareForDictionaryLookup];
+
// Convert baseline to screen coordinates.
NSPoint textBaselineOrigin = dictionaryPopupInfo.origin;
textBaselineOrigin = [_wkView convertPoint:textBaselineOrigin toView:nil];
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes