<!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>[188526] 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/188526">188526</a></dd>
<dt>Author</dt> <dd>timothy_horton@apple.com</dd>
<dt>Date</dt> <dd>2015-08-17 10:50:09 -0700 (Mon, 17 Aug 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Adopt shrink-wrapping for TextIndicators on Mac
https://bugs.webkit.org/show_bug.cgi?id=148064

Reviewed by Beth Dakin.

Instead of indicating the bounding rect when there are multiple text rects,
use shrink-wrapping for TextIndicatorWindow (on Mac), like we do on iOS.

* bindings/objc/DOM.mm:
(-[DOMNode getPreviewSnapshotImage:andRects:]):
Make getPreviewSnapshotImage use the same options that iOS WebKit2 uses.
This fixes a regression from <a href="http://trac.webkit.org/projects/webkit/changeset/188420">r188420</a> where iOS WebKit1 TextIndicators lost
all of the relevant (previously hardcoded inside TextIndicator) options.

* page/TextIndicator.cpp:
(WebCore::TextIndicator::createWithRange):
(WebCore::TextIndicator::createWithSelectionInFrame):
(WebCore::initializeIndicator):
Don't keep indicatesCurrentSelection in TextIndicatorData. Instead,
just pass it through to initializeIndicator. Add a flag which stops us
from zeroing out the margin if indicatesCurrentSelection is true.
Move default margins into TextIndicator so they can be applied to the stored rects
just like on iOS, instead of trying to apply them later like we used to on Mac.

* page/TextIndicator.h:
(WebCore::TextIndicator::indicatesCurrentSelection): Deleted.
* page/mac/TextIndicatorWindow.h:
* page/mac/TextIndicatorWindow.mm:
(-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]):
(WebCore::TextIndicatorWindow::setTextIndicator):
(outsetIndicatorRectIncludingShadow): Deleted.
(textIndicatorsForTextRectsOverlap): Deleted.
Make use of pathsWithShrinkWrappedRects for TextIndicatorWindow, instead
of just smushing all intersecting rects together. Use the computed path
for the shadows and to mask the yellow highlight and snapshot layer.

* platform/graphics/PathUtilities.cpp:
(WebCore::PathUtilities::pathsWithShrinkWrappedRects):
(WebCore::PathUtilities::pathWithShrinkWrappedRects):
* platform/graphics/PathUtilities.h:
Make it possible to retrieve each non-intersecting path individually, instead
of just a single giant Path, so that TextIndicatorWindow can make separate
layers for each one (so they can bounce separately).

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder&lt;TextIndicatorData&gt;::encode): Deleted.
(IPC::ArgumentCoder&lt;TextIndicatorData&gt;::decode): Deleted.
* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::updateFindIndicator):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getPositionInformation):
Use the new option, TextIndicatorOptionIncludeMarginIfRangeMatchesSelection,
for iOS and FindController, because we can keep the margins in these cases
because we don't have to animate to/from the blue highlight.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsobjcDOMmm">trunk/Source/WebCore/bindings/objc/DOM.mm</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="#trunkSourceWebCorepagemacTextIndicatorWindowh">trunk/Source/WebCore/page/mac/TextIndicatorWindow.h</a></li>
<li><a href="#trunkSourceWebCorepagemacTextIndicatorWindowmm">trunk/Source/WebCore/page/mac/TextIndicatorWindow.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsPathUtilitiescpp">trunk/Source/WebCore/platform/graphics/PathUtilities.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsPathUtilitiesh">trunk/Source/WebCore/platform/graphics/PathUtilities.h</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="#trunkSourceWebKit2WebProcessWebPageFindControllercpp">trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm">trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (188525 => 188526)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-08-17 17:41:44 UTC (rev 188525)
+++ trunk/Source/WebCore/ChangeLog        2015-08-17 17:50:09 UTC (rev 188526)
</span><span class="lines">@@ -1,3 +1,49 @@
</span><ins>+2015-08-17  Timothy Horton  &lt;timothy_horton@apple.com&gt;
+
+        Adopt shrink-wrapping for TextIndicators on Mac
+        https://bugs.webkit.org/show_bug.cgi?id=148064
+
+        Reviewed by Beth Dakin.
+
+        Instead of indicating the bounding rect when there are multiple text rects,
+        use shrink-wrapping for TextIndicatorWindow (on Mac), like we do on iOS.
+
+        * bindings/objc/DOM.mm:
+        (-[DOMNode getPreviewSnapshotImage:andRects:]):
+        Make getPreviewSnapshotImage use the same options that iOS WebKit2 uses.
+        This fixes a regression from r188420 where iOS WebKit1 TextIndicators lost
+        all of the relevant (previously hardcoded inside TextIndicator) options.
+
+        * page/TextIndicator.cpp:
+        (WebCore::TextIndicator::createWithRange):
+        (WebCore::TextIndicator::createWithSelectionInFrame):
+        (WebCore::initializeIndicator):
+        Don't keep indicatesCurrentSelection in TextIndicatorData. Instead,
+        just pass it through to initializeIndicator. Add a flag which stops us
+        from zeroing out the margin if indicatesCurrentSelection is true.
+        Move default margins into TextIndicator so they can be applied to the stored rects
+        just like on iOS, instead of trying to apply them later like we used to on Mac.
+
+        * page/TextIndicator.h:
+        (WebCore::TextIndicator::indicatesCurrentSelection): Deleted.
+        * page/mac/TextIndicatorWindow.h:
+        * page/mac/TextIndicatorWindow.mm:
+        (-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]):
+        (WebCore::TextIndicatorWindow::setTextIndicator):
+        (outsetIndicatorRectIncludingShadow): Deleted.
+        (textIndicatorsForTextRectsOverlap): Deleted.
+        Make use of pathsWithShrinkWrappedRects for TextIndicatorWindow, instead
+        of just smushing all intersecting rects together. Use the computed path
+        for the shadows and to mask the yellow highlight and snapshot layer.
+
+        * platform/graphics/PathUtilities.cpp:
+        (WebCore::PathUtilities::pathsWithShrinkWrappedRects):
+        (WebCore::PathUtilities::pathWithShrinkWrappedRects):
+        * platform/graphics/PathUtilities.h:
+        Make it possible to retrieve each non-intersecting path individually, instead
+        of just a single giant Path, so that TextIndicatorWindow can make separate
+        layers for each one (so they can bounce separately).
+
</ins><span class="cx"> 2015-08-17  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove some includes from Node.cpp
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsobjcDOMmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/objc/DOM.mm (188525 => 188526)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/objc/DOM.mm        2015-08-17 17:41:44 UTC (rev 188525)
+++ trunk/Source/WebCore/bindings/objc/DOM.mm        2015-08-17 17:50:09 UTC (rev 188526)
</span><span class="lines">@@ -596,7 +596,12 @@
</span><span class="cx">     Ref&lt;Range&gt; range = rangeOfContents(*coreNode);
</span><span class="cx"> 
</span><span class="cx">     const float margin = 4 / coreNode-&gt;document().page()-&gt;pageScaleFactor();
</span><del>-    RefPtr&lt;TextIndicator&gt; textIndicator = TextIndicator::createWithRange(range, TextIndicatorOptionDefault, TextIndicatorPresentationTransition::None, margin);
</del><ins>+    RefPtr&lt;TextIndicator&gt; textIndicator = TextIndicator::createWithRange(range, TextIndicatorOptionTightlyFitContent |
+        TextIndicatorOptionRespectTextColor |
+        TextIndicatorOptionPaintBackgrounds |
+        TextIndicatorOptionUseBoundingRectAndPaintAllContentForComplexRanges |
+        TextIndicatorOptionIncludeMarginIfRangeMatchesSelection,
+        TextIndicatorPresentationTransition::None, FloatSize(margin, margin));
</ins><span class="cx"> 
</span><span class="cx">     if (textIndicator) {
</span><span class="cx">         if (Image* image = textIndicator-&gt;contentImage())
</span></span></pre></div>
<a id="trunkSourceWebCorepageTextIndicatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/TextIndicator.cpp (188525 => 188526)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/TextIndicator.cpp        2015-08-17 17:41:44 UTC (rev 188525)
+++ trunk/Source/WebCore/page/TextIndicator.cpp        2015-08-17 17:50:09 UTC (rev 188526)
</span><span class="lines">@@ -46,7 +46,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-static bool initializeIndicator(TextIndicatorData&amp;, Frame&amp;, const Range&amp;, unsigned margin);
</del><ins>+static bool initializeIndicator(TextIndicatorData&amp;, Frame&amp;, const Range&amp;, FloatSize margin, bool indicatesCurrentSelection);
</ins><span class="cx"> 
</span><span class="cx"> TextIndicator::TextIndicator(const TextIndicatorData&amp; data)
</span><span class="cx">     : m_data(data)
</span><span class="lines">@@ -62,7 +62,7 @@
</span><span class="cx">     return adoptRef(*new TextIndicator(data));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;TextIndicator&gt; TextIndicator::createWithRange(const Range&amp; range, TextIndicatorOptions options, TextIndicatorPresentationTransition presentationTransition, unsigned margin)
</del><ins>+RefPtr&lt;TextIndicator&gt; TextIndicator::createWithRange(const Range&amp; range, TextIndicatorOptions options, TextIndicatorPresentationTransition presentationTransition, FloatSize margin)
</ins><span class="cx"> {
</span><span class="cx">     Frame* frame = range.startContainer()-&gt;document().frame();
</span><span class="cx"> 
</span><span class="lines">@@ -80,10 +80,11 @@
</span><span class="cx">     TextIndicatorData data;
</span><span class="cx"> 
</span><span class="cx">     data.presentationTransition = presentationTransition;
</span><del>-    data.indicatesCurrentSelection = !areRangesEqual(&amp;range, oldSelection.toNormalizedRange().get());
</del><span class="cx">     data.options = options;
</span><span class="cx"> 
</span><del>-    if (!initializeIndicator(data, *frame, range, margin))
</del><ins>+    bool indicatesCurrentSelection = areRangesEqual(&amp;range, oldSelection.toNormalizedRange().get());
+
+    if (!initializeIndicator(data, *frame, range, margin, indicatesCurrentSelection))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;TextIndicator&gt; indicator = TextIndicator::create(data);
</span><span class="lines">@@ -98,7 +99,7 @@
</span><span class="cx">     return indicator;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;TextIndicator&gt; TextIndicator::createWithSelectionInFrame(Frame&amp; frame, TextIndicatorOptions options, TextIndicatorPresentationTransition presentationTransition, unsigned margin)
</del><ins>+RefPtr&lt;TextIndicator&gt; TextIndicator::createWithSelectionInFrame(Frame&amp; frame, TextIndicatorOptions options, TextIndicatorPresentationTransition presentationTransition, FloatSize margin)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;Range&gt; range = frame.selection().toNormalizedRange();
</span><span class="cx">     if (!range)
</span><span class="lines">@@ -107,10 +108,9 @@
</span><span class="cx">     TextIndicatorData data;
</span><span class="cx"> 
</span><span class="cx">     data.presentationTransition = presentationTransition;
</span><del>-    data.indicatesCurrentSelection = true;
</del><span class="cx">     data.options = options;
</span><span class="cx"> 
</span><del>-    if (!initializeIndicator(data, frame, *range, margin))
</del><ins>+    if (!initializeIndicator(data, frame, *range, margin, true))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     return TextIndicator::create(data);
</span><span class="lines">@@ -175,10 +175,16 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool initializeIndicator(TextIndicatorData&amp; data, Frame&amp; frame, const Range&amp; range, unsigned margin)
</del><ins>+static bool initializeIndicator(TextIndicatorData&amp; data, Frame&amp; frame, const Range&amp; range, FloatSize margin, bool indicatesCurrentSelection)
</ins><span class="cx"> {
</span><span class="cx">     Vector&lt;FloatRect&gt; textRects;
</span><span class="cx"> 
</span><ins>+    // FIXME (138888): Ideally we wouldn't remove the margin in this case, but we need to
+    // ensure that the indicator and indicator-with-highlight overlap precisely, and
+    // we can't add a margin to the indicator-with-highlight.
+    if (indicatesCurrentSelection &amp;&amp; !(data.options &amp; TextIndicatorOptionIncludeMarginIfRangeMatchesSelection))
+        margin = FloatSize();
+
</ins><span class="cx">     FrameSelection::TextRectangleHeight textRectHeight = (data.options &amp; TextIndicatorOptionTightlyFitContent) ? FrameSelection::TextRectangleHeight::TextHeight : FrameSelection::TextRectangleHeight::SelectionHeight;
</span><span class="cx"> 
</span><span class="cx">     if ((data.options &amp; TextIndicatorOptionUseBoundingRectAndPaintAllContentForComplexRanges) &amp;&amp; hasNonInlineOrReplacedElements(range))
</span><span class="lines">@@ -203,7 +209,8 @@
</span><span class="cx">     Vector&lt;FloatRect&gt; textRectsInRootViewCoordinates;
</span><span class="cx">     for (const FloatRect&amp; textRect : textRects) {
</span><span class="cx">         FloatRect textRectInDocumentCoordinatesIncludingMargin = textRect;
</span><del>-        textRectInDocumentCoordinatesIncludingMargin.inflate(margin);
</del><ins>+        textRectInDocumentCoordinatesIncludingMargin.inflateX(margin.width());
+        textRectInDocumentCoordinatesIncludingMargin.inflateY(margin.height());
</ins><span class="cx">         textBoundingRectInDocumentCoordinates.unite(textRectInDocumentCoordinatesIncludingMargin);
</span><span class="cx"> 
</span><span class="cx">         FloatRect textRectInRootViewCoordinates = frame.view()-&gt;contentsToRootView(enclosingIntRect(textRectInDocumentCoordinatesIncludingMargin));
</span></span></pre></div>
<a id="trunkSourceWebCorepageTextIndicatorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/TextIndicator.h (188525 => 188526)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/TextIndicator.h        2015-08-17 17:41:44 UTC (rev 188525)
+++ trunk/Source/WebCore/page/TextIndicator.h        2015-08-17 17:50:09 UTC (rev 188526)
</span><span class="lines">@@ -32,6 +32,12 @@
</span><span class="cx"> #include &lt;wtf/RefCounted.h&gt;
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &lt; 101000
+#define ENABLE_LEGACY_TEXT_INDICATOR_STYLE 1
+#else
+#define ENABLE_LEGACY_TEXT_INDICATOR_STYLE 0
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class Frame;
</span><span class="lines">@@ -73,7 +79,11 @@
</span><span class="cx"> 
</span><span class="cx">     // If there are any non-inline or replaced elements in the Range, indicate the bounding rect
</span><span class="cx">     // of the range instead of the individual subrects, and don't restrict painting to the given Range
</span><del>-    TextIndicatorOptionUseBoundingRectAndPaintAllContentForComplexRanges = 1 &lt;&lt; 5
</del><ins>+    TextIndicatorOptionUseBoundingRectAndPaintAllContentForComplexRanges = 1 &lt;&lt; 5,
+
+    // By default, TextIndicator removes any margin if the given Range matches the
+    // selection Range. If this option is set, maintain the margin in any case.
+    TextIndicatorOptionIncludeMarginIfRangeMatchesSelection = 1 &lt;&lt; 6,
</ins><span class="cx"> };
</span><span class="cx"> typedef uint8_t TextIndicatorOptions;
</span><span class="cx"> 
</span><span class="lines">@@ -85,15 +95,24 @@
</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><del>-    bool indicatesCurrentSelection;
</del><span class="cx">     TextIndicatorOptions options;
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> class TextIndicator : public RefCounted&lt;TextIndicator&gt; {
</span><span class="cx"> public:
</span><ins>+    // FIXME: These are fairly Mac-specific, and they don't really belong here.
+    // But they're needed at TextIndicator creation time, so they can't go in TextIndicatorWindow.
+    // Maybe they can live in some Theme code somewhere?
+#if ENABLE(LEGACY_TEXT_INDICATOR_STYLE)
+    constexpr static float defaultHorizontalMargin { 3 };
+#else
+    constexpr static float defaultHorizontalMargin { 2 };
+#endif
+    constexpr static float defaultVerticalMargin { 1 };
+
</ins><span class="cx">     WEBCORE_EXPORT static Ref&lt;TextIndicator&gt; create(const TextIndicatorData&amp;);
</span><del>-    WEBCORE_EXPORT static RefPtr&lt;TextIndicator&gt; createWithSelectionInFrame(Frame&amp;, TextIndicatorOptions, TextIndicatorPresentationTransition, unsigned margin = 0);
-    WEBCORE_EXPORT static RefPtr&lt;TextIndicator&gt; createWithRange(const Range&amp;, TextIndicatorOptions, TextIndicatorPresentationTransition, unsigned margin = 0);
</del><ins>+    WEBCORE_EXPORT static RefPtr&lt;TextIndicator&gt; createWithSelectionInFrame(Frame&amp;, TextIndicatorOptions, TextIndicatorPresentationTransition, FloatSize margin = FloatSize(defaultHorizontalMargin, defaultVerticalMargin));
+    WEBCORE_EXPORT static RefPtr&lt;TextIndicator&gt; createWithRange(const Range&amp;, TextIndicatorOptions, TextIndicatorPresentationTransition, FloatSize margin = FloatSize(defaultHorizontalMargin, defaultVerticalMargin));
</ins><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT ~TextIndicator();
</span><span class="cx"> 
</span><span class="lines">@@ -109,8 +128,6 @@
</span><span class="cx"> 
</span><span class="cx">     TextIndicatorData data() const { return m_data; }
</span><span class="cx"> 
</span><del>-    bool indicatesCurrentSelection() const { return m_data.indicatesCurrentSelection; }
-
</del><span class="cx"> private:
</span><span class="cx">     TextIndicator(const TextIndicatorData&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagemacTextIndicatorWindowh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/mac/TextIndicatorWindow.h (188525 => 188526)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/mac/TextIndicatorWindow.h        2015-08-17 17:41:44 UTC (rev 188525)
+++ trunk/Source/WebCore/page/mac/TextIndicatorWindow.h        2015-08-17 17:50:09 UTC (rev 188526)
</span><span class="lines">@@ -32,12 +32,6 @@
</span><span class="cx"> #import &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> #import &lt;wtf/RunLoop.h&gt;
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &lt; 101000
-#define ENABLE_LEGACY_TEXT_INDICATOR_STYLE 1
-#else
-#define ENABLE_LEGACY_TEXT_INDICATOR_STYLE 0
-#endif
-
</del><span class="cx"> OBJC_CLASS NSView;
</span><span class="cx"> OBJC_CLASS WebTextIndicatorView;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagemacTextIndicatorWindowmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/mac/TextIndicatorWindow.mm (188525 => 188526)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/mac/TextIndicatorWindow.mm        2015-08-17 17:41:44 UTC (rev 188525)
+++ trunk/Source/WebCore/page/mac/TextIndicatorWindow.mm        2015-08-17 17:50:09 UTC (rev 188526)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #import &quot;CoreGraphicsSPI.h&quot;
</span><span class="cx"> #import &quot;GeometryUtilities.h&quot;
</span><span class="cx"> #import &quot;GraphicsContext.h&quot;
</span><ins>+#import &quot;PathUtilities.h&quot;
</ins><span class="cx"> #import &quot;QuartzCoreSPI.h&quot;
</span><span class="cx"> #import &quot;TextIndicator.h&quot;
</span><span class="cx"> #import &quot;WebActionDisablingCALayerDelegate.h&quot;
</span><span class="lines">@@ -43,8 +44,6 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(LEGACY_TEXT_INDICATOR_STYLE)
</span><span class="cx"> const CGFloat midBounceScale = 1.5;
</span><del>-const CGFloat horizontalBorder = 3;
-const CGFloat verticalBorder = 1;
</del><span class="cx"> const CGFloat borderWidth = 1.0;
</span><span class="cx"> const CGFloat cornerRadius = 3;
</span><span class="cx"> const CGFloat dropShadowOffsetX = 0;
</span><span class="lines">@@ -52,8 +51,6 @@
</span><span class="cx"> const CGFloat dropShadowBlurRadius = 1.5;
</span><span class="cx"> #else
</span><span class="cx"> const CGFloat midBounceScale = 1.25;
</span><del>-const CGFloat horizontalBorder = 2;
-const CGFloat verticalBorder = 1;
</del><span class="cx"> const CGFloat borderWidth = 0;
</span><span class="cx"> const CGFloat cornerRadius = 0;
</span><span class="cx"> const CGFloat dropShadowOffsetX = 0;
</span><span class="lines">@@ -92,38 +89,6 @@
</span><span class="cx"> 
</span><span class="cx"> @synthesize fadingOut = _fadingOut;
</span><span class="cx"> 
</span><del>-static FloatRect outsetIndicatorRectIncludingShadow(const FloatRect rect)
-{
-    FloatRect outsetRect = rect;
-    outsetRect.inflateX(dropShadowBlurRadius + horizontalBorder);
-    outsetRect.inflateY(dropShadowBlurRadius + verticalBorder);
-    return outsetRect;
-}
-
-static bool textIndicatorsForTextRectsOverlap(const Vector&lt;FloatRect&gt;&amp; textRects)
-{
-    size_t count = textRects.size();
-    if (count &lt;= 1)
-        return false;
-
-    Vector&lt;FloatRect&gt; indicatorRects;
-    indicatorRects.reserveInitialCapacity(count);
-
-    for (size_t i = 0; i &lt; count; ++i) {
-        FloatRect indicatorRect = outsetIndicatorRectIncludingShadow(textRects[i]);
-
-        for (size_t j = indicatorRects.size(); j; ) {
-            --j;
-            if (indicatorRect.intersects(indicatorRects[j]))
-                return true;
-        }
-
-        indicatorRects.uncheckedAppend(indicatorRect);
-    }
-
-    return false;
-}
-
</del><span class="cx"> static bool indicatorWantsBounce(const TextIndicator&amp; indicator)
</span><span class="cx"> {
</span><span class="cx">     switch (indicator.presentationTransition()) {
</span><span class="lines">@@ -221,19 +186,22 @@
</span><span class="cx">     RetainPtr&lt;CGColorRef&gt; gradientLightColor = [NSColor colorWithDeviceRed:.949 green:.937 blue:0 alpha:1].CGColor;
</span><span class="cx"> 
</span><span class="cx">     Vector&lt;FloatRect&gt; textRectsInBoundingRectCoordinates = _textIndicator-&gt;textRectsInBoundingRectCoordinates();
</span><del>-    if (textIndicatorsForTextRectsOverlap(textRectsInBoundingRectCoordinates)) {
-        textRectsInBoundingRectCoordinates[0] = unionRect(textRectsInBoundingRectCoordinates);
-        textRectsInBoundingRectCoordinates.shrink(1);
-    }
</del><span class="cx"> 
</span><del>-    for (const auto&amp; textRect : textRectsInBoundingRectCoordinates) {
-        FloatRect offsetTextRect = textRect;
</del><ins>+    Vector&lt;Path&gt; paths = PathUtilities::pathsWithShrinkWrappedRects(textRectsInBoundingRectCoordinates, cornerRadius);
+
+    for (const auto&amp; path : paths) {
+        FloatRect pathBoundingRect = path.boundingRect();
+
+        Path translatedPath;
+        AffineTransform transform;
+        transform.translate(-pathBoundingRect.x(), -pathBoundingRect.y());
+        translatedPath.addPath(path, transform);
+
+        FloatRect offsetTextRect = pathBoundingRect;
</ins><span class="cx">         offsetTextRect.move(offset.x, offset.y);
</span><span class="cx"> 
</span><span class="cx">         FloatRect bounceLayerRect = offsetTextRect;
</span><span class="cx">         bounceLayerRect.move(_margin.width, _margin.height);
</span><del>-        bounceLayerRect.inflateX(horizontalBorder);
-        bounceLayerRect.inflateY(verticalBorder);
</del><span class="cx"> 
</span><span class="cx">         RetainPtr&lt;CALayer&gt; bounceLayer = adoptNS([[CALayer alloc] init]);
</span><span class="cx">         [bounceLayer setDelegate:[WebActionDisablingCALayerDelegate shared]];
</span><span class="lines">@@ -242,22 +210,15 @@
</span><span class="cx">         [bounceLayers addObject:bounceLayer.get()];
</span><span class="cx"> 
</span><span class="cx">         FloatRect yellowHighlightRect(FloatPoint(), bounceLayerRect.size());
</span><del>-        // 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 (!_textIndicator-&gt;indicatesCurrentSelection()) {
-            yellowHighlightRect.inflateX(-horizontalBorder);
-            yellowHighlightRect.inflateY(-verticalBorder);
-        }
</del><span class="cx"> 
</span><span class="cx">         RetainPtr&lt;CALayer&gt; dropShadowLayer = adoptNS([[CALayer alloc] init]);
</span><span class="cx">         [dropShadowLayer setDelegate:[WebActionDisablingCALayerDelegate shared]];
</span><span class="cx">         [dropShadowLayer setShadowColor:dropShadowColor.get()];
</span><span class="cx">         [dropShadowLayer setShadowRadius:dropShadowBlurRadius];
</span><span class="cx">         [dropShadowLayer setShadowOffset:CGSizeMake(dropShadowOffsetX, dropShadowOffsetY)];
</span><del>-        [dropShadowLayer setShadowPathIsBounds:YES];
</del><ins>+        [dropShadowLayer setShadowPath:translatedPath.platformPath()];
</ins><span class="cx">         [dropShadowLayer setShadowOpacity:1];
</span><span class="cx">         [dropShadowLayer setFrame:yellowHighlightRect];
</span><del>-        [dropShadowLayer setCornerRadius:cornerRadius];
</del><span class="cx">         [bounceLayer addSublayer:dropShadowLayer.get()];
</span><span class="cx">         [bounceLayer setValue:dropShadowLayer.get() forKey:dropShadowLayerKey];
</span><span class="cx"> 
</span><span class="lines">@@ -267,11 +228,10 @@
</span><span class="cx">         [rimShadowLayer setFrame:yellowHighlightRect];
</span><span class="cx">         [rimShadowLayer setShadowColor:rimShadowColor.get()];
</span><span class="cx">         [rimShadowLayer setShadowRadius:rimShadowBlurRadius];
</span><del>-        [rimShadowLayer setShadowPathIsBounds:YES];
</del><ins>+        [rimShadowLayer setShadowPath:translatedPath.platformPath()];
</ins><span class="cx">         [rimShadowLayer setShadowOffset:CGSizeZero];
</span><span class="cx">         [rimShadowLayer setShadowOpacity:1];
</span><span class="cx">         [rimShadowLayer setFrame:yellowHighlightRect];
</span><del>-        [rimShadowLayer setCornerRadius:cornerRadius];
</del><span class="cx">         [bounceLayer addSublayer:rimShadowLayer.get()];
</span><span class="cx">         [bounceLayer setValue:rimShadowLayer.get() forKey:rimShadowLayerKey];
</span><span class="cx"> #endif
</span><span class="lines">@@ -288,12 +248,15 @@
</span><span class="cx">         [textLayer setDelegate:[WebActionDisablingCALayerDelegate shared]];
</span><span class="cx">         [textLayer setContents:(id)contentsImage.get()];
</span><span class="cx"> 
</span><del>-        FloatRect imageRect = textRect;
</del><ins>+        RetainPtr&lt;CAShapeLayer&gt; maskLayer = adoptNS([[CAShapeLayer alloc] init]);
+        [maskLayer setPath:translatedPath.platformPath()];
+        [textLayer setMask:maskLayer.get()];
+
+        FloatRect imageRect = pathBoundingRect;
</ins><span class="cx">         [textLayer setContentsRect:CGRectMake(imageRect.x() / contentsImageLogicalSize.width(), imageRect.y() / contentsImageLogicalSize.height(), imageRect.width() / contentsImageLogicalSize.width(), imageRect.height() / contentsImageLogicalSize.height())];
</span><span class="cx">         [textLayer setContentsGravity:kCAGravityCenter];
</span><span class="cx">         [textLayer setContentsScale:_textIndicator-&gt;contentImageScaleFactor()];
</span><span class="cx">         [textLayer setFrame:yellowHighlightRect];
</span><del>-        [textLayer setCornerRadius:cornerRadius];
</del><span class="cx">         [bounceLayer setValue:textLayer.get() forKey:textLayerKey];
</span><span class="cx">         [bounceLayer addSublayer:textLayer.get()];
</span><span class="cx">     }
</span><span class="lines">@@ -500,8 +463,8 @@
</span><span class="cx"> 
</span><span class="cx">     m_textIndicator = textIndicator.ptr();
</span><span class="cx"> 
</span><del>-    CGFloat horizontalMargin = dropShadowBlurRadius * 2 + horizontalBorder;
-    CGFloat verticalMargin = dropShadowBlurRadius * 2 + verticalBorder;
</del><ins>+    CGFloat horizontalMargin = dropShadowBlurRadius * 2 + TextIndicator::defaultHorizontalMargin;
+    CGFloat verticalMargin = dropShadowBlurRadius * 2 + TextIndicator::defaultVerticalMargin;
</ins><span class="cx">     
</span><span class="cx">     if (indicatorWantsBounce(*m_textIndicator)) {
</span><span class="cx">         horizontalMargin = std::max(horizontalMargin, textBoundingRectInScreenCoordinates.size.width * (midBounceScale - 1) + horizontalMargin);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsPathUtilitiescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/PathUtilities.cpp (188525 => 188526)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/PathUtilities.cpp        2015-08-17 17:41:44 UTC (rev 188525)
+++ trunk/Source/WebCore/platform/graphics/PathUtilities.cpp        2015-08-17 17:50:09 UTC (rev 188526)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;PathUtilities.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;AffineTransform.h&quot;
</ins><span class="cx"> #include &quot;FloatPoint.h&quot;
</span><span class="cx"> #include &quot;FloatRect.h&quot;
</span><span class="cx"> #include &quot;GeometryUtilities.h&quot;
</span><span class="lines">@@ -254,16 +255,18 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Path PathUtilities::pathWithShrinkWrappedRects(const Vector&lt;FloatRect&gt;&amp; rects, float radius)
</del><ins>+Vector&lt;Path&gt; PathUtilities::pathsWithShrinkWrappedRects(const Vector&lt;FloatRect&gt;&amp; rects, float radius)
</ins><span class="cx"> {
</span><del>-    Path path;
</del><ins>+    Vector&lt;Path&gt; paths;
</ins><span class="cx"> 
</span><span class="cx">     if (rects.isEmpty())
</span><del>-        return path;
</del><ins>+        return paths;
</ins><span class="cx"> 
</span><span class="cx">     if (rects.size() &gt; 20) {
</span><ins>+        Path path;
</ins><span class="cx">         path.addRoundedRect(unionRect(rects), FloatSize(radius, radius));
</span><del>-        return path;
</del><ins>+        paths.append(path);
+        return paths;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     Vector&lt;FloatRect&gt; sortedRects = rects;
</span><span class="lines">@@ -292,11 +295,14 @@
</span><span class="cx">     Vector&lt;FloatPointGraph::Polygon&gt; polys = unitePolygons(rectPolygons, graph);
</span><span class="cx"> 
</span><span class="cx">     if (polys.isEmpty()) {
</span><ins>+        Path path;
</ins><span class="cx">         path.addRoundedRect(unionRect(sortedRects), FloatSize(radius, radius));
</span><del>-        return path;
</del><ins>+        paths.append(path);
+        return paths;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     for (auto&amp; poly : polys) {
</span><ins>+        Path path;
</ins><span class="cx">         for (unsigned i = 0; i &lt; poly.size(); i++) {
</span><span class="cx">             FloatPointGraph::Edge&amp; toEdge = poly[i];
</span><span class="cx">             // Connect the first edge to the last.
</span><span class="lines">@@ -327,9 +333,21 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         path.closeSubpath();
</span><ins>+        paths.append(path);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return path;
</del><ins>+    return paths;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+Path PathUtilities::pathWithShrinkWrappedRects(const Vector&lt;FloatRect&gt;&amp; rects, float radius)
+{
+    Vector&lt;Path&gt; paths = pathsWithShrinkWrappedRects(rects, radius);
+
+    Path unionPath;
+    for (const auto&amp; path : paths)
+        unionPath.addPath(path, AffineTransform());
+
+    return unionPath;
</ins><span class="cx"> }
</span><ins>+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsPathUtilitiesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/PathUtilities.h (188525 => 188526)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/PathUtilities.h        2015-08-17 17:41:44 UTC (rev 188525)
+++ trunk/Source/WebCore/platform/graphics/PathUtilities.h        2015-08-17 17:50:09 UTC (rev 188526)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> class PathUtilities {
</span><span class="cx"> public:
</span><span class="cx">     WEBCORE_EXPORT static Path pathWithShrinkWrappedRects(const Vector&lt;FloatRect&gt;&amp; rects, float radius);
</span><ins>+    WEBCORE_EXPORT static Vector&lt;Path&gt; pathsWithShrinkWrappedRects(const Vector&lt;FloatRect&gt;&amp; rects, float radius);
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (188525 => 188526)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-08-17 17:41:44 UTC (rev 188525)
+++ trunk/Source/WebKit2/ChangeLog        2015-08-17 17:50:09 UTC (rev 188526)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2015-08-17  Timothy Horton  &lt;timothy_horton@apple.com&gt;
+
+        Adopt shrink-wrapping for TextIndicators on Mac
+        https://bugs.webkit.org/show_bug.cgi?id=148064
+
+        Reviewed by Beth Dakin.
+
+        * Shared/WebCoreArgumentCoders.cpp:
+        (IPC::ArgumentCoder&lt;TextIndicatorData&gt;::encode): Deleted.
+        (IPC::ArgumentCoder&lt;TextIndicatorData&gt;::decode): Deleted.
+        * WebProcess/WebPage/FindController.cpp:
+        (WebKit::FindController::updateFindIndicator):
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::getPositionInformation):
+        Use the new option, TextIndicatorOptionIncludeMarginIfRangeMatchesSelection,
+        for iOS and FindController, because we can keep the margins in these cases
+        because we don't have to animate to/from the blue highlight.
+
</ins><span class="cx"> 2015-08-16  Timothy Horton  &lt;timothy_horton@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Refactor ViewGestureController swipe snapshot removal to be more platform-independent
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebCoreArgumentCoderscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp (188525 => 188526)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp        2015-08-17 17:41:44 UTC (rev 188525)
+++ trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp        2015-08-17 17:50:09 UTC (rev 188526)
</span><span class="lines">@@ -2139,7 +2139,6 @@
</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><del>-    encoder &lt;&lt; textIndicatorData.indicatesCurrentSelection;
</del><span class="cx">     encoder.encodeEnum(textIndicatorData.presentationTransition);
</span><span class="cx">     encoder &lt;&lt; static_cast&lt;uint64_t&gt;(textIndicatorData.options);
</span><span class="cx"> 
</span><span class="lines">@@ -2161,9 +2160,6 @@
</span><span class="cx">     if (!decoder.decode(textIndicatorData.contentImageScaleFactor))
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    if (!decoder.decode(textIndicatorData.indicatesCurrentSelection))
-        return false;
-
</del><span class="cx">     if (!decoder.decodeEnum(textIndicatorData.presentationTransition))
</span><span class="cx">         return false;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageFindControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp (188525 => 188526)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp        2015-08-17 17:41:44 UTC (rev 188525)
+++ trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp        2015-08-17 17:50:09 UTC (rev 188526)
</span><span class="lines">@@ -320,7 +320,7 @@
</span><span class="cx"> #if !PLATFORM(IOS)
</span><span class="cx"> bool FindController::updateFindIndicator(Frame&amp; selectedFrame, bool isShowingOverlay, bool shouldAnimate)
</span><span class="cx"> {
</span><del>-    RefPtr&lt;TextIndicator&gt; indicator = TextIndicator::createWithSelectionInFrame(selectedFrame, TextIndicatorOptionDefault, shouldAnimate ? TextIndicatorPresentationTransition::Bounce : TextIndicatorPresentationTransition::None);
</del><ins>+    RefPtr&lt;TextIndicator&gt; indicator = TextIndicator::createWithSelectionInFrame(selectedFrame, TextIndicatorOptionIncludeMarginIfRangeMatchesSelection, shouldAnimate ? TextIndicatorPresentationTransition::Bounce : TextIndicatorPresentationTransition::None);
</ins><span class="cx">     if (!indicator)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (188525 => 188526)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2015-08-17 17:41:44 UTC (rev 188525)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2015-08-17 17:50:09 UTC (rev 188526)
</span><span class="lines">@@ -2195,13 +2195,13 @@
</span><span class="cx">                     if (RefPtr&lt;WebImage&gt; snapshot = snapshotNode(*element, SnapshotOptionsShareable, 600 * 1024))
</span><span class="cx">                         info.image = snapshot-&gt;bitmap();
</span><span class="cx"> 
</span><del>-
</del><span class="cx">                     RefPtr&lt;Range&gt; linkRange = rangeOfContents(*linkElement);
</span><span class="cx">                     if (linkRange) {
</span><span class="cx">                         float deviceScaleFactor = corePage()-&gt;deviceScaleFactor();
</span><span class="cx">                         const float marginInPoints = 4;
</span><span class="cx"> 
</span><del>-                        RefPtr&lt;TextIndicator&gt; textIndicator = TextIndicator::createWithRange(*linkRange, TextIndicatorOptionTightlyFitContent | TextIndicatorOptionRespectTextColor | TextIndicatorOptionPaintBackgrounds | TextIndicatorOptionUseBoundingRectAndPaintAllContentForComplexRanges, TextIndicatorPresentationTransition::None, marginInPoints * deviceScaleFactor);
</del><ins>+                        RefPtr&lt;TextIndicator&gt; textIndicator = TextIndicator::createWithRange(*linkRange, TextIndicatorOptionTightlyFitContent | TextIndicatorOptionRespectTextColor | TextIndicatorOptionPaintBackgrounds | TextIndicatorOptionUseBoundingRectAndPaintAllContentForComplexRanges |
+                            TextIndicatorOptionIncludeMarginIfRangeMatchesSelection, TextIndicatorPresentationTransition::None, FloatSize(marginInPoints * deviceScaleFactor, marginInPoints * deviceScaleFactor));
</ins><span class="cx">                         if (textIndicator)
</span><span class="cx">                             info.linkIndicator = textIndicator-&gt;data();
</span><span class="cx">                     }
</span></span></pre>
</div>
</div>

</body>
</html>