<!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>[176737] branches/safari-600.3-branch/Source/WebKit</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/176737">176737</a></dd>
<dt>Author</dt> <dd>dburkart@apple.com</dd>
<dt>Date</dt> <dd>2014-12-03 12:15:51 -0800 (Wed, 03 Dec 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merged <a href="http://trac.webkit.org/projects/webkit/changeset/176680">r176680</a>. rdar://problems/19067172</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari6003branchSourceWebKitChangeLog">branches/safari-600.3-branch/Source/WebKit/ChangeLog</a></li>
<li><a href="#branchessafari6003branchSourceWebKitWebKitxcodeprojprojectpbxproj">branches/safari-600.3-branch/Source/WebKit/WebKit.xcodeproj/project.pbxproj</a></li>
<li><a href="#branchessafari6003branchSourceWebKitmacChangeLog">branches/safari-600.3-branch/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#branchessafari6003branchSourceWebKitmacWebViewWebActionMenuControllermm">branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebActionMenuController.mm</a></li>
<li><a href="#branchessafari6003branchSourceWebKitmacWebViewWebHTMLViewmm">branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebHTMLView.mm</a></li>
<li><a href="#branchessafari6003branchSourceWebKitmacWebViewWebViewmm">branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebView.mm</a></li>
<li><a href="#branchessafari6003branchSourceWebKitmacWebViewWebViewInternalh">branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebViewInternal.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#branchessafari6003branchSourceWebKitmacWebViewDictionaryPopupInfoh">branches/safari-600.3-branch/Source/WebKit/mac/WebView/DictionaryPopupInfo.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari6003branchSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit/ChangeLog (176736 => 176737)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit/ChangeLog        2014-12-03 20:13:02 UTC (rev 176736)
+++ branches/safari-600.3-branch/Source/WebKit/ChangeLog        2014-12-03 20:15:51 UTC (rev 176737)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2014-12-03 Dana Burkart <dburkart@apple.com>
+
+ Merge r176680. <rdar://problem/19067172>
+
+ 2014-12-02 Tim Horton <timothy_horton@apple.com>
+
+ Implement Lookup transition from selection for Legacy WebKit
+ https://bugs.webkit.org/show_bug.cgi?id=139180
+ <rdar://problem/19067172>
+
+ Reviewed by Beth Dakin.
+
+ * WebKit.xcodeproj/project.pbxproj:
+ Add mac/WebView/DictionaryPopupInfo.h.
+
+
</ins><span class="cx"> 2014-10-28 Dana Burkart <dburkart@apple.com>
</span><span class="cx">
</span><span class="cx"> Merge r174791. <rdar://problem/18753175>
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKitWebKitxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit/WebKit.xcodeproj/project.pbxproj (176736 => 176737)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit/WebKit.xcodeproj/project.pbxproj        2014-12-03 20:13:02 UTC (rev 176736)
+++ branches/safari-600.3-branch/Source/WebKit/WebKit.xcodeproj/project.pbxproj        2014-12-03 20:15:51 UTC (rev 176737)
</span><span class="lines">@@ -85,6 +85,7 @@
</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><ins>+                2DF064A91A2DD53C00DBB354 /* DictionaryPopupInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DF064A81A2DD53C00DBB354 /* DictionaryPopupInfo.h */; };
</ins><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">@@ -541,6 +542,7 @@
</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><ins>+                2DF064A81A2DD53C00DBB354 /* DictionaryPopupInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DictionaryPopupInfo.h; sourceTree = "<group>"; };
</ins><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">@@ -1294,6 +1296,7 @@
</span><span class="cx">                                 F52CA6BD02DF9D0F018635CA /* HTML */,
</span><span class="cx">                                 51E94C0706C02CA300A9B09E /* PDF */,
</span><span class="cx">                                 A10C1D79182030190036883A /* ios */,
</span><ins>+                                2DF064A81A2DD53C00DBB354 /* DictionaryPopupInfo.h */,
</ins><span class="cx">                                 935D44E219F9AFF000FB5306 /* WebActionMenuController.h */,
</span><span class="cx">                                 935D44E319F9AFF000FB5306 /* WebActionMenuController.mm */,
</span><span class="cx">                                 8373435A0624EE0D00F3B289 /* WebArchive.h */,
</span><span class="lines">@@ -1814,6 +1817,7 @@
</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><ins>+                                2DF064A91A2DD53C00DBB354 /* DictionaryPopupInfo.h in Headers */,
</ins><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="branchessafari6003branchSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit/mac/ChangeLog (176736 => 176737)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit/mac/ChangeLog        2014-12-03 20:13:02 UTC (rev 176736)
+++ branches/safari-600.3-branch/Source/WebKit/mac/ChangeLog        2014-12-03 20:15:51 UTC (rev 176737)
</span><span class="lines">@@ -1,3 +1,51 @@
</span><ins>+2014-12-03 Dana Burkart <dburkart@apple.com>
+
+ Merge r176680. <rdar://problem/19067172>
+
+ 2014-12-02 Tim Horton <timothy_horton@apple.com>
+
+ Implement Lookup transition from selection for Legacy WebKit
+ https://bugs.webkit.org/show_bug.cgi?id=139180
+ <rdar://problem/19067172>
+
+ Reviewed by Beth Dakin.
+
+ * WebView/DictionaryPopupInfo.h: Added.
+ Split DictionaryPopupInfo out into its own file.
+
+ * WebView/WebActionMenuController.mm:
+ (-[WebActionMenuController _lookupText:]):
+ Hand the DictionaryPopupInfo to WebView, which will show the TextIndicator and invoke Lookup.
+
+ (performDictionaryLookupForSelection):
+ (performDictionaryLookupForRange):
+ Plumb the transition style through these helpers.
+ Create a TextIndicator from the selection range.
+
+ * WebView/WebHTMLView.mm:
+ (-[WebHTMLView _lookUpInDictionaryFromMenu:]):
+ Make use of TextIndicator (and DictionaryPopupInfo, and the new
+ _showDictionaryLookupPopup on WebView) to add a transition from blue
+ when performing Lookup from the context menu.
+
+ (-[WebHTMLView quickLookWithEvent:]):
+ Remove our TextIndicator whenever a normal three-finger-tap event
+ comes through, as it will have its own indication.
+
+ * WebView/WebView.mm:
+ (-[WebView _commonInitializationWithFrameName:groupName:]):
+ (-[WebView _dictionaryLookupPopoverWillClose:]):
+ Register for the LUNotificationPopoverWillClose notification and remove
+ our TextIndicator when it is called, just like in WebKit2.
+ Deregistration is already handled in _close.
+
+ (-[WebView _showDictionaryLookupPopup:]):
+ Just like WebKit2, show our TextIndicator and tell Lookup not to show its own,
+ if the relevant API is available.
+
+ * WebView/WebViewInternal.h:
+
+
</ins><span class="cx"> 2014-12-02 Dana Burkart <dburkart@apple.com>
</span><span class="cx">
</span><span class="cx"> Merge r176618. <rdar://problem/18992185>
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKitmacWebViewDictionaryPopupInfoh"></a>
<div class="addfile"><h4>Added: branches/safari-600.3-branch/Source/WebKit/mac/WebView/DictionaryPopupInfo.h (0 => 176737)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit/mac/WebView/DictionaryPopupInfo.h         (rev 0)
+++ branches/safari-600.3-branch/Source/WebKit/mac/WebView/DictionaryPopupInfo.h        2014-12-03 20:15:51 UTC (rev 176737)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+/*
+ * 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)
</ins></span></pre></div>
<a id="branchessafari6003branchSourceWebKitmacWebViewWebActionMenuControllermm"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebActionMenuController.mm (176736 => 176737)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebActionMenuController.mm        2014-12-03 20:13:02 UTC (rev 176736)
+++ branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebActionMenuController.mm        2014-12-03 20:15:51 UTC (rev 176737)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #import "DOMElementInternal.h"
</span><span class="cx"> #import "DOMNodeInternal.h"
</span><span class="cx"> #import "DOMRangeInternal.h"
</span><ins>+#import "DictionaryPopupInfo.h"
</ins><span class="cx"> #import "WebDocumentInternal.h"
</span><span class="cx"> #import "WebElementDictionary.h"
</span><span class="cx"> #import "WebFrameInternal.h"
</span><span class="lines">@@ -87,12 +88,6 @@
</span><span class="cx">
</span><span class="cx"> using namespace WebCore;
</span><span class="cx">
</span><del>-struct DictionaryPopupInfo {
- NSPoint origin;
- RetainPtr<NSDictionary> options;
- RetainPtr<NSAttributedString> attributedString;
-};
-
</del><span class="cx"> @implementation WebActionMenuController
</span><span class="cx">
</span><span class="cx"> - (id)initWithWebView:(WebView *)webView
</span><span class="lines">@@ -634,15 +629,7 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> DictionaryPopupInfo popupInfo = performDictionaryLookupForSelection(frame, frame->selection().selection());
</span><del>- if (!popupInfo.attributedString)
- return;
-
- NSPoint textBaselineOrigin = popupInfo.origin;
-
- // Convert to screen coordinates.
- textBaselineOrigin = [_webView.window convertRectToScreen:NSMakeRect(textBaselineOrigin.x, textBaselineOrigin.y, 0, 0)].origin;
-
- [getLULookupDefinitionModuleClass() showDefinitionForTerm:popupInfo.attributedString.get() atLocation:textBaselineOrigin options:popupInfo.options.get()];
</del><ins>+ [_webView _showDictionaryLookupPopup:popupInfo];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)_paste:(id)sender
</span><span class="lines">@@ -682,11 +669,11 @@
</span><span class="cx"> DictionaryPopupInfo popupInfo;
</span><span class="cx"> RefPtr<Range> selectedRange = rangeForDictionaryLookupForSelection(selection, &options);
</span><span class="cx"> if (selectedRange)
</span><del>- popupInfo = performDictionaryLookupForRange(frame, *selectedRange, options);
</del><ins>+ popupInfo = performDictionaryLookupForRange(frame, *selectedRange, options, TextIndicatorPresentationTransition::BounceAndCrossfade);
</ins><span class="cx"> return popupInfo;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static DictionaryPopupInfo performDictionaryLookupForRange(Frame* frame, Range& range, NSDictionary *options)
</del><ins>+static DictionaryPopupInfo performDictionaryLookupForRange(Frame* frame, Range& range, NSDictionary *options, TextIndicatorPresentationTransition presentationTransition)
</ins><span class="cx"> {
</span><span class="cx"> DictionaryPopupInfo popupInfo;
</span><span class="cx"> if (range.text().stripWhiteSpace().isEmpty())
</span><span class="lines">@@ -722,6 +709,7 @@
</span><span class="cx"> }];
</span><span class="cx">
</span><span class="cx"> popupInfo.attributedString = scaledNSAttributedString.get();
</span><ins>+ popupInfo.textIndicator = TextIndicator::createWithRange(range, presentationTransition);
</ins><span class="cx"> return popupInfo;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKitmacWebViewWebHTMLViewmm"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebHTMLView.mm (176736 => 176737)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebHTMLView.mm        2014-12-03 20:13:02 UTC (rev 176736)
+++ branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebHTMLView.mm        2014-12-03 20:15:51 UTC (rev 176737)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> #import "DOMDocumentInternal.h"
</span><span class="cx"> #import "DOMNodeInternal.h"
</span><span class="cx"> #import "DOMRangeInternal.h"
</span><ins>+#import "DictionaryPopupInfo.h"
</ins><span class="cx"> #import "WebActionMenuController.h"
</span><span class="cx"> #import "WebArchive.h"
</span><span class="cx"> #import "WebClipView.h"
</span><span class="lines">@@ -114,6 +115,7 @@
</span><span class="cx"> #import <WebCore/StyleProperties.h>
</span><span class="cx"> #import <WebCore/Text.h>
</span><span class="cx"> #import <WebCore/TextAlternativeWithRange.h>
</span><ins>+#import <WebCore/TextIndicator.h>
</ins><span class="cx"> #import <WebCore/TextUndoInsertionMarkupMac.h>
</span><span class="cx"> #import <WebCore/WebCoreObjCExtras.h>
</span><span class="cx"> #import <WebCore/WebNSAttributedStringExtras.h>
</span><span class="lines">@@ -5682,13 +5684,23 @@
</span><span class="cx">
</span><span class="cx"> NSRect rect = coreFrame->selection().selectionBounds();
</span><span class="cx">
</span><del>- NSDictionary *attributes = [attrString fontAttributesInRange:NSMakeRange(0,1)];
</del><ins>+ NSDictionary *attributes = [attrString fontAttributesInRange:NSMakeRange(0, 1)];
</ins><span class="cx"> NSFont *font = [attributes objectForKey:NSFontAttributeName];
</span><span class="cx"> if (font)
</span><del>- rect.origin.y += [font ascender];
</del><ins>+ rect.origin.y += [font descender];
</ins><span class="cx">
</span><del>- [self showDefinitionForAttributedString:attrString atPoint:rect.origin];
</del><ins>+ DictionaryPopupInfo info;
+ info.attributedString = attrString;
+ info.origin = coreFrame->view()->contentsToWindow(enclosingIntRect(rect)).location();
+ info.textIndicator = TextIndicator::createWithSelectionInFrame(*coreFrame, TextIndicatorPresentationTransition::BounceAndCrossfade);
+ [[self _webView] _showDictionaryLookupPopup:info];
</ins><span class="cx"> }
</span><ins>+
+- (void)quickLookWithEvent:(NSEvent *)event
+{
+ [[self _webView] _setTextIndicator:nullptr fadeOut:NO animationCompletionHandler:[] { }];
+ [super quickLookWithEvent:event];
+}
</ins><span class="cx"> #endif // !PLATFORM(IOS)
</span><span class="cx">
</span><span class="cx"> - (void)_executeSavedKeypressCommands
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKitmacWebViewWebViewmm"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebView.mm (176736 => 176737)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebView.mm        2014-12-03 20:13:02 UTC (rev 176736)
+++ branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebView.mm        2014-12-03 20:15:51 UTC (rev 176737)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> #import "DOMDocumentInternal.h"
</span><span class="cx"> #import "DOMNodeInternal.h"
</span><span class="cx"> #import "DOMRangeInternal.h"
</span><ins>+#import "DictionaryPopupInfo.h"
</ins><span class="cx"> #import "WebAlternativeTextClient.h"
</span><span class="cx"> #import "WebApplicationCache.h"
</span><span class="cx"> #import "WebBackForwardListInternal.h"
</span><span class="lines">@@ -208,7 +209,9 @@
</span><span class="cx"> #import "WebNSPasteboardExtras.h"
</span><span class="cx"> #import "WebNSPrintOperationExtras.h"
</span><span class="cx"> #import "WebPDFView.h"
</span><ins>+#import <WebCore/LookupSPI.h>
</ins><span class="cx"> #import <WebCore/NSViewSPI.h>
</span><ins>+#import <WebCore/SoftLinking.h>
</ins><span class="cx"> #import <WebCore/TextIndicator.h>
</span><span class="cx"> #import <WebCore/TextIndicatorWindow.h>
</span><span class="cx"> #import <WebCore/WebVideoFullscreenController.h>
</span><span class="lines">@@ -292,6 +295,11 @@
</span><span class="cx"> #import <WebCore/HIDGamepadProvider.h>
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#if PLATFORM(MAC)
+SOFT_LINK_CONSTANT_MAY_FAIL(Lookup, LUNotificationPopoverWillClose, NSString *)
+SOFT_LINK_CONSTANT_MAY_FAIL(Lookup, LUTermOptionDisableSearchTermIndicator, NSString *)
+#endif
+
</ins><span class="cx"> #if !PLATFORM(IOS)
</span><span class="cx"> @interface NSSpellChecker (WebNSSpellCheckerDetails)
</span><span class="cx"> - (void)_preflightChosenSpellServer;
</span><span class="lines">@@ -1024,6 +1032,9 @@
</span><span class="cx">
</span><span class="cx"> #if !PLATFORM(IOS)
</span><span class="cx"> [self _registerDraggedTypes];
</span><ins>+
+ if (canLoadLUNotificationPopoverWillClose())
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_dictionaryLookupPopoverWillClose:) name:getLUNotificationPopoverWillClose() object:nil];
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> [self _setIsVisible:[self _isViewVisible]];
</span><span class="lines">@@ -8554,7 +8565,8 @@
</span><span class="cx"> return NSMakeRect(rect.origin.x, [self bounds].size.height - rect.origin.y - rect.size.height, rect.size.width, rect.size.height);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
</del><ins>+#if PLATFORM(MAC)
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
</ins><span class="cx"> - (void)prepareForMenu:(NSMenu *)menu withEvent:(NSEvent *)event
</span><span class="cx"> {
</span><span class="cx"> if (menu != self.actionMenu)
</span><span class="lines">@@ -8579,6 +8591,12 @@
</span><span class="cx"> [_private->actionMenuController didCloseMenu:menu withEvent:event];
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+- (WebActionMenuController *)_actionMenuController
+{
+ return _private->actionMenuController;
+}
+#endif // __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
+
</ins><span class="cx"> - (void)_setTextIndicator:(TextIndicator *)textIndicator fadeOut:(BOOL)fadeOut animationCompletionHandler:(std::function<void ()>)completionHandler
</span><span class="cx"> {
</span><span class="cx"> if (!textIndicator) {
</span><span class="lines">@@ -8597,12 +8615,34 @@
</span><span class="cx"> [self _setTextIndicator:nullptr fadeOut:NO animationCompletionHandler:^ { }];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-- (WebActionMenuController *)_actionMenuController
</del><ins>+- (void)_showDictionaryLookupPopup:(const DictionaryPopupInfo&)dictionaryPopupInfo
</ins><span class="cx"> {
</span><del>- return _private->actionMenuController;
</del><ins>+ if (!dictionaryPopupInfo.attributedString)
+ return;
+
+ NSPoint textBaselineOrigin = dictionaryPopupInfo.origin;
+
+ // Convert to screen coordinates.
+ textBaselineOrigin = [self.window convertRectToScreen:NSMakeRect(textBaselineOrigin.x, textBaselineOrigin.y, 0, 0)].origin;
+
+ if (canLoadLUTermOptionDisableSearchTermIndicator()) {
+ RetainPtr<NSMutableDictionary> mutableOptions = adoptNS([dictionaryPopupInfo.options mutableCopy]);
+ if (!mutableOptions)
+ mutableOptions = adoptNS([[NSMutableDictionary alloc] init]);
+ [mutableOptions setObject:@YES forKey:getLUTermOptionDisableSearchTermIndicator()];
+ [self _setTextIndicator:dictionaryPopupInfo.textIndicator.get() fadeOut:NO animationCompletionHandler:[dictionaryPopupInfo, textBaselineOrigin, mutableOptions] {
+ [getLULookupDefinitionModuleClass() showDefinitionForTerm:dictionaryPopupInfo.attributedString.get() atLocation:textBaselineOrigin options:mutableOptions.get()];
+ }];
+ } else
+ [getLULookupDefinitionModuleClass() showDefinitionForTerm:dictionaryPopupInfo.attributedString.get() atLocation:textBaselineOrigin options:dictionaryPopupInfo.options.get()];
</ins><span class="cx"> }
</span><del>-#endif // PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
</del><span class="cx">
</span><ins>+- (void)_dictionaryLookupPopoverWillClose:(NSNotification *)notification
+{
+ [self _setTextIndicator:nullptr fadeOut:NO animationCompletionHandler:[] { }];
+}
+#endif // PLATFORM(MAC)
+
</ins><span class="cx"> @end
</span><span class="cx">
</span><span class="cx"> @implementation WebView (WebViewDeviceOrientation)
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKitmacWebViewWebViewInternalh"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebViewInternal.h (176736 => 176737)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebViewInternal.h        2014-12-03 20:13:02 UTC (rev 176736)
+++ branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebViewInternal.h        2014-12-03 20:15:51 UTC (rev 176737)
</span><span class="lines">@@ -58,6 +58,7 @@
</span><span class="cx"> struct DictationAlternative;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+struct DictionaryPopupInfo;
</ins><span class="cx"> class WebSelectionServiceController;
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="lines">@@ -258,6 +259,7 @@
</span><span class="cx"> #if PLATFORM(MAC) && defined(__cplusplus)
</span><span class="cx"> - (void)_setTextIndicator:(WebCore::TextIndicator*)textIndicator fadeOut:(BOOL)fadeOut animationCompletionHandler:(std::function<void ()>)completionHandler;
</span><span class="cx"> - (void)_clearTextIndicator;
</span><ins>+- (void)_showDictionaryLookupPopup:(const DictionaryPopupInfo&)dictionaryPopupInfo;
</ins><span class="cx"> #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
</span><span class="cx"> - (WebActionMenuController *)_actionMenuController;
</span><span class="cx"> #endif
</span></span></pre>
</div>
</div>
</body>
</html>