Diff
Modified: branches/safari-601-branch/Source/WebCore/ChangeLog (190746 => 190747)
--- branches/safari-601-branch/Source/WebCore/ChangeLog 2015-10-08 22:00:46 UTC (rev 190746)
+++ branches/safari-601-branch/Source/WebCore/ChangeLog 2015-10-08 22:08:08 UTC (rev 190747)
@@ -1,5 +1,9 @@
2015-10-08 Lucas Forschler <[email protected]>
+ Rollout r190745
+
+2015-10-08 Lucas Forschler <[email protected]>
+
Merge r188443. rdar://problem/22801969
2015-08-13 Tim Horton <[email protected]>
Modified: branches/safari-601-branch/Source/WebCore/platform/spi/mac/LookupSPI.h (190746 => 190747)
--- branches/safari-601-branch/Source/WebCore/platform/spi/mac/LookupSPI.h 2015-10-08 22:00:46 UTC (rev 190746)
+++ branches/safari-601-branch/Source/WebCore/platform/spi/mac/LookupSPI.h 2015-10-08 22:08:08 UTC (rev 190747)
@@ -42,7 +42,6 @@
+ (NSRange)tokenRangeForString:(NSString *)string range:(NSRange)range options:(NSDictionary **)options;
+ (void)showDefinitionForTerm:(NSAttributedString *)term atLocation:(NSPoint)screenPoint options:(NSDictionary *)options;
-+ (void)showDefinitionForTerm:(NSAttributedString *)term relativeToRect:(NSRect)positioningRect ofView:(NSView *)positioningView options:(NSDictionary *)options;
+ (void)hideDefinition;
@end
@@ -51,12 +50,10 @@
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
-@interface LULookupDefinitionModule ()
+@interface LULookupDefinitionModule (AnimationController)
+ (id<NSImmediateActionAnimationController>)lookupAnimationControllerForTerm:(NSAttributedString *)term atLocation:(NSPoint)screenPoint options:(NSDictionary *)options;
-+ (id<NSImmediateActionAnimationController>)lookupAnimationControllerForTerm:(NSAttributedString *)term relativeToRect:(NSRect)positioningRect ofView:(NSView *)positioningView options:(NSDictionary *)options;
-
@end
#endif // __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
Modified: branches/safari-601-branch/Source/WebKit/mac/ChangeLog (190746 => 190747)
--- branches/safari-601-branch/Source/WebKit/mac/ChangeLog 2015-10-08 22:00:46 UTC (rev 190746)
+++ branches/safari-601-branch/Source/WebKit/mac/ChangeLog 2015-10-08 22:08:08 UTC (rev 190747)
@@ -1,5 +1,9 @@
2015-10-08 Lucas Forschler <[email protected]>
+ Rollout r190745
+
+2015-10-08 Lucas Forschler <[email protected]>
+
Merge r188443. rdar://problem/22801969
2015-08-13 Tim Horton <[email protected]>
Modified: branches/safari-601-branch/Source/WebKit/mac/WebView/WebView.mm (190746 => 190747)
--- branches/safari-601-branch/Source/WebKit/mac/WebView/WebView.mm 2015-10-08 22:00:46 UTC (rev 190746)
+++ branches/safari-601-branch/Source/WebKit/mac/WebView/WebView.mm 2015-10-08 22:08:08 UTC (rev 190747)
@@ -8561,7 +8561,12 @@
if (!dictionaryPopupInfo.attributedString)
return nil;
- if (canLoadLUTermOptionDisableSearchTermIndicator() && canLoadLUNotificationPopoverWillClose() && dictionaryPopupInfo.textIndicator) {
+ NSPoint textBaselineOrigin = dictionaryPopupInfo.origin;
+
+ // Convert to screen coordinates.
+ textBaselineOrigin = [self.window convertRectToScreen:NSMakeRect(textBaselineOrigin.x, textBaselineOrigin.y, 0, 0)].origin;
+
+ if (canLoadLUTermOptionDisableSearchTermIndicator() && canLoadLUNotificationPopoverWillClose()) {
if (!_private->hasInitializedLookupObserver) {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_dictionaryLookupPopoverWillClose:) name:getLUNotificationPopoverWillClose() object:nil];
_private->hasInitializedLookupObserver = YES;
@@ -8572,17 +8577,9 @@
mutableOptions = adoptNS([[NSMutableDictionary alloc] init]);
[mutableOptions setObject:@YES forKey:getLUTermOptionDisableSearchTermIndicator()];
[self _setTextIndicator:*dictionaryPopupInfo.textIndicator withLifetime:TextIndicatorLifetime::Permanent];
-
- if ([getLULookupDefinitionModuleClass() respondsToSelector:@selector(lookupAnimationControllerForTerm:relativeToRect:ofView:options:)]) {
- FloatRect firstTextRectInViewCoordinates = dictionaryPopupInfo.textIndicator->textRectsInBoundingRectCoordinates()[0];
- firstTextRectInViewCoordinates.moveBy(dictionaryPopupInfo.textIndicator->textBoundingRectInRootViewCoordinates().location());
- return [getLULookupDefinitionModuleClass() lookupAnimationControllerForTerm:dictionaryPopupInfo.attributedString.get() relativeToRect:[self _convertRectFromRootView:firstTextRectInViewCoordinates] ofView:self options:mutableOptions.get()];
- }
+ return [getLULookupDefinitionModuleClass() lookupAnimationControllerForTerm:dictionaryPopupInfo.attributedString.get() atLocation:textBaselineOrigin options:mutableOptions.get()];
}
- // Convert to screen coordinates.
- NSPoint textBaselineOrigin = [self.window convertRectToScreen:NSMakeRect(dictionaryPopupInfo.origin.x, dictionaryPopupInfo.origin.y, 0, 0)].origin;
-
return [getLULookupDefinitionModuleClass() lookupAnimationControllerForTerm:dictionaryPopupInfo.attributedString.get() atLocation:textBaselineOrigin options:dictionaryPopupInfo.options.get()];
}
#endif // __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
@@ -8630,7 +8627,12 @@
if (!dictionaryPopupInfo.attributedString)
return;
- if (canLoadLUTermOptionDisableSearchTermIndicator() && canLoadLUNotificationPopoverWillClose() && dictionaryPopupInfo.textIndicator) {
+ NSPoint textBaselineOrigin = dictionaryPopupInfo.origin;
+
+ // Convert to screen coordinates.
+ textBaselineOrigin = [self.window convertRectToScreen:NSMakeRect(textBaselineOrigin.x, textBaselineOrigin.y, 0, 0)].origin;
+
+ if (canLoadLUTermOptionDisableSearchTermIndicator() && canLoadLUNotificationPopoverWillClose()) {
if (!_private->hasInitializedLookupObserver) {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_dictionaryLookupPopoverWillClose:) name:getLUNotificationPopoverWillClose() object:nil];
_private->hasInitializedLookupObserver = YES;
@@ -8641,19 +8643,9 @@
mutableOptions = adoptNS([[NSMutableDictionary alloc] init]);
[mutableOptions setObject:@YES forKey:getLUTermOptionDisableSearchTermIndicator()];
[self _setTextIndicator:*dictionaryPopupInfo.textIndicator withLifetime:TextIndicatorLifetime::Permanent];
-
- if ([getLULookupDefinitionModuleClass() respondsToSelector:@selector(showDefinitionForTerm:relativeToRect:ofView:options:)]) {
- FloatRect firstTextRectInViewCoordinates = dictionaryPopupInfo.textIndicator->textRectsInBoundingRectCoordinates()[0];
- firstTextRectInViewCoordinates.moveBy(dictionaryPopupInfo.textIndicator->textBoundingRectInRootViewCoordinates().location());
- [getLULookupDefinitionModuleClass() showDefinitionForTerm:dictionaryPopupInfo.attributedString.get() relativeToRect:[self _convertRectFromRootView:firstTextRectInViewCoordinates] ofView:self options:mutableOptions.get()];
- return;
- }
- }
-
- // Convert to screen coordinates.
- NSPoint textBaselineOrigin = [self.window convertRectToScreen:NSMakeRect(dictionaryPopupInfo.origin.x, dictionaryPopupInfo.origin.y, 0, 0)].origin;
-
- [getLULookupDefinitionModuleClass() showDefinitionForTerm:dictionaryPopupInfo.attributedString.get() atLocation:textBaselineOrigin options:dictionaryPopupInfo.options.get()];
+ [getLULookupDefinitionModuleClass() showDefinitionForTerm:dictionaryPopupInfo.attributedString.get() atLocation:textBaselineOrigin options:mutableOptions.get()];
+ } else
+ [getLULookupDefinitionModuleClass() showDefinitionForTerm:dictionaryPopupInfo.attributedString.get() atLocation:textBaselineOrigin options:dictionaryPopupInfo.options.get()];
}
- (void)_dictionaryLookupPopoverWillClose:(NSNotification *)notification
Modified: branches/safari-601-branch/Source/WebKit2/ChangeLog (190746 => 190747)
--- branches/safari-601-branch/Source/WebKit2/ChangeLog 2015-10-08 22:00:46 UTC (rev 190746)
+++ branches/safari-601-branch/Source/WebKit2/ChangeLog 2015-10-08 22:08:08 UTC (rev 190747)
@@ -1,5 +1,9 @@
2015-10-08 Lucas Forschler <[email protected]>
+ Rollout r190745
+
+2015-10-08 Lucas Forschler <[email protected]>
+
Merge r188443. rdar://problem/22801969
2015-08-13 Tim Horton <[email protected]>
Modified: branches/safari-601-branch/Source/WebKit2/UIProcess/mac/PageClientImpl.mm (190746 => 190747)
--- branches/safari-601-branch/Source/WebKit2/UIProcess/mac/PageClientImpl.mm 2015-10-08 22:00:46 UTC (rev 190746)
+++ branches/safari-601-branch/Source/WebKit2/UIProcess/mac/PageClientImpl.mm 2015-10-08 22:08:08 UTC (rev 190747)
@@ -587,6 +587,12 @@
if (!getLULookupDefinitionModuleClass())
return;
+ NSPoint textBaselineOrigin = dictionaryPopupInfo.origin;
+
+ // Convert to screen coordinates.
+ textBaselineOrigin = [m_wkView convertPoint:textBaselineOrigin toView:nil];
+ textBaselineOrigin = [m_wkView.window convertRectToScreen:NSMakeRect(textBaselineOrigin.x, textBaselineOrigin.y, 0, 0)].origin;
+
RetainPtr<NSMutableDictionary> mutableOptions = adoptNS([(NSDictionary *)dictionaryPopupInfo.options.get() mutableCopy]);
[m_wkView _prepareForDictionaryLookup];
@@ -594,22 +600,9 @@
if (canLoadLUTermOptionDisableSearchTermIndicator() && dictionaryPopupInfo.textIndicator.contentImage) {
[m_wkView _setTextIndicator:TextIndicator::create(dictionaryPopupInfo.textIndicator) withLifetime:TextIndicatorLifetime::Permanent];
[mutableOptions setObject:@YES forKey:getLUTermOptionDisableSearchTermIndicator()];
-
- if ([getLULookupDefinitionModuleClass() respondsToSelector:@selector(showDefinitionForTerm:relativeToRect:ofView:options:)]) {
- FloatRect firstTextRectInViewCoordinates = dictionaryPopupInfo.textIndicator.textRectsInBoundingRectCoordinates[0];
- firstTextRectInViewCoordinates.moveBy(dictionaryPopupInfo.textIndicator.textBoundingRectInRootViewCoordinates.location());
- [getLULookupDefinitionModuleClass() showDefinitionForTerm:dictionaryPopupInfo.attributedString.string.get() relativeToRect:firstTextRectInViewCoordinates ofView:m_wkView options:mutableOptions.get()];
- return;
- }
- }
-
- NSPoint textBaselineOrigin = dictionaryPopupInfo.origin;
-
- // Convert to screen coordinates.
- textBaselineOrigin = [m_wkView convertPoint:textBaselineOrigin toView:nil];
- textBaselineOrigin = [m_wkView.window convertRectToScreen:NSMakeRect(textBaselineOrigin.x, textBaselineOrigin.y, 0, 0)].origin;
-
- [getLULookupDefinitionModuleClass() showDefinitionForTerm:dictionaryPopupInfo.attributedString.string.get() atLocation:textBaselineOrigin options:mutableOptions.get()];
+ [getLULookupDefinitionModuleClass() showDefinitionForTerm:dictionaryPopupInfo.attributedString.string.get() atLocation:textBaselineOrigin options:mutableOptions.get()];
+ } else
+ [getLULookupDefinitionModuleClass() showDefinitionForTerm:dictionaryPopupInfo.attributedString.string.get() atLocation:textBaselineOrigin options:mutableOptions.get()];
}
void PageClientImpl::dismissContentRelativeChildWindows(bool withAnimation)
Modified: branches/safari-601-branch/Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm (190746 => 190747)
--- branches/safari-601-branch/Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm 2015-10-08 22:00:46 UTC (rev 190746)
+++ branches/safari-601-branch/Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm 2015-10-08 22:08:08 UTC (rev 190747)
@@ -469,23 +469,18 @@
[_wkView _prepareForDictionaryLookup];
- RetainPtr<NSMutableDictionary> mutableOptions = adoptNS([(NSDictionary *)dictionaryPopupInfo.options.get() mutableCopy]);
- if (canLoadLUTermOptionDisableSearchTermIndicator() && dictionaryPopupInfo.textIndicator.contentImage) {
- [_wkView _setTextIndicator:TextIndicator::create(dictionaryPopupInfo.textIndicator) withLifetime:TextIndicatorLifetime::Permanent];
- [mutableOptions setObject:@YES forKey:getLUTermOptionDisableSearchTermIndicator()];
-
- if ([getLULookupDefinitionModuleClass() respondsToSelector:@selector(lookupAnimationControllerForTerm:relativeToRect:ofView:options:)]) {
- FloatRect firstTextRectInViewCoordinates = dictionaryPopupInfo.textIndicator.textRectsInBoundingRectCoordinates[0];
- firstTextRectInViewCoordinates.moveBy(dictionaryPopupInfo.textIndicator.textBoundingRectInRootViewCoordinates.location());
- return [getLULookupDefinitionModuleClass() lookupAnimationControllerForTerm:dictionaryPopupInfo.attributedString.string.get() relativeToRect:firstTextRectInViewCoordinates ofView:_wkView options:mutableOptions.get()];
- }
- }
-
// Convert baseline to screen coordinates.
NSPoint textBaselineOrigin = dictionaryPopupInfo.origin;
textBaselineOrigin = [_wkView convertPoint:textBaselineOrigin toView:nil];
textBaselineOrigin = [_wkView.window convertRectToScreen:NSMakeRect(textBaselineOrigin.x, textBaselineOrigin.y, 0, 0)].origin;
+ RetainPtr<NSMutableDictionary> mutableOptions = adoptNS([(NSDictionary *)dictionaryPopupInfo.options.get() mutableCopy]);
+ if (canLoadLUTermOptionDisableSearchTermIndicator() && dictionaryPopupInfo.textIndicator.contentImage) {
+ RefPtr<TextIndicator> indicator = TextIndicator::create(dictionaryPopupInfo.textIndicator);
+ [_wkView _setTextIndicator:*indicator withLifetime:TextIndicatorLifetime::Permanent];
+ [mutableOptions setObject:@YES forKey:getLUTermOptionDisableSearchTermIndicator()];
+ return [getLULookupDefinitionModuleClass() lookupAnimationControllerForTerm:dictionaryPopupInfo.attributedString.string.get() atLocation:textBaselineOrigin options:mutableOptions.get()];
+ }
return [getLULookupDefinitionModuleClass() lookupAnimationControllerForTerm:dictionaryPopupInfo.attributedString.string.get() atLocation:textBaselineOrigin options:mutableOptions.get()];
}