Skip to content
Permalink
Browse files
Factor out Lookup invocation
https://bugs.webkit.org/show_bug.cgi?id=148509

Reviewed by Anders Carlsson.

There's a ton of duplicated code in legacy and modern WebKit to talk to
Lookup. And, it's pretty messy. As a first step to making it less messy,
make it so we only have it in one place instead of four (or two).

* editing/DictionaryPopupInfo.h:
Move DictionaryPopupInfo into WebCore. This was duplicated
in both legacy and modern WebKit.

* editing/mac/DictionaryLookup.h:
* editing/mac/DictionaryLookup.mm:
(WebCore::DictionaryLookup::rangeForSelection):
(WebCore::DictionaryLookup::rangeAtHitTestResult):
(WebCore::DictionaryLookup::stringForPDFSelection):
(WebCore::showPopupOrCreateAnimationController):
(WebCore::DictionaryLookup::showPopup):
(WebCore::DictionaryLookup::hidePopup):
(WebCore::DictionaryLookup::animationControllerForPopup):
(WebCore::rangeForDictionaryLookupForSelection): Deleted.
(WebCore::rangeForDictionaryLookupAtHitTestResult): Deleted.
(WebCore::dictionaryLookupForPDFSelection): Deleted.
Move DictionaryLookup stuff into a class for better names.

Move showPopup, hidePopup, and animationControllerForPopup here.
showPopup and animationControllerForPopup both bottleneck through
a single function, where previously we duplicated all of the code
for both of them, and in both legacy and modern WebKit.

showPopup and animationControllerForPopup take a block that they *may*
call if we have support for overriding Lookup's indicator with TextIndicator,
because the installation process is different per WebKit.

* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::selectClosestWordFromHitTestResultBasedOnLookup):
* testing/Internals.cpp:
(WebCore::Internals::rangeForDictionaryLookupAtLocation):
Adjust to the new naming.

* Shared/DictionaryPopupInfo.cpp: Removed.
* Shared/DictionaryPopupInfo.h: Removed.
Moved to WebCore.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<DictionaryPopupInfo>::encode):
(IPC::ArgumentCoder<DictionaryPopupInfo>::decode):
Add encode/decoders for DictionaryPopupInfo now that it's in WebCore.

* Shared/WebCoreArgumentCoders.h:
* Shared/WebHitTestResult.h:
* Shared/mac/ArgumentCodersMac.h:
* UIProcess/API/mac/WKView.mm:
(+[WKView hideWordDefinitionWindow]):
(-[WKView _dismissContentRelativeChildWindows]):
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::didPerformDictionaryLookup):
* UIProcess/mac/WKImmediateActionController.mm:
(-[WKImmediateActionController _animationControllerForText]):
* UIProcess/mac/WebPageProxyMac.mm:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::showDefinitionForAttributedString):
(WebKit::PDFPlugin::lookupTextAtLocation):
* WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performDictionaryLookupAtLocation):
(WebKit::WebPage::performDictionaryLookupForSelection):
(WebKit::WebPage::dictionaryPopupInfoForRange):
(WebKit::WebPage::dictionaryPopupInfoForSelectionInPDFPlugin):
(WebKit::WebPage::lookupTextAtLocation):
Adjust to new names and move stuff to WebCore.

* WebKit.xcodeproj/project.pbxproj:

* WebView/DictionaryPopupInfo.h: Removed.
Move to WebCore.

* WebView/WebHTMLView.mm:
(-[WebHTMLView _lookUpInDictionaryFromMenu:]):
DictionaryPopupInfo keeps a TextIndicatorData, not a TextIndicator.

* WebView/WebImmediateActionController.mm:
(-[WebImmediateActionController _animationControllerForDataDetectedLink]):
(dictionaryPopupInfoForRange):
(-[WebImmediateActionController _animationControllerForText]):
* WebView/WebView.mm:
(-[WebView _prepareForDictionaryLookup]):
(-[WebView _animationControllerForDictionaryLookupPopupInfo:]):
(-[WebView _setTextIndicator:withLifetime:]):
(-[WebView _showDictionaryLookupPopup:]):
* WebView/WebViewInternal.h:
Move a bunch of code to WebCore.
Factor some that has to stay out into _prepareForDictionaryLookup.


Canonical link: https://commits.webkit.org/166646@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@189052 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
hortont424 committed Aug 27, 2015
1 parent 489d948 commit 4ed53c33b408457929cc8919cb0847b3ecdf61c4
Showing with 376 additions and 302 deletions.
  1. +44 −0 Source/WebCore/ChangeLog
  2. +4 −0 Source/WebCore/WebCore.xcodeproj/project.pbxproj
  3. +15 −11 Source/{WebKit/mac/WebView → WebCore/editing}/DictionaryPopupInfo.h
  4. +25 −4 Source/WebCore/editing/mac/DictionaryLookup.h
  5. +70 −4 Source/WebCore/editing/mac/DictionaryLookup.mm
  6. +1 −1 Source/WebCore/page/mac/EventHandlerMac.mm
  7. +1 −1 Source/WebCore/testing/Internals.cpp
  8. +9 −0 Source/WebKit/ChangeLog
  9. +0 −4 Source/WebKit/WebKit.xcodeproj/project.pbxproj
  10. +27 −0 Source/WebKit/mac/ChangeLog
  11. +3 −2 Source/WebKit/mac/WebView/WebHTMLView.mm
  12. +5 −3 Source/WebKit/mac/WebView/WebImmediateActionController.mm
  13. +25 −46 Source/WebKit/mac/WebView/WebView.mm
  14. +3 −3 Source/WebKit/mac/WebView/WebViewInternal.h
  15. +0 −1 Source/WebKit2/CMakeLists.txt
  16. +45 −0 Source/WebKit2/ChangeLog
  17. +0 −75 Source/WebKit2/Shared/DictionaryPopupInfo.cpp
  18. +0 −58 Source/WebKit2/Shared/DictionaryPopupInfo.h
  19. +50 −0 Source/WebKit2/Shared/WebCoreArgumentCoders.cpp
  20. +6 −0 Source/WebKit2/Shared/WebCoreArgumentCoders.h
  21. +2 −2 Source/WebKit2/Shared/WebHitTestResult.h
  22. +10 −0 Source/WebKit2/Shared/mac/ArgumentCodersMac.h
  23. +3 −5 Source/WebKit2/UIProcess/API/mac/WKView.mm
  24. +1 −1 Source/WebKit2/UIProcess/PageClient.h
  25. +2 −2 Source/WebKit2/UIProcess/WebPageProxy.h
  26. +1 −1 Source/WebKit2/UIProcess/WebPageProxy.messages.in
  27. +1 −1 Source/WebKit2/UIProcess/mac/PageClientImpl.h
  28. +4 −29 Source/WebKit2/UIProcess/mac/PageClientImpl.mm
  29. +5 −23 Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm
  30. +1 −1 Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm
  31. +0 −8 Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
  32. +2 −4 Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm
  33. +1 −1 Source/WebKit2/WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm
  34. +3 −3 Source/WebKit2/WebProcess/WebPage/WebPage.h
  35. +7 −8 Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm
@@ -1,3 +1,47 @@
2015-08-27 Timothy Horton <timothy_horton@apple.com>

Factor out Lookup invocation
https://bugs.webkit.org/show_bug.cgi?id=148509

Reviewed by Anders Carlsson.

There's a ton of duplicated code in legacy and modern WebKit to talk to
Lookup. And, it's pretty messy. As a first step to making it less messy,
make it so we only have it in one place instead of four (or two).

* editing/DictionaryPopupInfo.h:
Move DictionaryPopupInfo into WebCore. This was duplicated
in both legacy and modern WebKit.

* editing/mac/DictionaryLookup.h:
* editing/mac/DictionaryLookup.mm:
(WebCore::DictionaryLookup::rangeForSelection):
(WebCore::DictionaryLookup::rangeAtHitTestResult):
(WebCore::DictionaryLookup::stringForPDFSelection):
(WebCore::showPopupOrCreateAnimationController):
(WebCore::DictionaryLookup::showPopup):
(WebCore::DictionaryLookup::hidePopup):
(WebCore::DictionaryLookup::animationControllerForPopup):
(WebCore::rangeForDictionaryLookupForSelection): Deleted.
(WebCore::rangeForDictionaryLookupAtHitTestResult): Deleted.
(WebCore::dictionaryLookupForPDFSelection): Deleted.
Move DictionaryLookup stuff into a class for better names.

Move showPopup, hidePopup, and animationControllerForPopup here.
showPopup and animationControllerForPopup both bottleneck through
a single function, where previously we duplicated all of the code
for both of them, and in both legacy and modern WebKit.

showPopup and animationControllerForPopup take a block that they *may*
call if we have support for overriding Lookup's indicator with TextIndicator,
because the installation process is different per WebKit.

* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::selectClosestWordFromHitTestResultBasedOnLookup):
* testing/Internals.cpp:
(WebCore::Internals::rangeForDictionaryLookupAtLocation):
Adjust to the new naming.

2015-08-27 Jon Davis <jond@apple.com>

Add IndexedDB to the feature status page.
@@ -1139,6 +1139,7 @@
2D5002F81B56D7810020AAF7 /* DOMPath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D5002F71B56D7810020AAF7 /* DOMPath.cpp */; };
2D5002FB1B56D7990020AAF7 /* PathUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D5002F91B56D7990020AAF7 /* PathUtilities.cpp */; };
2D5002FC1B56D7990020AAF7 /* PathUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D5002FA1B56D7990020AAF7 /* PathUtilities.h */; settings = {ATTRIBUTES = (Private, ); }; };
2D5646B01B8F8493003C4994 /* DictionaryPopupInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D5646AF1B8F8493003C4994 /* DictionaryPopupInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
2D58D8551A15F65F00A5F726 /* DataDetection.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D58D8531A15F65F00A5F726 /* DataDetection.h */; settings = {ATTRIBUTES = (Private, ); }; };
2D58D8561A15F65F00A5F726 /* DataDetection.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D58D8541A15F65F00A5F726 /* DataDetection.mm */; };
2D59F1BF1A0044C6001F3D29 /* DataDetectorsSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D59F1BE1A0044C6001F3D29 /* DataDetectorsSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -8351,6 +8352,7 @@
2D5002F71B56D7810020AAF7 /* DOMPath.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMPath.cpp; sourceTree = "<group>"; };
2D5002F91B56D7990020AAF7 /* PathUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PathUtilities.cpp; sourceTree = "<group>"; };
2D5002FA1B56D7990020AAF7 /* PathUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PathUtilities.h; sourceTree = "<group>"; };
2D5646AF1B8F8493003C4994 /* DictionaryPopupInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DictionaryPopupInfo.h; sourceTree = "<group>"; };
2D58D8531A15F65F00A5F726 /* DataDetection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataDetection.h; sourceTree = "<group>"; };
2D58D8541A15F65F00A5F726 /* DataDetection.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DataDetection.mm; sourceTree = "<group>"; };
2D59F1BE1A0044C6001F3D29 /* DataDetectorsSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataDetectorsSPI.h; sourceTree = "<group>"; };
@@ -17977,6 +17979,7 @@
CECADFC3153778FF00E37068 /* DictationAlternative.h */,
CECADFC4153778FF00E37068 /* DictationCommand.cpp */,
CECADFC5153778FF00E37068 /* DictationCommand.h */,
2D5646AF1B8F8493003C4994 /* DictionaryPopupInfo.h */,
93309D93099E64910056E581 /* EditAction.h */,
93309D94099E64910056E581 /* EditCommand.cpp */,
93309D95099E64910056E581 /* EditCommand.h */,
@@ -24374,6 +24377,7 @@
31288E750E3005D6003619AE /* CSSKeyframesRule.h in Headers */,
BC772E131331620C001EC9CE /* CSSLineBoxContainValue.h in Headers */,
A80E6D030A1989CA007FB8C5 /* CSSMediaRule.h in Headers */,
2D5646B01B8F8493003C4994 /* DictionaryPopupInfo.h in Headers */,
F98FFF4511A2676200F548E8 /* CSSOMUtils.h in Headers */,
A80E6D000A1989CA007FB8C5 /* CSSPageRule.h in Headers */,
BC772B3E0C4EA91E0083285F /* CSSParser.h in Headers */,
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2014 Apple Inc. All rights reserved.
* Copyright (C) 2014-2015 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -23,23 +23,27 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/

#if PLATFORM(MAC)
#ifndef DictionaryPopupInfo_h
#define DictionaryPopupInfo_h

#import <WebCore/FloatPoint.h>
#import <wtf/RetainPtr.h>
#include "FloatPoint.h"
#include "TextIndicator.h"
#include <wtf/RetainPtr.h>

@class NSAttributedString;
@class NSDictionary;
OBJC_CLASS NSAttributedString;
OBJC_CLASS NSDictionary;

namespace WebCore {
class TextIndicator;
};

struct DictionaryPopupInfo {
NSPoint origin;
FloatPoint origin;
TextIndicatorData textIndicator;
#if PLATFORM(COCOA)
RetainPtr<NSDictionary> options;
RetainPtr<NSAttributedString> attributedString;
RefPtr<WebCore::TextIndicator> textIndicator;
#endif
};

#endif // PLATFORM(MAC)
} // namespace WebCore

#endif // DictionaryPopupInfo_h
@@ -28,20 +28,41 @@

#if PLATFORM(MAC)

#include "DictionaryPopupInfo.h"
#include <functional>
#include <wtf/PassRefPtr.h>

OBJC_CLASS NSDictionary;
OBJC_CLASS NSString;
OBJC_CLASS NSView;
OBJC_CLASS PDFSelection;

// This file is included in Internals.cpp, so we can't use ObjC outright.
#if defined(__OBJC__) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
#include "NSImmediateActionGestureRecognizerSPI.h"
#define PlatformAnimationController id<NSImmediateActionAnimationController>
#else
#define PlatformAnimationController void*
#endif

namespace WebCore {

class HitTestResult;
class Range;
class VisibleSelection;

WEBCORE_EXPORT PassRefPtr<Range> rangeForDictionaryLookupForSelection(const VisibleSelection&, NSDictionary **options);
WEBCORE_EXPORT PassRefPtr<Range> rangeForDictionaryLookupAtHitTestResult(const HitTestResult&, NSDictionary **options);
WEBCORE_EXPORT NSString *dictionaryLookupForPDFSelection(PDFSelection *, NSDictionary **options);
class DictionaryLookup {
public:
WEBCORE_EXPORT static PassRefPtr<Range> rangeForSelection(const VisibleSelection&, NSDictionary **options);
WEBCORE_EXPORT static PassRefPtr<Range> rangeAtHitTestResult(const HitTestResult&, NSDictionary **options);
WEBCORE_EXPORT static NSString *stringForPDFSelection(PDFSelection *, NSDictionary **options);

// FIXME: Should move/unify dictionaryPopupInfoForRange here too.

WEBCORE_EXPORT static void showPopup(const DictionaryPopupInfo&, NSView *, std::function<void(TextIndicator&)> textIndicatorInstallationCallback);
WEBCORE_EXPORT static void hidePopup();

WEBCORE_EXPORT static PlatformAnimationController animationControllerForPopup(const DictionaryPopupInfo&, NSView *, std::function<void(TextIndicator&)> textIndicatorInstallationCallback);
};

} // namespace WebCore

@@ -35,6 +35,7 @@
#import "HTMLConverter.h"
#import "HitTestResult.h"
#import "LookupSPI.h"
#import "NSImmediateActionGestureRecognizerSPI.h"
#import "Page.h"
#import "Range.h"
#import "RenderObject.h"
@@ -47,6 +48,8 @@
#import <PDFKit/PDFKit.h>
#import <wtf/RefPtr.h>

SOFT_LINK_CONSTANT_MAY_FAIL(Lookup, LUTermOptionDisableSearchTermIndicator, NSString *)

namespace WebCore {

static bool selectionContainsPosition(const VisiblePosition& position, const VisibleSelection& selection)
@@ -61,7 +64,7 @@ static bool selectionContainsPosition(const VisiblePosition& position, const Vis
return selectedRange->contains(position);
}

PassRefPtr<Range> rangeForDictionaryLookupForSelection(const VisibleSelection& selection, NSDictionary **options)
PassRefPtr<Range> DictionaryLookup::rangeForSelection(const VisibleSelection& selection, NSDictionary **options)
{
RefPtr<Range> selectedRange = selection.toNormalizedRange();
if (!selectedRange)
@@ -87,7 +90,7 @@ static bool selectionContainsPosition(const VisiblePosition& position, const Vis
return selectedRange.release();
}

PassRefPtr<Range> rangeForDictionaryLookupAtHitTestResult(const HitTestResult& hitTestResult, NSDictionary **options)
PassRefPtr<Range> DictionaryLookup::rangeAtHitTestResult(const HitTestResult& hitTestResult, NSDictionary **options)
{
Node* node = hitTestResult.innerNonSharedNode();
if (!node)
@@ -113,7 +116,7 @@ static bool selectionContainsPosition(const VisiblePosition& position, const Vis
// If we hit the selection, use that instead of letting Lookup decide the range.
VisibleSelection selection = frame->page()->focusController().focusedOrMainFrame().selection().selection();
if (selectionContainsPosition(position, selection))
return rangeForDictionaryLookupForSelection(selection, options);
return DictionaryLookup::rangeForSelection(selection, options);

VisibleSelection selectionAccountingForLineRules = VisibleSelection(position);
selectionAccountingForLineRules.expandUsingGranularity(WordGranularity);
@@ -150,7 +153,7 @@ static void expandSelectionByCharacters(PDFSelection *selection, NSInteger numbe
charactersAddedAfterEnd = selection.string.length - originalLength - charactersAddedBeforeStart;
}

NSString *dictionaryLookupForPDFSelection(PDFSelection *selection, NSDictionary **options)
NSString *DictionaryLookup::stringForPDFSelection(PDFSelection *selection, NSDictionary **options)
{
// Don't do anything if there is no character at the point.
if (!selection || !selection.string.length)
@@ -185,6 +188,69 @@ static void expandSelectionByCharacters(PDFSelection *selection, NSInteger numbe
return selection.string;
}

static PlatformAnimationController showPopupOrCreateAnimationController(bool createAnimationController, const DictionaryPopupInfo& dictionaryPopupInfo, NSView *view, std::function<void(TextIndicator&)> textIndicatorInstallationCallback)
{
if (!getLULookupDefinitionModuleClass())
return nil;

RetainPtr<NSMutableDictionary> mutableOptions = adoptNS([(NSDictionary *)dictionaryPopupInfo.options.get() mutableCopy]);

auto textIndicator = TextIndicator::create(dictionaryPopupInfo.textIndicator);

if (canLoadLUTermOptionDisableSearchTermIndicator() && textIndicator.get().contentImage()) {
textIndicatorInstallationCallback(textIndicator.get());
[mutableOptions setObject:@YES forKey:getLUTermOptionDisableSearchTermIndicator()];

if ([getLULookupDefinitionModuleClass() respondsToSelector:@selector(showDefinitionForTerm:relativeToRect:ofView:options:)]) {
FloatRect firstTextRectInViewCoordinates = textIndicator.get().textRectsInBoundingRectCoordinates()[0];
firstTextRectInViewCoordinates.moveBy(textIndicator.get().textBoundingRectInRootViewCoordinates().location());
if (createAnimationController) {
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
return [getLULookupDefinitionModuleClass() lookupAnimationControllerForTerm:dictionaryPopupInfo.attributedString.get() relativeToRect:firstTextRectInViewCoordinates ofView:view options:mutableOptions.get()];
#else
return nil;
#endif
}
[getLULookupDefinitionModuleClass() showDefinitionForTerm:dictionaryPopupInfo.attributedString.get() relativeToRect:firstTextRectInViewCoordinates ofView:view options:mutableOptions.get()];
return nil;
}
}

NSPoint textBaselineOrigin = dictionaryPopupInfo.origin;

// Convert to screen coordinates.
textBaselineOrigin = [view convertPoint:textBaselineOrigin toView:nil];
textBaselineOrigin = [view.window convertRectToScreen:NSMakeRect(textBaselineOrigin.x, textBaselineOrigin.y, 0, 0)].origin;

if (createAnimationController) {
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
return [getLULookupDefinitionModuleClass() lookupAnimationControllerForTerm:dictionaryPopupInfo.attributedString.get() atLocation:textBaselineOrigin options:mutableOptions.get()];
#else
return nil;
#endif
}

[getLULookupDefinitionModuleClass() showDefinitionForTerm:dictionaryPopupInfo.attributedString.get() atLocation:textBaselineOrigin options:mutableOptions.get()];
return nil;
}

void DictionaryLookup::showPopup(const DictionaryPopupInfo& dictionaryPopupInfo, NSView *view, std::function<void(TextIndicator&)> textIndicatorInstallationCallback)
{
showPopupOrCreateAnimationController(false, dictionaryPopupInfo, view, textIndicatorInstallationCallback);
}

void DictionaryLookup::hidePopup()
{
if (!getLULookupDefinitionModuleClass())
return;
[getLULookupDefinitionModuleClass() hideDefinition];
}

PlatformAnimationController DictionaryLookup::animationControllerForPopup(const DictionaryPopupInfo& dictionaryPopupInfo, NSView *view, std::function<void(TextIndicator&)> textIndicatorInstallationCallback)
{
return showPopupOrCreateAnimationController(true, dictionaryPopupInfo, view, textIndicatorInstallationCallback);
}

} // namespace WebCore

#endif // PLATFORM(MAC)
@@ -1079,7 +1079,7 @@ static bool latchedToFrameOrBody(ContainerNode& container)
return VisibleSelection();

NSDictionary *options = nil;
if (RefPtr<Range> range = rangeForDictionaryLookupAtHitTestResult(result, &options))
if (RefPtr<Range> range = DictionaryLookup::rangeAtHitTestResult(result, &options))
return VisibleSelection(*range);

return VisibleSelection();
@@ -1269,7 +1269,7 @@ RefPtr<Range> Internals::rangeForDictionaryLookupAtLocation(int x, int y, Except

HitTestResult result = document->frame()->mainFrame().eventHandler().hitTestResultAtPoint(IntPoint(x, y));
NSDictionary *options = nullptr;
return rangeForDictionaryLookupAtHitTestResult(result, &options);
return DictionaryLookup::rangeAtHitTestResult(result, &options);
#else
UNUSED_PARAM(x);
UNUSED_PARAM(y);
@@ -1,3 +1,12 @@
2015-08-27 Timothy Horton <timothy_horton@apple.com>

Factor out Lookup invocation
https://bugs.webkit.org/show_bug.cgi?id=148509

Reviewed by Anders Carlsson.

* WebKit.xcodeproj/project.pbxproj:

2015-08-26 Brent Fulgham <bfulgham@apple.com>

Correct build after r188982.
@@ -101,7 +101,6 @@
2D25396718CE85C200270222 /* WebSharingServicePickerController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D25396518CE85C200270222 /* WebSharingServicePickerController.mm */; };
2DD632C219E5D1F0002E9C7B /* WebSelectionServiceController.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DD632C019E5D1F0002E9C7B /* WebSelectionServiceController.h */; };
2DD632C319E5D1F0002E9C7B /* WebSelectionServiceController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DD632C119E5D1F0002E9C7B /* WebSelectionServiceController.mm */; };
2DF064A91A2DD53C00DBB354 /* DictionaryPopupInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DF064A81A2DD53C00DBB354 /* DictionaryPopupInfo.h */; };
312E2FE514E48182007CCA18 /* WebNotification.h in Headers */ = {isa = PBXBuildFile; fileRef = 312E2FE314E48182007CCA18 /* WebNotification.h */; settings = {ATTRIBUTES = (Private, ); }; };
312E2FE614E48182007CCA18 /* WebNotification.mm in Sources */ = {isa = PBXBuildFile; fileRef = 312E2FE414E48182007CCA18 /* WebNotification.mm */; };
312E2FE914E48215007CCA18 /* WebNotificationInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 312E2FE814E48215007CCA18 /* WebNotificationInternal.h */; };
@@ -563,7 +562,6 @@
2D81DAB303EB0B2D00A80166 /* WebFormDelegate.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebFormDelegate.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
2DD632C019E5D1F0002E9C7B /* WebSelectionServiceController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSelectionServiceController.h; sourceTree = "<group>"; };
2DD632C119E5D1F0002E9C7B /* WebSelectionServiceController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebSelectionServiceController.mm; sourceTree = "<group>"; };
2DF064A81A2DD53C00DBB354 /* DictionaryPopupInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DictionaryPopupInfo.h; sourceTree = "<group>"; };
312E2FE314E48182007CCA18 /* WebNotification.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNotification.h; sourceTree = "<group>"; };
312E2FE414E48182007CCA18 /* WebNotification.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebNotification.mm; sourceTree = "<group>"; };
312E2FE814E48215007CCA18 /* WebNotificationInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNotificationInternal.h; sourceTree = "<group>"; };
@@ -1321,7 +1319,6 @@
F52CA6BD02DF9D0F018635CA /* HTML */,
51E94C0706C02CA300A9B09E /* PDF */,
A10C1D79182030190036883A /* ios */,
2DF064A81A2DD53C00DBB354 /* DictionaryPopupInfo.h */,
8373435A0624EE0D00F3B289 /* WebArchive.h */,
8373435B0624EE0D00F3B289 /* WebArchive.mm */,
44BB8B131241A022001E3A22 /* WebArchiveInternal.h */,
@@ -1840,7 +1837,6 @@
A10C1D8C1820305E0036883A /* WebPDFViewIPhone.h in Headers */,
9398106D0824BF01008DF038 /* WebKitErrorsPrivate.h in Headers */,
CD8BFCE815531224005AFB25 /* WebKitFullScreenListener.h in Headers */,
2DF064A91A2DD53C00DBB354 /* DictionaryPopupInfo.h in Headers */,
9398101D0824BF01008DF038 /* WebKitLogging.h in Headers */,
9398101E0824BF01008DF038 /* WebKitNSStringExtras.h in Headers */,
1AAF58940EDCCF15008D883D /* WebKitPluginAgent.defs in Headers */,

0 comments on commit 4ed53c3

Please sign in to comment.