<!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>[176363] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/176363">176363</a></dd>
<dt>Author</dt> <dd>timothy_horton@apple.com</dd>
<dt>Date</dt> <dd>2014-11-19 16:10:57 -0800 (Wed, 19 Nov 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add an optional entry transition (from selection highlight) to TextIndicator
https://bugs.webkit.org/show_bug.cgi?id=138856
&lt;rdar://problem/18840128&gt;

Reviewed by Anders Carlsson.

* Shared/TextIndicator.cpp:
(WebKit::outsetIndicatorRectIncludingShadow):
(WebKit::TextIndicator::createWithRange):
(WebKit::snapshotSelectionWithHighlight):
(WebKit::TextIndicator::createWithSelectionInFrame):
(WebKit::TextIndicator::frameRect):
(WebKit::TextIndicator::Data::encode):
(WebKit::TextIndicator::Data::decode):
Remove TextIndicator::draw and related functions; drawing is handled entirely
by the TextIndicatorWindow now, and TextIndicator just stores the required data.

Unify outsetIndicatorRectIncludingShadow.

Add an argument to createWithRange/createWithSelectionInFrame to indicate
if the TextIndicator should transition from the selection highlight to
the yellow bubble.

If we're doing the transition, paint the selection into a second bitmap,
without forcing the text to black and without hiding the blue highlight.

Encode/decode the second bitmap.

* Shared/TextIndicator.h:
* UIProcess/mac/TextIndicatorWindow.h:
* UIProcess/mac/TextIndicatorWindow.mm:
(-[WKTextIndicatorView initWithFrame:textIndicator:margin:transitionFromSelectionColor:]):
(-[WKTextIndicatorView presentWithCompletionHandler:]):
(-[WKTextIndicatorView hideWithCompletionHandler:]):
(-[WKTextIndicatorView isFlipped]):
(WebKit::TextIndicatorWindow::TextIndicatorWindow):
(WebKit::TextIndicatorWindow::setTextIndicator):
(WebKit::TextIndicatorWindow::closeWindow):
(WebKit::TextIndicatorWindow::startFadeOutTimerFired):
Re-implement the bounce animation using CoreAnimation instead of
the WKSI-based WKWindowBounceAnimation*.

* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performDictionaryLookupForSelection):
(WebKit::WebPage::performDictionaryLookupOfCurrentSelection):
(WebKit::WebPage::performDictionaryLookupForRange):
(WebKit::WebPage::performActionMenuHitTestAtLocation):
* WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
Use the aforementioned transition animation for performDictionaryLookupOfCurrentSelection,
the context menu lookup item, and for Data Detectors.

* WebCore.exp.in:
Add an export.

* platform/spi/cocoa/QuartzCoreSPI.h:
Add some SPI.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCoreplatformspicocoaQuartzCoreSPIh">trunk/Source/WebCore/platform/spi/cocoa/QuartzCoreSPI.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedTextIndicatorcpp">trunk/Source/WebKit2/Shared/TextIndicator.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedTextIndicatorh">trunk/Source/WebKit2/Shared/TextIndicator.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPImacWKViewmm">trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPImacWKViewInternalh">trunk/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessPageClienth">trunk/Source/WebKit2/UIProcess/PageClient.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxycpp">trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxymessagesin">trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosPageClientImplIOSh">trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosPageClientImplIOSmm">trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacPageClientImplh">trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacPageClientImplmm">trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacTextIndicatorWindowh">trunk/Source/WebKit2/UIProcess/mac/TextIndicatorWindow.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacTextIndicatorWindowmm">trunk/Source/WebKit2/UIProcess/mac/TextIndicatorWindow.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacWKActionMenuControllermm">trunk/Source/WebKit2/UIProcess/mac/WKActionMenuController.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportmacWebContextMenuClientMacmm">trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageFindControllercpp">trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPageh">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacWebPageMacmm">trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (176362 => 176363)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-11-20 00:02:22 UTC (rev 176362)
+++ trunk/Source/WebCore/ChangeLog        2014-11-20 00:10:57 UTC (rev 176363)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2014-11-19  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+        Add an optional entry transition (from selection highlight) to TextIndicator
+        https://bugs.webkit.org/show_bug.cgi?id=138856
+        &lt;rdar://problem/18840128&gt;
+
+        Reviewed by Anders Carlsson.
+
+        * WebCore.exp.in:
+        Add an export.
+
+        * platform/spi/cocoa/QuartzCoreSPI.h:
+        Add some SPI.
+
</ins><span class="cx"> 2014-11-19  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Move 'outline-style' CSS property to the new StyleBuilder
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (176362 => 176363)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-11-20 00:02:22 UTC (rev 176362)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-11-20 00:10:57 UTC (rev 176363)
</span><span class="lines">@@ -788,6 +788,7 @@
</span><span class="cx"> __ZN7WebCore17openTemporaryFileERKN3WTF6StringERi
</span><span class="cx"> __ZN7WebCore17sRGBColorSpaceRefEv
</span><span class="cx"> __ZN7WebCore17setCookiesFromDOMERKNS_21NetworkStorageSessionERKNS_3URLES5_RKN3WTF6StringE
</span><ins>+__ZN7WebCore17snapshotFrameRectERNS_5FrameERKNS_7IntRectEj
</ins><span class="cx"> __ZN7WebCore17snapshotSelectionERNS_5FrameEj
</span><span class="cx"> __ZN7WebCore17userVisibleStringEP5NSURL
</span><span class="cx"> __ZN7WebCore18DOMWindowExtensionC1EPNS_5FrameERNS_15DOMWrapperWorldE
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformspicocoaQuartzCoreSPIh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/spi/cocoa/QuartzCoreSPI.h (176362 => 176363)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/spi/cocoa/QuartzCoreSPI.h        2014-11-20 00:02:22 UTC (rev 176362)
+++ trunk/Source/WebCore/platform/spi/cocoa/QuartzCoreSPI.h        2014-11-20 00:10:57 UTC (rev 176363)
</span><span class="lines">@@ -72,6 +72,7 @@
</span><span class="cx"> @property BOOL canDrawConcurrently;
</span><span class="cx"> @property BOOL contentsOpaque;
</span><span class="cx"> @property BOOL needsLayoutOnGeometryChange;
</span><ins>+@property BOOL shadowPathIsBounds;
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> @interface CATiledLayer (Details)
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (176362 => 176363)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-11-20 00:02:22 UTC (rev 176362)
+++ trunk/Source/WebKit2/ChangeLog        2014-11-20 00:10:57 UTC (rev 176363)
</span><span class="lines">@@ -1,3 +1,57 @@
</span><ins>+2014-11-19  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+        Add an optional entry transition (from selection highlight) to TextIndicator
+        https://bugs.webkit.org/show_bug.cgi?id=138856
+        &lt;rdar://problem/18840128&gt;
+
+        Reviewed by Anders Carlsson.
+
+        * Shared/TextIndicator.cpp:
+        (WebKit::outsetIndicatorRectIncludingShadow):
+        (WebKit::TextIndicator::createWithRange):
+        (WebKit::snapshotSelectionWithHighlight):
+        (WebKit::TextIndicator::createWithSelectionInFrame):
+        (WebKit::TextIndicator::frameRect):
+        (WebKit::TextIndicator::Data::encode):
+        (WebKit::TextIndicator::Data::decode):
+        Remove TextIndicator::draw and related functions; drawing is handled entirely
+        by the TextIndicatorWindow now, and TextIndicator just stores the required data.
+
+        Unify outsetIndicatorRectIncludingShadow.
+
+        Add an argument to createWithRange/createWithSelectionInFrame to indicate
+        if the TextIndicator should transition from the selection highlight to
+        the yellow bubble.
+
+        If we're doing the transition, paint the selection into a second bitmap,
+        without forcing the text to black and without hiding the blue highlight.
+
+        Encode/decode the second bitmap.
+
+        * Shared/TextIndicator.h:
+        * UIProcess/mac/TextIndicatorWindow.h:
+        * UIProcess/mac/TextIndicatorWindow.mm:
+        (-[WKTextIndicatorView initWithFrame:textIndicator:margin:transitionFromSelectionColor:]):
+        (-[WKTextIndicatorView presentWithCompletionHandler:]):
+        (-[WKTextIndicatorView hideWithCompletionHandler:]):
+        (-[WKTextIndicatorView isFlipped]):
+        (WebKit::TextIndicatorWindow::TextIndicatorWindow):
+        (WebKit::TextIndicatorWindow::setTextIndicator):
+        (WebKit::TextIndicatorWindow::closeWindow):
+        (WebKit::TextIndicatorWindow::startFadeOutTimerFired):
+        Re-implement the bounce animation using CoreAnimation instead of
+        the WKSI-based WKWindowBounceAnimation*.
+
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/mac/WebPageMac.mm:
+        (WebKit::WebPage::performDictionaryLookupForSelection):
+        (WebKit::WebPage::performDictionaryLookupOfCurrentSelection):
+        (WebKit::WebPage::performDictionaryLookupForRange):
+        (WebKit::WebPage::performActionMenuHitTestAtLocation):
+        * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
+        Use the aforementioned transition animation for performDictionaryLookupOfCurrentSelection,
+        the context menu lookup item, and for Data Detectors.
+
</ins><span class="cx"> 2014-11-19  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Add a version of API::Data::createWithoutCopying that takes an NSData
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedTextIndicatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/TextIndicator.cpp (176362 => 176363)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/TextIndicator.cpp        2014-11-20 00:02:22 UTC (rev 176362)
+++ trunk/Source/WebKit2/Shared/TextIndicator.cpp        2014-11-20 00:10:57 UTC (rev 176363)
</span><span class="lines">@@ -39,91 +39,35 @@
</span><span class="cx"> #include &lt;WebCore/Document.h&gt;
</span><span class="cx"> #include &lt;WebCore/Frame.h&gt;
</span><span class="cx"> #include &lt;WebCore/FrameSelection.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/GeometryUtilities.h&gt;
</span><del>-#include &lt;WebCore/Gradient.h&gt;
</del><span class="cx"> #include &lt;WebCore/GraphicsContext.h&gt;
</span><ins>+#include &lt;WebCore/ImageBuffer.h&gt;
</ins><span class="cx"> #include &lt;WebCore/IntRect.h&gt;
</span><del>-#include &lt;WebCore/Path.h&gt;
</del><span class="cx"> 
</span><del>-#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
-
</del><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><ins>+// These should match the values in TextIndicatorWindow.
+// FIXME: Ideally these would only be in one place.
</ins><span class="cx"> #if ENABLE(LEGACY_TEXT_INDICATOR_STYLE)
</span><del>-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;
</del><ins>+const float horizontalBorder = 3;
+const float verticalBorder = 1;
+const float dropShadowBlurRadius = 1.5;
</ins><span class="cx"> #else
</span><del>-const float flatStyleHorizontalBorder = 2;
-const float flatStyleVerticalBorder = 1;
-const float flatShadowOffsetX = 0;
-const float flatShadowOffsetY = 5;
-const float flatShadowBlurRadius = 25;
-const float flatRimShadowBlurRadius = 2;
</del><ins>+const float horizontalBorder = 2;
+const float verticalBorder = 1;
+const float dropShadowBlurRadius = 12;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><del>-static FloatRect inflateRect(const FloatRect&amp; rect, float inflateX, float inflateY)
-{
-    FloatRect inflatedRect = rect;
-    inflatedRect.inflateX(inflateX);
-    inflatedRect.inflateY(inflateY);
-    return inflatedRect;
-}
-
</del><span class="cx"> static FloatRect outsetIndicatorRectIncludingShadow(const FloatRect rect)
</span><span class="cx"> {
</span><del>-#if ENABLE(LEGACY_TEXT_INDICATOR_STYLE)
</del><span class="cx">     FloatRect outsetRect = rect;
</span><del>-    outsetRect.move(-leftBorderThickness, -topBorderThickness);
-    outsetRect.expand(leftBorderThickness + rightBorderThickness, topBorderThickness + bottomBorderThickness);
</del><ins>+    outsetRect.inflateX(dropShadowBlurRadius + horizontalBorder);
+    outsetRect.inflateY(dropShadowBlurRadius + verticalBorder);
</ins><span class="cx">     return outsetRect;
</span><del>-#else
-    return inflateRect(rect, flatShadowBlurRadius + flatStyleHorizontalBorder, flatShadowBlurRadius + flatStyleVerticalBorder);
-#endif
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static bool textIndicatorsForTextRectsOverlap(const Vector&lt;FloatRect&gt;&amp; textRects)
</span><span class="lines">@@ -155,7 +99,7 @@
</span><span class="cx">     return adoptRef(new TextIndicator(data));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;TextIndicator&gt; TextIndicator::createWithRange(const Range&amp; range)
</del><ins>+PassRefPtr&lt;TextIndicator&gt; TextIndicator::createWithRange(const Range&amp; range, PresentationTransition presentationTransition)
</ins><span class="cx"> {
</span><span class="cx">     Frame* frame = range.startContainer()-&gt;document().frame();
</span><span class="cx"> 
</span><span class="lines">@@ -165,21 +109,57 @@
</span><span class="cx">     VisibleSelection oldSelection = frame-&gt;selection().selection();
</span><span class="cx">     frame-&gt;selection().setSelection(&amp;range);
</span><span class="cx"> 
</span><del>-    RefPtr&lt;TextIndicator&gt; indicator = TextIndicator::createWithSelectionInFrame(*WebFrame::fromCoreFrame(*frame));
</del><ins>+    RefPtr&lt;TextIndicator&gt; indicator = TextIndicator::createWithSelectionInFrame(*WebFrame::fromCoreFrame(*frame), presentationTransition);
</ins><span class="cx"> 
</span><span class="cx">     frame-&gt;selection().setSelection(oldSelection);
</span><span class="cx">     
</span><span class="cx">     return indicator.release();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;TextIndicator&gt; TextIndicator::createWithSelectionInFrame(const WebFrame&amp; frame)
</del><ins>+// FIXME (138889): Ideally the FrameSnapshotting functions would be more flexible
+// and we wouldn't have to implement this here.
+static PassRefPtr&lt;ShareableBitmap&gt; snapshotSelectionWithHighlight(Frame&amp; frame)
</ins><span class="cx"> {
</span><ins>+    auto&amp; selection = frame.selection();
+
+    if (!selection.isRange())
+        return nullptr;
+
+    FloatRect selectionBounds = selection.selectionBounds();
+
+    // It is possible for the selection bounds to be empty; see https://bugs.webkit.org/show_bug.cgi?id=56645.
+    if (selectionBounds.isEmpty())
+        return nullptr;
+
+    std::unique_ptr&lt;ImageBuffer&gt; snapshot = snapshotFrameRect(frame, enclosingIntRect(selectionBounds), 0);
+
+    if (!snapshot)
+        return nullptr;
+
+    RefPtr&lt;ShareableBitmap&gt; sharedSnapshot = ShareableBitmap::createShareable(snapshot-&gt;internalSize(), ShareableBitmap::SupportsAlpha);
+    if (!sharedSnapshot)
+        return nullptr;
+
+    auto graphicsContext = sharedSnapshot-&gt;createGraphicsContext();
+    float deviceScaleFactor = frame.page()-&gt;deviceScaleFactor();
+    graphicsContext-&gt;scale(FloatSize(deviceScaleFactor, deviceScaleFactor));
+    graphicsContext-&gt;drawImageBuffer(snapshot.get(), ColorSpaceDeviceRGB, FloatPoint());
+
+    return sharedSnapshot.release();
+}
+
+PassRefPtr&lt;TextIndicator&gt; TextIndicator::createWithSelectionInFrame(const WebFrame&amp; frame, PresentationTransition presentationTransition)
+{
</ins><span class="cx">     Frame&amp; coreFrame = *frame.coreFrame();
</span><span class="cx">     IntRect selectionRect = enclosingIntRect(coreFrame.selection().selectionBounds());
</span><span class="cx">     RefPtr&lt;ShareableBitmap&gt; indicatorBitmap = frame.createSelectionSnapshot();
</span><span class="cx">     if (!indicatorBitmap)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><ins>+    RefPtr&lt;ShareableBitmap&gt; indicatorBitmapWithHighlight;
+    if (presentationTransition == PresentationTransition::BounceAndCrossfade)
+        indicatorBitmapWithHighlight = snapshotSelectionWithHighlight(coreFrame);
+
</ins><span class="cx">     // Store the selection rect in window coordinates, to be used subsequently
</span><span class="cx">     // to determine if the indicator and selection still precisely overlap.
</span><span class="cx">     IntRect selectionRectInWindowCoordinates = coreFrame.view()-&gt;contentsToWindow(selectionRect);
</span><span class="lines">@@ -210,6 +190,8 @@
</span><span class="cx">     data.textRectsInBoundingRectCoordinates = textRectsInBoundingRectCoordinates;
</span><span class="cx">     data.contentImageScaleFactor = frame.page()-&gt;deviceScaleFactor();
</span><span class="cx">     data.contentImage = indicatorBitmap;
</span><ins>+    data.contentImageWithHighlight = indicatorBitmapWithHighlight;
+    data.presentationTransition = presentationTransition;
</ins><span class="cx"> 
</span><span class="cx">     return TextIndicator::create(data);
</span><span class="cx"> }
</span><span class="lines">@@ -231,131 +213,26 @@
</span><span class="cx"> 
</span><span class="cx"> FloatRect TextIndicator::frameRect() const
</span><span class="cx"> {
</span><del>-    return outsetIndicatorRectIncludingShadow(m_data.textBoundingRectInWindowCoordinates);
</del><ins>+    return m_data.textBoundingRectInWindowCoordinates;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-#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::drawContentImage(WebCore::GraphicsContext&amp; graphicsContext, WebCore::FloatRect textRect)
-{
-    FloatRect imageRect = textRect;
-    imageRect.move(m_data.textBoundingRectInWindowCoordinates.location() - m_data.selectionRectInWindowCoordinates.location());
-    m_data.contentImage-&gt;paint(graphicsContext, m_data.contentImageScaleFactor, enclosingIntRect(textRect).location(), enclosingIntRect(imageRect));
-}
-
-void TextIndicator::draw(GraphicsContext&amp; graphicsContext, const IntRect&amp; /*dirtyRect*/)
-{
-#if ENABLE(LEGACY_TEXT_INDICATOR_STYLE)
-    for (auto&amp; textRect : m_data.textRectsInBoundingRectCoordinates) {
-        FloatRect borderedTextRect = textRect;
-        borderedTextRect.move(leftBorderThickness, topBorderThickness);
-
-        FloatRect outerPathRect = inflateRect(borderedTextRect, horizontalOutsetToCenterOfLightBorder, verticalOutsetToCenterOfLightBorder);
-        FloatRect innerPathRect = inflateRect(borderedTextRect, 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)));
-
-            drawContentImage(graphicsContext, textRect);
-        }
-    }
-#else
-    for (auto&amp; textRect : m_data.textRectsInBoundingRectCoordinates) {
-        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));
-
-            drawContentImage(graphicsContext, textRect);
-        }
-    }
-#endif
-}
-
</del><span class="cx"> void TextIndicator::Data::encode(IPC::ArgumentEncoder&amp; encoder) const
</span><span class="cx"> {
</span><span class="cx">     encoder &lt;&lt; selectionRectInWindowCoordinates;
</span><span class="cx">     encoder &lt;&lt; textBoundingRectInWindowCoordinates;
</span><span class="cx">     encoder &lt;&lt; textRectsInBoundingRectCoordinates;
</span><span class="cx">     encoder &lt;&lt; contentImageScaleFactor;
</span><ins>+    encoder.encodeEnum(presentationTransition);
</ins><span class="cx"> 
</span><span class="cx">     ShareableBitmap::Handle contentImageHandle;
</span><span class="cx">     if (contentImage)
</span><span class="cx">         contentImage-&gt;createHandle(contentImageHandle, SharedMemory::ReadOnly);
</span><span class="cx">     encoder &lt;&lt; contentImageHandle;
</span><ins>+
+    ShareableBitmap::Handle contentImageWithHighlightHandle;
+    if (contentImageWithHighlight)
+        contentImageWithHighlight-&gt;createHandle(contentImageWithHighlightHandle, SharedMemory::ReadOnly);
+    encoder &lt;&lt; contentImageWithHighlightHandle;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool TextIndicator::Data::decode(IPC::ArgumentDecoder&amp; decoder, TextIndicator::Data&amp; textIndicatorData)
</span><span class="lines">@@ -372,6 +249,9 @@
</span><span class="cx">     if (!decoder.decode(textIndicatorData.contentImageScaleFactor))
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><ins>+    if (!decoder.decodeEnum(textIndicatorData.presentationTransition))
+        return false;
+
</ins><span class="cx">     ShareableBitmap::Handle contentImageHandle;
</span><span class="cx">     if (!decoder.decode(contentImageHandle))
</span><span class="cx">         return false;
</span><span class="lines">@@ -379,6 +259,13 @@
</span><span class="cx">     if (!contentImageHandle.isNull())
</span><span class="cx">         textIndicatorData.contentImage = ShareableBitmap::create(contentImageHandle, SharedMemory::ReadOnly);
</span><span class="cx"> 
</span><ins>+    ShareableBitmap::Handle contentImageWithHighlightHandle;
+    if (!decoder.decode(contentImageWithHighlightHandle))
+        return false;
+
+    if (!contentImageWithHighlightHandle.isNull())
+        textIndicatorData.contentImageWithHighlight = ShareableBitmap::create(contentImageWithHighlightHandle, SharedMemory::ReadOnly);
+
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedTextIndicatorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/TextIndicator.h (176362 => 176363)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/TextIndicator.h        2014-11-20 00:02:22 UTC (rev 176362)
+++ trunk/Source/WebKit2/Shared/TextIndicator.h        2014-11-20 00:10:57 UTC (rev 176363)
</span><span class="lines">@@ -32,6 +32,12 @@
</span><span class="cx"> #include &lt;wtf/RefCounted.h&gt;
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> 
</span><ins>+#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
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> class GraphicsContext;
</span><span class="cx"> class Range;
</span><span class="lines">@@ -48,20 +54,29 @@
</span><span class="cx"> 
</span><span class="cx"> class TextIndicator : public RefCounted&lt;TextIndicator&gt; {
</span><span class="cx"> public:
</span><ins>+    enum class PresentationTransition {
+        None,
+        Bounce,
+        BounceAndCrossfade
+    };
+
</ins><span class="cx">     struct Data {
</span><span class="cx">         WebCore::FloatRect selectionRectInWindowCoordinates;
</span><span class="cx">         WebCore::FloatRect textBoundingRectInWindowCoordinates;
</span><span class="cx">         Vector&lt;WebCore::FloatRect&gt; textRectsInBoundingRectCoordinates;
</span><span class="cx">         float contentImageScaleFactor;
</span><ins>+        RefPtr&lt;ShareableBitmap&gt; contentImageWithHighlight;
</ins><span class="cx">         RefPtr&lt;ShareableBitmap&gt; contentImage;
</span><span class="cx"> 
</span><ins>+        PresentationTransition presentationTransition;
+
</ins><span class="cx">         void encode(IPC::ArgumentEncoder&amp;) const;
</span><span class="cx">         static bool decode(IPC::ArgumentDecoder&amp;, Data&amp;);
</span><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     static PassRefPtr&lt;TextIndicator&gt; create(const TextIndicator::Data&amp;);
</span><del>-    static PassRefPtr&lt;TextIndicator&gt; createWithSelectionInFrame(const WebFrame&amp;);
-    static PassRefPtr&lt;TextIndicator&gt; createWithRange(const WebCore::Range&amp;);
</del><ins>+    static PassRefPtr&lt;TextIndicator&gt; createWithSelectionInFrame(const WebFrame&amp;, PresentationTransition);
+    static PassRefPtr&lt;TextIndicator&gt; createWithRange(const WebCore::Range&amp;, PresentationTransition);
</ins><span class="cx"> 
</span><span class="cx">     ~TextIndicator();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPImacWKViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (176362 => 176363)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm        2014-11-20 00:02:22 UTC (rev 176362)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm        2014-11-20 00:10:57 UTC (rev 176363)
</span><span class="lines">@@ -2698,7 +2698,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)_dictionaryLookupPopoverWillClose:(NSNotification *)notification
</span><span class="cx"> {
</span><del>-    [self _setTextIndicator:nil fadeOut:NO animate:NO];
</del><ins>+    [self _setTextIndicator:nil fadeOut:NO];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)_accessibilityRegisterUIProcessTokens
</span><span class="lines">@@ -3069,7 +3069,7 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)_setTextIndicator:(PassRefPtr&lt;TextIndicator&gt;)textIndicator fadeOut:(BOOL)fadeOut animate:(BOOL)animate animationCompletionHandler:(std::function&lt;void ()&gt;)completionHandler
</del><ins>+- (void)_setTextIndicator:(PassRefPtr&lt;TextIndicator&gt;)textIndicator fadeOut:(BOOL)fadeOut animationCompletionHandler:(std::function&lt;void ()&gt;)completionHandler
</ins><span class="cx"> {
</span><span class="cx">     if (!textIndicator) {
</span><span class="cx">         _data-&gt;_textIndicatorWindow = nullptr;
</span><span class="lines">@@ -3079,12 +3079,12 @@
</span><span class="cx">     if (!_data-&gt;_textIndicatorWindow)
</span><span class="cx">         _data-&gt;_textIndicatorWindow = std::make_unique&lt;TextIndicatorWindow&gt;(self);
</span><span class="cx"> 
</span><del>-    _data-&gt;_textIndicatorWindow-&gt;setTextIndicator(textIndicator, fadeOut, animate, WTF::move(completionHandler));
</del><ins>+    _data-&gt;_textIndicatorWindow-&gt;setTextIndicator(textIndicator, fadeOut, WTF::move(completionHandler));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)_setTextIndicator:(PassRefPtr&lt;TextIndicator&gt;)textIndicator fadeOut:(BOOL)fadeOut animate:(BOOL)animate
</del><ins>+- (void)_setTextIndicator:(PassRefPtr&lt;TextIndicator&gt;)textIndicator fadeOut:(BOOL)fadeOut
</ins><span class="cx"> {
</span><del>-    [self _setTextIndicator:textIndicator fadeOut:fadeOut animate:animate animationCompletionHandler:[] {}];
</del><ins>+    [self _setTextIndicator:textIndicator fadeOut:fadeOut animationCompletionHandler:[] { }];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (CALayer *)_rootLayer
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPImacWKViewInternalh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h (176362 => 176363)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h        2014-11-20 00:02:22 UTC (rev 176362)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h        2014-11-20 00:10:57 UTC (rev 176363)
</span><span class="lines">@@ -80,8 +80,8 @@
</span><span class="cx"> - (void)_setIntrinsicContentSize:(NSSize)intrinsicContentSize;
</span><span class="cx"> - (NSRect)_convertToDeviceSpace:(NSRect)rect;
</span><span class="cx"> - (NSRect)_convertToUserSpace:(NSRect)rect;
</span><del>-- (void)_setTextIndicator:(PassRefPtr&lt;WebKit::TextIndicator&gt;)textIndicator fadeOut:(BOOL)fadeOut animate:(BOOL)animate;
-- (void)_setTextIndicator:(PassRefPtr&lt;WebKit::TextIndicator&gt;)textIndicator fadeOut:(BOOL)fadeOut animate:(BOOL)animate animationCompletionHandler:(std::function&lt;void ()&gt;)completionHandler;
</del><ins>+- (void)_setTextIndicator:(PassRefPtr&lt;WebKit::TextIndicator&gt;)textIndicator fadeOut:(BOOL)fadeOut;
+- (void)_setTextIndicator:(PassRefPtr&lt;WebKit::TextIndicator&gt;)textIndicator fadeOut:(BOOL)fadeOut animationCompletionHandler:(std::function&lt;void ()&gt;)completionHandler;
</ins><span class="cx"> 
</span><span class="cx"> - (void)_setAcceleratedCompositingModeRootLayer:(CALayer *)rootLayer;
</span><span class="cx"> - (CALayer *)_acceleratedCompositingModeRootLayer;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessPageClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/PageClient.h (176362 => 176363)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/PageClient.h        2014-11-20 00:02:22 UTC (rev 176362)
+++ trunk/Source/WebKit2/UIProcess/PageClient.h        2014-11-20 00:10:57 UTC (rev 176363)
</span><span class="lines">@@ -214,7 +214,7 @@
</span><span class="cx">     virtual PassRefPtr&lt;WebColorPicker&gt; createColorPicker(WebPageProxy*, const WebCore::Color&amp; initialColor, const WebCore::IntRect&amp;) = 0;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    virtual void setTextIndicator(PassRefPtr&lt;TextIndicator&gt;, bool fadeOut, bool animate) = 0;
</del><ins>+    virtual void setTextIndicator(PassRefPtr&lt;TextIndicator&gt;, bool fadeOut) = 0;
</ins><span class="cx"> 
</span><span class="cx">     virtual void enterAcceleratedCompositingMode(const LayerTreeContext&amp;) = 0;
</span><span class="cx">     virtual void exitAcceleratedCompositingMode() = 0;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (176362 => 176363)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2014-11-20 00:02:22 UTC (rev 176362)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2014-11-20 00:10:57 UTC (rev 176363)
</span><span class="lines">@@ -3649,14 +3649,14 @@
</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 TextIndicator::Data&amp; indicatorData, bool fadeOut, bool animate)
</del><ins>+void WebPageProxy::setTextIndicator(const TextIndicator::Data&amp; indicatorData, bool fadeOut)
</ins><span class="cx"> {
</span><del>-    m_pageClient.setTextIndicator(TextIndicator::create(indicatorData), fadeOut, animate);
</del><ins>+    m_pageClient.setTextIndicator(TextIndicator::create(indicatorData), fadeOut);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageProxy::clearTextIndicator(bool fadeOut, bool animate)
</del><ins>+void WebPageProxy::clearTextIndicator()
</ins><span class="cx"> {
</span><del>-    m_pageClient.setTextIndicator(nullptr, fadeOut, animate);
</del><ins>+    m_pageClient.setTextIndicator(nullptr, false);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPageProxy::didFindString(const String&amp; string, uint32_t matchCount, int32_t matchIndex)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (176362 => 176363)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2014-11-20 00:02:22 UTC (rev 176362)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2014-11-20 00:10:57 UTC (rev 176363)
</span><span class="lines">@@ -668,8 +668,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 TextIndicator::Data&amp;, bool fadeOut, bool animate);
-    void clearTextIndicator(bool fadeOut, bool animate);
</del><ins>+    void setTextIndicator(const TextIndicator::Data&amp;, bool fadeOut);
+    void clearTextIndicator();
</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="trunkSourceWebKit2UIProcessWebPageProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in (176362 => 176363)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2014-11-20 00:02:22 UTC (rev 176362)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2014-11-20 00:10:57 UTC (rev 176363)
</span><span class="lines">@@ -227,8 +227,8 @@
</span><span class="cx"> 
</span><span class="cx">     # Find messages
</span><span class="cx">     DidCountStringMatches(String string, uint32_t matchCount)
</span><del>-    SetTextIndicator(WebKit::TextIndicator::Data indicator, bool fadeOut, bool animate)
-    ClearTextIndicator(bool fadeOut, bool animate)
</del><ins>+    SetTextIndicator(WebKit::TextIndicator::Data indicator, bool fadeOut)
+    ClearTextIndicator()
</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="trunkSourceWebKit2UIProcessiosPageClientImplIOSh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h (176362 => 176363)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h        2014-11-20 00:02:22 UTC (rev 176362)
+++ trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h        2014-11-20 00:10:57 UTC (rev 176363)
</span><span class="lines">@@ -96,7 +96,7 @@
</span><span class="cx"> #endif
</span><span class="cx">     virtual PassRefPtr&lt;WebPopupMenuProxy&gt; createPopupMenuProxy(WebPageProxy*) override;
</span><span class="cx">     virtual PassRefPtr&lt;WebContextMenuProxy&gt; createContextMenuProxy(WebPageProxy*) override;
</span><del>-    virtual void setTextIndicator(PassRefPtr&lt;TextIndicator&gt;, bool fadeOut, bool animate) override;
</del><ins>+    virtual void setTextIndicator(PassRefPtr&lt;TextIndicator&gt;, bool fadeOut) override;
</ins><span class="cx"> 
</span><span class="cx">     virtual void enterAcceleratedCompositingMode(const LayerTreeContext&amp;) override;
</span><span class="cx">     virtual void exitAcceleratedCompositingMode() override;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosPageClientImplIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm (176362 => 176363)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm        2014-11-20 00:02:22 UTC (rev 176362)
+++ trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm        2014-11-20 00:10:57 UTC (rev 176363)
</span><span class="lines">@@ -435,7 +435,7 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PageClientImpl::setTextIndicator(PassRefPtr&lt;TextIndicator&gt; textIndicator, bool fadeOut, bool animate)
</del><ins>+void PageClientImpl::setTextIndicator(PassRefPtr&lt;TextIndicator&gt; textIndicator, bool fadeOut)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacPageClientImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h (176362 => 176363)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h        2014-11-20 00:02:22 UTC (rev 176362)
+++ trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h        2014-11-20 00:10:57 UTC (rev 176363)
</span><span class="lines">@@ -120,7 +120,7 @@
</span><span class="cx">     virtual PassRefPtr&lt;WebColorPicker&gt; createColorPicker(WebPageProxy*, const WebCore::Color&amp; initialColor, const WebCore::IntRect&amp;);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    void setTextIndicator(PassRefPtr&lt;TextIndicator&gt;, bool fadeOut, bool animate);
</del><ins>+    void setTextIndicator(PassRefPtr&lt;TextIndicator&gt;, bool fadeOut);
</ins><span class="cx"> 
</span><span class="cx">     virtual void enterAcceleratedCompositingMode(const LayerTreeContext&amp;);
</span><span class="cx">     virtual void exitAcceleratedCompositingMode();
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacPageClientImplmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm (176362 => 176363)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm        2014-11-20 00:02:22 UTC (rev 176362)
+++ trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm        2014-11-20 00:10:57 UTC (rev 176363)
</span><span class="lines">@@ -470,9 +470,9 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-void PageClientImpl::setTextIndicator(PassRefPtr&lt;TextIndicator&gt; textIndicator, bool fadeOut, bool animate)
</del><ins>+void PageClientImpl::setTextIndicator(PassRefPtr&lt;TextIndicator&gt; textIndicator, bool fadeOut)
</ins><span class="cx"> {
</span><del>-    [m_wkView _setTextIndicator:textIndicator fadeOut:fadeOut animate:animate];
</del><ins>+    [m_wkView _setTextIndicator:textIndicator fadeOut:fadeOut];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PageClientImpl::accessibilityWebProcessTokenReceived(const IPC::DataReference&amp; data)
</span><span class="lines">@@ -549,7 +549,7 @@
</span><span class="cx">         // Run the animations serially because attaching another subwindow breaks the bounce animation.
</span><span class="cx">         // We could consider making the bounce NSAnimationNonblockingThreaded instead, which seems
</span><span class="cx">         // to work, but need to consider all of the implications.
</span><del>-        [m_wkView _setTextIndicator:TextIndicator::create(dictionaryPopupInfo.textIndicator) fadeOut:NO animate:YES animationCompletionHandler:[dictionaryPopupInfo, textBaselineOrigin, mutableOptions] {
</del><ins>+        [m_wkView _setTextIndicator:TextIndicator::create(dictionaryPopupInfo.textIndicator) fadeOut:NO animationCompletionHandler:[dictionaryPopupInfo, textBaselineOrigin, mutableOptions] {
</ins><span class="cx">             [mutableOptions setObject:@YES forKey:getLUTermOptionDisableSearchTermIndicator()];
</span><span class="cx">             [getLULookupDefinitionModuleClass() showDefinitionForTerm:dictionaryPopupInfo.attributedString.string.get() atLocation:textBaselineOrigin options:mutableOptions.get()];
</span><span class="cx">         }];
</span><span class="lines">@@ -564,7 +564,7 @@
</span><span class="cx"> 
</span><span class="cx">     // FIXME: We don't know which panel we are dismissing, it may not even be in the current page (see &lt;rdar://problem/13875766&gt;).
</span><span class="cx">     [getLULookupDefinitionModuleClass() hideDefinition];
</span><del>-    setTextIndicator(nil, false, true);
</del><ins>+    setTextIndicator(nil, false);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PageClientImpl::dismissActionMenuPopovers()
</span><span class="lines">@@ -699,7 +699,7 @@
</span><span class="cx"> void PageClientImpl::navigationGestureDidBegin()
</span><span class="cx"> {
</span><span class="cx">     // Hide the text indicator and action menu popovers if they are visible.
</span><del>-    setTextIndicator(nullptr, false, false);
</del><ins>+    setTextIndicator(nullptr, false);
</ins><span class="cx">     dismissActionMenuPopovers();
</span><span class="cx"> 
</span><span class="cx"> #if WK_API_ENABLED
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacTextIndicatorWindowh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/TextIndicatorWindow.h (176362 => 176363)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/TextIndicatorWindow.h        2014-11-20 00:02:22 UTC (rev 176362)
+++ trunk/Source/WebKit2/UIProcess/mac/TextIndicatorWindow.h        2014-11-20 00:10:57 UTC (rev 176363)
</span><span class="lines">@@ -28,14 +28,13 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx"> 
</span><del>-#import &quot;WebKitSystemInterface.h&quot;
</del><span class="cx"> #import &lt;functional&gt;
</span><span class="cx"> #import &lt;wtf/Noncopyable.h&gt;
</span><span class="cx"> #import &lt;wtf/RefPtr.h&gt;
</span><span class="cx"> #import &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> #import &lt;wtf/RunLoop.h&gt;
</span><span class="cx"> 
</span><del>-@class WKTextIndicatorWindowAnimation;
</del><ins>+@class WKTextIndicatorView;
</ins><span class="cx"> @class WKView;
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="lines">@@ -49,28 +48,19 @@
</span><span class="cx">     explicit TextIndicatorWindow(WKView *);
</span><span class="cx">     ~TextIndicatorWindow();
</span><span class="cx"> 
</span><del>-    void setTextIndicator(PassRefPtr&lt;TextIndicator&gt;, bool fadeOut, bool animate, std::function&lt;void ()&gt; animationCompletionHandler);
</del><ins>+    void setTextIndicator(PassRefPtr&lt;TextIndicator&gt;, bool fadeOut, std::function&lt;void ()&gt; animationCompletionHandler);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     void closeWindow();
</span><span class="cx"> 
</span><span class="cx">     void startFadeOutTimerFired();
</span><span class="cx"> 
</span><del>-    void fadeOutAnimationCallback(double);
-    void fadeOutAnimationDidEnd();
-
-    void bounceAnimationCallback(double);
-    void bounceAnimationDidEnd();
-
</del><span class="cx">     WKView* m_wkView;
</span><span class="cx">     RefPtr&lt;TextIndicator&gt; m_textIndicator;
</span><span class="cx">     RetainPtr&lt;NSWindow&gt; m_textIndicatorWindow;
</span><ins>+    RetainPtr&lt;WKTextIndicatorView&gt; m_textIndicatorView;
</ins><span class="cx"> 
</span><del>-    WKWindowBounceAnimationContextRef m_bounceAnimationContext;
-    RetainPtr&lt;WKTextIndicatorWindowAnimation&gt; m_bounceAnimation;
-
</del><span class="cx">     RunLoop::Timer&lt;TextIndicatorWindow&gt; m_startFadeOutTimer;
</span><del>-    RetainPtr&lt;WKTextIndicatorWindowAnimation&gt; m_fadeOutAnimation;
</del><span class="cx"> 
</span><span class="cx">     std::function&lt;void ()&gt; m_bounceAnimationCompletionHandler;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacTextIndicatorWindowmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/TextIndicatorWindow.mm (176362 => 176363)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/TextIndicatorWindow.mm        2014-11-20 00:02:22 UTC (rev 176362)
+++ trunk/Source/WebKit2/UIProcess/mac/TextIndicatorWindow.mm        2014-11-20 00:10:57 UTC (rev 176363)
</span><span class="lines">@@ -31,86 +31,233 @@
</span><span class="cx"> #import &quot;TextIndicator.h&quot;
</span><span class="cx"> #import &quot;WKView.h&quot;
</span><span class="cx"> #import &lt;WebCore/GraphicsContext.h&gt;
</span><ins>+#import &lt;WebCore/QuartzCoreSPI.h&gt;
+#import &lt;WebCore/WebActionDisablingCALayerDelegate.h&gt;
</ins><span class="cx"> 
</span><del>-static const double bounceAnimationDuration = 0.12;
-static const double timeBeforeFadeStarts = bounceAnimationDuration + 0.2;
-static const double fadeOutAnimationDuration = 0.3;
</del><ins>+const CFTimeInterval bounceAnimationDuration = 0.12;
+const CFTimeInterval bounceWithCrossfadeAnimationDuration = 0.3;
+const CFTimeInterval timeBeforeFadeStarts = bounceAnimationDuration + 0.2;
+const CFTimeInterval fadeOutAnimationDuration = 0.3;
</ins><span class="cx"> 
</span><ins>+#if ENABLE(LEGACY_TEXT_INDICATOR_STYLE)
+const CGFloat midBounceScale = 1.5;
+const CGFloat horizontalBorder = 3;
+const CGFloat verticalBorder = 1;
+const CGFloat borderWidth = 1.0;
+const CGFloat cornerRadius = 3;
+const CGFloat dropShadowOffsetX = 0;
+const CGFloat dropShadowOffsetY = 1;
+const CGFloat dropShadowBlurRadius = 1.5;
+#else
+const CGFloat midBounceScale = 1.2;
+const CGFloat horizontalBorder = 2;
+const CGFloat verticalBorder = 1;
+const CGFloat borderWidth = 0;
+const CGFloat cornerRadius = 0;
+const CGFloat dropShadowOffsetX = 0;
+const CGFloat dropShadowOffsetY = 5;
+const CGFloat dropShadowBlurRadius = 12;
+const CGFloat rimShadowBlurRadius = 2;
+#endif
+
+NSString *textLayerKey = @&quot;TextLayer&quot;;
+NSString *dropShadowLayerKey = @&quot;DropShadowLayer&quot;;
+NSString *rimShadowLayerKey = @&quot;RimShadowLayer&quot;;
+
</ins><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="cx"> @interface WKTextIndicatorView : NSView {
</span><span class="cx">     RefPtr&lt;WebKit::TextIndicator&gt; _textIndicator;
</span><ins>+    RetainPtr&lt;NSArray&gt; _bounceLayers;
+    NSSize _margin;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (id)_initWithTextIndicator:(PassRefPtr&lt;WebKit::TextIndicator&gt;)textIndicator;
</del><ins>+- (instancetype)initWithFrame:(NSRect)frame textIndicator:(PassRefPtr&lt;WebKit::TextIndicator&gt;)textIndicator margin:(NSSize)margin;
+
+- (void)presentWithCompletionHandler:(void(^)(void))completionHandler;
+- (void)hideWithCompletionHandler:(void(^)(void))completionHandler;
+
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> @implementation WKTextIndicatorView
</span><span class="cx"> 
</span><del>-- (id)_initWithTextIndicator:(PassRefPtr&lt;WebKit::TextIndicator&gt;)textIndicator
</del><ins>+- (instancetype)initWithFrame:(NSRect)frame textIndicator:(PassRefPtr&lt;WebKit::TextIndicator&gt;)textIndicator margin:(NSSize)margin
</ins><span class="cx"> {
</span><del>-    if ((self = [super initWithFrame:NSZeroRect]))
-        _textIndicator = textIndicator;
</del><ins>+    if (!(self = [super initWithFrame:frame]))
+        return nil;
</ins><span class="cx"> 
</span><del>-    return self;
-}
</del><ins>+    _textIndicator = textIndicator;
+    _margin = margin;
</ins><span class="cx"> 
</span><del>-- (void)drawRect:(NSRect)rect
-{
-    GraphicsContext graphicsContext(static_cast&lt;CGContextRef&gt;([[NSGraphicsContext currentContext] graphicsPort]));
</del><ins>+    self.wantsLayer = YES;
+    self.layer.anchorPoint = CGPointZero;
</ins><span class="cx"> 
</span><del>-    _textIndicator-&gt;draw(graphicsContext, enclosingIntRect(rect));
-}
</del><ins>+    bool wantsCrossfade = _textIndicator-&gt;data().presentationTransition == WebKit::TextIndicator::PresentationTransition::BounceAndCrossfade;
</ins><span class="cx"> 
</span><del>-- (BOOL)isFlipped
-{
-    return YES;
-}
</del><ins>+    FloatSize contentsImageLogicalSize = _textIndicator-&gt;data().contentImage-&gt;size();
+    contentsImageLogicalSize.scale(1 / _textIndicator-&gt;data().contentImageScaleFactor);
+    RetainPtr&lt;CGImageRef&gt; contentsImage;
+    if (wantsCrossfade)
+        contentsImage = _textIndicator-&gt;data().contentImageWithHighlight-&gt;makeCGImage();
+    else
+        contentsImage = _textIndicator-&gt;data().contentImage-&gt;makeCGImage();
</ins><span class="cx"> 
</span><del>-@end
</del><ins>+    RetainPtr&lt;NSMutableArray&gt; bounceLayers = adoptNS([[NSMutableArray alloc] init]);
</ins><span class="cx"> 
</span><del>-@interface WKTextIndicatorWindowAnimation : NSAnimation&lt;NSAnimationDelegate&gt; {
-    WebKit::TextIndicatorWindow* _textIndicatorWindow;
-    void (WebKit::TextIndicatorWindow::*_animationProgressCallback)(double progress);
-    void (WebKit::TextIndicatorWindow::*_animationDidEndCallback)();
-}
</del><ins>+    RetainPtr&lt;CGColorRef&gt; highlightColor = [NSColor colorWithDeviceRed:1 green:1 blue:0 alpha:1].CGColor;
+    RetainPtr&lt;CGColorRef&gt; rimShadowColor = [NSColor colorWithDeviceWhite:0 alpha:0.15].CGColor;
+    RetainPtr&lt;CGColorRef&gt; dropShadowColor = [NSColor colorWithDeviceWhite:0 alpha:0.2].CGColor;
</ins><span class="cx"> 
</span><del>-- (id)_initWithTextIndicatorWindow:(WebKit::TextIndicatorWindow *)textIndicatorWindow animationDuration:(CFTimeInterval)duration animationProgressCallback:(void (WebKit::TextIndicatorWindow::*)(double progress))animationProgressCallback animationDidEndCallback:(void (WebKit::TextIndicatorWindow::*)())animationDidEndCallback;
-@end
</del><ins>+    RetainPtr&lt;CGColorRef&gt; borderColor = [NSColor colorWithDeviceRed:.96 green:.90 blue:0 alpha:1].CGColor;
+    RetainPtr&lt;CGColorRef&gt; gradientDarkColor = [NSColor colorWithDeviceRed:.929 green:.8 blue:0 alpha:1].CGColor;
+    RetainPtr&lt;CGColorRef&gt; gradientLightColor = [NSColor colorWithDeviceRed:.949 green:.937 blue:0 alpha:1].CGColor;
</ins><span class="cx"> 
</span><del>-@implementation WKTextIndicatorWindowAnimation
</del><ins>+    for (auto&amp; textRect : _textIndicator-&gt;data().textRectsInBoundingRectCoordinates) {
+        FloatRect bounceLayerRect = textRect;
+        bounceLayerRect.move(_margin.width, _margin.height);
+        bounceLayerRect.inflateX(horizontalBorder);
+        bounceLayerRect.inflateY(verticalBorder);
</ins><span class="cx"> 
</span><del>-- (id)_initWithTextIndicatorWindow:(WebKit::TextIndicatorWindow *)textIndicatorWindow animationDuration:(CFTimeInterval)animationDuration animationProgressCallback:(void (WebKit::TextIndicatorWindow::*)(double progress))animationProgressCallback animationDidEndCallback:(void (WebKit::TextIndicatorWindow::*)())animationDidEndCallback
-{
-    if ((self = [super initWithDuration:animationDuration animationCurve:NSAnimationEaseInOut])) {
-        _textIndicatorWindow = textIndicatorWindow;
-        _animationProgressCallback = animationProgressCallback;
-        _animationDidEndCallback = animationDidEndCallback;
-        [self setDelegate:self];
-        [self setAnimationBlockingMode:NSAnimationNonblocking];
</del><ins>+        RetainPtr&lt;CALayer&gt; bounceLayer = adoptNS([[CALayer alloc] init]);
+        [bounceLayer setDelegate:[WebActionDisablingCALayerDelegate shared]];
+        [bounceLayer setFrame:bounceLayerRect];
+        [bounceLayer setOpacity:0];
+        [bounceLayers addObject:bounceLayer.get()];
+
+        FloatRect yellowHighlightRect(FloatPoint(), bounceLayerRect.size());
+        // FIXME (138888): Ideally we wouldn't remove the margin in this case, but we need to
+        // ensure that the yellow highlight and contentImageWithHighlight overlap precisely.
+        if (wantsCrossfade) {
+            yellowHighlightRect.inflateX(-horizontalBorder);
+            yellowHighlightRect.inflateY(-verticalBorder);
+        }
+
+        RetainPtr&lt;CALayer&gt; dropShadowLayer = adoptNS([[CALayer alloc] init]);
+        [dropShadowLayer setDelegate:[WebActionDisablingCALayerDelegate shared]];
+        [dropShadowLayer setShadowColor:dropShadowColor.get()];
+        [dropShadowLayer setShadowRadius:dropShadowBlurRadius];
+        [dropShadowLayer setShadowOffset:CGSizeMake(dropShadowOffsetX, dropShadowOffsetY)];
+        [dropShadowLayer setShadowPathIsBounds:YES];
+        [dropShadowLayer setShadowOpacity:1];
+        [dropShadowLayer setFrame:yellowHighlightRect];
+        [dropShadowLayer setCornerRadius:cornerRadius];
+        [bounceLayer addSublayer:dropShadowLayer.get()];
+        [bounceLayer setValue:dropShadowLayer.get() forKey:dropShadowLayerKey];
+
+#if !ENABLE(LEGACY_TEXT_INDICATOR_STYLE)
+        RetainPtr&lt;CALayer&gt; rimShadowLayer = adoptNS([[CALayer alloc] init]);
+        [rimShadowLayer setDelegate:[WebActionDisablingCALayerDelegate shared]];
+        [rimShadowLayer setFrame:yellowHighlightRect];
+        [rimShadowLayer setShadowColor:rimShadowColor.get()];
+        [rimShadowLayer setShadowRadius:rimShadowBlurRadius];
+        [rimShadowLayer setShadowPathIsBounds:YES];
+        [rimShadowLayer setShadowOffset:CGSizeZero];
+        [rimShadowLayer setShadowOpacity:1];
+        [rimShadowLayer setFrame:yellowHighlightRect];
+        [rimShadowLayer setCornerRadius:cornerRadius];
+        [bounceLayer addSublayer:rimShadowLayer.get()];
+        [bounceLayer setValue:rimShadowLayer.get() forKey:rimShadowLayerKey];
+#endif
+
+#if ENABLE(LEGACY_TEXT_INDICATOR_STYLE)
+        RetainPtr&lt;CAGradientLayer&gt; textLayer = adoptNS([[CAGradientLayer alloc] init]);
+        [textLayer setColors:@[ (id)gradientLightColor.get(), (id)gradientDarkColor.get() ]];
+#else
+        RetainPtr&lt;CALayer&gt; textLayer = adoptNS([[CALayer alloc] init]);
+#endif
+        [textLayer setBackgroundColor:highlightColor.get()];
+        [textLayer setBorderColor:borderColor.get()];
+        [textLayer setBorderWidth:borderWidth];
+        [textLayer setDelegate:[WebActionDisablingCALayerDelegate shared]];
+        [textLayer setContents:(id)contentsImage.get()];
+
+        FloatRect imageRect = textRect;
+        imageRect.move(_textIndicator-&gt;data().textBoundingRectInWindowCoordinates.location() - _textIndicator-&gt;data().selectionRectInWindowCoordinates.location());
+        [textLayer setContentsRect:CGRectMake(imageRect.x() / contentsImageLogicalSize.width(), imageRect.y() / contentsImageLogicalSize.height(), imageRect.width() / contentsImageLogicalSize.width(), imageRect.height() / contentsImageLogicalSize.height())];
+        [textLayer setContentsGravity:kCAGravityCenter];
+        [textLayer setContentsScale:_textIndicator-&gt;data().contentImageScaleFactor];
+        [textLayer setFrame:yellowHighlightRect];
+        [textLayer setCornerRadius:cornerRadius];
+        [bounceLayer setValue:textLayer.get() forKey:textLayerKey];
+        [bounceLayer addSublayer:textLayer.get()];
</ins><span class="cx">     }
</span><ins>+
+    self.layer.sublayers = bounceLayers.get();
+    _bounceLayers = bounceLayers;
+
</ins><span class="cx">     return self;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)setCurrentProgress:(NSAnimationProgress)progress
</del><ins>+- (void)presentWithCompletionHandler:(void(^)(void))completionHandler
</ins><span class="cx"> {
</span><del>-    (_textIndicatorWindow-&gt;*_animationProgressCallback)(progress);
</del><ins>+    bool wantsCrossfade = _textIndicator-&gt;data().presentationTransition == WebKit::TextIndicator::PresentationTransition::BounceAndCrossfade;
+    double animationDuration = wantsCrossfade ? bounceWithCrossfadeAnimationDuration : bounceAnimationDuration;
+    RetainPtr&lt;CAKeyframeAnimation&gt; bounceAnimation = [CAKeyframeAnimation animationWithKeyPath:@&quot;transform&quot;];
+    [bounceAnimation setValues:@[
+        [NSValue valueWithCATransform3D:CATransform3DIdentity],
+        [NSValue valueWithCATransform3D:CATransform3DMakeScale(midBounceScale, midBounceScale, 1)],
+        [NSValue valueWithCATransform3D:CATransform3DIdentity]
+        ]];
+    [bounceAnimation setDuration:animationDuration];
+
+    RetainPtr&lt;CABasicAnimation&gt; crossfadeAnimation;
+    RetainPtr&lt;CABasicAnimation&gt; fadeShadowInAnimation;
+    if (wantsCrossfade) {
+        crossfadeAnimation = [CABasicAnimation animationWithKeyPath:@&quot;contents&quot;];
+        RetainPtr&lt;CGImageRef&gt; contentsImage = _textIndicator-&gt;data().contentImage-&gt;makeCGImage();
+        [crossfadeAnimation setToValue:(id)contentsImage.get()];
+        [crossfadeAnimation setFillMode:kCAFillModeForwards];
+        [crossfadeAnimation setRemovedOnCompletion:NO];
+        [crossfadeAnimation setDuration:animationDuration];
+
+        fadeShadowInAnimation = [CABasicAnimation animationWithKeyPath:@&quot;shadowOpacity&quot;];
+        [fadeShadowInAnimation setFromValue:@0];
+        [fadeShadowInAnimation setToValue:@1];
+        [fadeShadowInAnimation setFillMode:kCAFillModeForwards];
+        [fadeShadowInAnimation setRemovedOnCompletion:NO];
+        [fadeShadowInAnimation setDuration:animationDuration];
+    }
+
+    [CATransaction begin];
+    [CATransaction setCompletionBlock:completionHandler];
+    for (CALayer* bounceLayer in _bounceLayers.get()) {
+        [bounceLayer setOpacity:1];
+        [bounceLayer addAnimation:bounceAnimation.get() forKey:@&quot;bounce&quot;];
+        if (wantsCrossfade) {
+            [[bounceLayer valueForKey:textLayerKey] addAnimation:crossfadeAnimation.get() forKey:@&quot;contentTransition&quot;];
+            [[bounceLayer valueForKey:dropShadowLayerKey] addAnimation:fadeShadowInAnimation.get() forKey:@&quot;fadeShadowIn&quot;];
+            [[bounceLayer valueForKey:rimShadowLayerKey] addAnimation:fadeShadowInAnimation.get() forKey:@&quot;fadeShadowIn&quot;];
+        }
+    }
+    [CATransaction commit];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)animationDidEnd:(NSAnimation *)animation
</del><ins>+- (void)hideWithCompletionHandler:(void(^)(void))completionHandler
</ins><span class="cx"> {
</span><del>-    ASSERT(animation == self);
</del><ins>+    RetainPtr&lt;CABasicAnimation&gt; fadeAnimation = [CABasicAnimation animationWithKeyPath:@&quot;opacity&quot;];
+    [fadeAnimation setFromValue:@1];
+    [fadeAnimation setToValue:@0];
+    [fadeAnimation setFillMode:kCAFillModeForwards];
+    [fadeAnimation setRemovedOnCompletion:NO];
+    [fadeAnimation setDuration:fadeOutAnimationDuration];
</ins><span class="cx"> 
</span><del>-    (_textIndicatorWindow-&gt;*_animationDidEndCallback)();
</del><ins>+    [CATransaction begin];
+    [CATransaction setCompletionBlock:completionHandler];
+    [self.layer addAnimation:fadeAnimation.get() forKey:@&quot;fadeOut&quot;];
+    [CATransaction commit];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (BOOL)isFlipped
+{
+    return YES;
+}
+
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><span class="cx"> TextIndicatorWindow::TextIndicatorWindow(WKView *wkView)
</span><span class="cx">     : m_wkView(wkView)
</span><del>-    , m_bounceAnimationContext(0)
</del><span class="cx">     , m_startFadeOutTimer(RunLoop::main(), this, &amp;TextIndicatorWindow::startFadeOutTimerFired)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -120,7 +267,7 @@
</span><span class="cx">     closeWindow();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TextIndicatorWindow::setTextIndicator(PassRefPtr&lt;TextIndicator&gt; textIndicator, bool fadeOut, bool animate, std::function&lt;void ()&gt; animationCompletionHandler)
</del><ins>+void TextIndicatorWindow::setTextIndicator(PassRefPtr&lt;TextIndicator&gt; textIndicator, bool fadeOut, std::function&lt;void ()&gt; animationCompletionHandler)
</ins><span class="cx"> {
</span><span class="cx">     if (m_textIndicator == textIndicator)
</span><span class="cx">         return;
</span><span class="lines">@@ -134,32 +281,31 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     NSRect contentRect = m_textIndicator-&gt;frameRect();
</span><ins>+
+    CGFloat horizontalMargin = std::max(dropShadowBlurRadius * 2 + horizontalBorder, contentRect.size.width * 2);
+    CGFloat verticalMargin = std::max(dropShadowBlurRadius * 2 + verticalBorder, contentRect.size.height * 2);
+
+    contentRect = NSInsetRect(contentRect, -horizontalMargin, -verticalMargin);
</ins><span class="cx">     NSRect windowFrameRect = NSIntegralRect([m_wkView convertRect:contentRect toView:nil]);
</span><del>-#pragma clang diagnostic push
-#pragma clang diagnostic ignored &quot;-Wdeprecated-declarations&quot;
-    windowFrameRect.origin = [[m_wkView window] convertBaseToScreen:windowFrameRect.origin];
-#pragma clang diagnostic pop
</del><ins>+    windowFrameRect = [[m_wkView window] convertRectToScreen:windowFrameRect];
</ins><span class="cx">     NSRect windowContentRect = [NSWindow contentRectForFrameRect:windowFrameRect styleMask:NSBorderlessWindowMask];
</span><del>-    
</del><ins>+
</ins><span class="cx">     m_textIndicatorWindow = adoptNS([[NSWindow alloc] initWithContentRect:windowContentRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO]);
</span><span class="cx"> 
</span><span class="cx">     [m_textIndicatorWindow setBackgroundColor:[NSColor clearColor]];
</span><span class="cx">     [m_textIndicatorWindow setOpaque:NO];
</span><span class="cx">     [m_textIndicatorWindow setIgnoresMouseEvents:YES];
</span><span class="cx"> 
</span><del>-    RetainPtr&lt;WKTextIndicatorView&gt; textIndicatorView = adoptNS([[WKTextIndicatorView alloc] _initWithTextIndicator:m_textIndicator]);
-    [m_textIndicatorWindow setContentView:textIndicatorView.get()];
</del><ins>+    m_textIndicatorView = adoptNS([[WKTextIndicatorView alloc] initWithFrame:NSMakeRect(0, 0, [m_textIndicatorWindow frame].size.width, [m_textIndicatorWindow frame].size.height) textIndicator:m_textIndicator margin:CGSizeMake(horizontalMargin, verticalMargin)]);
+    [m_textIndicatorWindow setContentView:m_textIndicatorView.get()];
</ins><span class="cx"> 
</span><span class="cx">     [[m_wkView window] addChildWindow:m_textIndicatorWindow.get() ordered:NSWindowAbove];
</span><span class="cx">     [m_textIndicatorWindow setReleasedWhenClosed:NO];
</span><span class="cx"> 
</span><del>-    if (animate) {
-        m_bounceAnimationCompletionHandler = WTF::move(animationCompletionHandler);
-        // Start the bounce animation.
-        m_bounceAnimationContext = WKWindowBounceAnimationContextCreate(m_textIndicatorWindow.get());
-        m_bounceAnimation = adoptNS([[WKTextIndicatorWindowAnimation alloc] _initWithTextIndicatorWindow:this animationDuration:bounceAnimationDuration
-            animationProgressCallback:&amp;TextIndicatorWindow::bounceAnimationCallback animationDidEndCallback:&amp;TextIndicatorWindow::bounceAnimationDidEnd]);
-        [m_bounceAnimation startAnimation];
</del><ins>+    if (m_textIndicator-&gt;data().presentationTransition != TextIndicator::PresentationTransition::None) {
+        [m_textIndicatorView presentWithCompletionHandler:[animationCompletionHandler] {
+            animationCompletionHandler();
+        }];
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (fadeOut)
</span><span class="lines">@@ -173,19 +319,6 @@
</span><span class="cx"> 
</span><span class="cx">     m_startFadeOutTimer.stop();
</span><span class="cx"> 
</span><del>-    if (m_fadeOutAnimation) {
-        [m_fadeOutAnimation stopAnimation];
-        m_fadeOutAnimation = nullptr;
-    }
-
-    if (m_bounceAnimation) {
-        [m_bounceAnimation stopAnimation];
-        m_bounceAnimation = nullptr;
-    }
-
-    if (m_bounceAnimationContext)
-        WKWindowBounceAnimationContextDestroy(m_bounceAnimationContext);
-    
</del><span class="cx">     [[m_textIndicatorWindow parentWindow] removeChildWindow:m_textIndicatorWindow.get()];
</span><span class="cx">     [m_textIndicatorWindow close];
</span><span class="cx">     m_textIndicatorWindow = nullptr;
</span><span class="lines">@@ -193,47 +326,13 @@
</span><span class="cx"> 
</span><span class="cx"> void TextIndicatorWindow::startFadeOutTimerFired()
</span><span class="cx"> {
</span><del>-    ASSERT(!m_fadeOutAnimation);
-    
-    m_fadeOutAnimation = adoptNS([[WKTextIndicatorWindowAnimation alloc] _initWithTextIndicatorWindow:this animationDuration:fadeOutAnimationDuration
-        animationProgressCallback:&amp;TextIndicatorWindow::fadeOutAnimationCallback animationDidEndCallback:&amp;TextIndicatorWindow::fadeOutAnimationDidEnd]);
-    [m_fadeOutAnimation startAnimation];
</del><ins>+    RetainPtr&lt;NSWindow&gt; indicatorWindow = m_textIndicatorWindow;
+    [m_textIndicatorView hideWithCompletionHandler:[indicatorWindow] {
+        [[indicatorWindow parentWindow] removeChildWindow:indicatorWindow.get()];
+        [indicatorWindow close];
+    }];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TextIndicatorWindow::fadeOutAnimationCallback(double progress)
-{
-    ASSERT(m_fadeOutAnimation);
-
-    [m_textIndicatorWindow setAlphaValue:1.0 - progress];
-}
-
-void TextIndicatorWindow::fadeOutAnimationDidEnd()
-{
-    ASSERT(m_fadeOutAnimation);
-    ASSERT(m_textIndicatorWindow);
-
-    closeWindow();
-}
-
-void TextIndicatorWindow::bounceAnimationCallback(double progress)
-{
-    ASSERT(m_bounceAnimation);
-    ASSERT(m_bounceAnimationContext);
-
-    WKWindowBounceAnimationSetAnimationProgress(m_bounceAnimationContext, progress);
-}
-
-void TextIndicatorWindow::bounceAnimationDidEnd()
-{
-    ASSERT(m_bounceAnimation);
-    ASSERT(m_bounceAnimationContext);
-    ASSERT(m_textIndicatorWindow);
-
-    WKWindowBounceAnimationContextDestroy(m_bounceAnimationContext);
-    m_bounceAnimationContext = 0;
-    m_bounceAnimationCompletionHandler();
-}
-
</del><span class="cx"> } // namespace WebKit
</span><span class="cx"> 
</span><span class="cx"> #endif // PLATFORM(MAC)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacWKActionMenuControllermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/WKActionMenuController.mm (176362 => 176363)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/WKActionMenuController.mm        2014-11-20 00:02:22 UTC (rev 176362)
+++ trunk/Source/WebKit2/UIProcess/mac/WKActionMenuController.mm        2014-11-20 00:10:57 UTC (rev 176363)
</span><span class="lines">@@ -273,7 +273,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (_hitTestResult.detectedDataTextIndicator) {
</span><del>-        _page-&gt;setTextIndicator(_hitTestResult.detectedDataTextIndicator-&gt;data(), false, true);
</del><ins>+        _page-&gt;setTextIndicator(_hitTestResult.detectedDataTextIndicator-&gt;data(), false);
</ins><span class="cx">         _isShowingTextIndicator = YES;
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -283,7 +283,7 @@
</span><span class="cx">     if (!_isShowingTextIndicator)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    _page-&gt;clearTextIndicator(false, true);
</del><ins>+    _page-&gt;clearTextIndicator();
</ins><span class="cx">     _isShowingTextIndicator = NO;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportmacWebContextMenuClientMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm (176362 => 176363)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm        2014-11-20 00:02:22 UTC (rev 176362)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm        2014-11-20 00:10:57 UTC (rev 176363)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #if ENABLE(CONTEXT_MENUS)
</span><span class="cx"> 
</span><span class="cx"> #import &quot;DictionaryPopupInfo.h&quot;
</span><ins>+#import &quot;TextIndicator.h&quot;
</ins><span class="cx"> #import &quot;WebCoreArgumentCoders.h&quot;
</span><span class="cx"> #import &quot;WebPage.h&quot;
</span><span class="cx"> #import &quot;WebPageProxyMessages.h&quot;
</span><span class="lines">@@ -43,7 +44,7 @@
</span><span class="cx"> 
</span><span class="cx"> void WebContextMenuClient::lookUpInDictionary(Frame* frame)
</span><span class="cx"> {
</span><del>-    m_page-&gt;performDictionaryLookupForSelection(frame, frame-&gt;selection().selection());
</del><ins>+    m_page-&gt;performDictionaryLookupForSelection(frame, frame-&gt;selection().selection(), TextIndicator::PresentationTransition::BounceAndCrossfade);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool WebContextMenuClient::isSpeaking()
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageFindControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp (176362 => 176363)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp        2014-11-20 00:02:22 UTC (rev 176362)
+++ trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp        2014-11-20 00:10:57 UTC (rev 176363)
</span><span class="lines">@@ -314,12 +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>-    RefPtr&lt;TextIndicator&gt; indicator = TextIndicator::createWithSelectionInFrame(*WebFrame::fromCoreFrame(selectedFrame));
</del><ins>+    RefPtr&lt;TextIndicator&gt; indicator = TextIndicator::createWithSelectionInFrame(*WebFrame::fromCoreFrame(selectedFrame), shouldAnimate ? TextIndicator::PresentationTransition::Bounce : TextIndicator::PresentationTransition::None);
</ins><span class="cx">     if (!indicator)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     m_findIndicatorRect = enclosingIntRect(indicator-&gt;selectionRectInWindowCoordinates());
</span><del>-    m_webPage-&gt;send(Messages::WebPageProxy::SetTextIndicator(indicator-&gt;data(), !isShowingOverlay, shouldAnimate));
</del><ins>+    m_webPage-&gt;send(Messages::WebPageProxy::SetTextIndicator(indicator-&gt;data(), !isShowingOverlay));
</ins><span class="cx">     m_isShowingFindIndicator = true;
</span><span class="cx"> 
</span><span class="cx">     return true;
</span><span class="lines">@@ -330,7 +330,7 @@
</span><span class="cx">     if (!m_isShowingFindIndicator)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_webPage-&gt;send(Messages::WebPageProxy::ClearTextIndicator(false, true));
</del><ins>+    m_webPage-&gt;send(Messages::WebPageProxy::ClearTextIndicator());
</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="trunkSourceWebKit2WebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (176362 => 176363)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2014-11-20 00:02:22 UTC (rev 176362)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2014-11-20 00:10:57 UTC (rev 176363)
</span><span class="lines">@@ -44,6 +44,7 @@
</span><span class="cx"> #include &quot;Plugin.h&quot;
</span><span class="cx"> #include &quot;SandboxExtension.h&quot;
</span><span class="cx"> #include &quot;ShareableBitmap.h&quot;
</span><ins>+#include &quot;TextIndicator.h&quot;
</ins><span class="cx"> #include &quot;UserMediaPermissionRequestManager.h&quot;
</span><span class="cx"> #include &lt;WebCore/DictationAlternative.h&gt;
</span><span class="cx"> #include &lt;WebCore/DragData.h&gt;
</span><span class="lines">@@ -670,7 +671,7 @@
</span><span class="cx">     void speak(const String&amp;);
</span><span class="cx">     void stopSpeaking();
</span><span class="cx"> 
</span><del>-    void performDictionaryLookupForSelection(WebCore::Frame*, const WebCore::VisibleSelection&amp;);
</del><ins>+    void performDictionaryLookupForSelection(WebCore::Frame*, const WebCore::VisibleSelection&amp;, TextIndicator::PresentationTransition);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     bool isSmartInsertDeleteEnabled();
</span><span class="lines">@@ -984,7 +985,7 @@
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     void performDictionaryLookupAtLocation(const WebCore::FloatPoint&amp;);
</span><span class="cx">     void performDictionaryLookupOfCurrentSelection();
</span><del>-    void performDictionaryLookupForRange(WebCore::Frame*, WebCore::Range&amp;, NSDictionary *options);
</del><ins>+    void performDictionaryLookupForRange(WebCore::Frame*, WebCore::Range&amp;, NSDictionary *options, TextIndicator::PresentationTransition);
</ins><span class="cx"> 
</span><span class="cx">     void windowAndViewFramesChanged(const WebCore::FloatRect&amp; windowFrameInScreenCoordinates, const WebCore::FloatRect&amp; windowFrameInUnflippedScreenCoordinates, const WebCore::FloatRect&amp; viewFrameInWindowCoordinates, const WebCore::FloatPoint&amp; accessibilityViewCoordinates);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacWebPageMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm (176362 => 176363)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm        2014-11-20 00:02:22 UTC (rev 176362)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm        2014-11-20 00:10:57 UTC (rev 176363)
</span><span class="lines">@@ -494,24 +494,24 @@
</span><span class="cx">     if (!range)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    performDictionaryLookupForRange(frame, *range, options);
</del><ins>+    performDictionaryLookupForRange(frame, *range, options, TextIndicator::PresentationTransition::Bounce);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPage::performDictionaryLookupForSelection(Frame* frame, const VisibleSelection&amp; selection)
</del><ins>+void WebPage::performDictionaryLookupForSelection(Frame* frame, const VisibleSelection&amp; selection, TextIndicator::PresentationTransition presentationTransition)
</ins><span class="cx"> {
</span><span class="cx">     NSDictionary *options = nil;
</span><span class="cx">     RefPtr&lt;Range&gt; selectedRange = rangeForDictionaryLookupForSelection(selection, &amp;options);
</span><span class="cx">     if (selectedRange)
</span><del>-        performDictionaryLookupForRange(frame, *selectedRange, options);
</del><ins>+        performDictionaryLookupForRange(frame, *selectedRange, options, presentationTransition);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPage::performDictionaryLookupOfCurrentSelection()
</span><span class="cx"> {
</span><span class="cx">     Frame* frame = &amp;m_page-&gt;focusController().focusedOrMainFrame();
</span><del>-    performDictionaryLookupForSelection(frame, frame-&gt;selection().selection());
</del><ins>+    performDictionaryLookupForSelection(frame, frame-&gt;selection().selection(), TextIndicator::PresentationTransition::BounceAndCrossfade);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPage::performDictionaryLookupForRange(Frame* frame, Range&amp; range, NSDictionary *options)
</del><ins>+void WebPage::performDictionaryLookupForRange(Frame* frame, Range&amp; range, NSDictionary *options, TextIndicator::PresentationTransition presentationTransition)
</ins><span class="cx"> {
</span><span class="cx">     if (range.text().stripWhiteSpace().isEmpty())
</span><span class="cx">         return;
</span><span class="lines">@@ -548,7 +548,7 @@
</span><span class="cx">         [scaledNSAttributedString addAttributes:scaledAttributes.get() range:range];
</span><span class="cx">     }];
</span><span class="cx"> 
</span><del>-    RefPtr&lt;TextIndicator&gt; textIndicator = TextIndicator::createWithRange(range);
</del><ins>+    RefPtr&lt;TextIndicator&gt; textIndicator = TextIndicator::createWithRange(range, presentationTransition);
</ins><span class="cx">     if (!textIndicator)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -1040,7 +1040,7 @@
</span><span class="cx">             detectedDataBoundingBox.unite(frameView-&gt;contentsToWindow(quad.enclosingBoundingBox()));
</span><span class="cx"> 
</span><span class="cx">         actionMenuResult.detectedDataBoundingBox = detectedDataBoundingBox;
</span><del>-        actionMenuResult.detectedDataTextIndicator = TextIndicator::createWithRange(*mainResultRange);
</del><ins>+        actionMenuResult.detectedDataTextIndicator = TextIndicator::createWithRange(*mainResultRange, TextIndicator::PresentationTransition::BounceAndCrossfade);
</ins><span class="cx">         actionMenuResult.detectedDataOriginatingPageOverlay = overlay-&gt;pageOverlayID();
</span><span class="cx">         m_lastActionMenuRangeForSelection = mainResultRange;
</span><span class="cx"> 
</span><span class="lines">@@ -1054,7 +1054,7 @@
</span><span class="cx">         actionMenuResult.actionContext = DataDetection::detectItemAroundHitTestResult(hitTestResult, detectedDataBoundingBox, detectedDataRange);
</span><span class="cx">         if (actionMenuResult.actionContext &amp;&amp; detectedDataRange) {
</span><span class="cx">             actionMenuResult.detectedDataBoundingBox = detectedDataBoundingBox;
</span><del>-            actionMenuResult.detectedDataTextIndicator = TextIndicator::createWithRange(*detectedDataRange);
</del><ins>+            actionMenuResult.detectedDataTextIndicator = TextIndicator::createWithRange(*detectedDataRange, TextIndicator::PresentationTransition::BounceAndCrossfade);
</ins><span class="cx">             m_lastActionMenuRangeForSelection = detectedDataRange;
</span><span class="cx">         }
</span><span class="cx">     }
</span></span></pre>
</div>
</div>

</body>
</html>