<!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
<rdar://problem/18840128>
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 <timothy_horton@apple.com>
+
+ Add an optional entry transition (from selection highlight) to TextIndicator
+ https://bugs.webkit.org/show_bug.cgi?id=138856
+ <rdar://problem/18840128>
+
+ 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 <cdumez@apple.com>
</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 <timothy_horton@apple.com>
+
+ Add an optional entry transition (from selection highlight) to TextIndicator
+ https://bugs.webkit.org/show_bug.cgi?id=138856
+ <rdar://problem/18840128>
+
+ 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 <andersca@apple.com>
</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 <WebCore/Document.h>
</span><span class="cx"> #include <WebCore/Frame.h>
</span><span class="cx"> #include <WebCore/FrameSelection.h>
</span><ins>+#include <WebCore/FrameSnapshotting.h>
</ins><span class="cx"> #include <WebCore/FrameView.h>
</span><span class="cx"> #include <WebCore/GeometryUtilities.h>
</span><del>-#include <WebCore/Gradient.h>
</del><span class="cx"> #include <WebCore/GraphicsContext.h>
</span><ins>+#include <WebCore/ImageBuffer.h>
</ins><span class="cx"> #include <WebCore/IntRect.h>
</span><del>-#include <WebCore/Path.h>
</del><span class="cx">
</span><del>-#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 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& 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<FloatRect>& 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<TextIndicator> TextIndicator::createWithRange(const Range& range)
</del><ins>+PassRefPtr<TextIndicator> TextIndicator::createWithRange(const Range& range, PresentationTransition presentationTransition)
</ins><span class="cx"> {
</span><span class="cx"> Frame* frame = range.startContainer()->document().frame();
</span><span class="cx">
</span><span class="lines">@@ -165,21 +109,57 @@
</span><span class="cx"> VisibleSelection oldSelection = frame->selection().selection();
</span><span class="cx"> frame->selection().setSelection(&range);
</span><span class="cx">
</span><del>- RefPtr<TextIndicator> indicator = TextIndicator::createWithSelectionInFrame(*WebFrame::fromCoreFrame(*frame));
</del><ins>+ RefPtr<TextIndicator> indicator = TextIndicator::createWithSelectionInFrame(*WebFrame::fromCoreFrame(*frame), presentationTransition);
</ins><span class="cx">
</span><span class="cx"> frame->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<TextIndicator> TextIndicator::createWithSelectionInFrame(const WebFrame& frame)
</del><ins>+// FIXME (138889): Ideally the FrameSnapshotting functions would be more flexible
+// and we wouldn't have to implement this here.
+static PassRefPtr<ShareableBitmap> snapshotSelectionWithHighlight(Frame& frame)
</ins><span class="cx"> {
</span><ins>+ auto& 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<ImageBuffer> snapshot = snapshotFrameRect(frame, enclosingIntRect(selectionBounds), 0);
+
+ if (!snapshot)
+ return nullptr;
+
+ RefPtr<ShareableBitmap> sharedSnapshot = ShareableBitmap::createShareable(snapshot->internalSize(), ShareableBitmap::SupportsAlpha);
+ if (!sharedSnapshot)
+ return nullptr;
+
+ auto graphicsContext = sharedSnapshot->createGraphicsContext();
+ float deviceScaleFactor = frame.page()->deviceScaleFactor();
+ graphicsContext->scale(FloatSize(deviceScaleFactor, deviceScaleFactor));
+ graphicsContext->drawImageBuffer(snapshot.get(), ColorSpaceDeviceRGB, FloatPoint());
+
+ return sharedSnapshot.release();
+}
+
+PassRefPtr<TextIndicator> TextIndicator::createWithSelectionInFrame(const WebFrame& frame, PresentationTransition presentationTransition)
+{
</ins><span class="cx"> Frame& coreFrame = *frame.coreFrame();
</span><span class="cx"> IntRect selectionRect = enclosingIntRect(coreFrame.selection().selectionBounds());
</span><span class="cx"> RefPtr<ShareableBitmap> indicatorBitmap = frame.createSelectionSnapshot();
</span><span class="cx"> if (!indicatorBitmap)
</span><span class="cx"> return nullptr;
</span><span class="cx">
</span><ins>+ RefPtr<ShareableBitmap> 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()->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()->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& 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& graphicsContext, WebCore::FloatRect textRect)
-{
- FloatRect imageRect = textRect;
- imageRect.move(m_data.textBoundingRectInWindowCoordinates.location() - m_data.selectionRectInWindowCoordinates.location());
- m_data.contentImage->paint(graphicsContext, m_data.contentImageScaleFactor, enclosingIntRect(textRect).location(), enclosingIntRect(imageRect));
-}
-
-void TextIndicator::draw(GraphicsContext& graphicsContext, const IntRect& /*dirtyRect*/)
-{
-#if ENABLE(LEGACY_TEXT_INDICATOR_STYLE)
- for (auto& 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<Gradient> gradient = Gradient::create(FloatPoint(innerPathRect.x(), innerPathRect.y()), FloatPoint(innerPathRect.x(), innerPathRect.maxY()));
- gradient->addColorStop(0, gradientLightColor());
- gradient->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& 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& encoder) const
</span><span class="cx"> {
</span><span class="cx"> encoder << selectionRectInWindowCoordinates;
</span><span class="cx"> encoder << textBoundingRectInWindowCoordinates;
</span><span class="cx"> encoder << textRectsInBoundingRectCoordinates;
</span><span class="cx"> encoder << 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->createHandle(contentImageHandle, SharedMemory::ReadOnly);
</span><span class="cx"> encoder << contentImageHandle;
</span><ins>+
+ ShareableBitmap::Handle contentImageWithHighlightHandle;
+ if (contentImageWithHighlight)
+ contentImageWithHighlight->createHandle(contentImageWithHighlightHandle, SharedMemory::ReadOnly);
+ encoder << contentImageWithHighlightHandle;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool TextIndicator::Data::decode(IPC::ArgumentDecoder& decoder, TextIndicator::Data& 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 <wtf/RefCounted.h>
</span><span class="cx"> #include <wtf/Vector.h>
</span><span class="cx">
</span><ins>+#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 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<TextIndicator> {
</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<WebCore::FloatRect> textRectsInBoundingRectCoordinates;
</span><span class="cx"> float contentImageScaleFactor;
</span><ins>+ RefPtr<ShareableBitmap> contentImageWithHighlight;
</ins><span class="cx"> RefPtr<ShareableBitmap> contentImage;
</span><span class="cx">
</span><ins>+ PresentationTransition presentationTransition;
+
</ins><span class="cx"> void encode(IPC::ArgumentEncoder&) const;
</span><span class="cx"> static bool decode(IPC::ArgumentDecoder&, Data&);
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> static PassRefPtr<TextIndicator> create(const TextIndicator::Data&);
</span><del>- static PassRefPtr<TextIndicator> createWithSelectionInFrame(const WebFrame&);
- static PassRefPtr<TextIndicator> createWithRange(const WebCore::Range&);
</del><ins>+ static PassRefPtr<TextIndicator> createWithSelectionInFrame(const WebFrame&, PresentationTransition);
+ static PassRefPtr<TextIndicator> createWithRange(const WebCore::Range&, 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<TextIndicator>)textIndicator fadeOut:(BOOL)fadeOut animate:(BOOL)animate animationCompletionHandler:(std::function<void ()>)completionHandler
</del><ins>+- (void)_setTextIndicator:(PassRefPtr<TextIndicator>)textIndicator fadeOut:(BOOL)fadeOut animationCompletionHandler:(std::function<void ()>)completionHandler
</ins><span class="cx"> {
</span><span class="cx"> if (!textIndicator) {
</span><span class="cx"> _data->_textIndicatorWindow = nullptr;
</span><span class="lines">@@ -3079,12 +3079,12 @@
</span><span class="cx"> if (!_data->_textIndicatorWindow)
</span><span class="cx"> _data->_textIndicatorWindow = std::make_unique<TextIndicatorWindow>(self);
</span><span class="cx">
</span><del>- _data->_textIndicatorWindow->setTextIndicator(textIndicator, fadeOut, animate, WTF::move(completionHandler));
</del><ins>+ _data->_textIndicatorWindow->setTextIndicator(textIndicator, fadeOut, WTF::move(completionHandler));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-- (void)_setTextIndicator:(PassRefPtr<TextIndicator>)textIndicator fadeOut:(BOOL)fadeOut animate:(BOOL)animate
</del><ins>+- (void)_setTextIndicator:(PassRefPtr<TextIndicator>)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<WebKit::TextIndicator>)textIndicator fadeOut:(BOOL)fadeOut animate:(BOOL)animate;
-- (void)_setTextIndicator:(PassRefPtr<WebKit::TextIndicator>)textIndicator fadeOut:(BOOL)fadeOut animate:(BOOL)animate animationCompletionHandler:(std::function<void ()>)completionHandler;
</del><ins>+- (void)_setTextIndicator:(PassRefPtr<WebKit::TextIndicator>)textIndicator fadeOut:(BOOL)fadeOut;
+- (void)_setTextIndicator:(PassRefPtr<WebKit::TextIndicator>)textIndicator fadeOut:(BOOL)fadeOut animationCompletionHandler:(std::function<void ()>)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<WebColorPicker> createColorPicker(WebPageProxy*, const WebCore::Color& initialColor, const WebCore::IntRect&) = 0;
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- virtual void setTextIndicator(PassRefPtr<TextIndicator>, bool fadeOut, bool animate) = 0;
</del><ins>+ virtual void setTextIndicator(PassRefPtr<TextIndicator>, bool fadeOut) = 0;
</ins><span class="cx">
</span><span class="cx"> virtual void enterAcceleratedCompositingMode(const LayerTreeContext&) = 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& indicatorData, bool fadeOut, bool animate)
</del><ins>+void WebPageProxy::setTextIndicator(const TextIndicator::Data& 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& 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&, FindOptions, unsigned maxMatchCount);
</span><span class="cx"> void didCountStringMatches(const String&, uint32_t matchCount);
</span><del>- void setTextIndicator(const TextIndicator::Data&, bool fadeOut, bool animate);
- void clearTextIndicator(bool fadeOut, bool animate);
</del><ins>+ void setTextIndicator(const TextIndicator::Data&, bool fadeOut);
+ void clearTextIndicator();
</ins><span class="cx"> void didFindString(const String&, uint32_t matchCount, int32_t matchIndex);
</span><span class="cx"> void didFailToFindString(const String&);
</span><span class="cx"> void didFindStringMatches(const String&, const Vector<Vector<WebCore::IntRect>>& 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<Vector<WebCore::IntRect>> 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<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy*) override;
</span><span class="cx"> virtual PassRefPtr<WebContextMenuProxy> createContextMenuProxy(WebPageProxy*) override;
</span><del>- virtual void setTextIndicator(PassRefPtr<TextIndicator>, bool fadeOut, bool animate) override;
</del><ins>+ virtual void setTextIndicator(PassRefPtr<TextIndicator>, bool fadeOut) override;
</ins><span class="cx">
</span><span class="cx"> virtual void enterAcceleratedCompositingMode(const LayerTreeContext&) 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<TextIndicator> textIndicator, bool fadeOut, bool animate)
</del><ins>+void PageClientImpl::setTextIndicator(PassRefPtr<TextIndicator> 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<WebColorPicker> createColorPicker(WebPageProxy*, const WebCore::Color& initialColor, const WebCore::IntRect&);
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- void setTextIndicator(PassRefPtr<TextIndicator>, bool fadeOut, bool animate);
</del><ins>+ void setTextIndicator(PassRefPtr<TextIndicator>, bool fadeOut);
</ins><span class="cx">
</span><span class="cx"> virtual void enterAcceleratedCompositingMode(const LayerTreeContext&);
</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<TextIndicator> textIndicator, bool fadeOut, bool animate)
</del><ins>+void PageClientImpl::setTextIndicator(PassRefPtr<TextIndicator> 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& 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 <rdar://problem/13875766>).
</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 "WebKitSystemInterface.h"
</del><span class="cx"> #import <functional>
</span><span class="cx"> #import <wtf/Noncopyable.h>
</span><span class="cx"> #import <wtf/RefPtr.h>
</span><span class="cx"> #import <wtf/RetainPtr.h>
</span><span class="cx"> #import <wtf/RunLoop.h>
</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<TextIndicator>, bool fadeOut, bool animate, std::function<void ()> animationCompletionHandler);
</del><ins>+ void setTextIndicator(PassRefPtr<TextIndicator>, bool fadeOut, std::function<void ()> 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<TextIndicator> m_textIndicator;
</span><span class="cx"> RetainPtr<NSWindow> m_textIndicatorWindow;
</span><ins>+ RetainPtr<WKTextIndicatorView> m_textIndicatorView;
</ins><span class="cx">
</span><del>- WKWindowBounceAnimationContextRef m_bounceAnimationContext;
- RetainPtr<WKTextIndicatorWindowAnimation> m_bounceAnimation;
-
</del><span class="cx"> RunLoop::Timer<TextIndicatorWindow> m_startFadeOutTimer;
</span><del>- RetainPtr<WKTextIndicatorWindowAnimation> m_fadeOutAnimation;
</del><span class="cx">
</span><span class="cx"> std::function<void ()> 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 "TextIndicator.h"
</span><span class="cx"> #import "WKView.h"
</span><span class="cx"> #import <WebCore/GraphicsContext.h>
</span><ins>+#import <WebCore/QuartzCoreSPI.h>
+#import <WebCore/WebActionDisablingCALayerDelegate.h>
</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 = @"TextLayer";
+NSString *dropShadowLayerKey = @"DropShadowLayer";
+NSString *rimShadowLayerKey = @"RimShadowLayer";
+
</ins><span class="cx"> using namespace WebCore;
</span><span class="cx">
</span><span class="cx"> @interface WKTextIndicatorView : NSView {
</span><span class="cx"> RefPtr<WebKit::TextIndicator> _textIndicator;
</span><ins>+ RetainPtr<NSArray> _bounceLayers;
+ NSSize _margin;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-- (id)_initWithTextIndicator:(PassRefPtr<WebKit::TextIndicator>)textIndicator;
</del><ins>+- (instancetype)initWithFrame:(NSRect)frame textIndicator:(PassRefPtr<WebKit::TextIndicator>)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<WebKit::TextIndicator>)textIndicator
</del><ins>+- (instancetype)initWithFrame:(NSRect)frame textIndicator:(PassRefPtr<WebKit::TextIndicator>)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<CGContextRef>([[NSGraphicsContext currentContext] graphicsPort]));
</del><ins>+ self.wantsLayer = YES;
+ self.layer.anchorPoint = CGPointZero;
</ins><span class="cx">
</span><del>- _textIndicator->draw(graphicsContext, enclosingIntRect(rect));
-}
</del><ins>+ bool wantsCrossfade = _textIndicator->data().presentationTransition == WebKit::TextIndicator::PresentationTransition::BounceAndCrossfade;
</ins><span class="cx">
</span><del>-- (BOOL)isFlipped
-{
- return YES;
-}
</del><ins>+ FloatSize contentsImageLogicalSize = _textIndicator->data().contentImage->size();
+ contentsImageLogicalSize.scale(1 / _textIndicator->data().contentImageScaleFactor);
+ RetainPtr<CGImageRef> contentsImage;
+ if (wantsCrossfade)
+ contentsImage = _textIndicator->data().contentImageWithHighlight->makeCGImage();
+ else
+ contentsImage = _textIndicator->data().contentImage->makeCGImage();
</ins><span class="cx">
</span><del>-@end
</del><ins>+ RetainPtr<NSMutableArray> bounceLayers = adoptNS([[NSMutableArray alloc] init]);
</ins><span class="cx">
</span><del>-@interface WKTextIndicatorWindowAnimation : NSAnimation<NSAnimationDelegate> {
- WebKit::TextIndicatorWindow* _textIndicatorWindow;
- void (WebKit::TextIndicatorWindow::*_animationProgressCallback)(double progress);
- void (WebKit::TextIndicatorWindow::*_animationDidEndCallback)();
-}
</del><ins>+ RetainPtr<CGColorRef> highlightColor = [NSColor colorWithDeviceRed:1 green:1 blue:0 alpha:1].CGColor;
+ RetainPtr<CGColorRef> rimShadowColor = [NSColor colorWithDeviceWhite:0 alpha:0.15].CGColor;
+ RetainPtr<CGColorRef> 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<CGColorRef> borderColor = [NSColor colorWithDeviceRed:.96 green:.90 blue:0 alpha:1].CGColor;
+ RetainPtr<CGColorRef> gradientDarkColor = [NSColor colorWithDeviceRed:.929 green:.8 blue:0 alpha:1].CGColor;
+ RetainPtr<CGColorRef> gradientLightColor = [NSColor colorWithDeviceRed:.949 green:.937 blue:0 alpha:1].CGColor;
</ins><span class="cx">
</span><del>-@implementation WKTextIndicatorWindowAnimation
</del><ins>+ for (auto& textRect : _textIndicator->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<CALayer> 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<CALayer> 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<CALayer> 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<CAGradientLayer> textLayer = adoptNS([[CAGradientLayer alloc] init]);
+ [textLayer setColors:@[ (id)gradientLightColor.get(), (id)gradientDarkColor.get() ]];
+#else
+ RetainPtr<CALayer> 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->data().textBoundingRectInWindowCoordinates.location() - _textIndicator->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->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->*_animationProgressCallback)(progress);
</del><ins>+ bool wantsCrossfade = _textIndicator->data().presentationTransition == WebKit::TextIndicator::PresentationTransition::BounceAndCrossfade;
+ double animationDuration = wantsCrossfade ? bounceWithCrossfadeAnimationDuration : bounceAnimationDuration;
+ RetainPtr<CAKeyframeAnimation> bounceAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform"];
+ [bounceAnimation setValues:@[
+ [NSValue valueWithCATransform3D:CATransform3DIdentity],
+ [NSValue valueWithCATransform3D:CATransform3DMakeScale(midBounceScale, midBounceScale, 1)],
+ [NSValue valueWithCATransform3D:CATransform3DIdentity]
+ ]];
+ [bounceAnimation setDuration:animationDuration];
+
+ RetainPtr<CABasicAnimation> crossfadeAnimation;
+ RetainPtr<CABasicAnimation> fadeShadowInAnimation;
+ if (wantsCrossfade) {
+ crossfadeAnimation = [CABasicAnimation animationWithKeyPath:@"contents"];
+ RetainPtr<CGImageRef> contentsImage = _textIndicator->data().contentImage->makeCGImage();
+ [crossfadeAnimation setToValue:(id)contentsImage.get()];
+ [crossfadeAnimation setFillMode:kCAFillModeForwards];
+ [crossfadeAnimation setRemovedOnCompletion:NO];
+ [crossfadeAnimation setDuration:animationDuration];
+
+ fadeShadowInAnimation = [CABasicAnimation animationWithKeyPath:@"shadowOpacity"];
+ [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:@"bounce"];
+ if (wantsCrossfade) {
+ [[bounceLayer valueForKey:textLayerKey] addAnimation:crossfadeAnimation.get() forKey:@"contentTransition"];
+ [[bounceLayer valueForKey:dropShadowLayerKey] addAnimation:fadeShadowInAnimation.get() forKey:@"fadeShadowIn"];
+ [[bounceLayer valueForKey:rimShadowLayerKey] addAnimation:fadeShadowInAnimation.get() forKey:@"fadeShadowIn"];
+ }
+ }
+ [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<CABasicAnimation> fadeAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"];
+ [fadeAnimation setFromValue:@1];
+ [fadeAnimation setToValue:@0];
+ [fadeAnimation setFillMode:kCAFillModeForwards];
+ [fadeAnimation setRemovedOnCompletion:NO];
+ [fadeAnimation setDuration:fadeOutAnimationDuration];
</ins><span class="cx">
</span><del>- (_textIndicatorWindow->*_animationDidEndCallback)();
</del><ins>+ [CATransaction begin];
+ [CATransaction setCompletionBlock:completionHandler];
+ [self.layer addAnimation:fadeAnimation.get() forKey:@"fadeOut"];
+ [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, &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<TextIndicator> textIndicator, bool fadeOut, bool animate, std::function<void ()> animationCompletionHandler)
</del><ins>+void TextIndicatorWindow::setTextIndicator(PassRefPtr<TextIndicator> textIndicator, bool fadeOut, std::function<void ()> 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->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 "-Wdeprecated-declarations"
- 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<WKTextIndicatorView> 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:&TextIndicatorWindow::bounceAnimationCallback animationDidEndCallback:&TextIndicatorWindow::bounceAnimationDidEnd]);
- [m_bounceAnimation startAnimation];
</del><ins>+ if (m_textIndicator->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:&TextIndicatorWindow::fadeOutAnimationCallback animationDidEndCallback:&TextIndicatorWindow::fadeOutAnimationDidEnd]);
- [m_fadeOutAnimation startAnimation];
</del><ins>+ RetainPtr<NSWindow> 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->setTextIndicator(_hitTestResult.detectedDataTextIndicator->data(), false, true);
</del><ins>+ _page->setTextIndicator(_hitTestResult.detectedDataTextIndicator->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->clearTextIndicator(false, true);
</del><ins>+ _page->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 "DictionaryPopupInfo.h"
</span><ins>+#import "TextIndicator.h"
</ins><span class="cx"> #import "WebCoreArgumentCoders.h"
</span><span class="cx"> #import "WebPage.h"
</span><span class="cx"> #import "WebPageProxyMessages.h"
</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->performDictionaryLookupForSelection(frame, frame->selection().selection());
</del><ins>+ m_page->performDictionaryLookupForSelection(frame, frame->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& selectedFrame, bool isShowingOverlay, bool shouldAnimate)
</span><span class="cx"> {
</span><del>- RefPtr<TextIndicator> indicator = TextIndicator::createWithSelectionInFrame(*WebFrame::fromCoreFrame(selectedFrame));
</del><ins>+ RefPtr<TextIndicator> 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->selectionRectInWindowCoordinates());
</span><del>- m_webPage->send(Messages::WebPageProxy::SetTextIndicator(indicator->data(), !isShowingOverlay, shouldAnimate));
</del><ins>+ m_webPage->send(Messages::WebPageProxy::SetTextIndicator(indicator->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->send(Messages::WebPageProxy::ClearTextIndicator(false, true));
</del><ins>+ m_webPage->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 "Plugin.h"
</span><span class="cx"> #include "SandboxExtension.h"
</span><span class="cx"> #include "ShareableBitmap.h"
</span><ins>+#include "TextIndicator.h"
</ins><span class="cx"> #include "UserMediaPermissionRequestManager.h"
</span><span class="cx"> #include <WebCore/DictationAlternative.h>
</span><span class="cx"> #include <WebCore/DragData.h>
</span><span class="lines">@@ -670,7 +671,7 @@
</span><span class="cx"> void speak(const String&);
</span><span class="cx"> void stopSpeaking();
</span><span class="cx">
</span><del>- void performDictionaryLookupForSelection(WebCore::Frame*, const WebCore::VisibleSelection&);
</del><ins>+ void performDictionaryLookupForSelection(WebCore::Frame*, const WebCore::VisibleSelection&, 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&);
</span><span class="cx"> void performDictionaryLookupOfCurrentSelection();
</span><del>- void performDictionaryLookupForRange(WebCore::Frame*, WebCore::Range&, NSDictionary *options);
</del><ins>+ void performDictionaryLookupForRange(WebCore::Frame*, WebCore::Range&, NSDictionary *options, TextIndicator::PresentationTransition);
</ins><span class="cx">
</span><span class="cx"> void windowAndViewFramesChanged(const WebCore::FloatRect& windowFrameInScreenCoordinates, const WebCore::FloatRect& windowFrameInUnflippedScreenCoordinates, const WebCore::FloatRect& viewFrameInWindowCoordinates, const WebCore::FloatPoint& accessibilityViewCoordinates);
</span><span 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& selection)
</del><ins>+void WebPage::performDictionaryLookupForSelection(Frame* frame, const VisibleSelection& selection, TextIndicator::PresentationTransition presentationTransition)
</ins><span class="cx"> {
</span><span class="cx"> NSDictionary *options = nil;
</span><span class="cx"> RefPtr<Range> selectedRange = rangeForDictionaryLookupForSelection(selection, &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 = &m_page->focusController().focusedOrMainFrame();
</span><del>- performDictionaryLookupForSelection(frame, frame->selection().selection());
</del><ins>+ performDictionaryLookupForSelection(frame, frame->selection().selection(), TextIndicator::PresentationTransition::BounceAndCrossfade);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void WebPage::performDictionaryLookupForRange(Frame* frame, Range& range, NSDictionary *options)
</del><ins>+void WebPage::performDictionaryLookupForRange(Frame* frame, Range& 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<TextIndicator> textIndicator = TextIndicator::createWithRange(range);
</del><ins>+ RefPtr<TextIndicator> 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->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->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 && 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>