<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[189052] trunk/Source</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/189052">189052</a></dd>
<dt>Author</dt> <dd>timothy_horton@apple.com</dd>
<dt>Date</dt> <dd>2015-08-27 14:24:27 -0700 (Thu, 27 Aug 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>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.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreeditingmacDictionaryLookuph">trunk/Source/WebCore/editing/mac/DictionaryLookup.h</a></li>
<li><a href="#trunkSourceWebCoreeditingmacDictionaryLookupmm">trunk/Source/WebCore/editing/mac/DictionaryLookup.mm</a></li>
<li><a href="#trunkSourceWebCorepagemacEventHandlerMacmm">trunk/Source/WebCore/page/mac/EventHandlerMac.mm</a></li>
<li><a href="#trunkSourceWebCoretestingInternalscpp">trunk/Source/WebCore/testing/Internals.cpp</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitWebKitxcodeprojprojectpbxproj">trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebHTMLViewmm">trunk/Source/WebKit/mac/WebView/WebHTMLView.mm</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebImmediateActionControllermm">trunk/Source/WebKit/mac/WebView/WebImmediateActionController.mm</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebViewmm">trunk/Source/WebKit/mac/WebView/WebView.mm</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebViewInternalh">trunk/Source/WebKit/mac/WebView/WebViewInternal.h</a></li>
<li><a href="#trunkSourceWebKit2CMakeListstxt">trunk/Source/WebKit2/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedWebCoreArgumentCoderscpp">trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedWebCoreArgumentCodersh">trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h</a></li>
<li><a href="#trunkSourceWebKit2SharedWebHitTestResulth">trunk/Source/WebKit2/Shared/WebHitTestResult.h</a></li>
<li><a href="#trunkSourceWebKit2SharedmacArgumentCodersMach">trunk/Source/WebKit2/Shared/mac/ArgumentCodersMac.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPImacWKViewmm">trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessPageClienth">trunk/Source/WebKit2/UIProcess/PageClient.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxymessagesin">trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacPageClientImplh">trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacPageClientImplmm">trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacWKImmediateActionControllermm">trunk/Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacWebPageProxyMacmm">trunk/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKit2WebProcessPluginsPDFPDFPluginmm">trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportmacWebContextMenuClientMacmm">trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPageh">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacWebPageMacmm">trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreeditingDictionaryPopupInfoh">trunk/Source/WebCore/editing/DictionaryPopupInfo.h</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitmacWebViewDictionaryPopupInfoh">trunk/Source/WebKit/mac/WebView/DictionaryPopupInfo.h</a></li>
<li><a href="#trunkSourceWebKit2SharedDictionaryPopupInfocpp">trunk/Source/WebKit2/Shared/DictionaryPopupInfo.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedDictionaryPopupInfoh">trunk/Source/WebKit2/Shared/DictionaryPopupInfo.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (189051 => 189052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-08-27 21:23:49 UTC (rev 189051)
+++ trunk/Source/WebCore/ChangeLog        2015-08-27 21:24:27 UTC (rev 189052)
</span><span class="lines">@@ -1,3 +1,47 @@
</span><ins>+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.
+
</ins><span class="cx"> 2015-08-27 Jon Davis <jond@apple.com>
</span><span class="cx">
</span><span class="cx"> Add IndexedDB to the feature status page.
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (189051 => 189052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-08-27 21:23:49 UTC (rev 189051)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-08-27 21:24:27 UTC (rev 189052)
</span><span class="lines">@@ -1139,6 +1139,7 @@
</span><span class="cx">                 2D5002F81B56D7810020AAF7 /* DOMPath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D5002F71B56D7810020AAF7 /* DOMPath.cpp */; };
</span><span class="cx">                 2D5002FB1B56D7990020AAF7 /* PathUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D5002F91B56D7990020AAF7 /* PathUtilities.cpp */; };
</span><span class="cx">                 2D5002FC1B56D7990020AAF7 /* PathUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D5002FA1B56D7990020AAF7 /* PathUtilities.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                2D5646B01B8F8493003C4994 /* DictionaryPopupInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D5646AF1B8F8493003C4994 /* DictionaryPopupInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 2D58D8551A15F65F00A5F726 /* DataDetection.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D58D8531A15F65F00A5F726 /* DataDetection.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 2D58D8561A15F65F00A5F726 /* DataDetection.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D58D8541A15F65F00A5F726 /* DataDetection.mm */; };
</span><span class="cx">                 2D59F1BF1A0044C6001F3D29 /* DataDetectorsSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D59F1BE1A0044C6001F3D29 /* DataDetectorsSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -8351,6 +8352,7 @@
</span><span class="cx">                 2D5002F71B56D7810020AAF7 /* DOMPath.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMPath.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 2D5002F91B56D7990020AAF7 /* PathUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PathUtilities.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 2D5002FA1B56D7990020AAF7 /* PathUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PathUtilities.h; sourceTree = "<group>"; };
</span><ins>+                2D5646AF1B8F8493003C4994 /* DictionaryPopupInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DictionaryPopupInfo.h; sourceTree = "<group>"; };
</ins><span class="cx">                 2D58D8531A15F65F00A5F726 /* DataDetection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataDetection.h; sourceTree = "<group>"; };
</span><span class="cx">                 2D58D8541A15F65F00A5F726 /* DataDetection.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DataDetection.mm; sourceTree = "<group>"; };
</span><span class="cx">                 2D59F1BE1A0044C6001F3D29 /* DataDetectorsSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataDetectorsSPI.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -17977,6 +17979,7 @@
</span><span class="cx">                                 CECADFC3153778FF00E37068 /* DictationAlternative.h */,
</span><span class="cx">                                 CECADFC4153778FF00E37068 /* DictationCommand.cpp */,
</span><span class="cx">                                 CECADFC5153778FF00E37068 /* DictationCommand.h */,
</span><ins>+                                2D5646AF1B8F8493003C4994 /* DictionaryPopupInfo.h */,
</ins><span class="cx">                                 93309D93099E64910056E581 /* EditAction.h */,
</span><span class="cx">                                 93309D94099E64910056E581 /* EditCommand.cpp */,
</span><span class="cx">                                 93309D95099E64910056E581 /* EditCommand.h */,
</span><span class="lines">@@ -24374,6 +24377,7 @@
</span><span class="cx">                                 31288E750E3005D6003619AE /* CSSKeyframesRule.h in Headers */,
</span><span class="cx">                                 BC772E131331620C001EC9CE /* CSSLineBoxContainValue.h in Headers */,
</span><span class="cx">                                 A80E6D030A1989CA007FB8C5 /* CSSMediaRule.h in Headers */,
</span><ins>+                                2D5646B01B8F8493003C4994 /* DictionaryPopupInfo.h in Headers */,
</ins><span class="cx">                                 F98FFF4511A2676200F548E8 /* CSSOMUtils.h in Headers */,
</span><span class="cx">                                 A80E6D000A1989CA007FB8C5 /* CSSPageRule.h in Headers */,
</span><span class="cx">                                 BC772B3E0C4EA91E0083285F /* CSSParser.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingDictionaryPopupInfoh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/editing/DictionaryPopupInfo.h (0 => 189052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/DictionaryPopupInfo.h         (rev 0)
+++ trunk/Source/WebCore/editing/DictionaryPopupInfo.h        2015-08-27 21:24:27 UTC (rev 189052)
</span><span class="lines">@@ -0,0 +1,49 @@
</span><ins>+/*
+ * 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
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef DictionaryPopupInfo_h
+#define DictionaryPopupInfo_h
+
+#include "FloatPoint.h"
+#include "TextIndicator.h"
+#include <wtf/RetainPtr.h>
+
+OBJC_CLASS NSAttributedString;
+OBJC_CLASS NSDictionary;
+
+namespace WebCore {
+
+struct DictionaryPopupInfo {
+ FloatPoint origin;
+ TextIndicatorData textIndicator;
+#if PLATFORM(COCOA)
+ RetainPtr<NSDictionary> options;
+ RetainPtr<NSAttributedString> attributedString;
+#endif
+};
+
+} // namespace WebCore
+
+#endif // DictionaryPopupInfo_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreeditingmacDictionaryLookuph"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/mac/DictionaryLookup.h (189051 => 189052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/mac/DictionaryLookup.h        2015-08-27 21:23:49 UTC (rev 189051)
+++ trunk/Source/WebCore/editing/mac/DictionaryLookup.h        2015-08-27 21:24:27 UTC (rev 189052)
</span><span class="lines">@@ -28,21 +28,42 @@
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">
</span><ins>+#include "DictionaryPopupInfo.h"
+#include <functional>
</ins><span class="cx"> #include <wtf/PassRefPtr.h>
</span><span class="cx">
</span><del>-OBJC_CLASS NSDictionary;
</del><ins>+OBJC_CLASS NSString;
+OBJC_CLASS NSView;
</ins><span class="cx"> OBJC_CLASS PDFSelection;
</span><span class="cx">
</span><ins>+// 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
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> class HitTestResult;
</span><span class="cx"> class Range;
</span><span class="cx"> class VisibleSelection;
</span><span class="cx">
</span><del>-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);
</del><ins>+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);
</ins><span class="cx">
</span><ins>+ // 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);
+};
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #endif // PLATFORM(MAC)
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingmacDictionaryLookupmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/mac/DictionaryLookup.mm (189051 => 189052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/mac/DictionaryLookup.mm        2015-08-27 21:23:49 UTC (rev 189051)
+++ trunk/Source/WebCore/editing/mac/DictionaryLookup.mm        2015-08-27 21:24:27 UTC (rev 189052)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> #import "HTMLConverter.h"
</span><span class="cx"> #import "HitTestResult.h"
</span><span class="cx"> #import "LookupSPI.h"
</span><ins>+#import "NSImmediateActionGestureRecognizerSPI.h"
</ins><span class="cx"> #import "Page.h"
</span><span class="cx"> #import "Range.h"
</span><span class="cx"> #import "RenderObject.h"
</span><span class="lines">@@ -47,6 +48,8 @@
</span><span class="cx"> #import <PDFKit/PDFKit.h>
</span><span class="cx"> #import <wtf/RefPtr.h>
</span><span class="cx">
</span><ins>+SOFT_LINK_CONSTANT_MAY_FAIL(Lookup, LUTermOptionDisableSearchTermIndicator, NSString *)
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> static bool selectionContainsPosition(const VisiblePosition& position, const VisibleSelection& selection)
</span><span class="lines">@@ -61,7 +64,7 @@
</span><span class="cx"> return selectedRange->contains(position);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-PassRefPtr<Range> rangeForDictionaryLookupForSelection(const VisibleSelection& selection, NSDictionary **options)
</del><ins>+PassRefPtr<Range> DictionaryLookup::rangeForSelection(const VisibleSelection& selection, NSDictionary **options)
</ins><span class="cx"> {
</span><span class="cx"> RefPtr<Range> selectedRange = selection.toNormalizedRange();
</span><span class="cx"> if (!selectedRange)
</span><span class="lines">@@ -87,7 +90,7 @@
</span><span class="cx"> return selectedRange.release();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-PassRefPtr<Range> rangeForDictionaryLookupAtHitTestResult(const HitTestResult& hitTestResult, NSDictionary **options)
</del><ins>+PassRefPtr<Range> DictionaryLookup::rangeAtHitTestResult(const HitTestResult& hitTestResult, NSDictionary **options)
</ins><span class="cx"> {
</span><span class="cx"> Node* node = hitTestResult.innerNonSharedNode();
</span><span class="cx"> if (!node)
</span><span class="lines">@@ -113,7 +116,7 @@
</span><span class="cx"> // If we hit the selection, use that instead of letting Lookup decide the range.
</span><span class="cx"> VisibleSelection selection = frame->page()->focusController().focusedOrMainFrame().selection().selection();
</span><span class="cx"> if (selectionContainsPosition(position, selection))
</span><del>- return rangeForDictionaryLookupForSelection(selection, options);
</del><ins>+ return DictionaryLookup::rangeForSelection(selection, options);
</ins><span class="cx">
</span><span class="cx"> VisibleSelection selectionAccountingForLineRules = VisibleSelection(position);
</span><span class="cx"> selectionAccountingForLineRules.expandUsingGranularity(WordGranularity);
</span><span class="lines">@@ -150,7 +153,7 @@
</span><span class="cx"> charactersAddedAfterEnd = selection.string.length - originalLength - charactersAddedBeforeStart;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-NSString *dictionaryLookupForPDFSelection(PDFSelection *selection, NSDictionary **options)
</del><ins>+NSString *DictionaryLookup::stringForPDFSelection(PDFSelection *selection, NSDictionary **options)
</ins><span class="cx"> {
</span><span class="cx"> // Don't do anything if there is no character at the point.
</span><span class="cx"> if (!selection || !selection.string.length)
</span><span class="lines">@@ -185,6 +188,69 @@
</span><span class="cx"> return selection.string;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+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);
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #endif // PLATFORM(MAC)
</span></span></pre></div>
<a id="trunkSourceWebCorepagemacEventHandlerMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/mac/EventHandlerMac.mm (189051 => 189052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/mac/EventHandlerMac.mm        2015-08-27 21:23:49 UTC (rev 189051)
+++ trunk/Source/WebCore/page/mac/EventHandlerMac.mm        2015-08-27 21:24:27 UTC (rev 189052)
</span><span class="lines">@@ -1079,7 +1079,7 @@
</span><span class="cx"> return VisibleSelection();
</span><span class="cx">
</span><span class="cx"> NSDictionary *options = nil;
</span><del>- if (RefPtr<Range> range = rangeForDictionaryLookupAtHitTestResult(result, &options))
</del><ins>+ if (RefPtr<Range> range = DictionaryLookup::rangeAtHitTestResult(result, &options))
</ins><span class="cx"> return VisibleSelection(*range);
</span><span class="cx">
</span><span class="cx"> return VisibleSelection();
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (189051 => 189052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp        2015-08-27 21:23:49 UTC (rev 189051)
+++ trunk/Source/WebCore/testing/Internals.cpp        2015-08-27 21:24:27 UTC (rev 189052)
</span><span class="lines">@@ -1269,7 +1269,7 @@
</span><span class="cx">
</span><span class="cx"> HitTestResult result = document->frame()->mainFrame().eventHandler().hitTestResultAtPoint(IntPoint(x, y));
</span><span class="cx"> NSDictionary *options = nullptr;
</span><del>- return rangeForDictionaryLookupAtHitTestResult(result, &options);
</del><ins>+ return DictionaryLookup::rangeAtHitTestResult(result, &options);
</ins><span class="cx"> #else
</span><span class="cx"> UNUSED_PARAM(x);
</span><span class="cx"> UNUSED_PARAM(y);
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (189051 => 189052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog        2015-08-27 21:23:49 UTC (rev 189051)
+++ trunk/Source/WebKit/ChangeLog        2015-08-27 21:24:27 UTC (rev 189052)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+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:
+
</ins><span class="cx"> 2015-08-26 Brent Fulgham <bfulgham@apple.com>
</span><span class="cx">
</span><span class="cx"> Correct build after r188982.
</span></span></pre></div>
<a id="trunkSourceWebKitWebKitxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (189051 => 189052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj        2015-08-27 21:23:49 UTC (rev 189051)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj        2015-08-27 21:24:27 UTC (rev 189052)
</span><span class="lines">@@ -101,7 +101,6 @@
</span><span class="cx">                 2D25396718CE85C200270222 /* WebSharingServicePickerController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D25396518CE85C200270222 /* WebSharingServicePickerController.mm */; };
</span><span class="cx">                 2DD632C219E5D1F0002E9C7B /* WebSelectionServiceController.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DD632C019E5D1F0002E9C7B /* WebSelectionServiceController.h */; };
</span><span class="cx">                 2DD632C319E5D1F0002E9C7B /* WebSelectionServiceController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DD632C119E5D1F0002E9C7B /* WebSelectionServiceController.mm */; };
</span><del>-                2DF064A91A2DD53C00DBB354 /* DictionaryPopupInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DF064A81A2DD53C00DBB354 /* DictionaryPopupInfo.h */; };
</del><span class="cx">                 312E2FE514E48182007CCA18 /* WebNotification.h in Headers */ = {isa = PBXBuildFile; fileRef = 312E2FE314E48182007CCA18 /* WebNotification.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 312E2FE614E48182007CCA18 /* WebNotification.mm in Sources */ = {isa = PBXBuildFile; fileRef = 312E2FE414E48182007CCA18 /* WebNotification.mm */; };
</span><span class="cx">                 312E2FE914E48215007CCA18 /* WebNotificationInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 312E2FE814E48215007CCA18 /* WebNotificationInternal.h */; };
</span><span class="lines">@@ -563,7 +562,6 @@
</span><span class="cx">                 2D81DAB303EB0B2D00A80166 /* WebFormDelegate.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebFormDelegate.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
</span><span class="cx">                 2DD632C019E5D1F0002E9C7B /* WebSelectionServiceController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSelectionServiceController.h; sourceTree = "<group>"; };
</span><span class="cx">                 2DD632C119E5D1F0002E9C7B /* WebSelectionServiceController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebSelectionServiceController.mm; sourceTree = "<group>"; };
</span><del>-                2DF064A81A2DD53C00DBB354 /* DictionaryPopupInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DictionaryPopupInfo.h; sourceTree = "<group>"; };
</del><span class="cx">                 312E2FE314E48182007CCA18 /* WebNotification.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNotification.h; sourceTree = "<group>"; };
</span><span class="cx">                 312E2FE414E48182007CCA18 /* WebNotification.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebNotification.mm; sourceTree = "<group>"; };
</span><span class="cx">                 312E2FE814E48215007CCA18 /* WebNotificationInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNotificationInternal.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -1321,7 +1319,6 @@
</span><span class="cx">                                 F52CA6BD02DF9D0F018635CA /* HTML */,
</span><span class="cx">                                 51E94C0706C02CA300A9B09E /* PDF */,
</span><span class="cx">                                 A10C1D79182030190036883A /* ios */,
</span><del>-                                2DF064A81A2DD53C00DBB354 /* DictionaryPopupInfo.h */,
</del><span class="cx">                                 8373435A0624EE0D00F3B289 /* WebArchive.h */,
</span><span class="cx">                                 8373435B0624EE0D00F3B289 /* WebArchive.mm */,
</span><span class="cx">                                 44BB8B131241A022001E3A22 /* WebArchiveInternal.h */,
</span><span class="lines">@@ -1840,7 +1837,6 @@
</span><span class="cx">                                 A10C1D8C1820305E0036883A /* WebPDFViewIPhone.h in Headers */,
</span><span class="cx">                                 9398106D0824BF01008DF038 /* WebKitErrorsPrivate.h in Headers */,
</span><span class="cx">                                 CD8BFCE815531224005AFB25 /* WebKitFullScreenListener.h in Headers */,
</span><del>-                                2DF064A91A2DD53C00DBB354 /* DictionaryPopupInfo.h in Headers */,
</del><span class="cx">                                 9398101D0824BF01008DF038 /* WebKitLogging.h in Headers */,
</span><span class="cx">                                 9398101E0824BF01008DF038 /* WebKitNSStringExtras.h in Headers */,
</span><span class="cx">                                 1AAF58940EDCCF15008D883D /* WebKitPluginAgent.defs in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (189051 => 189052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2015-08-27 21:23:49 UTC (rev 189051)
+++ trunk/Source/WebKit/mac/ChangeLog        2015-08-27 21:24:27 UTC (rev 189052)
</span><span class="lines">@@ -1,3 +1,30 @@
</span><ins>+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.
+
+ * 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.
+
</ins><span class="cx"> 2015-08-27 Brian Burg <bburg@apple.com>
</span><span class="cx">
</span><span class="cx"> Web Inspector: FrontendChannel should know its own connection type
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewDictionaryPopupInfoh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit/mac/WebView/DictionaryPopupInfo.h (189051 => 189052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/DictionaryPopupInfo.h        2015-08-27 21:23:49 UTC (rev 189051)
+++ trunk/Source/WebKit/mac/WebView/DictionaryPopupInfo.h        2015-08-27 21:24:27 UTC (rev 189052)
</span><span class="lines">@@ -1,45 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#if PLATFORM(MAC)
-
-#import <WebCore/FloatPoint.h>
-#import <wtf/RetainPtr.h>
-
-@class NSAttributedString;
-@class NSDictionary;
-
-namespace WebCore {
-class TextIndicator;
-};
-
-struct DictionaryPopupInfo {
- NSPoint origin;
- RetainPtr<NSDictionary> options;
- RetainPtr<NSAttributedString> attributedString;
- RefPtr<WebCore::TextIndicator> textIndicator;
-};
-
-#endif // PLATFORM(MAC)
</del></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebHTMLViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebHTMLView.mm (189051 => 189052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebHTMLView.mm        2015-08-27 21:23:49 UTC (rev 189051)
+++ trunk/Source/WebKit/mac/WebView/WebHTMLView.mm        2015-08-27 21:24:27 UTC (rev 189052)
</span><span class="lines">@@ -34,7 +34,6 @@
</span><span class="cx"> #import "DOMDocumentInternal.h"
</span><span class="cx"> #import "DOMNodeInternal.h"
</span><span class="cx"> #import "DOMRangeInternal.h"
</span><del>-#import "DictionaryPopupInfo.h"
</del><span class="cx"> #import "WebArchive.h"
</span><span class="cx"> #import "WebClipView.h"
</span><span class="cx"> #import "WebContextMenuClient.h"
</span><span class="lines">@@ -82,6 +81,7 @@
</span><span class="cx"> #import <WebCore/ColorMac.h>
</span><span class="cx"> #import <WebCore/ContextMenu.h>
</span><span class="cx"> #import <WebCore/ContextMenuController.h>
</span><ins>+#import <WebCore/DictionaryLookup.h>
</ins><span class="cx"> #import <WebCore/Document.h>
</span><span class="cx"> #import <WebCore/DocumentFragment.h>
</span><span class="cx"> #import <WebCore/DocumentMarkerController.h>
</span><span class="lines">@@ -5689,7 +5689,8 @@
</span><span class="cx"> DictionaryPopupInfo info;
</span><span class="cx"> info.attributedString = attrString;
</span><span class="cx"> info.origin = coreFrame->view()->contentsToWindow(enclosingIntRect(rect)).location();
</span><del>- info.textIndicator = TextIndicator::createWithSelectionInFrame(*coreFrame, TextIndicatorOptionIncludeSnapshotWithSelectionHighlight, TextIndicatorPresentationTransition::BounceAndCrossfade);
</del><ins>+ if (auto textIndicator = TextIndicator::createWithSelectionInFrame(*coreFrame, TextIndicatorOptionIncludeSnapshotWithSelectionHighlight, TextIndicatorPresentationTransition::BounceAndCrossfade))
+ info.textIndicator = textIndicator->data();
</ins><span class="cx"> [[self _webView] _showDictionaryLookupPopup:info];
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebImmediateActionControllermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebImmediateActionController.mm (189051 => 189052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebImmediateActionController.mm        2015-08-27 21:23:49 UTC (rev 189051)
+++ trunk/Source/WebKit/mac/WebView/WebImmediateActionController.mm        2015-08-27 21:24:27 UTC (rev 189052)
</span><span class="lines">@@ -30,7 +30,6 @@
</span><span class="cx"> #import "DOMElementInternal.h"
</span><span class="cx"> #import "DOMNodeInternal.h"
</span><span class="cx"> #import "DOMRangeInternal.h"
</span><del>-#import "DictionaryPopupInfo.h"
</del><span class="cx"> #import "WebElementDictionary.h"
</span><span class="cx"> #import "WebFrameInternal.h"
</span><span class="cx"> #import "WebHTMLView.h"
</span><span class="lines">@@ -454,6 +453,7 @@
</span><span class="cx"> if (!linkRange)
</span><span class="cx"> return nullptr;
</span><span class="cx"> RefPtr<TextIndicator> indicator = TextIndicator::createWithRange(*linkRange, TextIndicatorOptionDefault, TextIndicatorPresentationTransition::FadeIn);
</span><ins>+ indicator->data().textBoundingRectInRootViewCoordinates = [_webView _convertRectFromRootView:indicator->textBoundingRectInRootViewCoordinates()];
</ins><span class="cx">
</span><span class="cx"> _currentActionContext = [actionContext contextForView:_webView altMode:YES interactionStartedHandler:^() {
</span><span class="cx"> } interactionChangedHandler:^() {
</span><span class="lines">@@ -510,7 +510,9 @@
</span><span class="cx"> }];
</span><span class="cx">
</span><span class="cx"> popupInfo.attributedString = scaledNSAttributedString.get();
</span><del>- popupInfo.textIndicator = TextIndicator::createWithRange(range, TextIndicatorOptionDefault, presentationTransition);
</del><ins>+
+ if (auto textIndicator = TextIndicator::createWithRange(range, TextIndicatorOptionDefault, presentationTransition))
+ popupInfo.textIndicator = textIndicator->data();
</ins><span class="cx"> return popupInfo;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -528,7 +530,7 @@
</span><span class="cx"> return nil;
</span><span class="cx">
</span><span class="cx"> NSDictionary *options = nil;
</span><del>- RefPtr<Range> dictionaryRange = rangeForDictionaryLookupAtHitTestResult(_hitTestResult, &options);
</del><ins>+ RefPtr<Range> dictionaryRange = DictionaryLookup::rangeAtHitTestResult(_hitTestResult, &options);
</ins><span class="cx"> if (!dictionaryRange)
</span><span class="cx"> return nil;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (189051 => 189052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebView.mm        2015-08-27 21:23:49 UTC (rev 189051)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm        2015-08-27 21:24:27 UTC (rev 189052)
</span><span class="lines">@@ -35,7 +35,6 @@
</span><span class="cx"> #import "DOMDocumentInternal.h"
</span><span class="cx"> #import "DOMNodeInternal.h"
</span><span class="cx"> #import "DOMRangeInternal.h"
</span><del>-#import "DictionaryPopupInfo.h"
</del><span class="cx"> #import "StorageThread.h"
</span><span class="cx"> #import "WebAlternativeTextClient.h"
</span><span class="cx"> #import "WebApplicationCacheInternal.h"
</span><span class="lines">@@ -123,6 +122,7 @@
</span><span class="cx"> #import <WebCore/Chrome.h>
</span><span class="cx"> #import <WebCore/ColorMac.h>
</span><span class="cx"> #import <WebCore/DatabaseManager.h>
</span><ins>+#import <WebCore/DictionaryLookup.h>
</ins><span class="cx"> #import <WebCore/Document.h>
</span><span class="cx"> #import <WebCore/DocumentLoader.h>
</span><span class="cx"> #import <WebCore/DragController.h>
</span><span class="lines">@@ -295,7 +295,6 @@
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx"> SOFT_LINK_CONSTANT_MAY_FAIL(Lookup, LUNotificationPopoverWillClose, NSString *)
</span><del>-SOFT_LINK_CONSTANT_MAY_FAIL(Lookup, LUTermOptionDisableSearchTermIndicator, NSString *)
</del><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if !PLATFORM(IOS)
</span><span class="lines">@@ -8551,29 +8550,14 @@
</span><span class="cx"> if (!dictionaryPopupInfo.attributedString)
</span><span class="cx"> return nil;
</span><span class="cx">
</span><del>- if (canLoadLUTermOptionDisableSearchTermIndicator() && canLoadLUNotificationPopoverWillClose() && dictionaryPopupInfo.textIndicator) {
- if (!_private->hasInitializedLookupObserver) {
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_dictionaryLookupPopoverWillClose:) name:getLUNotificationPopoverWillClose() object:nil];
- _private->hasInitializedLookupObserver = YES;
- }
</del><ins>+ [self _prepareForDictionaryLookup];
</ins><span class="cx">
</span><del>- RetainPtr<NSMutableDictionary> mutableOptions = adoptNS([dictionaryPopupInfo.options mutableCopy]);
- if (!mutableOptions)
- mutableOptions = adoptNS([[NSMutableDictionary alloc] init]);
- [mutableOptions setObject:@YES forKey:getLUTermOptionDisableSearchTermIndicator()];
- [self _setTextIndicator:*dictionaryPopupInfo.textIndicator withLifetime:TextIndicatorWindowLifetime::Permanent];
</del><ins>+ DictionaryPopupInfo adjustedPopupInfo = dictionaryPopupInfo;
+ adjustedPopupInfo.textIndicator.textBoundingRectInRootViewCoordinates = [self _convertRectFromRootView:adjustedPopupInfo.textIndicator.textBoundingRectInRootViewCoordinates];
</ins><span class="cx">
</span><del>- 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()];
- }
- }
-
- // 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()];
</del><ins>+ return DictionaryLookup::animationControllerForPopup(adjustedPopupInfo, self, [self](TextIndicator& textIndicator) {
+ [self _setTextIndicator:textIndicator withLifetime:TextIndicatorWindowLifetime::Permanent];
+ });
</ins><span class="cx"> }
</span><span class="cx"> #endif // __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
</span><span class="cx">
</span><span class="lines">@@ -8597,7 +8581,7 @@
</span><span class="cx"> if (!_private->textIndicatorWindow)
</span><span class="cx"> _private->textIndicatorWindow = std::make_unique<TextIndicatorWindow>(self);
</span><span class="cx">
</span><del>- NSRect textBoundingRectInWindowCoordinates = [self convertRect:[self _convertRectFromRootView:textIndicator.textBoundingRectInRootViewCoordinates()] toView:nil];
</del><ins>+ NSRect textBoundingRectInWindowCoordinates = [self convertRect:textIndicator.textBoundingRectInRootViewCoordinates() toView:nil];
</ins><span class="cx"> NSRect textBoundingRectInScreenCoordinates = [self.window convertRectToScreen:textBoundingRectInWindowCoordinates];
</span><span class="cx"> _private->textIndicatorWindow->setTextIndicator(textIndicator, NSRectToCGRect(textBoundingRectInScreenCoordinates), lifetime);
</span><span class="cx"> }
</span><span class="lines">@@ -8615,35 +8599,30 @@
</span><span class="cx"> _private->textIndicatorWindow->setAnimationProgress(progress);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-- (void)_showDictionaryLookupPopup:(const DictionaryPopupInfo&)dictionaryPopupInfo
</del><ins>+- (void)_prepareForDictionaryLookup
</ins><span class="cx"> {
</span><del>- if (!dictionaryPopupInfo.attributedString)
</del><ins>+ if (_private->hasInitializedLookupObserver)
</ins><span class="cx"> return;
</span><span class="cx">
</span><del>- if (canLoadLUTermOptionDisableSearchTermIndicator() && canLoadLUNotificationPopoverWillClose() && dictionaryPopupInfo.textIndicator) {
- if (!_private->hasInitializedLookupObserver) {
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_dictionaryLookupPopoverWillClose:) name:getLUNotificationPopoverWillClose() object:nil];
- _private->hasInitializedLookupObserver = YES;
- }
</del><ins>+ _private->hasInitializedLookupObserver = YES;
</ins><span class="cx">
</span><del>- RetainPtr<NSMutableDictionary> mutableOptions = adoptNS([dictionaryPopupInfo.options mutableCopy]);
- if (!mutableOptions)
- mutableOptions = adoptNS([[NSMutableDictionary alloc] init]);
- [mutableOptions setObject:@YES forKey:getLUTermOptionDisableSearchTermIndicator()];
- [self _setTextIndicator:*dictionaryPopupInfo.textIndicator withLifetime:TextIndicatorWindowLifetime::Permanent];
</del><ins>+ if (canLoadLUNotificationPopoverWillClose())
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_dictionaryLookupPopoverWillClose:) name:getLUNotificationPopoverWillClose() object:nil];
+}
</ins><span class="cx">
</span><del>- 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;
- }
- }
</del><ins>+- (void)_showDictionaryLookupPopup:(const DictionaryPopupInfo&)dictionaryPopupInfo
+{
+ if (!dictionaryPopupInfo.attributedString)
+ return;
</ins><span class="cx">
</span><del>- // Convert to screen coordinates.
- NSPoint textBaselineOrigin = [self.window convertRectToScreen:NSMakeRect(dictionaryPopupInfo.origin.x, dictionaryPopupInfo.origin.y, 0, 0)].origin;
</del><ins>+ [self _prepareForDictionaryLookup];
</ins><span class="cx">
</span><del>- [getLULookupDefinitionModuleClass() showDefinitionForTerm:dictionaryPopupInfo.attributedString.get() atLocation:textBaselineOrigin options:dictionaryPopupInfo.options.get()];
</del><ins>+ DictionaryPopupInfo adjustedPopupInfo = dictionaryPopupInfo;
+ adjustedPopupInfo.textIndicator.textBoundingRectInRootViewCoordinates = [self _convertRectFromRootView:adjustedPopupInfo.textIndicator.textBoundingRectInRootViewCoordinates];
+
+ DictionaryLookup::showPopup(adjustedPopupInfo, self, [self](TextIndicator& textIndicator) {
+ [self _setTextIndicator:textIndicator withLifetime:TextIndicatorWindowLifetime::Permanent];
+ });
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)_dictionaryLookupPopoverWillClose:(NSNotification *)notification
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebViewInternalh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebViewInternal.h (189051 => 189052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebViewInternal.h        2015-08-27 21:23:49 UTC (rev 189051)
+++ trunk/Source/WebKit/mac/WebView/WebViewInternal.h        2015-08-27 21:24:27 UTC (rev 189052)
</span><span class="lines">@@ -58,9 +58,9 @@
</span><span class="cx"> class TextIndicator;
</span><span class="cx"> class URL;
</span><span class="cx"> struct DictationAlternative;
</span><ins>+struct DictionaryPopupInfo;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-struct DictionaryPopupInfo;
</del><span class="cx"> class WebMediaPlaybackTargetPicker;
</span><span class="cx"> class WebSelectionServiceController;
</span><span class="cx">
</span><span class="lines">@@ -269,9 +269,9 @@
</span><span class="cx"> - (void)_setTextIndicator:(WebCore::TextIndicator&)textIndicator withLifetime:(WebCore::TextIndicatorWindowLifetime)lifetime;
</span><span class="cx"> - (void)_clearTextIndicatorWithAnimation:(WebCore::TextIndicatorWindowDismissalAnimation)animation;
</span><span class="cx"> - (void)_setTextIndicatorAnimationProgress:(float)progress;
</span><del>-- (void)_showDictionaryLookupPopup:(const DictionaryPopupInfo&)dictionaryPopupInfo;
</del><ins>+- (void)_showDictionaryLookupPopup:(const WebCore::DictionaryPopupInfo&)dictionaryPopupInfo;
</ins><span class="cx"> #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
</span><del>-- (id)_animationControllerForDictionaryLookupPopupInfo:(const DictionaryPopupInfo&)dictionaryPopupInfo;
</del><ins>+- (id)_animationControllerForDictionaryLookupPopupInfo:(const WebCore::DictionaryPopupInfo&)dictionaryPopupInfo;
</ins><span class="cx"> - (WebImmediateActionController *)_immediateActionController;
</span><span class="cx"> #endif
</span><span class="cx"> - (NSEvent *)_pressureEvent;
</span></span></pre></div>
<a id="trunkSourceWebKit2CMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/CMakeLists.txt (189051 => 189052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/CMakeLists.txt        2015-08-27 21:23:49 UTC (rev 189051)
+++ trunk/Source/WebKit2/CMakeLists.txt        2015-08-27 21:24:27 UTC (rev 189052)
</span><span class="lines">@@ -217,7 +217,6 @@
</span><span class="cx"> Shared/ChildProcess.cpp
</span><span class="cx"> Shared/ChildProcessProxy.cpp
</span><span class="cx"> Shared/ContextMenuContextData.cpp
</span><del>- Shared/DictionaryPopupInfo.cpp
</del><span class="cx"> Shared/EditorState.cpp
</span><span class="cx"> Shared/FontInfo.cpp
</span><span class="cx"> Shared/LayerTreeContext.cpp
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (189051 => 189052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-08-27 21:23:49 UTC (rev 189051)
+++ trunk/Source/WebKit2/ChangeLog        2015-08-27 21:24:27 UTC (rev 189052)
</span><span class="lines">@@ -1,3 +1,48 @@
</span><ins>+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.
+
+ * 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.
+
</ins><span class="cx"> 2015-08-27 Brian Burg <bburg@apple.com>
</span><span class="cx">
</span><span class="cx"> Web Inspector: FrontendChannel should know its own connection type
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedDictionaryPopupInfocpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/Shared/DictionaryPopupInfo.cpp (189051 => 189052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/DictionaryPopupInfo.cpp        2015-08-27 21:23:49 UTC (rev 189051)
+++ trunk/Source/WebKit2/Shared/DictionaryPopupInfo.cpp        2015-08-27 21:24:27 UTC (rev 189052)
</span><span class="lines">@@ -1,75 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "DictionaryPopupInfo.h"
-
-#include "WebCoreArgumentCoders.h"
-
-#if PLATFORM(COCOA)
-#include "ArgumentCodersCF.h"
-#endif
-
-namespace WebKit {
-
-void DictionaryPopupInfo::encode(IPC::ArgumentEncoder& encoder) const
-{
- encoder << origin;
- encoder << textIndicator;
-
-#if PLATFORM(COCOA)
- bool hadOptions = options;
- encoder << hadOptions;
- if (hadOptions)
- IPC::encode(encoder, options.get());
-
- encoder << attributedString;
-#endif
-}
-
-bool DictionaryPopupInfo::decode(IPC::ArgumentDecoder& decoder, DictionaryPopupInfo& result)
-{
- if (!decoder.decode(result.origin))
- return false;
-
- if (!decoder.decode(result.textIndicator))
- return false;
-
-#if PLATFORM(COCOA)
- bool hadOptions;
- if (!decoder.decode(hadOptions))
- return false;
- if (hadOptions) {
- if (!IPC::decode(decoder, result.options))
- return false;
- }
-
- if (!decoder.decode(result.attributedString))
- return false;
-#endif
- return true;
-}
-
-} // namespace WebKit
</del></span></pre></div>
<a id="trunkSourceWebKit2SharedDictionaryPopupInfoh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/Shared/DictionaryPopupInfo.h (189051 => 189052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/DictionaryPopupInfo.h        2015-08-27 21:23:49 UTC (rev 189051)
+++ trunk/Source/WebKit2/Shared/DictionaryPopupInfo.h        2015-08-27 21:24:27 UTC (rev 189052)
</span><span class="lines">@@ -1,58 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef DictionaryPopupInfo_h
-#define DictionaryPopupInfo_h
-
-#include <WebCore/FloatPoint.h>
-#include <WebCore/TextIndicator.h>
-
-#if PLATFORM(COCOA)
-#include "AttributedString.h"
-#include <wtf/RetainPtr.h>
-#endif
-
-namespace IPC {
-class ArgumentDecoder;
-class ArgumentEncoder;
-}
-
-namespace WebKit {
-
-struct DictionaryPopupInfo {
- void encode(IPC::ArgumentEncoder&) const;
- static bool decode(IPC::ArgumentDecoder&, DictionaryPopupInfo&);
-
- WebCore::FloatPoint origin;
- WebCore::TextIndicatorData textIndicator;
-#if PLATFORM(COCOA)
- RetainPtr<CFDictionaryRef> options;
- AttributedString attributedString;
-#endif
-};
-
-} // namespace WebKit
-
-#endif // DictionaryPopupInfo_h
</del></span></pre></div>
<a id="trunkSourceWebKit2SharedWebCoreArgumentCoderscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp (189051 => 189052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp        2015-08-27 21:23:49 UTC (rev 189051)
+++ trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp        2015-08-27 21:24:27 UTC (rev 189052)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> #include <WebCore/Cursor.h>
</span><span class="cx"> #include <WebCore/DatabaseDetails.h>
</span><span class="cx"> #include <WebCore/DictationAlternative.h>
</span><ins>+#include <WebCore/DictionaryPopupInfo.h>
</ins><span class="cx"> #include <WebCore/Editor.h>
</span><span class="cx"> #include <WebCore/FileChooser.h>
</span><span class="cx"> #include <WebCore/FilterOperation.h>
</span><span class="lines">@@ -73,6 +74,7 @@
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx"> #include "ArgumentCodersCF.h"
</span><ins>+#include "ArgumentCodersMac.h"
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="lines">@@ -2203,4 +2205,52 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+void ArgumentCoder<DictionaryPopupInfo>::encode(IPC::ArgumentEncoder& encoder, const DictionaryPopupInfo& info)
+{
+ encoder << info.origin;
+ encoder << info.textIndicator;
+
+#if PLATFORM(COCOA)
+ bool hadOptions = info.options;
+ encoder << hadOptions;
+ if (hadOptions)
+ IPC::encode(encoder, info.options.get());
+
+ bool hadAttributedString = info.attributedString;
+ encoder << hadAttributedString;
+ if (hadAttributedString)
+ IPC::encode(encoder, info.attributedString.get());
+#endif
+}
+
+bool ArgumentCoder<DictionaryPopupInfo>::decode(IPC::ArgumentDecoder& decoder, DictionaryPopupInfo& result)
+{
+ if (!decoder.decode(result.origin))
+ return false;
+
+ if (!decoder.decode(result.textIndicator))
+ return false;
+
+#if PLATFORM(COCOA)
+ bool hadOptions;
+ if (!decoder.decode(hadOptions))
+ return false;
+ if (hadOptions) {
+ if (!IPC::decode(decoder, result.options))
+ return false;
+ } else
+ result.options = nullptr;
+
+ bool hadAttributedString;
+ if (!decoder.decode(hadAttributedString))
+ return false;
+ if (hadAttributedString) {
+ if (!IPC::decode(decoder, result.attributedString))
+ return false;
+ } else
+ result.attributedString = nullptr;
+#endif
+ return true;
+}
+
</ins><span class="cx"> } // namespace IPC
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebCoreArgumentCodersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h (189051 => 189052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h        2015-08-27 21:23:49 UTC (rev 189051)
+++ trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h        2015-08-27 21:24:27 UTC (rev 189052)
</span><span class="lines">@@ -71,6 +71,7 @@
</span><span class="cx"> struct CompositionUnderline;
</span><span class="cx"> struct Cookie;
</span><span class="cx"> struct DictationAlternative;
</span><ins>+struct DictionaryPopupInfo;
</ins><span class="cx"> struct FileChooserSettings;
</span><span class="cx"> struct IDBDatabaseMetadata;
</span><span class="cx"> struct IDBGetResult;
</span><span class="lines">@@ -473,6 +474,11 @@
</span><span class="cx"> static bool decode(ArgumentDecoder&, WebCore::TextIndicatorData&);
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+template<> struct ArgumentCoder<WebCore::DictionaryPopupInfo> {
+ static void encode(ArgumentEncoder&, const WebCore::DictionaryPopupInfo&);
+ static bool decode(ArgumentDecoder&, WebCore::DictionaryPopupInfo&);
+};
+
</ins><span class="cx"> #if ENABLE(WIRELESS_PLAYBACK_TARGET)
</span><span class="cx"> template<> struct ArgumentCoder<WebCore::MediaPlaybackTargetContext> {
</span><span class="cx"> static void encode(ArgumentEncoder&, const WebCore::MediaPlaybackTargetContext&);
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebHitTestResulth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebHitTestResult.h (189051 => 189052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebHitTestResult.h        2015-08-27 21:23:49 UTC (rev 189051)
+++ trunk/Source/WebKit2/Shared/WebHitTestResult.h        2015-08-27 21:24:27 UTC (rev 189052)
</span><span class="lines">@@ -21,8 +21,8 @@
</span><span class="cx"> #define WebHitTestResult_h
</span><span class="cx">
</span><span class="cx"> #include "APIObject.h"
</span><del>-#include "DictionaryPopupInfo.h"
</del><span class="cx"> #include "SharedMemory.h"
</span><ins>+#include <WebCore/DictionaryPopupInfo.h>
</ins><span class="cx"> #include <WebCore/FloatPoint.h>
</span><span class="cx"> #include <WebCore/IntRect.h>
</span><span class="cx"> #include <WebCore/PageOverlay.h>
</span><span class="lines">@@ -75,7 +75,7 @@
</span><span class="cx"> RefPtr<WebCore::TextIndicator> detectedDataTextIndicator;
</span><span class="cx"> WebCore::PageOverlay::PageOverlayID detectedDataOriginatingPageOverlay;
</span><span class="cx">
</span><del>- DictionaryPopupInfo dictionaryPopupInfo;
</del><ins>+ WebCore::DictionaryPopupInfo dictionaryPopupInfo;
</ins><span class="cx">
</span><span class="cx"> RefPtr<WebCore::TextIndicator> linkTextIndicator;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedmacArgumentCodersMach"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/mac/ArgumentCodersMac.h (189051 => 189052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/mac/ArgumentCodersMac.h        2015-08-27 21:23:49 UTC (rev 189051)
+++ trunk/Source/WebKit2/Shared/mac/ArgumentCodersMac.h        2015-08-27 21:24:27 UTC (rev 189052)
</span><span class="lines">@@ -28,6 +28,16 @@
</span><span class="cx">
</span><span class="cx"> #include <wtf/RetainPtr.h>
</span><span class="cx">
</span><ins>+OBJC_CLASS NSArray;
+OBJC_CLASS NSAttributedString;
+OBJC_CLASS NSColor;
+OBJC_CLASS NSData;
+OBJC_CLASS NSDate;
+OBJC_CLASS NSDictionary;
+OBJC_CLASS NSFont;
+OBJC_CLASS NSNumber;
+OBJC_CLASS NSString;
+
</ins><span class="cx"> namespace IPC {
</span><span class="cx">
</span><span class="cx"> class ArgumentEncoder;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPImacWKViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (189051 => 189052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm        2015-08-27 21:23:49 UTC (rev 189051)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm        2015-08-27 21:24:27 UTC (rev 189052)
</span><span class="lines">@@ -83,6 +83,7 @@
</span><span class="cx"> #import <WebCore/AXObjectCache.h>
</span><span class="cx"> #import <WebCore/ColorMac.h>
</span><span class="cx"> #import <WebCore/DataDetectorsSPI.h>
</span><ins>+#import <WebCore/DictionaryLookup.h>
</ins><span class="cx"> #import <WebCore/DragController.h>
</span><span class="cx"> #import <WebCore/DragData.h>
</span><span class="cx"> #import <WebCore/FloatRect.h>
</span><span class="lines">@@ -4083,9 +4084,7 @@
</span><span class="cx">
</span><span class="cx"> + (void)hideWordDefinitionWindow
</span><span class="cx"> {
</span><del>- if (!getLULookupDefinitionModuleClass())
- return;
- [getLULookupDefinitionModuleClass() hideDefinition];
</del><ins>+ DictionaryLookup::hidePopup();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (NSSize)minimumSizeForAutoLayout
</span><span class="lines">@@ -4676,8 +4675,7 @@
</span><span class="cx"> || [_data->_immediateActionController hasActiveImmediateAction]
</span><span class="cx"> #endif
</span><span class="cx"> ) {
</span><del>- if (Class lookupDefinitionModuleClass = getLULookupDefinitionModuleClass())
- [lookupDefinitionModuleClass hideDefinition];
</del><ins>+ DictionaryLookup::hidePopup();
</ins><span class="cx">
</span><span class="cx"> #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
</span><span class="cx"> DDActionsManager *actionsManager = [getDDActionsManagerClass() sharedManager];
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessPageClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/PageClient.h (189051 => 189052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/PageClient.h        2015-08-27 21:23:49 UTC (rev 189051)
+++ trunk/Source/WebKit2/UIProcess/PageClient.h        2015-08-27 21:24:27 UTC (rev 189052)
</span><span class="lines">@@ -239,7 +239,7 @@
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx"> virtual void pluginFocusOrWindowFocusChanged(uint64_t pluginComplexTextInputIdentifier, bool pluginHasFocusAndWindowHasFocus) = 0;
</span><span class="cx"> virtual void setPluginComplexTextInputState(uint64_t pluginComplexTextInputIdentifier, PluginComplexTextInputState) = 0;
</span><del>- virtual void didPerformDictionaryLookup(const DictionaryPopupInfo&) = 0;
</del><ins>+ virtual void didPerformDictionaryLookup(const WebCore::DictionaryPopupInfo&) = 0;
</ins><span class="cx"> virtual void dismissContentRelativeChildWindows(bool withAnimation = true) = 0;
</span><span class="cx"> virtual void showCorrectionPanel(WebCore::AlternativeTextType, const WebCore::FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings) = 0;
</span><span class="cx"> virtual void dismissCorrectionPanel(WebCore::ReasonForDismissingAlternativeText) = 0;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (189051 => 189052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2015-08-27 21:23:49 UTC (rev 189051)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2015-08-27 21:24:27 UTC (rev 189052)
</span><span class="lines">@@ -155,6 +155,7 @@
</span><span class="cx"> class RunLoopObserver;
</span><span class="cx"> class SharedBuffer;
</span><span class="cx"> class TextIndicator;
</span><ins>+struct DictionaryPopupInfo;
</ins><span class="cx"> struct FileChooserSettings;
</span><span class="cx"> struct TextAlternativeWithRange;
</span><span class="cx"> struct TextCheckingResult;
</span><span class="lines">@@ -201,7 +202,6 @@
</span><span class="cx"> class WebsiteDataStore;
</span><span class="cx"> struct AttributedString;
</span><span class="cx"> struct ColorSpaceData;
</span><del>-struct DictionaryPopupInfo;
</del><span class="cx"> struct EditingRange;
</span><span class="cx"> struct EditorState;
</span><span class="cx"> struct PlatformPopupMenuData;
</span><span class="lines">@@ -1295,7 +1295,7 @@
</span><span class="cx"> void searchTheWeb(const String&);
</span><span class="cx">
</span><span class="cx"> // Dictionary.
</span><del>- void didPerformDictionaryLookup(const DictionaryPopupInfo&);
</del><ins>+ void didPerformDictionaryLookup(const WebCore::DictionaryPopupInfo&);
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(MAC)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in (189051 => 189052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2015-08-27 21:23:49 UTC (rev 189051)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2015-08-27 21:24:27 UTC (rev 189052)
</span><span class="lines">@@ -308,7 +308,7 @@
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx"> # Dictionary support.
</span><del>- DidPerformDictionaryLookup(struct WebKit::DictionaryPopupInfo dictionaryPopupInfo)
</del><ins>+ DidPerformDictionaryLookup(struct WebCore::DictionaryPopupInfo dictionaryPopupInfo)
</ins><span class="cx">
</span><span class="cx"> # Keyboard input support messages
</span><span class="cx"> ExecuteSavedCommandBySelector(String selector) -> (bool handled)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacPageClientImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h (189051 => 189052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h        2015-08-27 21:23:49 UTC (rev 189051)
+++ trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h        2015-08-27 21:24:27 UTC (rev 189052)
</span><span class="lines">@@ -145,7 +145,7 @@
</span><span class="cx">
</span><span class="cx"> virtual void makeFirstResponder() override;
</span><span class="cx">
</span><del>- virtual void didPerformDictionaryLookup(const DictionaryPopupInfo&) override;
</del><ins>+ virtual void didPerformDictionaryLookup(const WebCore::DictionaryPopupInfo&) override;
</ins><span class="cx"> virtual void dismissContentRelativeChildWindows(bool withAnimation = true) override;
</span><span class="cx">
</span><span class="cx"> virtual void showCorrectionPanel(WebCore::AlternativeTextType, const WebCore::FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacementString, const Vector<String>& alternativeReplacementStrings) override;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacPageClientImplmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm (189051 => 189052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm        2015-08-27 21:23:49 UTC (rev 189051)
+++ trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm        2015-08-27 21:24:27 UTC (rev 189052)
</span><span class="lines">@@ -28,10 +28,8 @@
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">
</span><del>-#import "AttributedString.h"
</del><span class="cx"> #import "ColorSpaceData.h"
</span><span class="cx"> #import "DataReference.h"
</span><del>-#import "DictionaryPopupInfo.h"
</del><span class="cx"> #import "DownloadProxy.h"
</span><span class="cx"> #import "NativeWebKeyboardEvent.h"
</span><span class="cx"> #import "NativeWebWheelEvent.h"
</span><span class="lines">@@ -53,11 +51,11 @@
</span><span class="cx"> #import <WebCore/AlternativeTextUIController.h>
</span><span class="cx"> #import <WebCore/BitmapImage.h>
</span><span class="cx"> #import <WebCore/Cursor.h>
</span><ins>+#import <WebCore/DictionaryLookup.h>
</ins><span class="cx"> #import <WebCore/FloatRect.h>
</span><span class="cx"> #import <WebCore/GraphicsContext.h>
</span><span class="cx"> #import <WebCore/Image.h>
</span><span class="cx"> #import <WebCore/KeyboardEvent.h>
</span><del>-#import <WebCore/LookupSPI.h>
</del><span class="cx"> #import <WebCore/NotImplemented.h>
</span><span class="cx"> #import <WebCore/SharedBuffer.h>
</span><span class="cx"> #import <WebCore/TextIndicator.h>
</span><span class="lines">@@ -85,8 +83,6 @@
</span><span class="cx"> @end
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-SOFT_LINK_CONSTANT_MAY_FAIL(Lookup, LUTermOptionDisableSearchTermIndicator, NSString *)
-
</del><span class="cx"> using namespace WebCore;
</span><span class="cx"> using namespace WebKit;
</span><span class="cx">
</span><span class="lines">@@ -585,32 +581,11 @@
</span><span class="cx">
</span><span class="cx"> void PageClientImpl::didPerformDictionaryLookup(const DictionaryPopupInfo& dictionaryPopupInfo)
</span><span class="cx"> {
</span><del>- if (!getLULookupDefinitionModuleClass())
- return;
-
- RetainPtr<NSMutableDictionary> mutableOptions = adoptNS([(NSDictionary *)dictionaryPopupInfo.options.get() mutableCopy]);
-
</del><span class="cx"> [m_wkView _prepareForDictionaryLookup];
</span><span class="cx">
</span><del>- if (canLoadLUTermOptionDisableSearchTermIndicator() && dictionaryPopupInfo.textIndicator.contentImage) {
- [m_wkView _setTextIndicator:TextIndicator::create(dictionaryPopupInfo.textIndicator) withLifetime:TextIndicatorWindowLifetime::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()];
</del><ins>+ DictionaryLookup::showPopup(dictionaryPopupInfo, m_wkView, [this](TextIndicator& textIndicator) {
+ [m_wkView _setTextIndicator:textIndicator withLifetime:TextIndicatorWindowLifetime::Permanent];
+ });
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void PageClientImpl::dismissContentRelativeChildWindows(bool withAnimation)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacWKImmediateActionControllermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm (189051 => 189052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm        2015-08-27 21:23:49 UTC (rev 189051)
+++ trunk/Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm        2015-08-27 21:24:27 UTC (rev 189052)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> #import "WebPageProxyMessages.h"
</span><span class="cx"> #import "WebProcessProxy.h"
</span><span class="cx"> #import <WebCore/DataDetectorsSPI.h>
</span><ins>+#import <WebCore/DictionaryLookup.h>
</ins><span class="cx"> #import <WebCore/GeometryUtilities.h>
</span><span class="cx"> #import <WebCore/LookupSPI.h>
</span><span class="cx"> #import <WebCore/NSMenuSPI.h>
</span><span class="lines">@@ -46,7 +47,6 @@
</span><span class="cx">
</span><span class="cx"> SOFT_LINK_FRAMEWORK_IN_UMBRELLA(Quartz, QuickLookUI)
</span><span class="cx"> SOFT_LINK_CLASS(QuickLookUI, QLPreviewMenuItem)
</span><del>-SOFT_LINK_CONSTANT_MAY_FAIL(Lookup, LUTermOptionDisableSearchTermIndicator, NSString *)
</del><span class="cx">
</span><span class="cx"> using namespace WebCore;
</span><span class="cx"> using namespace WebKit;
</span><span class="lines">@@ -461,33 +461,15 @@
</span><span class="cx"> if (_state != ImmediateActionState::Ready)
</span><span class="cx"> return nil;
</span><span class="cx">
</span><del>- if (!getLULookupDefinitionModuleClass())
- return nil;
-
</del><span class="cx"> DictionaryPopupInfo dictionaryPopupInfo = _hitTestResultData.dictionaryPopupInfo;
</span><del>- if (!dictionaryPopupInfo.attributedString.string)
</del><ins>+ if (!dictionaryPopupInfo.attributedString)
</ins><span class="cx"> return nil;
</span><span class="cx">
</span><span class="cx"> [_wkView _prepareForDictionaryLookup];
</span><span class="cx">
</span><del>- RetainPtr<NSMutableDictionary> mutableOptions = adoptNS([(NSDictionary *)dictionaryPopupInfo.options.get() mutableCopy]);
- if (canLoadLUTermOptionDisableSearchTermIndicator() && dictionaryPopupInfo.textIndicator.contentImage) {
- [_wkView _setTextIndicator:TextIndicator::create(dictionaryPopupInfo.textIndicator) withLifetime:TextIndicatorWindowLifetime::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;
-
- return [getLULookupDefinitionModuleClass() lookupAnimationControllerForTerm:dictionaryPopupInfo.attributedString.string.get() atLocation:textBaselineOrigin options:mutableOptions.get()];
</del><ins>+ return DictionaryLookup::animationControllerForPopup(dictionaryPopupInfo, _wkView, [self](TextIndicator& textIndicator) {
+ [_wkView _setTextIndicator:textIndicator withLifetime:TextIndicatorWindowLifetime::Permanent];
+ });
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> @end
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacWebPageProxyMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm (189051 => 189052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm        2015-08-27 21:23:49 UTC (rev 189051)
+++ trunk/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm        2015-08-27 21:24:27 UTC (rev 189052)
</span><span class="lines">@@ -32,7 +32,6 @@
</span><span class="cx"> #import "AttributedString.h"
</span><span class="cx"> #import "ColorSpaceData.h"
</span><span class="cx"> #import "DataReference.h"
</span><del>-#import "DictionaryPopupInfo.h"
</del><span class="cx"> #import "EditingRange.h"
</span><span class="cx"> #import "EditorState.h"
</span><span class="cx"> #import "MenuUtilities.h"
</span><span class="lines">@@ -48,6 +47,7 @@
</span><span class="cx"> #import "WebPageMessages.h"
</span><span class="cx"> #import "WebProcessProxy.h"
</span><span class="cx"> #import <WebCore/DictationAlternative.h>
</span><ins>+#import <WebCore/DictionaryLookup.h>
</ins><span class="cx"> #import <WebCore/GraphicsLayer.h>
</span><span class="cx"> #import <WebCore/RuntimeApplicationChecks.h>
</span><span class="cx"> #import <WebCore/SharedBuffer.h>
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (189051 => 189052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2015-08-27 21:23:49 UTC (rev 189051)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2015-08-27 21:24:27 UTC (rev 189052)
</span><span class="lines">@@ -1594,8 +1594,6 @@
</span><span class="cx">                 BCE469791214F2B4000B98EB /* WebFrameListenerProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCE469781214F2B4000B98EB /* WebFrameListenerProxy.cpp */; };
</span><span class="cx">                 BCE81D8C1319F7EF00241910 /* FontInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCE81D8A1319F7EF00241910 /* FontInfo.cpp */; };
</span><span class="cx">                 BCE81D8D1319F7EF00241910 /* FontInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE81D8B1319F7EF00241910 /* FontInfo.h */; };
</span><del>-                BCE81D98131AE02100241910 /* DictionaryPopupInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCE81D96131AE02000241910 /* DictionaryPopupInfo.cpp */; };
-                BCE81D99131AE02100241910 /* DictionaryPopupInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE81D97131AE02100241910 /* DictionaryPopupInfo.h */; };
</del><span class="cx">                 BCEE7AD012817988009827DA /* WebProcessProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEE7ACC12817988009827DA /* WebProcessProxyMessageReceiver.cpp */; };
</span><span class="cx">                 BCEE7AD112817988009827DA /* WebProcessProxyMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEE7ACD12817988009827DA /* WebProcessProxyMessages.h */; };
</span><span class="cx">                 BCEE7DC5128B645D009827DA /* InjectedBundleClient.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEE7DC3128B645D009827DA /* InjectedBundleClient.h */; };
</span><span class="lines">@@ -3821,8 +3819,6 @@
</span><span class="cx">                 BCE469781214F2B4000B98EB /* WebFrameListenerProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebFrameListenerProxy.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 BCE81D8A1319F7EF00241910 /* FontInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontInfo.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 BCE81D8B1319F7EF00241910 /* FontInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontInfo.h; sourceTree = "<group>"; };
</span><del>-                BCE81D96131AE02000241910 /* DictionaryPopupInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DictionaryPopupInfo.cpp; sourceTree = "<group>"; };
-                BCE81D97131AE02100241910 /* DictionaryPopupInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DictionaryPopupInfo.h; sourceTree = "<group>"; };
</del><span class="cx">                 BCE9C0CF1485965D00E33D61 /* WebConnectionToUIProcess.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebConnectionToUIProcess.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 BCE9C0D01485965D00E33D61 /* WebConnectionToUIProcess.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebConnectionToUIProcess.h; sourceTree = "<group>"; };
</span><span class="cx">                 BCEE7AB312817095009827DA /* WebProcessProxy.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebProcessProxy.messages.in; sourceTree = "<group>"; };
</span><span class="lines">@@ -4700,8 +4696,6 @@
</span><span class="cx">                                 1A6F9F8E11E13EFC00DB1371 /* CommandLine.h */,
</span><span class="cx">                                 5106D7BF18BDBE73000AB166 /* ContextMenuContextData.cpp */,
</span><span class="cx">                                 5106D7C018BDBE73000AB166 /* ContextMenuContextData.h */,
</span><del>-                                BCE81D96131AE02000241910 /* DictionaryPopupInfo.cpp */,
-                                BCE81D97131AE02100241910 /* DictionaryPopupInfo.h */,
</del><span class="cx">                                 C517388012DF8F4F00EE3F47 /* DragControllerAction.h */,
</span><span class="cx">                                 0FB659221208B4DB0044816C /* DrawingAreaInfo.h */,
</span><span class="cx">                                 E105FE5318D7B9DE008F57A8 /* EditingRange.h */,
</span><span class="lines">@@ -7637,7 +7631,6 @@
</span><span class="cx">                                 CE1A0BD41A48E6C60054EF74 /* DataDetectorsUISPI.h in Headers */,
</span><span class="cx">                                 1AC75380183BE50F0072CB15 /* DataReference.h in Headers */,
</span><span class="cx">                                 83891B6C1A68C30B0030F386 /* DiagnosticLoggingClient.h in Headers */,
</span><del>-                                BCE81D99131AE02100241910 /* DictionaryPopupInfo.h in Headers */,
</del><span class="cx">                                 518E8F0816B2093700E91429 /* Download.h in Headers */,
</span><span class="cx">                                 518E8F0A16B2093700E91429 /* DownloadAuthenticationClient.h in Headers */,
</span><span class="cx">                                 A1DF631318E0B7C8003A3E2A /* DownloadClient.h in Headers */,
</span><span class="lines">@@ -9440,7 +9433,6 @@
</span><span class="cx">                                 51032F1D180F791700961BB7 /* DatabaseToWebProcessConnectionMessageReceiver.cpp in Sources */,
</span><span class="cx">                                 1AC7537F183BE50F0072CB15 /* DataReference.cpp in Sources */,
</span><span class="cx">                                 83891B6D1A68C30B0030F386 /* DiagnosticLoggingClient.mm in Sources */,
</span><del>-                                BCE81D98131AE02100241910 /* DictionaryPopupInfo.cpp in Sources */,
</del><span class="cx">                                 518E8F0716B2093700E91429 /* Download.cpp in Sources */,
</span><span class="cx">                                 518E8F0916B2093700E91429 /* DownloadAuthenticationClient.cpp in Sources */,
</span><span class="cx">                                 A1DF631218E0B7C8003A3E2A /* DownloadClient.mm in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessPluginsPDFPDFPluginmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm (189051 => 189052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm        2015-08-27 21:23:49 UTC (rev 189051)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm        2015-08-27 21:24:27 UTC (rev 189052)
</span><span class="lines">@@ -29,9 +29,7 @@
</span><span class="cx"> #if ENABLE(PDFKIT_PLUGIN)
</span><span class="cx">
</span><span class="cx"> #import "ArgumentCoders.h"
</span><del>-#import "AttributedString.h"
</del><span class="cx"> #import "DataReference.h"
</span><del>-#import "DictionaryPopupInfo.h"
</del><span class="cx"> #import "PDFAnnotationTextWidgetDetails.h"
</span><span class="cx"> #import "PDFKitImports.h"
</span><span class="cx"> #import "PDFLayerControllerDetails.h"
</span><span class="lines">@@ -1720,7 +1718,7 @@
</span><span class="cx"> {
</span><span class="cx"> DictionaryPopupInfo dictionaryPopupInfo;
</span><span class="cx"> dictionaryPopupInfo.origin = convertFromPDFViewToRootView(IntPoint(point));
</span><del>- dictionaryPopupInfo.attributedString.string = string;
</del><ins>+ dictionaryPopupInfo.attributedString = string;
</ins><span class="cx">
</span><span class="cx"> webFrame()->page()->send(Messages::WebPageProxy::DidPerformDictionaryLookup(dictionaryPopupInfo));
</span><span class="cx"> }
</span><span class="lines">@@ -1937,7 +1935,7 @@
</span><span class="cx"> return selection.string;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- NSString *lookupText = dictionaryLookupForPDFSelection(selection, options);
</del><ins>+ NSString *lookupText = DictionaryLookup::stringForPDFSelection(selection, options);
</ins><span class="cx"> if (!lookupText || !lookupText.length)
</span><span class="cx"> return @"";
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportmacWebContextMenuClientMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm (189051 => 189052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm        2015-08-27 21:23:49 UTC (rev 189051)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm        2015-08-27 21:24:27 UTC (rev 189052)
</span><span class="lines">@@ -28,10 +28,10 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(CONTEXT_MENUS)
</span><span class="cx">
</span><del>-#import "DictionaryPopupInfo.h"
</del><span class="cx"> #import "WebCoreArgumentCoders.h"
</span><span class="cx"> #import "WebPage.h"
</span><span class="cx"> #import "WebPageProxyMessages.h"
</span><ins>+#import <WebCore/DictionaryLookup.h>
</ins><span class="cx"> #import <WebCore/FrameView.h>
</span><span class="cx"> #import <WebCore/MainFrame.h>
</span><span class="cx"> #import <WebCore/Page.h>
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (189051 => 189052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2015-08-27 21:23:49 UTC (rev 189051)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2015-08-27 21:24:27 UTC (rev 189052)
</span><span class="lines">@@ -30,7 +30,6 @@
</span><span class="cx"> #include "APIInjectedBundlePageContextMenuClient.h"
</span><span class="cx"> #include "APIInjectedBundlePageUIClient.h"
</span><span class="cx"> #include "APIObject.h"
</span><del>-#include "DictionaryPopupInfo.h"
</del><span class="cx"> #include "FindController.h"
</span><span class="cx"> #include "GeolocationPermissionRequestManager.h"
</span><span class="cx"> #include "ImageOptions.h"
</span><span class="lines">@@ -49,6 +48,7 @@
</span><span class="cx"> #include "UserData.h"
</span><span class="cx"> #include "UserMediaPermissionRequestManager.h"
</span><span class="cx"> #include <WebCore/DictationAlternative.h>
</span><ins>+#include <WebCore/DictionaryPopupInfo.h>
</ins><span class="cx"> #include <WebCore/DragData.h>
</span><span class="cx"> #include <WebCore/Editor.h>
</span><span class="cx"> #include <WebCore/FrameLoaderTypes.h>
</span><span class="lines">@@ -1055,9 +1055,9 @@
</span><span class="cx"> void performDictionaryLookupAtLocation(const WebCore::FloatPoint&);
</span><span class="cx"> void performDictionaryLookupOfCurrentSelection();
</span><span class="cx"> void performDictionaryLookupForRange(WebCore::Frame*, WebCore::Range&, NSDictionary *options, WebCore::TextIndicatorPresentationTransition);
</span><del>- DictionaryPopupInfo dictionaryPopupInfoForRange(WebCore::Frame* frame, WebCore::Range& range, NSDictionary **options, WebCore::TextIndicatorPresentationTransition presentationTransition);
</del><ins>+ WebCore::DictionaryPopupInfo dictionaryPopupInfoForRange(WebCore::Frame*, WebCore::Range&, NSDictionary **options, WebCore::TextIndicatorPresentationTransition);
</ins><span class="cx"> #if ENABLE(PDFKIT_PLUGIN)
</span><del>- DictionaryPopupInfo dictionaryPopupInfoForSelectionInPDFPlugin(PDFSelection *, PDFPlugin&, NSDictionary **options, WebCore::TextIndicatorPresentationTransition);
</del><ins>+ WebCore::DictionaryPopupInfo dictionaryPopupInfoForSelectionInPDFPlugin(PDFSelection *, PDFPlugin&, NSDictionary **options, WebCore::TextIndicatorPresentationTransition);
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> void windowAndViewFramesChanged(const WebCore::FloatRect& windowFrameInScreenCoordinates, const WebCore::FloatRect& windowFrameInUnflippedScreenCoordinates, const WebCore::FloatRect& viewFrameInWindowCoordinates, const WebCore::FloatPoint& accessibilityViewCoordinates);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacWebPageMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm (189051 => 189052)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm        2015-08-27 21:23:49 UTC (rev 189051)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm        2015-08-27 21:24:27 UTC (rev 189052)
</span><span class="lines">@@ -30,7 +30,6 @@
</span><span class="cx">
</span><span class="cx"> #import "AttributedString.h"
</span><span class="cx"> #import "DataReference.h"
</span><del>-#import "DictionaryPopupInfo.h"
</del><span class="cx"> #import "EditingRange.h"
</span><span class="cx"> #import "EditorState.h"
</span><span class="cx"> #import "InjectedBundleHitTestResult.h"
</span><span class="lines">@@ -518,7 +517,7 @@
</span><span class="cx"> HitTestResult result = m_page->mainFrame().eventHandler().hitTestResultAtPoint(m_page->mainFrame().view()->windowToContents(point));
</span><span class="cx"> Frame* frame = result.innerNonSharedNode() ? result.innerNonSharedNode()->document().frame() : &m_page->focusController().focusedOrMainFrame();
</span><span class="cx"> NSDictionary *options = nil;
</span><del>- RefPtr<Range> range = rangeForDictionaryLookupAtHitTestResult(result, &options);
</del><ins>+ RefPtr<Range> range = DictionaryLookup::rangeAtHitTestResult(result, &options);
</ins><span class="cx"> if (!range)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -528,7 +527,7 @@
</span><span class="cx"> void WebPage::performDictionaryLookupForSelection(Frame* frame, const VisibleSelection& selection, TextIndicatorPresentationTransition presentationTransition)
</span><span class="cx"> {
</span><span class="cx"> NSDictionary *options = nil;
</span><del>- RefPtr<Range> selectedRange = rangeForDictionaryLookupForSelection(selection, &options);
</del><ins>+ RefPtr<Range> selectedRange = DictionaryLookup::rangeForSelection(selection, &options);
</ins><span class="cx"> if (selectedRange)
</span><span class="cx"> performDictionaryLookupForRange(frame, *selectedRange, options, presentationTransition);
</span><span class="cx"> }
</span><span class="lines">@@ -556,7 +555,7 @@
</span><span class="cx"> IntRect rangeRect = frame->view()->contentsToWindow(quads[0].enclosingBoundingBox());
</span><span class="cx">
</span><span class="cx"> dictionaryPopupInfo.origin = FloatPoint(rangeRect.x(), rangeRect.y() + (style.fontMetrics().ascent() * pageScaleFactor()));
</span><del>- dictionaryPopupInfo.options = (CFDictionaryRef)*options;
</del><ins>+ dictionaryPopupInfo.options = *options;
</ins><span class="cx">
</span><span class="cx"> NSAttributedString *nsAttributedString = editingAttributedStringFromRange(range, IncludeImagesInAttributedString::No);
</span><span class="cx">
</span><span class="lines">@@ -585,7 +584,7 @@
</span><span class="cx"> return dictionaryPopupInfo;
</span><span class="cx">
</span><span class="cx"> dictionaryPopupInfo.textIndicator = textIndicator->data();
</span><del>- dictionaryPopupInfo.attributedString.string = scaledNSAttributedString;
</del><ins>+ dictionaryPopupInfo.attributedString = scaledNSAttributedString;
</ins><span class="cx">
</span><span class="cx"> return dictionaryPopupInfo;
</span><span class="cx"> }
</span><span class="lines">@@ -638,9 +637,9 @@
</span><span class="cx"> dataForSelection.presentationTransition = presentationTransition;
</span><span class="cx">
</span><span class="cx"> dictionaryPopupInfo.origin = rangeRect.origin;
</span><del>- dictionaryPopupInfo.options = (CFDictionaryRef)*options;
</del><ins>+ dictionaryPopupInfo.options = *options;
</ins><span class="cx"> dictionaryPopupInfo.textIndicator = dataForSelection;
</span><del>- dictionaryPopupInfo.attributedString.string = scaledNSAttributedString;
</del><ins>+ dictionaryPopupInfo.attributedString = scaledNSAttributedString;
</ins><span class="cx">
</span><span class="cx"> return dictionaryPopupInfo;
</span><span class="cx"> }
</span><span class="lines">@@ -1198,7 +1197,7 @@
</span><span class="cx">
</span><span class="cx"> IntPoint point = roundedIntPoint(locationInViewCoordinates);
</span><span class="cx"> HitTestResult result = mainFrame.eventHandler().hitTestResultAtPoint(m_page->mainFrame().view()->windowToContents(point));
</span><del>- return rangeForDictionaryLookupAtHitTestResult(result, options);
</del><ins>+ return DictionaryLookup::rangeAtHitTestResult(result, options);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebPage::immediateActionDidUpdate()
</span></span></pre>
</div>
</div>
</body>
</html>