<!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>[185804] 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/185804">185804</a></dd>
<dt>Author</dt> <dd>timothy_horton@apple.com</dd>
<dt>Date</dt> <dd>2015-06-20 23:43:14 -0700 (Sat, 20 Jun 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Deselection of text causes a noticeable jump on force touch machines
https://bugs.webkit.org/show_bug.cgi?id=146173
&lt;rdar://problem/20992842&gt;

Reviewed by Sam Weinig.

Source/WebCore:

When we have a TextIndicator of type Crossfade, we end up putting
a layer with the blue highlight + text painted into it on top of the
content, and cross-fading that layer to the yellow-highlighted text.

This is necessary for BounceAndCrossfade TextIndicators, because the
blue highlight has to bounce, but is not necessary for Crossfade-only
ones; we can just fade in the yellow highlight on top of the
existing blue page highlight, and all is well.

So, get rid of the Crossfade TextIndicator type and use FadeIn, separately
keeping track of whether or not we can add a margin (we still can't
add a margin to TextIndicators that indicate the page's current selection,
because the blue highlight cannot have the margin applied to it, and we
want the bounds to match exactly).

* page/TextIndicator.cpp:
(WebCore::TextIndicator::createWithRange):
If the range is the same as the selection, turn off the margin.
We were previously doing this based on the presentation transition, but now
there's no difference in presentation transition in this case.

(WebCore::TextIndicator::createWithSelectionInFrame):
(WebCore::TextIndicator::wantsBounce):
(WebCore::TextIndicator::wantsContentCrossfade):
(WebCore::TextIndicator::wantsFadeIn):
(WebCore::TextIndicator::wantsManualAnimation):
* page/TextIndicator.h:
Get rid of TextIndicatorPresentationTransition::Crossfade.

(WebCore::TextIndicator::setWantsMargin):
(WebCore::TextIndicator::wantsMargin):
Keep track of whether we want a margin.

* page/mac/TextIndicatorWindow.mm:
(-[WebTextIndicatorView initWithFrame:textIndicator:margin:]):
Determine if we should use a margin based on wantsMargin instead of the
presentation transition.

Source/WebKit/mac:

* WebView/WebImmediateActionController.mm:
(-[WebImmediateActionController _animationControllerForText]):
Get rid of TextIndicatorPresentationTransition::Crossfade.

Source/WebKit2:

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder&lt;TextIndicatorData&gt;::encode):
(IPC::ArgumentCoder&lt;TextIndicatorData&gt;::decode):
Encode/decode wantsMargin.

* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performImmediateActionHitTestAtLocation):
(WebKit::textIndicatorTransitionForImmediateAction): Deleted.
Get rid of TextIndicatorPresentationTransition::Crossfade.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorepageTextIndicatorcpp">trunk/Source/WebCore/page/TextIndicator.cpp</a></li>
<li><a href="#trunkSourceWebCorepageTextIndicatorh">trunk/Source/WebCore/page/TextIndicator.h</a></li>
<li><a href="#trunkSourceWebCorepagemacTextIndicatorWindowmm">trunk/Source/WebCore/page/mac/TextIndicatorWindow.mm</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebImmediateActionControllermm">trunk/Source/WebKit/mac/WebView/WebImmediateActionController.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedWebCoreArgumentCoderscpp">trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp</a></li>
<li><a href="#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 (185803 => 185804)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-06-21 03:27:20 UTC (rev 185803)
+++ trunk/Source/WebCore/ChangeLog        2015-06-21 06:43:14 UTC (rev 185804)
</span><span class="lines">@@ -1,3 +1,49 @@
</span><ins>+2015-06-20  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+        Deselection of text causes a noticeable jump on force touch machines
+        https://bugs.webkit.org/show_bug.cgi?id=146173
+        &lt;rdar://problem/20992842&gt;
+
+        Reviewed by Sam Weinig.
+
+        When we have a TextIndicator of type Crossfade, we end up putting
+        a layer with the blue highlight + text painted into it on top of the
+        content, and cross-fading that layer to the yellow-highlighted text.
+
+        This is necessary for BounceAndCrossfade TextIndicators, because the
+        blue highlight has to bounce, but is not necessary for Crossfade-only
+        ones; we can just fade in the yellow highlight on top of the
+        existing blue page highlight, and all is well.
+
+        So, get rid of the Crossfade TextIndicator type and use FadeIn, separately
+        keeping track of whether or not we can add a margin (we still can't
+        add a margin to TextIndicators that indicate the page's current selection,
+        because the blue highlight cannot have the margin applied to it, and we
+        want the bounds to match exactly).
+
+        * page/TextIndicator.cpp:
+        (WebCore::TextIndicator::createWithRange):
+        If the range is the same as the selection, turn off the margin.
+        We were previously doing this based on the presentation transition, but now
+        there's no difference in presentation transition in this case.
+
+        (WebCore::TextIndicator::createWithSelectionInFrame):
+        (WebCore::TextIndicator::wantsBounce):
+        (WebCore::TextIndicator::wantsContentCrossfade):
+        (WebCore::TextIndicator::wantsFadeIn):
+        (WebCore::TextIndicator::wantsManualAnimation):
+        * page/TextIndicator.h:
+        Get rid of TextIndicatorPresentationTransition::Crossfade.
+
+        (WebCore::TextIndicator::setWantsMargin):
+        (WebCore::TextIndicator::wantsMargin):
+        Keep track of whether we want a margin.
+
+        * page/mac/TextIndicatorWindow.mm:
+        (-[WebTextIndicatorView initWithFrame:textIndicator:margin:]):
+        Determine if we should use a margin based on wantsMargin instead of the
+        presentation transition.
+
</ins><span class="cx"> 2015-06-20  Ryuan Choi  &lt;ryuan.choi@navercorp.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [EFL] Do not consider test directories when DEVELOPER_MODE is OFF
</span></span></pre></div>
<a id="trunkSourceWebCorepageTextIndicatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/TextIndicator.cpp (185803 => 185804)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/TextIndicator.cpp        2015-06-21 03:27:20 UTC (rev 185803)
+++ trunk/Source/WebCore/page/TextIndicator.cpp        2015-06-21 06:43:14 UTC (rev 185804)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> #include &quot;ImageBuffer.h&quot;
</span><span class="cx"> #include &quot;IntRect.h&quot;
</span><span class="cx"> #include &quot;Page.h&quot;
</span><ins>+#include &quot;Range.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="lines">@@ -103,6 +104,8 @@
</span><span class="cx">     RefPtr&lt;TextIndicator&gt; indicator = TextIndicator::createWithSelectionInFrame(*frame, presentationTransition);
</span><span class="cx"> 
</span><span class="cx">     frame-&gt;selection().setSelection(oldSelection);
</span><ins>+
+    indicator-&gt;setWantsMargin(!areRangesEqual(&amp;range, oldSelection.toNormalizedRange().get()));
</ins><span class="cx">     
</span><span class="cx">     return indicator.release();
</span><span class="cx"> }
</span><span class="lines">@@ -141,7 +144,7 @@
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;Image&gt; indicatorBitmapWithHighlight;
</span><del>-    if (presentationTransition == TextIndicatorPresentationTransition::BounceAndCrossfade || presentationTransition == TextIndicatorPresentationTransition::Crossfade)
</del><ins>+    if (presentationTransition == TextIndicatorPresentationTransition::BounceAndCrossfade)
</ins><span class="cx">         indicatorBitmapWithHighlight = snapshotSelectionWithHighlight(frame);
</span><span class="cx"> 
</span><span class="cx">     // Store the selection rect in window coordinates, to be used subsequently
</span><span class="lines">@@ -176,6 +179,7 @@
</span><span class="cx">     data.contentImage = indicatorBitmap;
</span><span class="cx">     data.contentImageWithHighlight = indicatorBitmapWithHighlight;
</span><span class="cx">     data.presentationTransition = presentationTransition;
</span><ins>+    data.wantsMargin = true;
</ins><span class="cx"> 
</span><span class="cx">     return TextIndicator::create(data);
</span><span class="cx"> }
</span><span class="lines">@@ -203,7 +207,6 @@
</span><span class="cx">         return true;
</span><span class="cx">         
</span><span class="cx">     case TextIndicatorPresentationTransition::FadeIn:
</span><del>-    case TextIndicatorPresentationTransition::Crossfade:
</del><span class="cx">     case TextIndicatorPresentationTransition::None:
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="lines">@@ -219,7 +222,6 @@
</span><span class="cx">     
</span><span class="cx">     switch (m_data.presentationTransition) {
</span><span class="cx">     case TextIndicatorPresentationTransition::BounceAndCrossfade:
</span><del>-    case TextIndicatorPresentationTransition::Crossfade:
</del><span class="cx">         return true;
</span><span class="cx">         
</span><span class="cx">     case TextIndicatorPresentationTransition::Bounce:
</span><span class="lines">@@ -240,7 +242,6 @@
</span><span class="cx">         
</span><span class="cx">     case TextIndicatorPresentationTransition::Bounce:
</span><span class="cx">     case TextIndicatorPresentationTransition::BounceAndCrossfade:
</span><del>-    case TextIndicatorPresentationTransition::Crossfade:
</del><span class="cx">     case TextIndicatorPresentationTransition::None:
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="lines">@@ -253,7 +254,6 @@
</span><span class="cx"> {
</span><span class="cx">     switch (m_data.presentationTransition) {
</span><span class="cx">     case TextIndicatorPresentationTransition::FadeIn:
</span><del>-    case TextIndicatorPresentationTransition::Crossfade:
</del><span class="cx">         return true;
</span><span class="cx"> 
</span><span class="cx">     case TextIndicatorPresentationTransition::Bounce:
</span></span></pre></div>
<a id="trunkSourceWebCorepageTextIndicatorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/TextIndicator.h (185803 => 185804)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/TextIndicator.h        2015-06-21 03:27:20 UTC (rev 185803)
+++ trunk/Source/WebCore/page/TextIndicator.h        2015-06-21 06:43:14 UTC (rev 185804)
</span><span class="lines">@@ -51,9 +51,8 @@
</span><span class="cx">     Bounce,
</span><span class="cx">     BounceAndCrossfade,
</span><span class="cx"> 
</span><del>-    // These animations need to be driven manually via TextIndicatorWindow::setAnimationProgress.
</del><ins>+    // This animation needs to be driven manually via TextIndicatorWindow::setAnimationProgress.
</ins><span class="cx">     FadeIn,
</span><del>-    Crossfade
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> enum class TextIndicatorLifetime {
</span><span class="lines">@@ -77,6 +76,7 @@
</span><span class="cx">     RefPtr&lt;Image&gt; contentImageWithHighlight;
</span><span class="cx">     RefPtr&lt;Image&gt; contentImage;
</span><span class="cx">     TextIndicatorPresentationTransition presentationTransition;
</span><ins>+    bool wantsMargin;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> class TextIndicator : public RefCounted&lt;TextIndicator&gt; {
</span><span class="lines">@@ -104,6 +104,9 @@
</span><span class="cx">     bool wantsFadeIn() const;
</span><span class="cx">     bool wantsManualAnimation() const;
</span><span class="cx"> 
</span><ins>+    void setWantsMargin(bool wantsMargin) { m_data.wantsMargin = wantsMargin; }
+    bool wantsMargin() const { return m_data.wantsMargin; }
+
</ins><span class="cx"> private:
</span><span class="cx">     TextIndicator(const TextIndicatorData&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagemacTextIndicatorWindowmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/mac/TextIndicatorWindow.mm (185803 => 185804)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/mac/TextIndicatorWindow.mm        2015-06-21 03:27:20 UTC (rev 185803)
+++ trunk/Source/WebCore/page/mac/TextIndicatorWindow.mm        2015-06-21 06:43:14 UTC (rev 185804)
</span><span class="lines">@@ -102,12 +102,10 @@
</span><span class="cx">     self.wantsLayer = YES;
</span><span class="cx">     self.layer.anchorPoint = CGPointZero;
</span><span class="cx"> 
</span><del>-    bool wantsCrossfade = _textIndicator-&gt;wantsContentCrossfade();
-
</del><span class="cx">     FloatSize contentsImageLogicalSize = _textIndicator-&gt;contentImage()-&gt;size();
</span><span class="cx">     contentsImageLogicalSize.scale(1 / _textIndicator-&gt;contentImageScaleFactor());
</span><span class="cx">     RetainPtr&lt;CGImageRef&gt; contentsImage;
</span><del>-    if (wantsCrossfade)
</del><ins>+    if (_textIndicator-&gt;wantsContentCrossfade())
</ins><span class="cx">         contentsImage = _textIndicator-&gt;contentImageWithHighlight()-&gt;getCGImageRef();
</span><span class="cx">     else
</span><span class="cx">         contentsImage = _textIndicator-&gt;contentImage()-&gt;getCGImageRef();
</span><span class="lines">@@ -137,7 +135,7 @@
</span><span class="cx">         FloatRect yellowHighlightRect(FloatPoint(), bounceLayerRect.size());
</span><span class="cx">         // FIXME (138888): Ideally we wouldn't remove the margin in this case, but we need to
</span><span class="cx">         // ensure that the yellow highlight and contentImageWithHighlight overlap precisely.
</span><del>-        if (wantsCrossfade) {
</del><ins>+        if (!_textIndicator-&gt;wantsMargin()) {
</ins><span class="cx">             yellowHighlightRect.inflateX(-horizontalBorder);
</span><span class="cx">             yellowHighlightRect.inflateY(-verticalBorder);
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (185803 => 185804)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2015-06-21 03:27:20 UTC (rev 185803)
+++ trunk/Source/WebKit/mac/ChangeLog        2015-06-21 06:43:14 UTC (rev 185804)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2015-06-20  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+        Deselection of text causes a noticeable jump on force touch machines
+        https://bugs.webkit.org/show_bug.cgi?id=146173
+        &lt;rdar://problem/20992842&gt;
+
+        Reviewed by Sam Weinig.
+
+        * WebView/WebImmediateActionController.mm:
+        (-[WebImmediateActionController _animationControllerForText]):
+        Get rid of TextIndicatorPresentationTransition::Crossfade.
+
</ins><span class="cx"> 2015-06-19  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         All calls of ImageBuffer::create should null check the return value
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebImmediateActionControllermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebImmediateActionController.mm (185803 => 185804)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebImmediateActionController.mm        2015-06-21 03:27:20 UTC (rev 185803)
+++ trunk/Source/WebKit/mac/WebView/WebImmediateActionController.mm        2015-06-21 06:43:14 UTC (rev 185804)
</span><span class="lines">@@ -528,8 +528,7 @@
</span><span class="cx">         return nil;
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;Range&gt; selectionRange = frame-&gt;page()-&gt;focusController().focusedOrMainFrame().selection().selection().firstRange();
</span><del>-    bool rangeMatchesSelection = areRangesEqual(dictionaryRange.get(), selectionRange.get());
-    DictionaryPopupInfo dictionaryPopupInfo = dictionaryPopupInfoForRange(frame, *dictionaryRange, options, rangeMatchesSelection ? TextIndicatorPresentationTransition::Crossfade : TextIndicatorPresentationTransition::FadeIn);
</del><ins>+    DictionaryPopupInfo dictionaryPopupInfo = dictionaryPopupInfoForRange(frame, *dictionaryRange, options, TextIndicatorPresentationTransition::FadeIn);
</ins><span class="cx">     if (!dictionaryPopupInfo.attributedString)
</span><span class="cx">         return nil;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (185803 => 185804)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-06-21 03:27:20 UTC (rev 185803)
+++ trunk/Source/WebKit2/ChangeLog        2015-06-21 06:43:14 UTC (rev 185804)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2015-06-20  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+        Deselection of text causes a noticeable jump on force touch machines
+        https://bugs.webkit.org/show_bug.cgi?id=146173
+        &lt;rdar://problem/20992842&gt;
+
+        Reviewed by Sam Weinig.
+
+        * Shared/WebCoreArgumentCoders.cpp:
+        (IPC::ArgumentCoder&lt;TextIndicatorData&gt;::encode):
+        (IPC::ArgumentCoder&lt;TextIndicatorData&gt;::decode):
+        Encode/decode wantsMargin.
+
+        * WebProcess/WebPage/mac/WebPageMac.mm:
+        (WebKit::WebPage::performImmediateActionHitTestAtLocation):
+        (WebKit::textIndicatorTransitionForImmediateAction): Deleted.
+        Get rid of TextIndicatorPresentationTransition::Crossfade.
+
</ins><span class="cx"> 2015-06-20  Dan Bernstein  &lt;mitz@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Cocoa] Actually use Objective-C lightweight generics when the compiler supports them
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebCoreArgumentCoderscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp (185803 => 185804)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp        2015-06-21 03:27:20 UTC (rev 185803)
+++ trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp        2015-06-21 06:43:14 UTC (rev 185804)
</span><span class="lines">@@ -2102,6 +2102,7 @@
</span><span class="cx">     encoder &lt;&lt; textIndicatorData.textBoundingRectInRootViewCoordinates;
</span><span class="cx">     encoder &lt;&lt; textIndicatorData.textRectsInBoundingRectCoordinates;
</span><span class="cx">     encoder &lt;&lt; textIndicatorData.contentImageScaleFactor;
</span><ins>+    encoder &lt;&lt; textIndicatorData.wantsMargin;
</ins><span class="cx">     encoder.encodeEnum(textIndicatorData.presentationTransition);
</span><span class="cx"> 
</span><span class="cx">     bool hasImage = textIndicatorData.contentImage;
</span><span class="lines">@@ -2129,6 +2130,9 @@
</span><span class="cx">     if (!decoder.decode(textIndicatorData.contentImageScaleFactor))
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><ins>+    if (!decoder.decode(textIndicatorData.wantsMargin))
+        return false;
+
</ins><span class="cx">     if (!decoder.decodeEnum(textIndicatorData.presentationTransition))
</span><span class="cx">         return false;
</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 (185803 => 185804)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm        2015-06-21 03:27:20 UTC (rev 185803)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm        2015-06-21 06:43:14 UTC (rev 185804)
</span><span class="lines">@@ -1062,20 +1062,6 @@
</span><span class="cx">     return String();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static TextIndicatorPresentationTransition textIndicatorTransitionForImmediateAction(Range* selectionRange, Range&amp; indicatorRange, bool forDataDetectors)
-{
-    if (areRangesEqual(&amp;indicatorRange, selectionRange))
-        return TextIndicatorPresentationTransition::Crossfade;
-    return TextIndicatorPresentationTransition::FadeIn;
-}
-
-#if ENABLE(PDFKIT_PLUGIN)
-static TextIndicatorPresentationTransition textIndicatorTransitionForImmediateAction()
-{
-    return TextIndicatorPresentationTransition::FadeIn;
-}
-#endif
-
</del><span class="cx"> void WebPage::performImmediateActionHitTestAtLocation(WebCore::FloatPoint locationInViewCoordinates)
</span><span class="cx"> {
</span><span class="cx">     layoutIfNeeded();
</span><span class="lines">@@ -1104,7 +1090,7 @@
</span><span class="cx">     Element *URLElement = hitTestResult.URLElement();
</span><span class="cx">     if (!absoluteLinkURL.isEmpty() &amp;&amp; URLElement) {
</span><span class="cx">         RefPtr&lt;Range&gt; linkRange = rangeOfContents(*URLElement);
</span><del>-        immediateActionResult.linkTextIndicator = TextIndicator::createWithRange(*linkRange, textIndicatorTransitionForImmediateAction(selectionRange.get(), *linkRange, false));
</del><ins>+        immediateActionResult.linkTextIndicator = TextIndicator::createWithRange(*linkRange, TextIndicatorPresentationTransition::FadeIn);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     NSDictionary *options = nil;
</span><span class="lines">@@ -1114,7 +1100,7 @@
</span><span class="cx">     if (lookupRange) {
</span><span class="cx">         if (Node* node = hitTestResult.innerNode()) {
</span><span class="cx">             if (Frame* hitTestResultFrame = node-&gt;document().frame())
</span><del>-                immediateActionResult.dictionaryPopupInfo = dictionaryPopupInfoForRange(hitTestResultFrame, *lookupRange.get(), &amp;options, textIndicatorTransitionForImmediateAction(selectionRange.get(), *lookupRange, false));
</del><ins>+                immediateActionResult.dictionaryPopupInfo = dictionaryPopupInfoForRange(hitTestResultFrame, *lookupRange.get(), &amp;options, TextIndicatorPresentationTransition::FadeIn);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -1140,7 +1126,7 @@
</span><span class="cx">             detectedDataBoundingBox.unite(frameView-&gt;contentsToWindow(quad.enclosingBoundingBox()));
</span><span class="cx"> 
</span><span class="cx">         immediateActionResult.detectedDataBoundingBox = detectedDataBoundingBox;
</span><del>-        immediateActionResult.detectedDataTextIndicator = TextIndicator::createWithRange(*mainResultRange, textIndicatorTransitionForImmediateAction(selectionRange.get(), *mainResultRange, true));
</del><ins>+        immediateActionResult.detectedDataTextIndicator = TextIndicator::createWithRange(*mainResultRange, TextIndicatorPresentationTransition::FadeIn);
</ins><span class="cx">         immediateActionResult.detectedDataOriginatingPageOverlay = overlay-&gt;pageOverlayID();
</span><span class="cx"> 
</span><span class="cx">         break;
</span><span class="lines">@@ -1153,7 +1139,7 @@
</span><span class="cx">         immediateActionResult.detectedDataActionContext = DataDetection::detectItemAroundHitTestResult(hitTestResult, detectedDataBoundingBox, detectedDataRange);
</span><span class="cx">         if (immediateActionResult.detectedDataActionContext &amp;&amp; detectedDataRange) {
</span><span class="cx">             immediateActionResult.detectedDataBoundingBox = detectedDataBoundingBox;
</span><del>-            immediateActionResult.detectedDataTextIndicator = TextIndicator::createWithRange(*detectedDataRange, textIndicatorTransitionForImmediateAction(selectionRange.get(), *detectedDataRange, true));
</del><ins>+            immediateActionResult.detectedDataTextIndicator = TextIndicator::createWithRange(*detectedDataRange, TextIndicatorPresentationTransition::FadeIn);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -1181,7 +1167,7 @@
</span><span class="cx">                 immediateActionResult.isSelected = true;
</span><span class="cx">                 immediateActionResult.allowsCopy = true;
</span><span class="cx"> 
</span><del>-                immediateActionResult.dictionaryPopupInfo = dictionaryPopupInfoForSelectionInPDFPlugin(selection, *pdfPugin, &amp;options, textIndicatorTransitionForImmediateAction());
</del><ins>+                immediateActionResult.dictionaryPopupInfo = dictionaryPopupInfoForSelectionInPDFPlugin(selection, *pdfPugin, &amp;options, TextIndicatorPresentationTransition::FadeIn);
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">     }
</span></span></pre>
</div>
</div>

</body>
</html>