<!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>[175664] branches/safari-600.3-branch/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/175664">175664</a></dd>
<dt>Author</dt> <dd>dburkart@apple.com</dd>
<dt>Date</dt> <dd>2014-11-05 21:14:01 -0800 (Wed, 05 Nov 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merged <a href="http://trac.webkit.org/projects/webkit/changeset/175564">r175564</a>. &lt;rdar://problems/18840102&gt;</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari6003branchSourceWebCoreChangeLog">branches/safari-600.3-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari6003branchSourceWebCoreplatformspimacDataDetectorsSPIh">branches/safari-600.3-branch/Source/WebCore/platform/spi/mac/DataDetectorsSPI.h</a></li>
<li><a href="#branchessafari6003branchSourceWebKit2CMakeListstxt">branches/safari-600.3-branch/Source/WebKit2/CMakeLists.txt</a></li>
<li><a href="#branchessafari6003branchSourceWebKit2ChangeLog">branches/safari-600.3-branch/Source/WebKit2/ChangeLog</a></li>
<li><a href="#branchessafari6003branchSourceWebKit2SharedmacActionMenuHitTestResulth">branches/safari-600.3-branch/Source/WebKit2/Shared/mac/ActionMenuHitTestResult.h</a></li>
<li><a href="#branchessafari6003branchSourceWebKit2SharedmacActionMenuHitTestResultmm">branches/safari-600.3-branch/Source/WebKit2/Shared/mac/ActionMenuHitTestResult.mm</a></li>
<li><a href="#branchessafari6003branchSourceWebKit2UIProcessWebPageProxycpp">branches/safari-600.3-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp</a></li>
<li><a href="#branchessafari6003branchSourceWebKit2UIProcessWebPageProxyh">branches/safari-600.3-branch/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#branchessafari6003branchSourceWebKit2UIProcessWebPageProxymessagesin">branches/safari-600.3-branch/Source/WebKit2/UIProcess/WebPageProxy.messages.in</a></li>
<li><a href="#branchessafari6003branchSourceWebKit2UIProcessmacWKActionMenuControllerh">branches/safari-600.3-branch/Source/WebKit2/UIProcess/mac/WKActionMenuController.h</a></li>
<li><a href="#branchessafari6003branchSourceWebKit2UIProcessmacWKActionMenuControllermm">branches/safari-600.3-branch/Source/WebKit2/UIProcess/mac/WKActionMenuController.mm</a></li>
<li><a href="#branchessafari6003branchSourceWebKit2WebKit2xcodeprojprojectpbxproj">branches/safari-600.3-branch/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
<li><a href="#branchessafari6003branchSourceWebKit2WebProcessWebPageFindControllercpp">branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebPage/FindController.cpp</a></li>
<li><a href="#branchessafari6003branchSourceWebKit2WebProcessWebPageWebFramecpp">branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp</a></li>
<li><a href="#branchessafari6003branchSourceWebKit2WebProcessWebPageWebFrameh">branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebPage/WebFrame.h</a></li>
<li><a href="#branchessafari6003branchSourceWebKit2WebProcessWebPagemacWebPageMacmm">branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#branchessafari6003branchSourceWebKit2SharedTextIndicatorcpp">branches/safari-600.3-branch/Source/WebKit2/Shared/TextIndicator.cpp</a></li>
<li><a href="#branchessafari6003branchSourceWebKit2SharedTextIndicatorh">branches/safari-600.3-branch/Source/WebKit2/Shared/TextIndicator.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#branchessafari6003branchSourceWebKit2UIProcessTextIndicatorcpp">branches/safari-600.3-branch/Source/WebKit2/UIProcess/TextIndicator.cpp</a></li>
<li><a href="#branchessafari6003branchSourceWebKit2UIProcessTextIndicatorh">branches/safari-600.3-branch/Source/WebKit2/UIProcess/TextIndicator.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari6003branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebCore/ChangeLog (175663 => 175664)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebCore/ChangeLog        2014-11-06 05:04:00 UTC (rev 175663)
+++ branches/safari-600.3-branch/Source/WebCore/ChangeLog        2014-11-06 05:14:01 UTC (rev 175664)
</span><span class="lines">@@ -1,5 +1,21 @@
</span><span class="cx"> 2014-11-05  Dana Burkart  &lt;dburkart@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r175564. &lt;rdar://problem/18840102&gt;
+
+    2014-11-04  Tim Horton  &lt;timothy_horton@apple.com&gt;
+    
+            Implement yellow highlight over data detected items
+            https://bugs.webkit.org/show_bug.cgi?id=138340
+            &lt;rdar://problem/18840102&gt;
+    
+            Reviewed by Anders Carlsson.
+    
+            * platform/spi/mac/DataDetectorsSPI.h:
+            Add completionHandler SPI.
+    
+
+2014-11-05  Dana Burkart  &lt;dburkart@apple.com&gt;
+
</ins><span class="cx">         Merge r175375. &lt;rdar://problem/18883807&gt;
</span><span class="cx"> 
</span><span class="cx">     2014-10-30  Eric Carlson  &lt;eric.carlson@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebCoreplatformspimacDataDetectorsSPIh"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebCore/platform/spi/mac/DataDetectorsSPI.h (175663 => 175664)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebCore/platform/spi/mac/DataDetectorsSPI.h        2014-11-06 05:04:00 UTC (rev 175663)
+++ branches/safari-600.3-branch/Source/WebCore/platform/spi/mac/DataDetectorsSPI.h        2014-11-06 05:14:01 UTC (rev 175664)
</span><span class="lines">@@ -66,6 +66,7 @@
</span><span class="cx"> @property NSRect highlightFrame;
</span><span class="cx"> @property (retain) NSArray *allResults;
</span><span class="cx"> @property (retain) __attribute__((NSObject)) DDResultRef mainResult;
</span><ins>+@property (copy) void (^completionHandler)(void);
</ins><span class="cx"> 
</span><span class="cx"> @end
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKit2CMakeListstxt"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit2/CMakeLists.txt (175663 => 175664)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit2/CMakeLists.txt        2014-11-06 05:04:00 UTC (rev 175663)
+++ branches/safari-600.3-branch/Source/WebKit2/CMakeLists.txt        2014-11-06 05:14:01 UTC (rev 175664)
</span><span class="lines">@@ -209,6 +209,7 @@
</span><span class="cx">     Shared/ShareableBitmap.cpp
</span><span class="cx">     Shared/ShareableResource.cpp
</span><span class="cx">     Shared/StatisticsData.cpp
</span><ins>+    Shared/TextIndicator.cpp
</ins><span class="cx">     Shared/UpdateInfo.cpp
</span><span class="cx">     Shared/UserData.cpp
</span><span class="cx">     Shared/VisitedLinkTable.cpp
</span><span class="lines">@@ -303,7 +304,6 @@
</span><span class="cx">     UIProcess/ResponsivenessTimer.cpp
</span><span class="cx">     UIProcess/StatisticsRequest.cpp
</span><span class="cx">     UIProcess/TextCheckerCompletion.cpp
</span><del>-    UIProcess/TextIndicator.cpp
</del><span class="cx">     UIProcess/VisitedLinkProvider.cpp
</span><span class="cx">     UIProcess/WebApplicationCacheManagerProxy.cpp
</span><span class="cx">     UIProcess/WebBackForwardList.cpp
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit2/ChangeLog (175663 => 175664)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit2/ChangeLog        2014-11-06 05:04:00 UTC (rev 175663)
+++ branches/safari-600.3-branch/Source/WebKit2/ChangeLog        2014-11-06 05:14:01 UTC (rev 175664)
</span><span class="lines">@@ -1,5 +1,91 @@
</span><span class="cx"> 2014-11-05  Dana Burkart  &lt;dburkart@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r175564. &lt;rdar://problem/18840102&gt;
+
+    2014-11-04  Tim Horton  &lt;timothy_horton@apple.com&gt;
+    
+            Implement yellow highlight over data detected items
+            https://bugs.webkit.org/show_bug.cgi?id=138340
+            &lt;rdar://problem/18840102&gt;
+    
+            Reviewed by Anders Carlsson.
+    
+            * Shared/TextIndicator.cpp: Renamed from Source/WebKit2/UIProcess/TextIndicator.cpp.
+            * Shared/TextIndicator.h: Renamed from Source/WebKit2/UIProcess/TextIndicator.h.
+            Move TextIndicator to Shared.
+            Move all of the members to a Data struct.
+            Implement encode/decode for TextIndicator::Data, so it can be passed as
+            the argument to SetTextIndicator, and also as a field on ActionMenuHitTestResult.
+            Add 'createWithSelectionInFrame', which builds a TextIndicator
+            from the selection in the given frame.
+    
+            * Shared/mac/ActionMenuHitTestResult.h:
+            * Shared/mac/ActionMenuHitTestResult.mm:
+            (WebKit::ActionMenuHitTestResult::encode):
+            (WebKit::ActionMenuHitTestResult::decode):
+            Rename actionBoundingBox to detectedDataBoundingBox.
+            Store/encode/decode detectedDataTextIndicator.
+    
+            * UIProcess/WebPageProxy.cpp:
+            (WebKit::WebPageProxy::setTextIndicator):
+            * UIProcess/WebPageProxy.h:
+            * UIProcess/WebPageProxy.messages.in:
+            Create a TextIndicator from the TextIndicator::Data.
+            Add an explicit ClearTextIndicator message instead of sending empty Data.
+            
+            * UIProcess/mac/WKActionMenuController.h:
+            * UIProcess/mac/WKActionMenuController.mm:
+            (-[WKActionMenuController prepareForMenu:withEvent:]):
+            If the text indicator is up when preparing for a new menu invocation, hide it.
+    
+            (-[WKActionMenuController willOpenMenu:withEvent:]):
+            Show the text indicator when the menu opens, for data detected items.
+    
+            (-[WKActionMenuController didCloseMenu:withEvent:]):
+            Hide the text indicator when the menu closes, unless we only had one item.
+            Then, we'll hide it in the DDActionContext completionHandler block.
+            
+            (-[WKActionMenuController _showTextIndicator]):
+            (-[WKActionMenuController _hideTextIndicator]):
+            Added. Show and hide the text indicator based on the TextIndicator
+            data included in the action menu hit test result.
+    
+            (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
+            Hide the text indicator when the data detector popover completes.
+    
+            * WebKit2.xcodeproj/project.pbxproj:
+            * WebProcess/WebPage/FindController.cpp:
+            (WebKit::FindController::getImageForFindMatch):
+            Make use of the newly-moved createSelectionSnapshot.
+    
+            (WebKit::FindController::updateFindIndicator):
+            Make use of TextIndicator::createWithSelectionInFrame, which allows
+            us to share this code for building a TextIndicator with other callers.
+    
+            (WebKit::FindController::hideFindIndicator):
+    
+            (WebKit::getFindIndicatorBitmap): Deleted.
+            Move getFindIndicatorBitmap to WebFrame::createSelectionSnapshot.
+    
+            * WebProcess/WebPage/WebFrame.cpp:
+            (WebKit::WebFrame::createSelectionSnapshot):
+            Moved from FindController's getFindIndicatorBitmap.
+            Now returns a ShareableBitmap instead of going ahead and making a Handle.
+    
+            * WebProcess/WebPage/WebFrame.h:
+            * WebProcess/WebPage/mac/WebPageMac.mm:
+            (WebKit::scanForDataDetectedItems):
+            (WebKit::textIndicatorForRange):
+            Temporarily change the selection to the given range, then use
+            TextIndicator::indicatorWithSelectionInFrame to acquire a TextIndicator,
+            then reset the selection.
+    
+            (WebKit::WebPage::performActionMenuHitTestAtLocation):
+            Create a TextIndicator from the data detected range.
+    
+
+2014-11-05  Dana Burkart  &lt;dburkart@apple.com&gt;
+
</ins><span class="cx">         Merge r175524. &lt;rdar://problem/18861406&gt;
</span><span class="cx"> 
</span><span class="cx">     2014-11-04  Tim Horton  &lt;timothy_horton@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKit2SharedTextIndicatorcppfromrev175663branchessafari6003branchSourceWebKit2UIProcessTextIndicatorcpp"></a>
<div class="copfile"><h4>Copied: branches/safari-600.3-branch/Source/WebKit2/Shared/TextIndicator.cpp (from rev 175663, branches/safari-600.3-branch/Source/WebKit2/UIProcess/TextIndicator.cpp) (0 => 175664)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit2/Shared/TextIndicator.cpp                                (rev 0)
+++ branches/safari-600.3-branch/Source/WebKit2/Shared/TextIndicator.cpp        2014-11-06 05:14:01 UTC (rev 175664)
</span><span class="lines">@@ -0,0 +1,350 @@
</span><ins>+/*
+ * Copyright (C) 2010 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 &quot;config.h&quot;
+#include &quot;TextIndicator.h&quot;
+
+#include &quot;ArgumentCodersCF.h&quot;
+#include &quot;ArgumentDecoder.h&quot;
+#include &quot;ArgumentEncoder.h&quot;
+#include &quot;ShareableBitmap.h&quot;
+#include &quot;WebCoreArgumentCoders.h&quot;
+#include &quot;WebFrame.h&quot;
+#include &quot;WebPage.h&quot;
+#include &lt;WebCore/Frame.h&gt;
+#include &lt;WebCore/FrameSelection.h&gt;
+#include &lt;WebCore/FrameView.h&gt;
+#include &lt;WebCore/GeometryUtilities.h&gt;
+#include &lt;WebCore/Gradient.h&gt;
+#include &lt;WebCore/GraphicsContext.h&gt;
+#include &lt;WebCore/IntRect.h&gt;
+#include &lt;WebCore/Path.h&gt;
+
+#if PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &lt; 101000
+#define ENABLE_LEGACY_TEXT_INDICATOR_STYLE 1
+#else
+#define ENABLE_LEGACY_TEXT_INDICATOR_STYLE 0
+#endif
+
+using namespace WebCore;
+
+#if ENABLE(LEGACY_TEXT_INDICATOR_STYLE)
+static const float cornerRadius = 3.0;
+
+static const float shadowOffsetX = 0.0;
+static const float shadowOffsetY = 1.0;
+static const float shadowBlurRadius = 3.0;
+
+static const int shadowRed = 0;
+static const int shadowGreen = 0;
+static const int shadowBlue = 0;
+static const int shadowAlpha = 204;
+
+static const float lightBorderThickness = 1.0;
+static const float horizontalPaddingInsideLightBorder = 3.0;
+static const float verticalPaddingInsideLightBorder = 1.0;
+
+static const float horizontalBorderInsideShadow = lightBorderThickness + horizontalPaddingInsideLightBorder;
+static const float verticalBorderInsideShadow = lightBorderThickness + verticalPaddingInsideLightBorder;
+
+static const float leftBorderThickness = horizontalBorderInsideShadow + shadowOffsetX + shadowBlurRadius / 2.0;
+static const float topBorderThickness = verticalBorderInsideShadow - shadowOffsetY + shadowBlurRadius / 2.0;
+static const float rightBorderThickness = horizontalBorderInsideShadow - shadowOffsetX + shadowBlurRadius / 2.0;
+static const float bottomBorderThickness = verticalBorderInsideShadow + shadowOffsetY + shadowBlurRadius / 2.0;
+
+static const float horizontalOutsetToCenterOfLightBorder = horizontalBorderInsideShadow - lightBorderThickness / 2.0;
+static const float verticalOutsetToCenterOfLightBorder = verticalBorderInsideShadow - lightBorderThickness / 2.0;
+
+static const int lightBorderRed = 245;
+static const int lightBorderGreen = 230;
+static const int lightBorderBlue = 0;
+static const int lightBorderAlpha = 255;
+
+static const int gradientDarkRed = 237;
+static const int gradientDarkGreen = 204;
+static const int gradientDarkBlue = 0;
+static const int gradientDarkAlpha = 255;
+
+static const int gradientLightRed = 242;
+static const int gradientLightGreen = 239;
+static const int gradientLightBlue = 0;
+static const int gradientLightAlpha = 255;
+#else
+const float flatStyleHorizontalBorder = 2;
+const float flatStyleVerticalBorder = 1;
+const float flatShadowOffsetX = 0;
+const float flatShadowOffsetY = 5;
+const float flatShadowBlurRadius = 25;
+const float flatRimShadowBlurRadius = 2;
+#endif
+
+namespace WebKit {
+
+static FloatRect inflateRect(const FloatRect&amp; rect, float inflateX, float inflateY)
+{
+    FloatRect inflatedRect = rect;
+    inflatedRect.inflateX(inflateX);
+    inflatedRect.inflateY(inflateY);
+    return inflatedRect;
+}
+
+static FloatRect outsetIndicatorRectIncludingShadow(const FloatRect rect)
+{
+#if ENABLE(LEGACY_TEXT_INDICATOR_STYLE)
+    FloatRect outsetRect = rect;
+    outsetRect.move(-leftBorderThickness, -topBorderThickness);
+    outsetRect.expand(leftBorderThickness + rightBorderThickness, topBorderThickness + bottomBorderThickness);
+    return outsetRect;
+#else
+    return inflateRect(rect, flatShadowBlurRadius + flatStyleHorizontalBorder, flatShadowBlurRadius + flatStyleVerticalBorder);
+#endif
+}
+
+static bool textIndicatorsForTextRectsOverlap(const Vector&lt;FloatRect&gt;&amp; textRects)
+{
+    size_t count = textRects.size();
+    if (count &lt;= 1)
+        return false;
+
+    Vector&lt;FloatRect&gt; indicatorRects;
+    indicatorRects.reserveInitialCapacity(count);
+
+    for (size_t i = 0; i &lt; count; ++i) {
+        FloatRect indicatorRect = outsetIndicatorRectIncludingShadow(textRects[i]);
+
+        for (size_t j = indicatorRects.size(); j; ) {
+            --j;
+            if (indicatorRect.intersects(indicatorRects[j]))
+                return true;
+        }
+
+        indicatorRects.uncheckedAppend(indicatorRect);
+    }
+
+    return false;
+}
+
+PassRefPtr&lt;TextIndicator&gt; TextIndicator::create(const WebCore::FloatRect&amp; selectionRectInWindowCoordinates, const Vector&lt;WebCore::FloatRect&gt;&amp; textRectsInSelectionRectCoordinates, float contentImageScaleFactor, PassRefPtr&lt;ShareableBitmap&gt; contentImage)
+{
+    TextIndicator::Data data;
+    data.selectionRectInWindowCoordinates = selectionRectInWindowCoordinates;
+    data.textRectsInSelectionRectCoordinates = textRectsInSelectionRectCoordinates;
+    data.contentImageScaleFactor = contentImageScaleFactor;
+    data.contentImage = contentImage;
+
+    return TextIndicator::create(data);
+}
+
+PassRefPtr&lt;TextIndicator&gt; TextIndicator::create(const TextIndicator::Data&amp; data)
+{
+    return adoptRef(new TextIndicator(data));
+}
+
+PassRefPtr&lt;TextIndicator&gt; TextIndicator::createWithSelectionInFrame(WebFrame&amp; frame)
+{
+    Frame&amp; coreFrame = *frame.coreFrame();
+    IntRect selectionRect = enclosingIntRect(coreFrame.selection().selectionBounds());
+    RefPtr&lt;ShareableBitmap&gt; indicatorBitmap = frame.createSelectionSnapshot();
+    if (!indicatorBitmap)
+        return nullptr;
+
+    // We want the selection rect in window coordinates.
+    IntRect selectionRectInWindowCoordinates = coreFrame.view()-&gt;contentsToWindow(selectionRect);
+
+    Vector&lt;FloatRect&gt; textRects;
+    coreFrame.selection().getClippedVisibleTextRectangles(textRects);
+
+    // We want the text rects in selection rect coordinates.
+    Vector&lt;FloatRect&gt; textRectsInSelectionRectCoordinates;
+
+    for (const FloatRect&amp; textRect : textRects) {
+        IntRect textRectInSelectionRectCoordinates = coreFrame.view()-&gt;contentsToWindow(enclosingIntRect(textRect));
+        textRectInSelectionRectCoordinates.move(-selectionRectInWindowCoordinates.x(), -selectionRectInWindowCoordinates.y());
+        textRectsInSelectionRectCoordinates.append(textRectInSelectionRectCoordinates);
+    }
+
+    return TextIndicator::create(selectionRectInWindowCoordinates, textRectsInSelectionRectCoordinates, frame.page()-&gt;deviceScaleFactor(), indicatorBitmap);
+}
+
+TextIndicator::TextIndicator(const TextIndicator::Data&amp; data)
+    : m_data(data)
+{
+    ASSERT(m_data.contentImageScaleFactor != 1 || m_data.contentImage-&gt;size() == enclosingIntRect(m_data.selectionRectInWindowCoordinates).size());
+
+    if (textIndicatorsForTextRectsOverlap(m_data.textRectsInSelectionRectCoordinates)) {
+        m_data.textRectsInSelectionRectCoordinates[0] = unionRect(m_data.textRectsInSelectionRectCoordinates);
+        m_data.textRectsInSelectionRectCoordinates.shrink(1);
+    }
+}
+
+TextIndicator::~TextIndicator()
+{
+}
+
+FloatRect TextIndicator::frameRect() const
+{
+    return outsetIndicatorRectIncludingShadow(m_data.selectionRectInWindowCoordinates);
+}
+
+#if ENABLE(LEGACY_TEXT_INDICATOR_STYLE)
+static inline Color lightBorderColor()
+{
+    return Color(lightBorderRed, lightBorderGreen, lightBorderBlue, lightBorderAlpha);
+}
+
+static inline Color shadowColor()
+{
+    return Color(shadowRed, shadowGreen, shadowBlue, shadowAlpha);
+}
+
+static inline Color gradientLightColor()
+{
+    return Color(gradientLightRed, gradientLightGreen, gradientLightBlue, gradientLightAlpha);
+}
+
+static inline Color gradientDarkColor()
+{
+    return Color(gradientDarkRed, gradientDarkGreen, gradientDarkBlue, gradientDarkAlpha);
+}
+
+static Path pathWithRoundedRect(const FloatRect&amp; pathRect, float radius)
+{
+    Path path;
+    path.addRoundedRect(pathRect, FloatSize(radius, radius));
+
+    return path;
+}
+#else
+static inline Color flatHighlightColor()
+{
+    return Color(255, 255, 0, 255);
+}
+
+static inline Color flatRimShadowColor()
+{
+    return Color(0, 0, 0, 38);
+}
+
+static inline Color flatDropShadowColor()
+{
+    return Color(0, 0, 0, 51);
+}
+#endif
+    
+void TextIndicator::draw(GraphicsContext&amp; graphicsContext, const IntRect&amp; /*dirtyRect*/)
+{
+#if ENABLE(LEGACY_TEXT_INDICATOR_STYLE)
+    for (size_t i = 0; i &lt; m_data.textRectsInSelectionRectCoordinates.size(); ++i) {
+        FloatRect textRect = m_data.textRectsInSelectionRectCoordinates[i];
+        textRect.move(leftBorderThickness, topBorderThickness);
+
+        FloatRect outerPathRect = inflateRect(textRect, horizontalOutsetToCenterOfLightBorder, verticalOutsetToCenterOfLightBorder);
+        FloatRect innerPathRect = inflateRect(textRect, horizontalPaddingInsideLightBorder, verticalPaddingInsideLightBorder);
+
+        {
+            GraphicsContextStateSaver stateSaver(graphicsContext);
+            graphicsContext.setShadow(FloatSize(shadowOffsetX, shadowOffsetY), shadowBlurRadius, shadowColor(), ColorSpaceSRGB);
+            graphicsContext.setFillColor(lightBorderColor(), ColorSpaceDeviceRGB);
+            graphicsContext.fillPath(pathWithRoundedRect(outerPathRect, cornerRadius));
+        }
+
+        {
+            GraphicsContextStateSaver stateSaver(graphicsContext);
+            graphicsContext.clip(pathWithRoundedRect(innerPathRect, cornerRadius));
+            RefPtr&lt;Gradient&gt; gradient = Gradient::create(FloatPoint(innerPathRect.x(), innerPathRect.y()), FloatPoint(innerPathRect.x(), innerPathRect.maxY()));
+            gradient-&gt;addColorStop(0, gradientLightColor());
+            gradient-&gt;addColorStop(1, gradientDarkColor());
+            graphicsContext.setFillGradient(gradient.releaseNonNull());
+            graphicsContext.fillRect(outerPathRect);
+        }
+
+        {
+            GraphicsContextStateSaver stateSaver(graphicsContext);
+            graphicsContext.translate(FloatSize(roundf(leftBorderThickness), roundf(topBorderThickness)));
+
+            IntRect contentImageRect = enclosingIntRect(m_data.textRectsInSelectionRectCoordinates[i]);
+            m_data.contentImage-&gt;paint(graphicsContext, m_data.contentImageScaleFactor, contentImageRect.location(), contentImageRect);
+        }
+    }
+#else
+    for (auto&amp; textRect : m_data.textRectsInSelectionRectCoordinates) {
+        FloatRect blurRect = textRect;
+        blurRect.move(flatShadowBlurRadius + flatStyleHorizontalBorder, flatShadowBlurRadius + flatStyleVerticalBorder);
+        FloatRect outerPathRect = inflateRect(blurRect, flatStyleHorizontalBorder, flatStyleVerticalBorder);
+
+        {
+            GraphicsContextStateSaver stateSaver(graphicsContext);
+            graphicsContext.setShadow(FloatSize(), flatRimShadowBlurRadius, flatRimShadowColor(), ColorSpaceSRGB);
+            graphicsContext.setFillColor(flatHighlightColor(), ColorSpaceSRGB);
+            graphicsContext.fillRect(outerPathRect);
+            graphicsContext.setShadow(FloatSize(flatShadowOffsetX, flatShadowOffsetY), flatShadowBlurRadius, flatDropShadowColor(), ColorSpaceSRGB);
+            graphicsContext.fillRect(outerPathRect);
+        }
+
+        {
+            GraphicsContextStateSaver stateSaver(graphicsContext);
+            graphicsContext.translate(FloatSize(flatShadowBlurRadius + flatStyleHorizontalBorder, flatShadowBlurRadius + flatStyleVerticalBorder));
+
+            IntRect contentImageRect = enclosingIntRect(textRect);
+            m_data.contentImage-&gt;paint(graphicsContext, m_data.contentImageScaleFactor, contentImageRect.location(), contentImageRect);
+        }
+    }
+#endif
+}
+
+void TextIndicator::Data::encode(IPC::ArgumentEncoder&amp; encoder) const
+{
+    encoder &lt;&lt; selectionRectInWindowCoordinates;
+    encoder &lt;&lt; textRectsInSelectionRectCoordinates;
+    encoder &lt;&lt; contentImageScaleFactor;
+
+    ShareableBitmap::Handle contentImageHandle;
+    if (contentImage)
+        contentImage-&gt;createHandle(contentImageHandle, SharedMemory::ReadOnly);
+    encoder &lt;&lt; contentImageHandle;
+}
+
+bool TextIndicator::Data::decode(IPC::ArgumentDecoder&amp; decoder, TextIndicator::Data&amp; textIndicatorData)
+{
+    if (!decoder.decode(textIndicatorData.selectionRectInWindowCoordinates))
+        return false;
+
+    if (!decoder.decode(textIndicatorData.textRectsInSelectionRectCoordinates))
+        return false;
+
+    if (!decoder.decode(textIndicatorData.contentImageScaleFactor))
+        return false;
+
+    ShareableBitmap::Handle contentImageHandle;
+    if (!decoder.decode(contentImageHandle))
+        return false;
+
+    if (!contentImageHandle.isNull())
+        textIndicatorData.contentImage = ShareableBitmap::create(contentImageHandle, SharedMemory::ReadOnly);
+
+    return true;
+}
+
+} // namespace WebKit
</ins></span></pre></div>
<a id="branchessafari6003branchSourceWebKit2SharedTextIndicatorhfromrev175663branchessafari6003branchSourceWebKit2UIProcessTextIndicatorh"></a>
<div class="copfile"><h4>Copied: branches/safari-600.3-branch/Source/WebKit2/Shared/TextIndicator.h (from rev 175663, branches/safari-600.3-branch/Source/WebKit2/UIProcess/TextIndicator.h) (0 => 175664)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit2/Shared/TextIndicator.h                                (rev 0)
+++ branches/safari-600.3-branch/Source/WebKit2/Shared/TextIndicator.h        2014-11-06 05:14:01 UTC (rev 175664)
</span><span class="lines">@@ -0,0 +1,81 @@
</span><ins>+/*
+ * Copyright (C) 2010 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 TextIndicator_h
+#define TextIndicator_h
+
+#include &quot;ShareableBitmap.h&quot;
+#include &lt;WebCore/FloatRect.h&gt;
+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/RefCounted.h&gt;
+#include &lt;wtf/Vector.h&gt;
+
+namespace WebCore {
+class GraphicsContext;
+}
+
+namespace IPC {
+class ArgumentDecoder;
+class ArgumentEncoder;
+}
+
+namespace WebKit {
+
+class WebFrame;
+
+class TextIndicator : public RefCounted&lt;TextIndicator&gt; {
+public:
+    struct Data {
+        WebCore::FloatRect selectionRectInWindowCoordinates;
+        Vector&lt;WebCore::FloatRect&gt; textRectsInSelectionRectCoordinates;
+        float contentImageScaleFactor;
+        RefPtr&lt;ShareableBitmap&gt; contentImage;
+
+        void encode(IPC::ArgumentEncoder&amp;) const;
+        static bool decode(IPC::ArgumentDecoder&amp;, Data&amp;);
+    };
+
+    static PassRefPtr&lt;TextIndicator&gt; create(const WebCore::FloatRect&amp; selectionRectInWindowCoordinates, const Vector&lt;WebCore::FloatRect&gt;&amp; textRectsInSelectionCoordinates, float contentImageScaleFactor, PassRefPtr&lt;ShareableBitmap&gt; contentImage);
+    static PassRefPtr&lt;TextIndicator&gt; create(const TextIndicator::Data&amp;);
+    static PassRefPtr&lt;TextIndicator&gt; createWithSelectionInFrame(WebFrame&amp;);
+
+    ~TextIndicator();
+
+    WebCore::FloatRect selectionRectInWindowCoordinates() const { return m_data.selectionRectInWindowCoordinates; }
+    WebCore::FloatRect frameRect() const;
+    ShareableBitmap* contentImage() const { return m_data.contentImage.get(); }
+    Data data() const { return m_data; }
+
+    void draw(WebCore::GraphicsContext&amp;, const WebCore::IntRect&amp; dirtyRect);
+
+private:
+    TextIndicator(const TextIndicator::Data&amp;);
+
+    Data m_data;
+};
+
+} // namespace WebKit
+
+#endif // TextIndicator_h
</ins></span></pre></div>
<a id="branchessafari6003branchSourceWebKit2SharedmacActionMenuHitTestResulth"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit2/Shared/mac/ActionMenuHitTestResult.h (175663 => 175664)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit2/Shared/mac/ActionMenuHitTestResult.h        2014-11-06 05:04:00 UTC (rev 175663)
+++ branches/safari-600.3-branch/Source/WebKit2/Shared/mac/ActionMenuHitTestResult.h        2014-11-06 05:14:01 UTC (rev 175664)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #define ActionMenuHitTestResult_h
</span><span class="cx"> 
</span><span class="cx"> #include &quot;ShareableBitmap.h&quot;
</span><ins>+#include &quot;TextIndicator.h&quot;
</ins><span class="cx"> #include &quot;WebHitTestResult.h&quot;
</span><span class="cx"> #include &lt;WebCore/FloatRect.h&gt;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="lines">@@ -51,7 +52,8 @@
</span><span class="cx">     RefPtr&lt;ShareableBitmap&gt; image;
</span><span class="cx"> 
</span><span class="cx">     RetainPtr&lt;DDActionContext&gt; actionContext;
</span><del>-    WebCore::FloatRect actionBoundingBox;
</del><ins>+    WebCore::FloatRect detectedDataBoundingBox;
+    RefPtr&lt;TextIndicator&gt; detectedDataTextIndicator;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKit2SharedmacActionMenuHitTestResultmm"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit2/Shared/mac/ActionMenuHitTestResult.mm (175663 => 175664)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit2/Shared/mac/ActionMenuHitTestResult.mm        2014-11-06 05:04:00 UTC (rev 175663)
+++ branches/safari-600.3-branch/Source/WebKit2/Shared/mac/ActionMenuHitTestResult.mm        2014-11-06 05:14:01 UTC (rev 175664)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #import &quot;ArgumentCodersCF.h&quot;
</span><span class="cx"> #import &quot;ArgumentDecoder.h&quot;
</span><span class="cx"> #import &quot;ArgumentEncoder.h&quot;
</span><ins>+#import &quot;TextIndicator.h&quot;
</ins><span class="cx"> #import &quot;WebCoreArgumentCoders.h&quot;
</span><span class="cx"> #import &lt;WebCore/DataDetectorsSPI.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -58,9 +59,14 @@
</span><span class="cx">         [archiver finishEncoding];
</span><span class="cx"> 
</span><span class="cx">         IPC::encode(encoder, reinterpret_cast&lt;CFDataRef&gt;(data.get()));
</span><ins>+
+        encoder &lt;&lt; detectedDataBoundingBox;
+
+        bool hasTextIndicator = detectedDataTextIndicator;
+        encoder &lt;&lt; hasTextIndicator;
+        if (hasTextIndicator)
+            encoder &lt;&lt; detectedDataTextIndicator-&gt;data();
</ins><span class="cx">     }
</span><del>-
-    encoder &lt;&lt; actionBoundingBox;
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool ActionMenuHitTestResult::decode(IPC::ArgumentDecoder&amp; decoder, ActionMenuHitTestResult&amp; actionMenuHitTestResult)
</span><span class="lines">@@ -100,11 +106,23 @@
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">         [unarchiver finishDecoding];
</span><ins>+
+        if (!decoder.decode(actionMenuHitTestResult.detectedDataBoundingBox))
+            return false;
+
+        bool hasTextIndicator;
+        if (!decoder.decode(hasTextIndicator))
+            return false;
+
+        if (hasTextIndicator) {
+            TextIndicator::Data indicatorData;
+            if (!decoder.decode(indicatorData))
+                return false;
+
+            actionMenuHitTestResult.detectedDataTextIndicator = TextIndicator::create(indicatorData);
+        }
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (!decoder.decode(actionMenuHitTestResult.actionBoundingBox))
-        return false;
-
</del><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx">     
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKit2UIProcessTextIndicatorcpp"></a>
<div class="delfile"><h4>Deleted: branches/safari-600.3-branch/Source/WebKit2/UIProcess/TextIndicator.cpp (175663 => 175664)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit2/UIProcess/TextIndicator.cpp        2014-11-06 05:04:00 UTC (rev 175663)
+++ branches/safari-600.3-branch/Source/WebKit2/UIProcess/TextIndicator.cpp        2014-11-06 05:14:01 UTC (rev 175664)
</span><span class="lines">@@ -1,277 +0,0 @@
</span><del>-/*
- * Copyright (C) 2010 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 &quot;config.h&quot;
-#include &quot;TextIndicator.h&quot;
-
-#include &quot;ShareableBitmap.h&quot;
-#include &lt;WebCore/GeometryUtilities.h&gt;
-#include &lt;WebCore/Gradient.h&gt;
-#include &lt;WebCore/GraphicsContext.h&gt;
-#include &lt;WebCore/IntRect.h&gt;
-#include &lt;WebCore/Path.h&gt;
-
-#if PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &lt; 101000
-#define ENABLE_LEGACY_TEXT_INDICATOR_STYLE 1
-#else
-#define ENABLE_LEGACY_TEXT_INDICATOR_STYLE 0
-#endif
-
-using namespace WebCore;
-
-#if ENABLE(LEGACY_TEXT_INDICATOR_STYLE)
-static const float cornerRadius = 3.0;
-
-static const float shadowOffsetX = 0.0;
-static const float shadowOffsetY = 1.0;
-static const float shadowBlurRadius = 3.0;
-
-static const int shadowRed = 0;
-static const int shadowGreen = 0;
-static const int shadowBlue = 0;
-static const int shadowAlpha = 204;
-
-static const float lightBorderThickness = 1.0;
-static const float horizontalPaddingInsideLightBorder = 3.0;
-static const float verticalPaddingInsideLightBorder = 1.0;
-
-static const float horizontalBorderInsideShadow = lightBorderThickness + horizontalPaddingInsideLightBorder;
-static const float verticalBorderInsideShadow = lightBorderThickness + verticalPaddingInsideLightBorder;
-
-static const float leftBorderThickness = horizontalBorderInsideShadow + shadowOffsetX + shadowBlurRadius / 2.0;
-static const float topBorderThickness = verticalBorderInsideShadow - shadowOffsetY + shadowBlurRadius / 2.0;
-static const float rightBorderThickness = horizontalBorderInsideShadow - shadowOffsetX + shadowBlurRadius / 2.0;
-static const float bottomBorderThickness = verticalBorderInsideShadow + shadowOffsetY + shadowBlurRadius / 2.0;
-
-static const float horizontalOutsetToCenterOfLightBorder = horizontalBorderInsideShadow - lightBorderThickness / 2.0;
-static const float verticalOutsetToCenterOfLightBorder = verticalBorderInsideShadow - lightBorderThickness / 2.0;
-
-static const int lightBorderRed = 245;
-static const int lightBorderGreen = 230;
-static const int lightBorderBlue = 0;
-static const int lightBorderAlpha = 255;
-
-static const int gradientDarkRed = 237;
-static const int gradientDarkGreen = 204;
-static const int gradientDarkBlue = 0;
-static const int gradientDarkAlpha = 255;
-
-static const int gradientLightRed = 242;
-static const int gradientLightGreen = 239;
-static const int gradientLightBlue = 0;
-static const int gradientLightAlpha = 255;
-#else
-const float flatStyleHorizontalBorder = 2;
-const float flatStyleVerticalBorder = 1;
-const float flatShadowOffsetX = 0;
-const float flatShadowOffsetY = 5;
-const float flatShadowBlurRadius = 25;
-const float flatRimShadowBlurRadius = 2;
-#endif
-
-namespace WebKit {
-
-PassRefPtr&lt;TextIndicator&gt; TextIndicator::create(const FloatRect&amp; selectionRectInWindowCoordinates, const Vector&lt;FloatRect&gt;&amp; textRectsInSelectionRectCoordinates, float contentImageScaleFactor, const ShareableBitmap::Handle&amp; contentImageHandle)
-{
-    RefPtr&lt;ShareableBitmap&gt; contentImage = ShareableBitmap::create(contentImageHandle);
-    if (!contentImage)
-        return 0;
-    ASSERT(contentImageScaleFactor != 1 || contentImage-&gt;size() == enclosingIntRect(selectionRectInWindowCoordinates).size());
-
-    return adoptRef(new TextIndicator(selectionRectInWindowCoordinates, textRectsInSelectionRectCoordinates, contentImageScaleFactor, contentImage.release()));
-}
-
-static FloatRect inflateRect(const FloatRect&amp; rect, float inflateX, float inflateY)
-{
-    FloatRect inflatedRect = rect;
-    inflatedRect.inflateX(inflateX);
-    inflatedRect.inflateY(inflateY);
-    return inflatedRect;
-}
-
-static FloatRect outsetIndicatorRectIncludingShadow(const FloatRect rect)
-{
-#if ENABLE(LEGACY_TEXT_INDICATOR_STYLE)
-    FloatRect outsetRect = rect;
-    outsetRect.move(-leftBorderThickness, -topBorderThickness);
-    outsetRect.expand(leftBorderThickness + rightBorderThickness, topBorderThickness + bottomBorderThickness);
-    return outsetRect;
-#else
-    return inflateRect(rect, flatShadowBlurRadius + flatStyleHorizontalBorder, flatShadowBlurRadius + flatStyleVerticalBorder);
-#endif
-}
-
-static bool textIndicatorsForTextRectsOverlap(const Vector&lt;FloatRect&gt;&amp; textRects)
-{
-    size_t count = textRects.size();
-    if (count &lt;= 1)
-        return false;
-
-    Vector&lt;FloatRect&gt; indicatorRects;
-    indicatorRects.reserveInitialCapacity(count);
-
-    for (size_t i = 0; i &lt; count; ++i) {
-        FloatRect indicatorRect = outsetIndicatorRectIncludingShadow(textRects[i]);
-
-        for (size_t j = indicatorRects.size(); j; ) {
-            --j;
-            if (indicatorRect.intersects(indicatorRects[j]))
-                return true;
-        }
-
-        indicatorRects.uncheckedAppend(indicatorRect);
-    }
-
-    return false;
-}
-
-TextIndicator::TextIndicator(const WebCore::FloatRect&amp; selectionRectInWindowCoordinates, const Vector&lt;WebCore::FloatRect&gt;&amp; textRectsInSelectionRectCoordinates, float contentImageScaleFactor, PassRefPtr&lt;ShareableBitmap&gt; contentImage)
-    : m_selectionRectInWindowCoordinates(selectionRectInWindowCoordinates)
-    , m_textRectsInSelectionRectCoordinates(textRectsInSelectionRectCoordinates)
-    , m_contentImageScaleFactor(contentImageScaleFactor)
-    , m_contentImage(contentImage)
-{
-    if (textIndicatorsForTextRectsOverlap(m_textRectsInSelectionRectCoordinates)) {
-        m_textRectsInSelectionRectCoordinates[0] = unionRect(m_textRectsInSelectionRectCoordinates);
-        m_textRectsInSelectionRectCoordinates.shrink(1);
-    }
-}
-
-TextIndicator::~TextIndicator()
-{
-}
-
-FloatRect TextIndicator::frameRect() const
-{
-    return outsetIndicatorRectIncludingShadow(m_selectionRectInWindowCoordinates);
-}
-
-#if ENABLE(LEGACY_TEXT_INDICATOR_STYLE)
-static inline Color lightBorderColor()
-{
-    return Color(lightBorderRed, lightBorderGreen, lightBorderBlue, lightBorderAlpha);
-}
-
-static inline Color shadowColor()
-{
-    return Color(shadowRed, shadowGreen, shadowBlue, shadowAlpha);
-}
-
-static inline Color gradientLightColor()
-{
-    return Color(gradientLightRed, gradientLightGreen, gradientLightBlue, gradientLightAlpha);
-}
-
-static inline Color gradientDarkColor()
-{
-    return Color(gradientDarkRed, gradientDarkGreen, gradientDarkBlue, gradientDarkAlpha);
-}
-
-static Path pathWithRoundedRect(const FloatRect&amp; pathRect, float radius)
-{
-    Path path;
-    path.addRoundedRect(pathRect, FloatSize(radius, radius));
-
-    return path;
-}
-#else
-static inline Color flatHighlightColor()
-{
-    return Color(255, 255, 0, 255);
-}
-
-static inline Color flatRimShadowColor()
-{
-    return Color(0, 0, 0, 38);
-}
-
-static inline Color flatDropShadowColor()
-{
-    return Color(0, 0, 0, 51);
-}
-#endif
-    
-void TextIndicator::draw(GraphicsContext&amp; graphicsContext, const IntRect&amp; /*dirtyRect*/)
-{
-#if ENABLE(LEGACY_TEXT_INDICATOR_STYLE)
-    for (size_t i = 0; i &lt; m_textRectsInSelectionRectCoordinates.size(); ++i) {
-        FloatRect textRect = m_textRectsInSelectionRectCoordinates[i];
-        textRect.move(leftBorderThickness, topBorderThickness);
-
-        FloatRect outerPathRect = inflateRect(textRect, horizontalOutsetToCenterOfLightBorder, verticalOutsetToCenterOfLightBorder);
-        FloatRect innerPathRect = inflateRect(textRect, horizontalPaddingInsideLightBorder, verticalPaddingInsideLightBorder);
-
-        {
-            GraphicsContextStateSaver stateSaver(graphicsContext);
-            graphicsContext.setShadow(FloatSize(shadowOffsetX, shadowOffsetY), shadowBlurRadius, shadowColor(), ColorSpaceSRGB);
-            graphicsContext.setFillColor(lightBorderColor(), ColorSpaceDeviceRGB);
-            graphicsContext.fillPath(pathWithRoundedRect(outerPathRect, cornerRadius));
-        }
-
-        {
-            GraphicsContextStateSaver stateSaver(graphicsContext);
-            graphicsContext.clip(pathWithRoundedRect(innerPathRect, cornerRadius));
-            RefPtr&lt;Gradient&gt; gradient = Gradient::create(FloatPoint(innerPathRect.x(), innerPathRect.y()), FloatPoint(innerPathRect.x(), innerPathRect.maxY()));
-            gradient-&gt;addColorStop(0, gradientLightColor());
-            gradient-&gt;addColorStop(1, gradientDarkColor());
-            graphicsContext.setFillGradient(gradient.releaseNonNull());
-            graphicsContext.fillRect(outerPathRect);
-        }
-
-        {
-            GraphicsContextStateSaver stateSaver(graphicsContext);
-            graphicsContext.translate(FloatSize(roundf(leftBorderThickness), roundf(topBorderThickness)));
-
-            IntRect contentImageRect = enclosingIntRect(m_textRectsInSelectionRectCoordinates[i]);
-            m_contentImage-&gt;paint(graphicsContext, m_contentImageScaleFactor, contentImageRect.location(), contentImageRect);
-        }
-    }
-#else
-    for (auto&amp; textRect : m_textRectsInSelectionRectCoordinates) {
-        FloatRect blurRect = textRect;
-        blurRect.move(flatShadowBlurRadius + flatStyleHorizontalBorder, flatShadowBlurRadius + flatStyleVerticalBorder);
-        FloatRect outerPathRect = inflateRect(blurRect, flatStyleHorizontalBorder, flatStyleVerticalBorder);
-
-        {
-            GraphicsContextStateSaver stateSaver(graphicsContext);
-            graphicsContext.setShadow(FloatSize(), flatRimShadowBlurRadius, flatRimShadowColor(), ColorSpaceSRGB);
-            graphicsContext.setFillColor(flatHighlightColor(), ColorSpaceSRGB);
-            graphicsContext.fillRect(outerPathRect);
-            graphicsContext.setShadow(FloatSize(flatShadowOffsetX, flatShadowOffsetY), flatShadowBlurRadius, flatDropShadowColor(), ColorSpaceSRGB);
-            graphicsContext.fillRect(outerPathRect);
-        }
-
-        {
-            GraphicsContextStateSaver stateSaver(graphicsContext);
-            graphicsContext.translate(FloatSize(flatShadowBlurRadius + flatStyleHorizontalBorder, flatShadowBlurRadius + flatStyleVerticalBorder));
-
-            IntRect contentImageRect = enclosingIntRect(textRect);
-            m_contentImage-&gt;paint(graphicsContext, m_contentImageScaleFactor, contentImageRect.location(), contentImageRect);
-        }
-    }
-#endif
-}
-
-} // namespace WebKit
</del></span></pre></div>
<a id="branchessafari6003branchSourceWebKit2UIProcessTextIndicatorh"></a>
<div class="delfile"><h4>Deleted: branches/safari-600.3-branch/Source/WebKit2/UIProcess/TextIndicator.h (175663 => 175664)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit2/UIProcess/TextIndicator.h        2014-11-06 05:04:00 UTC (rev 175663)
+++ branches/safari-600.3-branch/Source/WebKit2/UIProcess/TextIndicator.h        2014-11-06 05:14:01 UTC (rev 175664)
</span><span class="lines">@@ -1,64 +0,0 @@
</span><del>-/*
- * Copyright (C) 2010 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 TextIndicator_h
-#define TextIndicator_h
-
-#include &quot;ShareableBitmap.h&quot;
-#include &lt;WebCore/FloatRect.h&gt;
-#include &lt;wtf/PassRefPtr.h&gt;
-#include &lt;wtf/RefCounted.h&gt;
-#include &lt;wtf/Vector.h&gt;
-
-namespace WebCore {
-class GraphicsContext;
-}
-
-namespace WebKit {
-
-class TextIndicator : public RefCounted&lt;TextIndicator&gt; {
-public:
-    static PassRefPtr&lt;TextIndicator&gt; create(const WebCore::FloatRect&amp; selectionRectInWindowCoordinates, const Vector&lt;WebCore::FloatRect&gt;&amp; textRectsInSelectionRectCoordinates, float contentImageScaleFactor, const ShareableBitmap::Handle&amp; contentImageHandle);
-    ~TextIndicator();
-
-    WebCore::FloatRect selectionRectInWindowCoordinates() const { return m_selectionRectInWindowCoordinates; }
-    WebCore::FloatRect frameRect() const;
-
-    ShareableBitmap* contentImage() const { return m_contentImage.get(); }
-
-    void draw(WebCore::GraphicsContext&amp;, const WebCore::IntRect&amp; dirtyRect);
-
-private:
-    TextIndicator(const WebCore::FloatRect&amp; selectionRect, const Vector&lt;WebCore::FloatRect&gt;&amp; textRects, float contentImageScaleFactor, PassRefPtr&lt;ShareableBitmap&gt; contentImage);
-
-    WebCore::FloatRect m_selectionRectInWindowCoordinates;
-    Vector&lt;WebCore::FloatRect&gt; m_textRectsInSelectionRectCoordinates;
-    float m_contentImageScaleFactor;
-    RefPtr&lt;ShareableBitmap&gt; m_contentImage;
-};
-
-} // namespace WebKit
-
-#endif // TextIndicator_h
</del></span></pre></div>
<a id="branchessafari6003branchSourceWebKit2UIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp (175663 => 175664)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp        2014-11-06 05:04:00 UTC (rev 175663)
+++ branches/safari-600.3-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp        2014-11-06 05:14:01 UTC (rev 175664)
</span><span class="lines">@@ -3548,12 +3548,16 @@
</span><span class="cx">     m_findMatchesClient.didGetImageForMatchResult(this, WebImage::create(ShareableBitmap::create(contentImageHandle)).get(), matchIndex);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageProxy::setTextIndicator(const FloatRect&amp; selectionRectInWindowCoordinates, const Vector&lt;FloatRect&gt;&amp; textRectsInSelectionRectCoordinates, float contentImageScaleFactor, const ShareableBitmap::Handle&amp; contentImageHandle, bool fadeOut, bool animate)
</del><ins>+void WebPageProxy::setTextIndicator(const TextIndicator::Data&amp; indicatorData, bool fadeOut, bool animate)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;TextIndicator&gt; textIndicator = TextIndicator::create(selectionRectInWindowCoordinates, textRectsInSelectionRectCoordinates, contentImageScaleFactor, contentImageHandle);
-    m_pageClient.setTextIndicator(textIndicator.release(), fadeOut, animate);
</del><ins>+    m_pageClient.setTextIndicator(TextIndicator::create(indicatorData), fadeOut, animate);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebPageProxy::clearTextIndicator(bool fadeOut, bool animate)
+{
+    m_pageClient.setTextIndicator(nullptr, fadeOut, animate);
+}
+
</ins><span class="cx"> void WebPageProxy::didFindString(const String&amp; string, uint32_t matchCount, int32_t matchIndex)
</span><span class="cx"> {
</span><span class="cx">     m_findClient-&gt;didFindString(this, string, matchCount, matchIndex);
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit2/UIProcess/WebPageProxy.h (175663 => 175664)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit2/UIProcess/WebPageProxy.h        2014-11-06 05:04:00 UTC (rev 175663)
+++ branches/safari-600.3-branch/Source/WebKit2/UIProcess/WebPageProxy.h        2014-11-06 05:14:01 UTC (rev 175664)
</span><span class="lines">@@ -152,6 +152,7 @@
</span><span class="cx"> class RemoteLayerTreeTransaction;
</span><span class="cx"> class RemoteScrollingCoordinatorProxy;
</span><span class="cx"> class StringPairVector;
</span><ins>+class TextIndicator;
</ins><span class="cx"> class ViewSnapshot;
</span><span class="cx"> class VisitedLinkProvider;
</span><span class="cx"> class WebBackForwardList;
</span><span class="lines">@@ -656,7 +657,8 @@
</span><span class="cx">     void hideFindUI();
</span><span class="cx">     void countStringMatches(const String&amp;, FindOptions, unsigned maxMatchCount);
</span><span class="cx">     void didCountStringMatches(const String&amp;, uint32_t matchCount);
</span><del>-    void setTextIndicator(const WebCore::FloatRect&amp; selectionRectInWindowCoordinates, const Vector&lt;WebCore::FloatRect&gt;&amp; textRectsInSelectionRectCoordinates, float contentImageScaleFactor, const ShareableBitmap::Handle&amp; contentImageHandle, bool fadeOut, bool animate);
</del><ins>+    void setTextIndicator(const TextIndicator::Data&amp;, bool fadeOut, bool animate);
+    void clearTextIndicator(bool fadeOut, bool animate);
</ins><span class="cx">     void didFindString(const String&amp;, uint32_t matchCount, int32_t matchIndex);
</span><span class="cx">     void didFailToFindString(const String&amp;);
</span><span class="cx">     void didFindStringMatches(const String&amp;, const Vector&lt;Vector&lt;WebCore::IntRect&gt;&gt;&amp; matchRects, int32_t firstIndexAfterSelection);
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKit2UIProcessWebPageProxymessagesin"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit2/UIProcess/WebPageProxy.messages.in (175663 => 175664)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2014-11-06 05:04:00 UTC (rev 175663)
+++ branches/safari-600.3-branch/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2014-11-06 05:14:01 UTC (rev 175664)
</span><span class="lines">@@ -223,7 +223,8 @@
</span><span class="cx"> 
</span><span class="cx">     # Find messages
</span><span class="cx">     DidCountStringMatches(String string, uint32_t matchCount)
</span><del>-    SetTextIndicator(WebCore::FloatRect selectionRect, Vector&lt;WebCore::FloatRect&gt; textRects, float contentImageScaleFactor, WebKit::ShareableBitmap::Handle contentImageHandle, bool fadeOut, bool animate)
</del><ins>+    SetTextIndicator(WebKit::TextIndicator::Data indicator, bool fadeOut, bool animate)
+    ClearTextIndicator(bool fadeOut, bool animate)
</ins><span class="cx">     DidFindString(String string, uint32_t matchCount, int32_t matchIndex)
</span><span class="cx">     DidFailToFindString(String string)
</span><span class="cx">     DidFindStringMatches(String string, Vector&lt;Vector&lt;WebCore::IntRect&gt;&gt; matches, int32_t firstIndexAfterSelection)
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKit2UIProcessmacWKActionMenuControllerh"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit2/UIProcess/mac/WKActionMenuController.h (175663 => 175664)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit2/UIProcess/mac/WKActionMenuController.h        2014-11-06 05:04:00 UTC (rev 175663)
+++ branches/safari-600.3-branch/Source/WebKit2/UIProcess/mac/WKActionMenuController.h        2014-11-06 05:14:01 UTC (rev 175664)
</span><span class="lines">@@ -56,6 +56,8 @@
</span><span class="cx">     RefPtr&lt;API::Object&gt; _userData;
</span><span class="cx">     _WKActionMenuType _type;
</span><span class="cx">     RetainPtr&lt;NSSharingServicePicker&gt; _sharingServicePicker;
</span><ins>+
+    BOOL _isShowingTextIndicator;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (instancetype)initWithPage:(WebKit::WebPageProxy&amp;)page view:(WKView *)wkView;
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKit2UIProcessmacWKActionMenuControllermm"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit2/UIProcess/mac/WKActionMenuController.mm (175663 => 175664)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit2/UIProcess/mac/WKActionMenuController.mm        2014-11-06 05:04:00 UTC (rev 175663)
+++ branches/safari-600.3-branch/Source/WebKit2/UIProcess/mac/WKActionMenuController.mm        2014-11-06 05:14:01 UTC (rev 175664)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
</span><span class="cx"> 
</span><ins>+#import &quot;TextIndicator.h&quot;
</ins><span class="cx"> #import &quot;WKNSURLExtras.h&quot;
</span><span class="cx"> #import &quot;WKViewInternal.h&quot;
</span><span class="cx"> #import &quot;WebContext.h&quot;
</span><span class="lines">@@ -71,6 +72,8 @@
</span><span class="cx"> @interface WKActionMenuController () &lt;NSSharingServiceDelegate, NSSharingServicePickerDelegate&gt;
</span><span class="cx"> - (void)_updateActionMenuItemsForStage:(MenuUpdateStage)stage;
</span><span class="cx"> - (BOOL)_canAddImageToPhotos;
</span><ins>+- (void)_showTextIndicator;
+- (void)_hideTextIndicator;
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> @interface WKView (WKDeprecatedSPI)
</span><span class="lines">@@ -97,6 +100,7 @@
</span><span class="cx"> {
</span><span class="cx">     _page = nullptr;
</span><span class="cx">     _wkView = nullptr;
</span><ins>+    _hitTestResult = ActionMenuHitTestResult();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)prepareForMenu:(NSMenu *)menu withEvent:(NSEvent *)event
</span><span class="lines">@@ -108,6 +112,8 @@
</span><span class="cx"> 
</span><span class="cx">     _state = ActionMenuState::Pending;
</span><span class="cx">     [self _updateActionMenuItemsForStage:MenuUpdateStage::PrepareForMenu];
</span><ins>+
+    [self _hideTextIndicator];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)isMenuForTextContent
</span><span class="lines">@@ -120,6 +126,9 @@
</span><span class="cx">     if (menu != _wkView.actionMenu)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+    if (_type == kWKActionMenuDataDetectedItem)
+        [self _showTextIndicator];
+
</ins><span class="cx">     if (![self isMenuForTextContent])
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -134,6 +143,9 @@
</span><span class="cx"> {
</span><span class="cx">     if (menu != _wkView.actionMenu)
</span><span class="cx">         return;
</span><ins>+
+    if (_type == kWKActionMenuDataDetectedItem &amp;&amp; menu.numberOfItems &gt; 1)
+        [self _hideTextIndicator];
</ins><span class="cx">     
</span><span class="cx">     _state = ActionMenuState::None;
</span><span class="cx">     _hitTestResult = ActionMenuHitTestResult();
</span><span class="lines">@@ -149,6 +161,28 @@
</span><span class="cx">     _userData = userData;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#pragma mark Text Indicator
+
+- (void)_showTextIndicator
+{
+    if (_isShowingTextIndicator)
+        return;
+
+    if (_hitTestResult.detectedDataTextIndicator) {
+        _page-&gt;setTextIndicator(_hitTestResult.detectedDataTextIndicator-&gt;data(), false, true);
+        _isShowingTextIndicator = YES;
+    }
+}
+
+- (void)_hideTextIndicator
+{
+    if (!_isShowingTextIndicator)
+        return;
+
+    _page-&gt;clearTextIndicator(false, true);
+    _isShowingTextIndicator = NO;
+}
+
</ins><span class="cx"> #pragma mark Link actions
</span><span class="cx"> 
</span><span class="cx"> - (NSArray *)_defaultMenuItemsForLink
</span><span class="lines">@@ -321,8 +355,12 @@
</span><span class="cx">     if (!actionContext)
</span><span class="cx">         return @[ ];
</span><span class="cx"> 
</span><ins>+    actionContext.completionHandler = ^() {
+        [self _hideTextIndicator];
+    };
+
</ins><span class="cx">     WKSetDDActionContextIsForActionMenu(actionContext);
</span><del>-    actionContext.highlightFrame = [_wkView.window convertRectToScreen:[_wkView convertRect:_hitTestResult.actionBoundingBox toView:nil]];
</del><ins>+    actionContext.highlightFrame = [_wkView.window convertRectToScreen:[_wkView convertRect:_hitTestResult.detectedDataBoundingBox toView:nil]];
</ins><span class="cx">     return [[getDDActionsManagerClass() sharedManager] menuItemsForResult:[_hitTestResult.actionContext mainResult] actionContext:actionContext];
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (175663 => 175664)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-11-06 05:04:00 UTC (rev 175663)
+++ branches/safari-600.3-branch/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-11-06 05:14:01 UTC (rev 175664)
</span><span class="lines">@@ -4472,6 +4472,8 @@
</span><span class="cx">                                 5272B2881406985D0096A5D0 /* StatisticsData.cpp */,
</span><span class="cx">                                 5272B2891406985D0096A5D0 /* StatisticsData.h */,
</span><span class="cx">                                 1A5E4DA312D3BD3D0099A2BB /* TextCheckerState.h */,
</span><ins>+                                1A910070126675C4001842F5 /* TextIndicator.cpp */,
+                                1A91006F126675C3001842F5 /* TextIndicator.h */,
</ins><span class="cx">                                 1A64245D12DE29A100CAAE2C /* UpdateInfo.cpp */,
</span><span class="cx">                                 1A64245C12DE29A100CAAE2C /* UpdateInfo.h */,
</span><span class="cx">                                 1AC1336518565B5700F3EC05 /* UserData.cpp */,
</span><span class="lines">@@ -5798,10 +5800,8 @@
</span><span class="cx">                                 BC2652121182608100243E12 /* DrawingAreaProxy.cpp */,
</span><span class="cx">                                 BC2652131182608100243E12 /* DrawingAreaProxy.h */,
</span><span class="cx">                                 1A6422FC12DD08FE00CAAE2C /* DrawingAreaProxy.messages.in */,
</span><del>-                                1A910070126675C4001842F5 /* TextIndicator.cpp */,
</del><span class="cx">                                 1AE00D5E1831792100087DD7 /* FrameLoadState.cpp */,
</span><span class="cx">                                 1AE00D5F1831792100087DD7 /* FrameLoadState.h */,
</span><del>-                                1A91006F126675C3001842F5 /* TextIndicator.h */,
</del><span class="cx">                                 BC17753E118BABF0007D9E9A /* GenericCallback.h */,
</span><span class="cx">                                 BC06F44912DBD1F5002D78DE /* GeolocationPermissionRequestManagerProxy.cpp */,
</span><span class="cx">                                 BC06F44812DBD1F5002D78DE /* GeolocationPermissionRequestManagerProxy.h */,
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKit2WebProcessWebPageFindControllercpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebPage/FindController.cpp (175663 => 175664)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebPage/FindController.cpp        2014-11-06 05:04:00 UTC (rev 175663)
+++ branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebPage/FindController.cpp        2014-11-06 05:14:01 UTC (rev 175664)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #include &quot;DrawingArea.h&quot;
</span><span class="cx"> #include &quot;PluginView.h&quot;
</span><span class="cx"> #include &quot;ShareableBitmap.h&quot;
</span><ins>+#include &quot;TextIndicator.h&quot;
</ins><span class="cx"> #include &quot;WKPage.h&quot;
</span><span class="cx"> #include &quot;WebCoreArgumentCoders.h&quot;
</span><span class="cx"> #include &quot;WebPage.h&quot;
</span><span class="lines">@@ -36,10 +37,8 @@
</span><span class="cx"> #include &lt;WebCore/DocumentMarkerController.h&gt;
</span><span class="cx"> #include &lt;WebCore/FloatQuad.h&gt;
</span><span class="cx"> #include &lt;WebCore/FocusController.h&gt;
</span><del>-#include &lt;WebCore/FrameSnapshotting.h&gt;
</del><span class="cx"> #include &lt;WebCore/FrameView.h&gt;
</span><span class="cx"> #include &lt;WebCore/GraphicsContext.h&gt;
</span><del>-#include &lt;WebCore/ImageBuffer.h&gt;
</del><span class="cx"> #include &lt;WebCore/MainFrame.h&gt;
</span><span class="cx"> #include &lt;WebCore/Page.h&gt;
</span><span class="cx"> #include &lt;WebCore/PageOverlayController.h&gt;
</span><span class="lines">@@ -259,28 +258,6 @@
</span><span class="cx">     m_webPage-&gt;send(Messages::WebPageProxy::DidFindStringMatches(string, matchRects, indexForSelection));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool getFindIndicatorBitmap(Frame&amp; frame, ShareableBitmap::Handle&amp; handle)
-{
-    std::unique_ptr&lt;ImageBuffer&gt; snapshot = snapshotSelection(frame, WebCore::SnapshotOptionsForceBlackText);
-    if (!snapshot)
-        return false;
-
-    RefPtr&lt;ShareableBitmap&gt; findIndicatorTextBackingStore = ShareableBitmap::createShareable(snapshot-&gt;internalSize(), ShareableBitmap::SupportsAlpha);
-    if (!findIndicatorTextBackingStore)
-        return false;
-
-    // FIXME: We should consider using subpixel antialiasing for the snapshot
-    // if we're compositing this image onto a solid color (the modern find indicator style).
-    auto graphicsContext = findIndicatorTextBackingStore-&gt;createGraphicsContext();
-    float deviceScaleFactor = frame.page()-&gt;deviceScaleFactor();
-    graphicsContext-&gt;scale(FloatSize(deviceScaleFactor, deviceScaleFactor));
-    graphicsContext-&gt;drawImageBuffer(snapshot.get(), ColorSpaceDeviceRGB, FloatPoint());
-
-    if (!findIndicatorTextBackingStore-&gt;createHandle(handle))
-        return false;
-    return true;
-}
-
</del><span class="cx"> void FindController::getImageForFindMatch(uint32_t matchIndex)
</span><span class="cx"> {
</span><span class="cx">     if (matchIndex &gt;= m_findMatches.size())
</span><span class="lines">@@ -292,11 +269,16 @@
</span><span class="cx">     VisibleSelection oldSelection = frame-&gt;selection().selection();
</span><span class="cx">     frame-&gt;selection().setSelection(VisibleSelection(m_findMatches[matchIndex].get()));
</span><span class="cx"> 
</span><del>-    ShareableBitmap::Handle handle;
-    getFindIndicatorBitmap(*frame, handle);
</del><ins>+    RefPtr&lt;ShareableBitmap&gt; selectionSnapshot = WebFrame::fromCoreFrame(*frame)-&gt;createSelectionSnapshot();
</ins><span class="cx"> 
</span><span class="cx">     frame-&gt;selection().setSelection(oldSelection);
</span><span class="cx"> 
</span><ins>+    if (!selectionSnapshot)
+        return;
+
+    ShareableBitmap::Handle handle;
+    selectionSnapshot-&gt;createHandle(handle);
+
</ins><span class="cx">     if (handle.isNull())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -332,29 +314,12 @@
</span><span class="cx"> #if !PLATFORM(IOS)
</span><span class="cx"> bool FindController::updateFindIndicator(Frame&amp; selectedFrame, bool isShowingOverlay, bool shouldAnimate)
</span><span class="cx"> {
</span><del>-    IntRect selectionRect = enclosingIntRect(selectedFrame.selection().selectionBounds());
-    ShareableBitmap::Handle handle;
-    if (!getFindIndicatorBitmap(selectedFrame, handle))
</del><ins>+    RefPtr&lt;TextIndicator&gt; indicator = TextIndicator::createWithSelectionInFrame(*WebFrame::fromCoreFrame(selectedFrame));
+    if (!indicator)
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    // We want the selection rect in window coordinates.
-    IntRect selectionRectInWindowCoordinates = selectedFrame.view()-&gt;contentsToWindow(selectionRect);
-
-    Vector&lt;FloatRect&gt; textRects;
-    selectedFrame.selection().getClippedVisibleTextRectangles(textRects);
-
-    // We want the text rects in selection rect coordinates.
-    Vector&lt;FloatRect&gt; textRectsInSelectionRectCoordinates;
-    
-    for (size_t i = 0; i &lt; textRects.size(); ++i) {
-        IntRect textRectInSelectionRectCoordinates = selectedFrame.view()-&gt;contentsToWindow(enclosingIntRect(textRects[i]));
-        textRectInSelectionRectCoordinates.move(-selectionRectInWindowCoordinates.x(), -selectionRectInWindowCoordinates.y());
-
-        textRectsInSelectionRectCoordinates.append(textRectInSelectionRectCoordinates);
-    }            
-
-    m_webPage-&gt;send(Messages::WebPageProxy::SetTextIndicator(selectionRectInWindowCoordinates, textRectsInSelectionRectCoordinates, m_webPage-&gt;corePage()-&gt;deviceScaleFactor(), handle, !isShowingOverlay, shouldAnimate));
-    m_findIndicatorRect = selectionRectInWindowCoordinates;
</del><ins>+    m_findIndicatorRect = enclosingIntRect(indicator-&gt;selectionRectInWindowCoordinates());
+    m_webPage-&gt;send(Messages::WebPageProxy::SetTextIndicator(indicator-&gt;data(), !isShowingOverlay, shouldAnimate));
</ins><span class="cx">     m_isShowingFindIndicator = true;
</span><span class="cx"> 
</span><span class="cx">     return true;
</span><span class="lines">@@ -365,8 +330,7 @@
</span><span class="cx">     if (!m_isShowingFindIndicator)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    ShareableBitmap::Handle handle;
-    m_webPage-&gt;send(Messages::WebPageProxy::SetTextIndicator(FloatRect(), Vector&lt;FloatRect&gt;(), m_webPage-&gt;corePage()-&gt;deviceScaleFactor(), handle, false, true));
</del><ins>+    m_webPage-&gt;send(Messages::WebPageProxy::ClearTextIndicator(false, true));
</ins><span class="cx">     m_isShowingFindIndicator = false;
</span><span class="cx">     m_foundStringMatchIndex = -1;
</span><span class="cx">     didHideFindIndicator();
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKit2WebProcessWebPageWebFramecpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp (175663 => 175664)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp        2014-11-06 05:04:00 UTC (rev 175663)
+++ branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebPage/WebFrame.cpp        2014-11-06 05:14:01 UTC (rev 175664)
</span><span class="lines">@@ -50,12 +50,14 @@
</span><span class="cx"> #include &lt;WebCore/DocumentLoader.h&gt;
</span><span class="cx"> #include &lt;WebCore/EventHandler.h&gt;
</span><span class="cx"> #include &lt;WebCore/Frame.h&gt;
</span><ins>+#include &lt;WebCore/FrameSnapshotting.h&gt;
</ins><span class="cx"> #include &lt;WebCore/FrameView.h&gt;
</span><span class="cx"> #include &lt;WebCore/HTMLFormElement.h&gt;
</span><span class="cx"> #include &lt;WebCore/HTMLFrameOwnerElement.h&gt;
</span><span class="cx"> #include &lt;WebCore/HTMLInputElement.h&gt;
</span><span class="cx"> #include &lt;WebCore/HTMLNames.h&gt;
</span><span class="cx"> #include &lt;WebCore/HTMLTextAreaElement.h&gt;
</span><ins>+#include &lt;WebCore/ImageBuffer.h&gt;
</ins><span class="cx"> #include &lt;WebCore/JSCSSStyleDeclaration.h&gt;
</span><span class="cx"> #include &lt;WebCore/JSElement.h&gt;
</span><span class="cx"> #include &lt;WebCore/JSRange.h&gt;
</span><span class="lines">@@ -781,5 +783,25 @@
</span><span class="cx">     return archive-&gt;rawDataRepresentation();
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><ins>+
+PassRefPtr&lt;ShareableBitmap&gt; WebFrame::createSelectionSnapshot()
+{
+    std::unique_ptr&lt;ImageBuffer&gt; snapshot = snapshotSelection(*coreFrame(), WebCore::SnapshotOptionsForceBlackText);
+    if (!snapshot)
+        return nullptr;
+
+    RefPtr&lt;ShareableBitmap&gt; sharedSnapshot = ShareableBitmap::createShareable(snapshot-&gt;internalSize(), ShareableBitmap::SupportsAlpha);
+    if (!sharedSnapshot)
+        return nullptr;
+
+    // FIXME: We should consider providing a way to use subpixel antialiasing for the snapshot
+    // if we're compositing this image onto a solid color (e.g. the modern find indicator style).
+    auto graphicsContext = sharedSnapshot-&gt;createGraphicsContext();
+    float deviceScaleFactor = coreFrame()-&gt;page()-&gt;deviceScaleFactor();
+    graphicsContext-&gt;scale(FloatSize(deviceScaleFactor, deviceScaleFactor));
+    graphicsContext-&gt;drawImageBuffer(snapshot.get(), ColorSpaceDeviceRGB, FloatPoint());
+
+    return sharedSnapshot.release();
+}
</ins><span class="cx">     
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKit2WebProcessWebPageWebFrameh"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebPage/WebFrame.h (175663 => 175664)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebPage/WebFrame.h        2014-11-06 05:04:00 UTC (rev 175663)
+++ branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebPage/WebFrame.h        2014-11-06 05:14:01 UTC (rev 175664)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #define WebFrame_h
</span><span class="cx"> 
</span><span class="cx"> #include &quot;APIObject.h&quot;
</span><ins>+#include &quot;ShareableBitmap.h&quot;
</ins><span class="cx"> #include &quot;WKBase.h&quot;
</span><span class="cx"> #include &quot;WebFrameLoaderClient.h&quot;
</span><span class="cx"> #include &lt;JavaScriptCore/JSBase.h&gt;
</span><span class="lines">@@ -149,6 +150,8 @@
</span><span class="cx">     RetainPtr&lt;CFDataRef&gt; webArchiveData(FrameFilterFunction, void* context);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    PassRefPtr&lt;ShareableBitmap&gt; createSelectionSnapshot();
+
</ins><span class="cx"> private:
</span><span class="cx">     static PassRefPtr&lt;WebFrame&gt; create(std::unique_ptr&lt;WebFrameLoaderClient&gt;);
</span><span class="cx">     WebFrame(std::unique_ptr&lt;WebFrameLoaderClient&gt;);
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKit2WebProcessWebPagemacWebPageMacmm"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm (175663 => 175664)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm        2014-11-06 05:04:00 UTC (rev 175663)
+++ branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm        2014-11-06 05:14:01 UTC (rev 175664)
</span><span class="lines">@@ -1072,7 +1072,7 @@
</span><span class="cx">     return String();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static RetainPtr&lt;DDActionContext&gt; scanForDataDetectedItems(const HitTestResult&amp; hitTestResult, FloatRect&amp; actionBoundingBox)
</del><ins>+static RetainPtr&lt;DDActionContext&gt; scanForDataDetectedItems(const HitTestResult&amp; hitTestResult, FloatRect&amp; detectedDataBoundingBox, RefPtr&lt;Range&gt;&amp; detectedDataRange)
</ins><span class="cx"> {
</span><span class="cx">     Node* node = hitTestResult.innerNonSharedNode();
</span><span class="cx">     if (!node)
</span><span class="lines">@@ -1123,11 +1123,33 @@
</span><span class="cx">     Vector&lt;FloatQuad&gt; quads;
</span><span class="cx">     mainResultRange-&gt;textQuads(quads);
</span><span class="cx">     if (!quads.isEmpty())
</span><del>-        actionBoundingBox = mainResultRange-&gt;ownerDocument().view()-&gt;contentsToWindow(quads[0].enclosingBoundingBox());
</del><ins>+        detectedDataBoundingBox = mainResultRange-&gt;ownerDocument().view()-&gt;contentsToWindow(quads[0].enclosingBoundingBox());
</ins><span class="cx"> 
</span><ins>+    detectedDataRange = mainResultRange;
+
</ins><span class="cx">     return actionContext;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static PassRefPtr&lt;TextIndicator&gt; textIndicatorForRange(Range* range)
+{
+    if (!range)
+        return nullptr;
+
+    Frame* frame = range-&gt;startContainer()-&gt;document().frame();
+
+    if (!frame)
+        return nullptr;
+
+    VisibleSelection oldSelection = frame-&gt;selection().selection();
+    frame-&gt;selection().setSelection(range);
+
+    RefPtr&lt;TextIndicator&gt; indicator = TextIndicator::createWithSelectionInFrame(*WebFrame::fromCoreFrame(*frame));
+
+    frame-&gt;selection().setSelection(oldSelection);
+
+    return indicator.release();
+}
+
</ins><span class="cx"> void WebPage::performActionMenuHitTestAtLocation(WebCore::FloatPoint locationInViewCooordinates)
</span><span class="cx"> {
</span><span class="cx">     layoutIfNeeded();
</span><span class="lines">@@ -1161,9 +1183,13 @@
</span><span class="cx"> 
</span><span class="cx">     // FIXME: Avoid scanning if we will just throw away the result (e.g. we're over a link).
</span><span class="cx">     if (hitTestResult.innerNode() &amp;&amp; hitTestResult.innerNode()-&gt;isTextNode()) {
</span><del>-        FloatRect actionBoundingBox;
-        actionMenuResult.actionContext = scanForDataDetectedItems(hitTestResult, actionBoundingBox);
-        actionMenuResult.actionBoundingBox = actionBoundingBox;
</del><ins>+        FloatRect detectedDataBoundingBox;
+        RefPtr&lt;Range&gt; detectedDataRange;
+        actionMenuResult.actionContext = scanForDataDetectedItems(hitTestResult, detectedDataBoundingBox, detectedDataRange);
+        if (actionMenuResult.actionContext) {
+            actionMenuResult.detectedDataBoundingBox = detectedDataBoundingBox;
+            actionMenuResult.detectedDataTextIndicator = textIndicatorForRange(detectedDataRange.get());
+        }
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;API::Object&gt; userData;
</span></span></pre>
</div>
</div>

</body>
</html>