<!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>[188420] 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/188420">188420</a></dd>
<dt>Author</dt> <dd>timothy_horton@apple.com</dd>
<dt>Date</dt> <dd>2015-08-13 17:06:28 -0700 (Thu, 13 Aug 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Refactor and improve TextIndicator to prepare for tests
https://bugs.webkit.org/show_bug.cgi?id=147622

Reviewed by Simon Fraser.

No new tests because they're coming soon!

* page/TextIndicator.cpp:
(WebCore::TextIndicator::TextIndicator):
(WebCore::TextIndicator::~TextIndicator):
(WebCore::TextIndicator::createWithRange):
(WebCore::TextIndicator::createWithSelectionInFrame):
(WebCore::hasNonInlineOrReplacedElements):
(WebCore::snapshotOptionsForTextIndicatorOptions):
(WebCore::takeSnapshot):
(WebCore::takeSnapshots):
(WebCore::initializeIndicator):
(WebCore::snapshotSelectionWithHighlight): Deleted.
(WebCore::TextIndicator::wantsBounce): Deleted.
(WebCore::TextIndicator::wantsContentCrossfade): Deleted.
(WebCore::TextIndicator::wantsFadeIn): Deleted.
(WebCore::TextIndicator::wantsManualAnimation): Deleted.
* page/TextIndicator.h:
(WebCore::TextIndicator::indicatesCurrentSelection):
(WebCore::TextIndicator::setWantsMargin): Deleted.
(WebCore::TextIndicator::wantsMargin): Deleted.
Rename wantsMargin to indicatesCurrentSelection. It's really about whether
the TextIndicator indicates the existing selection, and the Mac presentation
just uses that to determine whether or not to show a margin, but that
margin has nothing to do with the cross-platform TextIndicator code.

Move most of the snapshotting and rect gathering code to initializeTextIndicator, and call it
from both ::createWithRange and ::createWithSelectionInFrame, instead of calling
::createWithSelectionInFrame from ::createWithRange after setting the selection.
This way, the range passed into ::createWithRange is preserved for use in initializeTextIndicator,
instead of round-tripping through selection code, which can change it (e.g. in the case
of user-select: none; elements).

Add TextIndicatorOptions, which allow callers to adjust the behavior of TextIndicator
instead of having #if PLATFORM(X) strewn throughout TextIndicator.

Add an option which was previously implemented at the iOS-specific callsites,
TextIndicatorOptionUseBoundingRectAndPaintAllContentForComplexRanges,
which falls back to indicating a bounding rect and not doing a range-only paint
if the given range includes any non-inline elements or any replaced elements.
This makes it so that we do something reasonable-looking for very complex ranges,
like article links on the New York Times, which include multiple disparate paragraphs
of text and one or more images, and also so that indicating a range that only
includes an image does something fairly reasonable.

Move presentation-specific functions (wantsBounce, wantsContentCrossfade, etc.)
to TextIndicatorWindow. Ideally TextIndicatorPresentationTransition would also move,
but that is a fairly large and complicated change that should be made separately.

* page/mac/TextIndicatorWindow.h:
* page/mac/TextIndicatorWindow.mm:
(indicatorWantsBounce):
(indicatorWantsContentCrossfade):
(indicatorWantsFadeIn):
(indicatorWantsManualAnimation):
(-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]):
(-[WebTextIndicatorView _animationDuration]):
(-[WebTextIndicatorView present]):
(WebCore::TextIndicatorWindow::~TextIndicatorWindow):
(WebCore::TextIndicatorWindow::clearTextIndicator):
(WebCore::TextIndicatorWindow::setTextIndicator):
Rename TextIndicatorDismissalAnimation to TextIndicatorWindowDismissalAnimation,
and TextIndicatorLifetime to TextIndicatorWindowLifetime, because
they are TextIndicatorWindow specific.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::boundsForVisiblePositionRange):
* bindings/objc/DOM.mm:
(-[DOMNode getPreviewSnapshotImage:andRects:]):
(-[DOMRange boundingBox]):
(-[DOMRange textRects]):
* dom/DocumentMarkerController.cpp:
(WebCore::DocumentMarkerController::addTextMatchMarker):
* dom/Node.cpp:
(WebCore::Node::textRects):
* dom/Range.cpp:
(WebCore::Range::intersectsNode):
(WebCore::Range::absoluteBoundingBox):
(WebCore::Range::absoluteTextRects):
(WebCore::Range::absoluteTextQuads):
(WebCore::Range::getClientRects):
(WebCore::Range::getBoundingClientRect):
(WebCore::Range::getBorderAndTextQuads):
(WebCore::Range::boundingRectInternal):
(WebCore::Range::absoluteBoundingRect):
(WebCore::Range::boundingBox): Deleted.
(WebCore::Range::textRects): Deleted.
(WebCore::Range::textQuads): Deleted.
(WebCore::Range::boundingRect): Deleted.
* dom/Range.h:
* editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::rootViewRectForRange):
* editing/Editor.cpp:
(WebCore::Editor::findStringAndScrollToVisible):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::getClippedVisibleTextRectangles):
* editing/mac/DataDetection.mm:
(WebCore::DataDetection::detectItemAroundHitTestResult):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::absoluteBoundingBoxRectForRange):
Rename various Range methods to make it clear whether they return absolute or client rects.

* WebView/WebFrame.mm:
(-[WebFrame _rectsForRange:]):
* WebView/WebHTMLView.mm:
(-[WebHTMLView _lookUpInDictionaryFromMenu:]):
(-[WebHTMLView quickLookWithEvent:]):
* WebView/WebImmediateActionController.mm:
(-[WebImmediateActionController webView:didHandleScrollWheel:]):
(-[WebImmediateActionController _cancelImmediateAction]):
(-[WebImmediateActionController immediateActionRecognizerDidCancelAnimation:]):
(-[WebImmediateActionController _defaultAnimationController]):
(-[WebImmediateActionController menuItemDidClose:]):
(-[WebImmediateActionController _animationControllerForDataDetectedText]):
(-[WebImmediateActionController _animationControllerForDataDetectedLink]):
(dictionaryPopupInfoForRange):
* WebView/WebView.mm:
(-[WebView _animationControllerForDictionaryLookupPopupInfo:]):
(-[WebView _setTextIndicator:]):
(-[WebView _setTextIndicator:withLifetime:]):
(-[WebView _clearTextIndicatorWithAnimation:]):
(-[WebView _showDictionaryLookupPopup:]):
(-[WebView _dictionaryLookupPopoverWillClose:]):
* WebView/WebViewInternal.h:
Adopt TextIndicatorOptions.
Adjust to Range method renames.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::encodeOptionalImage):
(IPC::decodeOptionalImage):
(IPC::ArgumentCoder&lt;TextIndicatorData&gt;::encode):
(IPC::ArgumentCoder&lt;TextIndicatorData&gt;::decode):
Move encode/decodeOptionalImage to their own functions to avoid duplication.

* UIProcess/API/mac/WKView.mm:
(-[WKView _dictionaryLookupPopoverWillClose:]):
(-[WKView _setTextIndicator:]):
(-[WKView _setTextIndicator:withLifetime:]):
(-[WKView _clearTextIndicatorWithAnimation:]):
(-[WKView _dismissContentRelativeChildWindows]):
(-[WKView _dismissContentRelativeChildWindowsWithAnimation:]):
* UIProcess/API/mac/WKViewInternal.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setTextIndicator):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::setTextIndicator):
(WebKit::PageClientImpl::clearTextIndicator):
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::setTextIndicator):
(WebKit::PageClientImpl::clearTextIndicator):
(WebKit::PageClientImpl::didPerformDictionaryLookup):
* UIProcess/mac/WKImmediateActionController.mm:
(-[WKImmediateActionController _animationControllerForText]):
* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::updateFindIndicator):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getPositionInformation):
(WebKit::shouldUseTextIndicatorForLink): Deleted.
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::dictionaryPopupInfoForRange):
(WebKit::WebPage::performImmediateActionHitTestAtLocation):
Adopt TextIndicatorOptions.
Adjust to Range method renames.

* WebCoreSupport/WebFrameIOS.mm:
(-[WebFrame closestCaretRectInMarkedTextRangeForPoint:]):
Adjust to Range method renames.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityAccessibilityRenderObjectcpp">trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsobjcDOMmm">trunk/Source/WebCore/bindings/objc/DOM.mm</a></li>
<li><a href="#trunkSourceWebCoredomDocumentMarkerControllercpp">trunk/Source/WebCore/dom/DocumentMarkerController.cpp</a></li>
<li><a href="#trunkSourceWebCoredomNodecpp">trunk/Source/WebCore/dom/Node.cpp</a></li>
<li><a href="#trunkSourceWebCoredomRangecpp">trunk/Source/WebCore/dom/Range.cpp</a></li>
<li><a href="#trunkSourceWebCoredomRangeh">trunk/Source/WebCore/dom/Range.h</a></li>
<li><a href="#trunkSourceWebCoreeditingAlternativeTextControllercpp">trunk/Source/WebCore/editing/AlternativeTextController.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingEditorcpp">trunk/Source/WebCore/editing/Editor.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingFrameSelectioncpp">trunk/Source/WebCore/editing/FrameSelection.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingmacDataDetectionmm">trunk/Source/WebCore/editing/mac/DataDetection.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="#trunkSourceWebCorepagemacServicesOverlayControllermm">trunk/Source/WebCore/page/mac/ServicesOverlayController.mm</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="#trunkSourceWebCorerenderingRenderObjectcpp">trunk/Source/WebCore/rendering/RenderObject.cpp</a></li>
<li><a href="#trunkSourceWebKitiosChangeLog">trunk/Source/WebKit/ios/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitiosWebCoreSupportWebFrameIOSmm">trunk/Source/WebKit/ios/WebCoreSupport/WebFrameIOS.mm</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebFramemm">trunk/Source/WebKit/mac/WebView/WebFrame.mm</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebHTMLViewmm">trunk/Source/WebKit/mac/WebView/WebHTMLView.mm</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebImmediateActionControllermm">trunk/Source/WebKit/mac/WebView/WebImmediateActionController.mm</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebViewmm">trunk/Source/WebKit/mac/WebView/WebView.mm</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebViewInternalh">trunk/Source/WebKit/mac/WebView/WebViewInternal.h</a></li>
<li><a href="#trunkSourceWebKitwinAccessibleTextImplcpp">trunk/Source/WebKit/win/AccessibleTextImpl.cpp</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="#trunkSourceWebKit2UIProcessAPIgtkPageClientImplcpp">trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkPageClientImplh">trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.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="#trunkSourceWebKit2UIProcessCoordinatedGraphicsWebViewcpp">trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCoordinatedGraphicsWebViewh">trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.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="#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="#trunkSourceWebKit2UIProcessmacWKImmediateActionControllermm">trunk/Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPImacWKDOMRangemm">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMRange.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleDOMInjectedBundleRangeHandlecpp">trunk/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.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>
<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 (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebCore/ChangeLog        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -1,3 +1,112 @@
</span><ins>+2015-08-13  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+        Refactor and improve TextIndicator to prepare for tests
+        https://bugs.webkit.org/show_bug.cgi?id=147622
+
+        Reviewed by Simon Fraser.
+
+        No new tests because they're coming soon!
+
+        * page/TextIndicator.cpp:
+        (WebCore::TextIndicator::TextIndicator):
+        (WebCore::TextIndicator::~TextIndicator):
+        (WebCore::TextIndicator::createWithRange):
+        (WebCore::TextIndicator::createWithSelectionInFrame):
+        (WebCore::hasNonInlineOrReplacedElements):
+        (WebCore::snapshotOptionsForTextIndicatorOptions):
+        (WebCore::takeSnapshot):
+        (WebCore::takeSnapshots):
+        (WebCore::initializeIndicator):
+        (WebCore::snapshotSelectionWithHighlight): Deleted.
+        (WebCore::TextIndicator::wantsBounce): Deleted.
+        (WebCore::TextIndicator::wantsContentCrossfade): Deleted.
+        (WebCore::TextIndicator::wantsFadeIn): Deleted.
+        (WebCore::TextIndicator::wantsManualAnimation): Deleted.
+        * page/TextIndicator.h:
+        (WebCore::TextIndicator::indicatesCurrentSelection):
+        (WebCore::TextIndicator::setWantsMargin): Deleted.
+        (WebCore::TextIndicator::wantsMargin): Deleted.
+        Rename wantsMargin to indicatesCurrentSelection. It's really about whether
+        the TextIndicator indicates the existing selection, and the Mac presentation
+        just uses that to determine whether or not to show a margin, but that
+        margin has nothing to do with the cross-platform TextIndicator code.
+
+        Move most of the snapshotting and rect gathering code to initializeTextIndicator, and call it
+        from both ::createWithRange and ::createWithSelectionInFrame, instead of calling
+        ::createWithSelectionInFrame from ::createWithRange after setting the selection.
+        This way, the range passed into ::createWithRange is preserved for use in initializeTextIndicator,
+        instead of round-tripping through selection code, which can change it (e.g. in the case
+        of user-select: none; elements).
+
+        Add TextIndicatorOptions, which allow callers to adjust the behavior of TextIndicator
+        instead of having #if PLATFORM(X) strewn throughout TextIndicator.
+
+        Add an option which was previously implemented at the iOS-specific callsites,
+        TextIndicatorOptionUseBoundingRectAndPaintAllContentForComplexRanges,
+        which falls back to indicating a bounding rect and not doing a range-only paint
+        if the given range includes any non-inline elements or any replaced elements.
+        This makes it so that we do something reasonable-looking for very complex ranges,
+        like article links on the New York Times, which include multiple disparate paragraphs
+        of text and one or more images, and also so that indicating a range that only
+        includes an image does something fairly reasonable.
+
+        Move presentation-specific functions (wantsBounce, wantsContentCrossfade, etc.)
+        to TextIndicatorWindow. Ideally TextIndicatorPresentationTransition would also move,
+        but that is a fairly large and complicated change that should be made separately.
+
+        * page/mac/TextIndicatorWindow.h:
+        * page/mac/TextIndicatorWindow.mm:
+        (indicatorWantsBounce):
+        (indicatorWantsContentCrossfade):
+        (indicatorWantsFadeIn):
+        (indicatorWantsManualAnimation):
+        (-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]):
+        (-[WebTextIndicatorView _animationDuration]):
+        (-[WebTextIndicatorView present]):
+        (WebCore::TextIndicatorWindow::~TextIndicatorWindow):
+        (WebCore::TextIndicatorWindow::clearTextIndicator):
+        (WebCore::TextIndicatorWindow::setTextIndicator):
+        Rename TextIndicatorDismissalAnimation to TextIndicatorWindowDismissalAnimation,
+        and TextIndicatorLifetime to TextIndicatorWindowLifetime, because
+        they are TextIndicatorWindow specific.
+
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::boundsForVisiblePositionRange):
+        * bindings/objc/DOM.mm:
+        (-[DOMNode getPreviewSnapshotImage:andRects:]):
+        (-[DOMRange boundingBox]):
+        (-[DOMRange textRects]):
+        * dom/DocumentMarkerController.cpp:
+        (WebCore::DocumentMarkerController::addTextMatchMarker):
+        * dom/Node.cpp:
+        (WebCore::Node::textRects):
+        * dom/Range.cpp:
+        (WebCore::Range::intersectsNode):
+        (WebCore::Range::absoluteBoundingBox):
+        (WebCore::Range::absoluteTextRects):
+        (WebCore::Range::absoluteTextQuads):
+        (WebCore::Range::getClientRects):
+        (WebCore::Range::getBoundingClientRect):
+        (WebCore::Range::getBorderAndTextQuads):
+        (WebCore::Range::boundingRectInternal):
+        (WebCore::Range::absoluteBoundingRect):
+        (WebCore::Range::boundingBox): Deleted.
+        (WebCore::Range::textRects): Deleted.
+        (WebCore::Range::textQuads): Deleted.
+        (WebCore::Range::boundingRect): Deleted.
+        * dom/Range.h:
+        * editing/AlternativeTextController.cpp:
+        (WebCore::AlternativeTextController::rootViewRectForRange):
+        * editing/Editor.cpp:
+        (WebCore::Editor::findStringAndScrollToVisible):
+        * editing/FrameSelection.cpp:
+        (WebCore::FrameSelection::getClippedVisibleTextRectangles):
+        * editing/mac/DataDetection.mm:
+        (WebCore::DataDetection::detectItemAroundHitTestResult):
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::absoluteBoundingBoxRectForRange):
+        Rename various Range methods to make it clear whether they return absolute or client rects.
+
</ins><span class="cx"> 2015-08-13  Jer Noble  &lt;jer.noble@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Don't short circuit seeking
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityAccessibilityRenderObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -1987,7 +1987,7 @@
</span><span class="cx">     // if the rectangle spans lines and contains multiple text chars, use the range's bounding box intead
</span><span class="cx">     if (rect1.maxY() != rect2.maxY()) {
</span><span class="cx">         RefPtr&lt;Range&gt; dataRange = makeRange(range.start, range.end);
</span><del>-        LayoutRect boundingBox = dataRange-&gt;boundingBox();
</del><ins>+        LayoutRect boundingBox = dataRange-&gt;absoluteBoundingBox();
</ins><span class="cx">         String rangeString = plainText(dataRange.get());
</span><span class="cx">         if (rangeString.length() &gt; 1 &amp;&amp; !boundingBox.isEmpty())
</span><span class="cx">             ourrect = boundingBox;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsobjcDOMmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/objc/DOM.mm (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/objc/DOM.mm        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebCore/bindings/objc/DOM.mm        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -596,7 +596,7 @@
</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, TextIndicatorPresentationTransition::None, margin);
</del><ins>+    RefPtr&lt;TextIndicator&gt; textIndicator = TextIndicator::createWithRange(range, TextIndicatorOptionDefault, TextIndicatorPresentationTransition::None, margin);
</ins><span class="cx"> 
</span><span class="cx">     if (textIndicator) {
</span><span class="cx">         if (Image* image = textIndicator-&gt;contentImage())
</span><span class="lines">@@ -647,7 +647,7 @@
</span><span class="cx"> {
</span><span class="cx">     // FIXME: The call to updateLayoutIgnorePendingStylesheets should be moved into WebCore::Range.
</span><span class="cx">     core(self)-&gt;ownerDocument().updateLayoutIgnorePendingStylesheets();
</span><del>-    return core(self)-&gt;boundingBox();
</del><ins>+    return core(self)-&gt;absoluteBoundingBox();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if !PLATFORM(IOS)
</span><span class="lines">@@ -680,7 +680,7 @@
</span><span class="cx">     // FIXME: The call to updateLayoutIgnorePendingStylesheets should be moved into WebCore::Range.
</span><span class="cx">     Vector&lt;WebCore::IntRect&gt; rects;
</span><span class="cx">     core(self)-&gt;ownerDocument().updateLayoutIgnorePendingStylesheets();
</span><del>-    core(self)-&gt;textRects(rects);
</del><ins>+    core(self)-&gt;absoluteTextRects(rects);
</ins><span class="cx">     return kit(rects);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentMarkerControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/DocumentMarkerController.cpp (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DocumentMarkerController.cpp        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebCore/dom/DocumentMarkerController.cpp        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -102,7 +102,7 @@
</span><span class="cx">             // matches off-screen are (that haven't been painted yet).
</span><span class="cx">             Node* node = textPiece-&gt;startContainer();
</span><span class="cx">             Vector&lt;RenderedDocumentMarker*&gt; markers = markersFor(node);
</span><del>-            markers[markers.size() - 1]-&gt;setRenderedRect(range-&gt;boundingBox());
</del><ins>+            markers[markers.size() - 1]-&gt;setRenderedRect(range-&gt;absoluteBoundingBox());
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoredomNodecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Node.cpp (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Node.cpp        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebCore/dom/Node.cpp        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -2283,7 +2283,7 @@
</span><span class="cx"> {
</span><span class="cx">     RefPtr&lt;Range&gt; range = Range::create(document());
</span><span class="cx">     range-&gt;selectNodeContents(const_cast&lt;Node*&gt;(this), IGNORE_EXCEPTION);
</span><del>-    range-&gt;textRects(rects);
</del><ins>+    range-&gt;absoluteTextRects(rects);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> unsigned Node::connectedSubframeCount() const
</span></span></pre></div>
<a id="trunkSourceWebCoredomRangecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Range.cpp (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Range.cpp        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebCore/dom/Range.cpp        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -575,7 +575,7 @@
</span><span class="cx">     processContents(Delete, ec);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool Range::intersectsNode(Node* refNode, ExceptionCode&amp; ec)
</del><ins>+bool Range::intersectsNode(Node* refNode, ExceptionCode&amp; ec) const
</ins><span class="cx"> {
</span><span class="cx">     // http://developer.mozilla.org/en/docs/DOM:range.intersectsNode
</span><span class="cx">     // Returns a bool if the node intersects the range.
</span><span class="lines">@@ -1573,18 +1573,18 @@
</span><span class="cx">     return NodeTraversal::nextSkippingChildren(*m_end.container());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-IntRect Range::boundingBox() const
</del><ins>+IntRect Range::absoluteBoundingBox() const
</ins><span class="cx"> {
</span><span class="cx">     IntRect result;
</span><span class="cx">     Vector&lt;IntRect&gt; rects;
</span><del>-    textRects(rects);
</del><ins>+    absoluteTextRects(rects);
</ins><span class="cx">     const size_t n = rects.size();
</span><span class="cx">     for (size_t i = 0; i &lt; n; ++i)
</span><span class="cx">         result.unite(rects[i]);
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Range::textRects(Vector&lt;IntRect&gt;&amp; rects, bool useSelectionHeight, RangeInFixedPosition* inFixed) const
</del><ins>+void Range::absoluteTextRects(Vector&lt;IntRect&gt;&amp; rects, bool useSelectionHeight, RangeInFixedPosition* inFixed) const
</ins><span class="cx"> {
</span><span class="cx">     Node* startContainer = m_start.container();
</span><span class="cx">     Node* endContainer = m_end.container();
</span><span class="lines">@@ -1620,7 +1620,7 @@
</span><span class="cx">         *inFixed = allFixed ? EntirelyFixedPosition : (someFixed ? PartiallyFixedPosition : NotFixedPosition);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Range::textQuads(Vector&lt;FloatQuad&gt;&amp; quads, bool useSelectionHeight, RangeInFixedPosition* inFixed) const
</del><ins>+void Range::absoluteTextQuads(Vector&lt;FloatQuad&gt;&amp; quads, bool useSelectionHeight, RangeInFixedPosition* inFixed) const
</ins><span class="cx"> {
</span><span class="cx">     Node* startContainer = m_start.container();
</span><span class="cx">     Node* endContainer = m_end.container();
</span><span class="lines">@@ -2181,17 +2181,17 @@
</span><span class="cx">     ownerDocument().updateLayoutIgnorePendingStylesheets();
</span><span class="cx"> 
</span><span class="cx">     Vector&lt;FloatQuad&gt; quads;
</span><del>-    getBorderAndTextQuads(quads);
</del><ins>+    getBorderAndTextQuads(quads, CoordinateSpace::Client);
</ins><span class="cx"> 
</span><span class="cx">     return ClientRectList::create(quads);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Ref&lt;ClientRect&gt; Range::getBoundingClientRect() const
</span><span class="cx"> {
</span><del>-    return ClientRect::create(boundingRect());
</del><ins>+    return ClientRect::create(boundingRectInternal(CoordinateSpace::Client));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Range::getBorderAndTextQuads(Vector&lt;FloatQuad&gt;&amp; quads) const
</del><ins>+void Range::getBorderAndTextQuads(Vector&lt;FloatQuad&gt;&amp; quads, CoordinateSpace space) const
</ins><span class="cx"> {
</span><span class="cx">     Node* startContainer = m_start.container();
</span><span class="cx">     Node* endContainer = m_end.container();
</span><span class="lines">@@ -2213,8 +2213,10 @@
</span><span class="cx">             if (RenderBoxModelObject* renderBoxModelObject = downcast&lt;Element&gt;(*node).renderBoxModelObject()) {
</span><span class="cx">                 Vector&lt;FloatQuad&gt; elementQuads;
</span><span class="cx">                 renderBoxModelObject-&gt;absoluteQuads(elementQuads);
</span><del>-                ownerDocument().adjustFloatQuadsForScrollAndAbsoluteZoomAndFrameScale(elementQuads, renderBoxModelObject-&gt;style());
</del><span class="cx"> 
</span><ins>+                if (space == CoordinateSpace::Client)
+                    ownerDocument().adjustFloatQuadsForScrollAndAbsoluteZoomAndFrameScale(elementQuads, renderBoxModelObject-&gt;style());
+
</ins><span class="cx">                 quads.appendVector(elementQuads);
</span><span class="cx">             }
</span><span class="cx">         } else if (is&lt;Text&gt;(*node)) {
</span><span class="lines">@@ -2223,15 +2225,17 @@
</span><span class="cx">                 int endOffset = (node == endContainer) ? m_end.offset() : INT_MAX;
</span><span class="cx">                 
</span><span class="cx">                 auto textQuads = renderText-&gt;absoluteQuadsForRange(startOffset, endOffset);
</span><del>-                ownerDocument().adjustFloatQuadsForScrollAndAbsoluteZoomAndFrameScale(textQuads, renderText-&gt;style());
</del><span class="cx"> 
</span><ins>+                if (space == CoordinateSpace::Client)
+                    ownerDocument().adjustFloatQuadsForScrollAndAbsoluteZoomAndFrameScale(textQuads, renderText-&gt;style());
+
</ins><span class="cx">                 quads.appendVector(textQuads);
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-FloatRect Range::boundingRect() const
</del><ins>+FloatRect Range::boundingRectInternal(CoordinateSpace space) const
</ins><span class="cx"> {
</span><span class="cx">     if (!m_start.container())
</span><span class="cx">         return FloatRect();
</span><span class="lines">@@ -2239,7 +2243,7 @@
</span><span class="cx">     ownerDocument().updateLayoutIgnorePendingStylesheets();
</span><span class="cx"> 
</span><span class="cx">     Vector&lt;FloatQuad&gt; quads;
</span><del>-    getBorderAndTextQuads(quads);
</del><ins>+    getBorderAndTextQuads(quads, space);
</ins><span class="cx">     if (quads.isEmpty())
</span><span class="cx">         return FloatRect();
</span><span class="cx"> 
</span><span class="lines">@@ -2250,6 +2254,11 @@
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+FloatRect Range::absoluteBoundingRect() const
+{
+    return boundingRectInternal(CoordinateSpace::Absolute);
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(TREE_DEBUGGING)
</span></span></pre></div>
<a id="trunkSourceWebCoredomRangeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Range.h (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Range.h        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebCore/dom/Range.h        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -83,7 +83,7 @@
</span><span class="cx">     static short compareBoundaryPoints(Node* containerA, int offsetA, Node* containerB, int offsetB, ExceptionCode&amp;);
</span><span class="cx">     static short compareBoundaryPoints(const RangeBoundaryPoint&amp; boundaryA, const RangeBoundaryPoint&amp; boundaryB, ExceptionCode&amp;);
</span><span class="cx">     WEBCORE_EXPORT bool boundaryPointsValid() const;
</span><del>-    bool intersectsNode(Node* refNode, ExceptionCode&amp;);
</del><ins>+    bool intersectsNode(Node* refNode, ExceptionCode&amp;) const;
</ins><span class="cx">     void deleteContents(ExceptionCode&amp;);
</span><span class="cx">     PassRefPtr&lt;DocumentFragment&gt; extractContents(ExceptionCode&amp;);
</span><span class="cx">     PassRefPtr&lt;DocumentFragment&gt; cloneContents(ExceptionCode&amp;);
</span><span class="lines">@@ -123,13 +123,12 @@
</span><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     // Not transform-friendly
</span><del>-    WEBCORE_EXPORT void textRects(Vector&lt;IntRect&gt;&amp;, bool useSelectionHeight = false, RangeInFixedPosition* = nullptr) const;
-    WEBCORE_EXPORT IntRect boundingBox() const;
</del><ins>+    WEBCORE_EXPORT void absoluteTextRects(Vector&lt;IntRect&gt;&amp;, bool useSelectionHeight = false, RangeInFixedPosition* = nullptr) const;
+    WEBCORE_EXPORT IntRect absoluteBoundingBox() const;
</ins><span class="cx"> 
</span><span class="cx">     // Transform-friendly
</span><del>-    WEBCORE_EXPORT void textQuads(Vector&lt;FloatQuad&gt;&amp;, bool useSelectionHeight = false, RangeInFixedPosition* = nullptr) const;
-    void getBorderAndTextQuads(Vector&lt;FloatQuad&gt;&amp;) const;
-    WEBCORE_EXPORT FloatRect boundingRect() const;
</del><ins>+    WEBCORE_EXPORT void absoluteTextQuads(Vector&lt;FloatQuad&gt;&amp;, bool useSelectionHeight = false, RangeInFixedPosition* = nullptr) const;
+    WEBCORE_EXPORT FloatRect absoluteBoundingRect() const;
</ins><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     WEBCORE_EXPORT void collectSelectionRects(Vector&lt;SelectionRect&gt;&amp;);
</span><span class="cx"> #endif
</span><span class="lines">@@ -175,6 +174,10 @@
</span><span class="cx">     enum ContentsProcessDirection { ProcessContentsForward, ProcessContentsBackward };
</span><span class="cx">     static PassRefPtr&lt;Node&gt; processAncestorsAndTheirSiblings(ActionType, Node* container, ContentsProcessDirection, PassRefPtr&lt;Node&gt; clonedContainer, Node* commonRoot, ExceptionCode&amp;);
</span><span class="cx"> 
</span><ins>+    enum class CoordinateSpace { Absolute, Client };
+    void getBorderAndTextQuads(Vector&lt;FloatQuad&gt;&amp;, CoordinateSpace) const;
+    FloatRect boundingRectInternal(CoordinateSpace) const;
+
</ins><span class="cx">     Ref&lt;Document&gt; m_ownerDocument;
</span><span class="cx">     RangeBoundaryPoint m_start;
</span><span class="cx">     RangeBoundaryPoint m_end;
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingAlternativeTextControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/AlternativeTextController.cpp (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/AlternativeTextController.cpp        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebCore/editing/AlternativeTextController.cpp        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -436,7 +436,7 @@
</span><span class="cx">     if (!view)
</span><span class="cx">         return FloatRect();
</span><span class="cx">     Vector&lt;FloatQuad&gt; textQuads;
</span><del>-    range-&gt;textQuads(textQuads);
</del><ins>+    range-&gt;absoluteTextQuads(textQuads);
</ins><span class="cx">     FloatRect boundingRect;
</span><span class="cx">     size_t size = textQuads.size();
</span><span class="cx">     for (size_t i = 0; i &lt; size; ++i)
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/Editor.cpp (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/Editor.cpp        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebCore/editing/Editor.cpp        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -3093,7 +3093,7 @@
</span><span class="cx">     if (!nextMatch)
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><del>-    nextMatch-&gt;firstNode()-&gt;renderer()-&gt;scrollRectToVisible(nextMatch-&gt;boundingBox(),
</del><ins>+    nextMatch-&gt;firstNode()-&gt;renderer()-&gt;scrollRectToVisible(nextMatch-&gt;absoluteBoundingBox(),
</ins><span class="cx">         ScrollAlignment::alignCenterIfNeeded, ScrollAlignment::alignCenterIfNeeded);
</span><span class="cx"> 
</span><span class="cx">     return nextMatch.release();
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingFrameSelectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/FrameSelection.cpp (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/FrameSelection.cpp        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebCore/editing/FrameSelection.cpp        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -2088,7 +2088,7 @@
</span><span class="cx">     FloatRect visibleContentRect = m_frame-&gt;view()-&gt;visibleContentRect(ScrollableArea::LegacyIOSDocumentVisibleRect);
</span><span class="cx"> 
</span><span class="cx">     Vector&lt;FloatQuad&gt; quads;
</span><del>-    range-&gt;textQuads(quads, textRectHeight == TextRectangleHeight::SelectionHeight);
</del><ins>+    range-&gt;absoluteTextQuads(quads, textRectHeight == TextRectangleHeight::SelectionHeight);
</ins><span class="cx"> 
</span><span class="cx">     size_t size = quads.size();
</span><span class="cx">     for (size_t i = 0; i &lt; size; ++i) {
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingmacDataDetectionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/mac/DataDetection.mm (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/mac/DataDetection.mm        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebCore/editing/mac/DataDetection.mm        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -93,7 +93,7 @@
</span><span class="cx">     [actionContext setMainResult:mainResult];
</span><span class="cx"> 
</span><span class="cx">     Vector&lt;FloatQuad&gt; quads;
</span><del>-    mainResultRange-&gt;textQuads(quads);
</del><ins>+    mainResultRange-&gt;absoluteTextQuads(quads);
</ins><span class="cx">     detectedDataBoundingBox = FloatRect();
</span><span class="cx">     FrameView* frameView = mainResultRange-&gt;ownerDocument().view();
</span><span class="cx">     for (const auto&amp; quad : quads)
</span></span></pre></div>
<a id="trunkSourceWebCorepageTextIndicatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/TextIndicator.cpp (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/TextIndicator.cpp        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebCore/page/TextIndicator.cpp        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Document.h&quot;
</span><span class="cx"> #include &quot;Editor.h&quot;
</span><ins>+#include &quot;Element.h&quot;
</ins><span class="cx"> #include &quot;Frame.h&quot;
</span><span class="cx"> #include &quot;FrameSelection.h&quot;
</span><span class="cx"> #include &quot;FrameSnapshotting.h&quot;
</span><span class="lines">@@ -36,19 +37,32 @@
</span><span class="cx"> #include &quot;GraphicsContext.h&quot;
</span><span class="cx"> #include &quot;ImageBuffer.h&quot;
</span><span class="cx"> #include &quot;IntRect.h&quot;
</span><ins>+#include &quot;NodeTraversal.h&quot;
</ins><span class="cx"> #include &quot;Page.h&quot;
</span><span class="cx"> #include &quot;Range.h&quot;
</span><ins>+#include &quot;RenderObject.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+static bool initializeIndicator(TextIndicatorData&amp;, Frame&amp;, const Range&amp;, unsigned margin);
+
+TextIndicator::TextIndicator(const TextIndicatorData&amp; data)
+    : m_data(data)
+{
+}
+
+TextIndicator::~TextIndicator()
+{
+}
+
</ins><span class="cx"> Ref&lt;TextIndicator&gt; TextIndicator::create(const TextIndicatorData&amp; data)
</span><span class="cx"> {
</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, TextIndicatorPresentationTransition presentationTransition, unsigned margin)
</del><ins>+RefPtr&lt;TextIndicator&gt; TextIndicator::createWithRange(const Range&amp; range, TextIndicatorOptions options, TextIndicatorPresentationTransition presentationTransition, unsigned margin)
</ins><span class="cx"> {
</span><span class="cx">     Frame* frame = range.startContainer()-&gt;document().frame();
</span><span class="cx"> 
</span><span class="lines">@@ -63,68 +77,133 @@
</span><span class="cx">     VisibleSelection oldSelection = frame-&gt;selection().selection();
</span><span class="cx">     frame-&gt;selection().setSelection(range);
</span><span class="cx"> 
</span><del>-    RefPtr&lt;TextIndicator&gt; indicator = TextIndicator::createWithSelectionInFrame(*frame, presentationTransition, margin);
</del><ins>+    TextIndicatorData data;
</ins><span class="cx"> 
</span><del>-    frame-&gt;selection().setSelection(oldSelection);
</del><ins>+    data.presentationTransition = presentationTransition;
+    data.indicatesCurrentSelection = !areRangesEqual(&amp;range, oldSelection.toNormalizedRange().get());
+    data.options = options;
</ins><span class="cx"> 
</span><del>-    if (indicator)
-        indicator-&gt;setWantsMargin(!areRangesEqual(&amp;range, oldSelection.toNormalizedRange().get()));
</del><ins>+    if (!initializeIndicator(data, *frame, range, margin))
+        return nullptr;
</ins><span class="cx"> 
</span><ins>+    RefPtr&lt;TextIndicator&gt; indicator = TextIndicator::create(data);
+
+    frame-&gt;selection().setSelection(oldSelection);
+
</ins><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     frame-&gt;editor().setIgnoreCompositionSelectionChange(false, Editor::RevealSelection::No);
</span><span class="cx">     frame-&gt;selection().setUpdateAppearanceEnabled(false);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    return indicator.release();
</del><ins>+    return indicator;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-// FIXME (138889): Ideally the FrameSnapshotting functions would be more flexible
-// and we wouldn't have to implement this here.
-static RefPtr&lt;Image&gt; snapshotSelectionWithHighlight(Frame&amp; frame)
</del><ins>+RefPtr&lt;TextIndicator&gt; TextIndicator::createWithSelectionInFrame(Frame&amp; frame, TextIndicatorOptions options, TextIndicatorPresentationTransition presentationTransition, unsigned margin)
</ins><span class="cx"> {
</span><del>-    auto&amp; selection = frame.selection();
-
-    if (!selection.isRange())
</del><ins>+    RefPtr&lt;Range&gt; range = frame.selection().toNormalizedRange();
+    if (!range)
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    FloatRect selectionBounds = selection.selectionBounds();
</del><ins>+    TextIndicatorData data;
</ins><span class="cx"> 
</span><del>-    // It is possible for the selection bounds to be empty; see https://bugs.webkit.org/show_bug.cgi?id=56645.
-    if (selectionBounds.isEmpty())
</del><ins>+    data.presentationTransition = presentationTransition;
+    data.indicatesCurrentSelection = true;
+    data.options = options;
+
+    if (!initializeIndicator(data, frame, *range, margin))
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    std::unique_ptr&lt;ImageBuffer&gt; snapshot = snapshotFrameRect(frame, enclosingIntRect(selectionBounds), 0);
</del><ins>+    return TextIndicator::create(data);
+}
</ins><span class="cx"> 
</span><del>-    if (!snapshot)
</del><ins>+static bool hasNonInlineOrReplacedElements(const Range&amp; range)
+{
+    Node* stopNode = range.pastLastNode();
+    for (Node* node = range.firstNode(); node != stopNode; node = NodeTraversal::next(*node)) {
+        if (!node)
+            continue;
+        RenderObject* renderer = node-&gt;renderer();
+        if (!renderer)
+            continue;
+        if ((!renderer-&gt;isInline() || renderer-&gt;isReplaced()) &amp;&amp; range.intersectsNode(node, ASSERT_NO_EXCEPTION))
+            return true;
+    }
+
+    return false;
+}
+
+static SnapshotOptions snapshotOptionsForTextIndicatorOptions(TextIndicatorOptions options)
+{
+    SnapshotOptions snapshotOptions = SnapshotOptionsNone;
+    if (!(options &amp; TextIndicatorOptionRespectTextColor))
+        snapshotOptions |= SnapshotOptionsForceBlackText;
+
+    if (!(options &amp; TextIndicatorOptionPaintAllContent)) {
+        if (options &amp; TextIndicatorOptionPaintBackgrounds)
+            snapshotOptions |= SnapshotOptionsPaintSelectionAndBackgroundsOnly;
+        else
+            snapshotOptions |= SnapshotOptionsPaintSelectionOnly;
+    } else
+        snapshotOptions |= SnapshotOptionsExcludeSelectionHighlighting;
+
+    return snapshotOptions;
+}
+
+static RefPtr&lt;Image&gt; takeSnapshot(Frame&amp; frame, IntRect rect, SnapshotOptions options, float&amp; scaleFactor)
+{
+    std::unique_ptr&lt;ImageBuffer&gt; buffer = snapshotFrameRect(frame, rect, options);
+    if (!buffer)
</ins><span class="cx">         return nullptr;
</span><ins>+    scaleFactor = buffer-&gt;resolutionScale();
+    return buffer-&gt;copyImage(CopyBackingStore, Unscaled);
+}
</ins><span class="cx"> 
</span><del>-    return snapshot-&gt;copyImage(CopyBackingStore, Unscaled);
</del><ins>+static bool takeSnapshots(TextIndicatorData&amp; data, Frame&amp; frame, IntRect snapshotRect)
+{
+    SnapshotOptions snapshotOptions = snapshotOptionsForTextIndicatorOptions(data.options);
+
+    data.contentImage = takeSnapshot(frame, snapshotRect, snapshotOptions, data.contentImageScaleFactor);
+    if (!data.contentImage)
+        return false;
+
+    if (data.options &amp; TextIndicatorOptionIncludeSnapshotWithSelectionHighlight) {
+        float snapshotScaleFactor;
+        data.contentImageWithHighlight = takeSnapshot(frame, snapshotRect, SnapshotOptionsNone, snapshotScaleFactor);
+        ASSERT(!data.contentImageWithHighlight || data.contentImageScaleFactor == snapshotScaleFactor);
+    }
+    
+    return true;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;TextIndicator&gt; TextIndicator::createWithSelectionInFrame(Frame&amp; frame, TextIndicatorPresentationTransition presentationTransition, unsigned margin)
</del><ins>+static bool initializeIndicator(TextIndicatorData&amp; data, Frame&amp; frame, const Range&amp; range, unsigned margin)
</ins><span class="cx"> {
</span><span class="cx">     Vector&lt;FloatRect&gt; textRects;
</span><span class="cx"> 
</span><del>-    // On iOS, we don't need to expand the TextIndicator to cover the whole selection height.
-    // FIXME: Ideally, on Mac, there are times when we don't need to (if we don't have a selection),
-    // and using TextHeight would provide a more sensible appearance.
-#if PLATFORM(IOS)
-    FrameSelection::TextRectangleHeight textRectHeight = FrameSelection::TextRectangleHeight::TextHeight;
-#else
-    FrameSelection::TextRectangleHeight textRectHeight = FrameSelection::TextRectangleHeight::SelectionHeight;
-#endif
-    frame.selection().getClippedVisibleTextRectangles(textRects, textRectHeight);
</del><ins>+    FrameSelection::TextRectangleHeight textRectHeight = (data.options &amp; TextIndicatorOptionTightlyFitContent) ? FrameSelection::TextRectangleHeight::TextHeight : FrameSelection::TextRectangleHeight::SelectionHeight;
</ins><span class="cx"> 
</span><del>-    // The bounding rect of all the text rects can be different than the selection
-    // rect when the selection spans multiple lines; the indicator doesn't actually
-    // care where the selection highlight goes, just where the text actually is.
</del><ins>+    if ((data.options &amp; TextIndicatorOptionUseBoundingRectAndPaintAllContentForComplexRanges) &amp;&amp; hasNonInlineOrReplacedElements(range))
+        data.options |= TextIndicatorOptionPaintAllContent;
+    else
+        frame.selection().getClippedVisibleTextRectangles(textRects, textRectHeight);
+
+    if (textRects.isEmpty()) {
+        RenderView* renderView = frame.contentRenderer();
+        if (!renderView)
+            return false;
+        // Clip to the visible rect, just like getClippedVisibleTextRectangles does.
+        // FIXME: We really want to clip to the unobscured rect in both cases, I think.
+        // (this seems to work on Mac, but maybe not iOS?)
+        FloatRect visibleContentRect = frame.view()-&gt;visibleContentRect(ScrollableArea::LegacyIOSDocumentVisibleRect);
+        FloatRect boundingRect = range.absoluteBoundingRect();
+        textRects.append(intersection(visibleContentRect, boundingRect));
+    }
+
</ins><span class="cx">     FloatRect textBoundingRectInRootViewCoordinates;
</span><span class="cx">     FloatRect textBoundingRectInDocumentCoordinates;
</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><span class="cx">         textRectInDocumentCoordinatesIncludingMargin.inflate(margin);
</span><del>-
</del><span class="cx">         textBoundingRectInDocumentCoordinates.unite(textRectInDocumentCoordinatesIncludingMargin);
</span><span class="cx"> 
</span><span class="cx">         FloatRect textRectInRootViewCoordinates = frame.view()-&gt;contentsToRootView(enclosingIntRect(textRectInDocumentCoordinatesIncludingMargin));
</span><span class="lines">@@ -138,114 +217,13 @@
</span><span class="cx">         textRectsInBoundingRectCoordinates.append(rect);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    // FIXME: We should have TextIndicator options instead of this being platform-specific.
-#if PLATFORM(IOS)
-    SnapshotOptions snapshotOptions = SnapshotOptionsPaintSelectionAndBackgroundsOnly;
-#else
-    SnapshotOptions snapshotOptions = SnapshotOptionsForceBlackText | SnapshotOptionsPaintSelectionOnly;
-#endif
-
-    std::unique_ptr&lt;ImageBuffer&gt; indicatorBuffer = snapshotFrameRect(frame, enclosingIntRect(textBoundingRectInDocumentCoordinates), snapshotOptions);
-    if (!indicatorBuffer)
-        return nullptr;
-    RefPtr&lt;Image&gt; indicatorBitmap = indicatorBuffer-&gt;copyImage(CopyBackingStore, Unscaled);
-    if (!indicatorBitmap)
-        return nullptr;
-
-    RefPtr&lt;Image&gt; indicatorBitmapWithHighlight;
-    if (presentationTransition == TextIndicatorPresentationTransition::BounceAndCrossfade)
-        indicatorBitmapWithHighlight = snapshotSelectionWithHighlight(frame);
-
-    TextIndicatorData data;
-
</del><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">     data.selectionRectInRootViewCoordinates = frame.view()-&gt;contentsToRootView(enclosingIntRect(frame.selection().selectionBounds()));
</span><span class="cx">     data.textBoundingRectInRootViewCoordinates = textBoundingRectInRootViewCoordinates;
</span><span class="cx">     data.textRectsInBoundingRectCoordinates = textRectsInBoundingRectCoordinates;
</span><del>-    data.contentImageScaleFactor = indicatorBuffer-&gt;resolutionScale();
-    data.contentImage = indicatorBitmap;
-    data.contentImageWithHighlight = indicatorBitmapWithHighlight;
-    data.presentationTransition = presentationTransition;
-    data.wantsMargin = true;
</del><span class="cx"> 
</span><del>-    return TextIndicator::create(data);
</del><ins>+    return takeSnapshots(data, frame, enclosingIntRect(textBoundingRectInDocumentCoordinates));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-TextIndicator::TextIndicator(const TextIndicatorData&amp; data)
-    : m_data(data)
-{
-}
-
-TextIndicator::~TextIndicator()
-{
-}
-    
-bool TextIndicator::wantsBounce() const
-{
-    switch (m_data.presentationTransition) {
-    case TextIndicatorPresentationTransition::BounceAndCrossfade:
-    case TextIndicatorPresentationTransition::Bounce:
-        return true;
-        
-    case TextIndicatorPresentationTransition::FadeIn:
-    case TextIndicatorPresentationTransition::None:
-        return false;
-    }
-
-    ASSERT_NOT_REACHED();
-    return false;
-}
-
-bool TextIndicator::wantsContentCrossfade() const
-{
-    if (!m_data.contentImageWithHighlight)
-        return false;
-    
-    switch (m_data.presentationTransition) {
-    case TextIndicatorPresentationTransition::BounceAndCrossfade:
-        return true;
-        
-    case TextIndicatorPresentationTransition::Bounce:
-    case TextIndicatorPresentationTransition::FadeIn:
-    case TextIndicatorPresentationTransition::None:
-        return false;
-    }
-
-    ASSERT_NOT_REACHED();
-    return false;
-}
-
-bool TextIndicator::wantsFadeIn() const
-{
-    switch (m_data.presentationTransition) {
-    case TextIndicatorPresentationTransition::FadeIn:
-        return true;
-        
-    case TextIndicatorPresentationTransition::Bounce:
-    case TextIndicatorPresentationTransition::BounceAndCrossfade:
-    case TextIndicatorPresentationTransition::None:
-        return false;
-    }
-
-    ASSERT_NOT_REACHED();
-    return false;
-}
-
-bool TextIndicator::wantsManualAnimation() const
-{
-    switch (m_data.presentationTransition) {
-    case TextIndicatorPresentationTransition::FadeIn:
-        return true;
-
-    case TextIndicatorPresentationTransition::Bounce:
-    case TextIndicatorPresentationTransition::BounceAndCrossfade:
-    case TextIndicatorPresentationTransition::None:
-        return false;
-    }
-
-    ASSERT_NOT_REACHED();
-    return false;
-}
-
</del><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorepageTextIndicatorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/TextIndicator.h (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/TextIndicator.h        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebCore/page/TextIndicator.h        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -32,18 +32,13 @@
</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><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"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class Frame;
</span><span class="cx"> class GraphicsContext;
</span><span class="cx"> class Range;
</span><span class="cx"> 
</span><ins>+// FIXME: Move PresentationTransition to TextIndicatorWindow, because it's about presentation.
</ins><span class="cx"> enum class TextIndicatorPresentationTransition {
</span><span class="cx">     None,
</span><span class="cx"> 
</span><span class="lines">@@ -55,18 +50,32 @@
</span><span class="cx">     FadeIn,
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-enum class TextIndicatorLifetime {
-    // The TextIndicator should indicate the text until dismissed.
-    Permanent,
</del><ins>+// Make sure to keep these in sync with the ones in Internals.idl.
+enum TextIndicatorOption : uint8_t {
+    TextIndicatorOptionDefault = 0,
</ins><span class="cx"> 
</span><del>-    // The TextIndicator should briefly indicate the text and then automatically dismiss.
-    Temporary
-};
</del><ins>+    // Use the styled text color instead of forcing black text (the default)
+    TextIndicatorOptionRespectTextColor = 1 &lt;&lt; 0,
</ins><span class="cx"> 
</span><del>-enum class TextIndicatorDismissalAnimation {
-    None,
-    FadeOut
</del><ins>+    // Paint backgrounds, even if they're not part of the Range
+    TextIndicatorOptionPaintBackgrounds = 1 &lt;&lt; 1,
+
+    // Don't restrict painting to the given Range
+    TextIndicatorOptionPaintAllContent = 1 &lt;&lt; 2,
+
+    // Take two snapshots:
+    //    - one including the selection highlight and ignoring other painting-related options
+    //    - one respecting the other painting-related options
+    TextIndicatorOptionIncludeSnapshotWithSelectionHighlight = 1 &lt;&lt; 3,
+
+    // Tightly fit the content instead of expanding to cover the bounds of the selection highlight
+    TextIndicatorOptionTightlyFitContent = 1 &lt;&lt; 4,
+
+    // If there are any non-inline or replaced elements in the Range, indicate the bounding rect
+    // of the range instead of the individual subrects, and don't restrict painting to the given Range
+    TextIndicatorOptionUseBoundingRectAndPaintAllContentForComplexRanges = 1 &lt;&lt; 5
</ins><span class="cx"> };
</span><ins>+typedef uint8_t TextIndicatorOptions;
</ins><span class="cx"> 
</span><span class="cx"> struct TextIndicatorData {
</span><span class="cx">     FloatRect selectionRectInRootViewCoordinates;
</span><span class="lines">@@ -76,14 +85,15 @@
</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 wantsMargin;
</del><ins>+    bool indicatesCurrentSelection;
+    TextIndicatorOptions options;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> class TextIndicator : public RefCounted&lt;TextIndicator&gt; {
</span><span class="cx"> public:
</span><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;, TextIndicatorPresentationTransition, unsigned margin = 0);
-    WEBCORE_EXPORT static RefPtr&lt;TextIndicator&gt; createWithRange(const Range&amp;, TextIndicatorPresentationTransition, unsigned margin = 0);
</del><ins>+    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);
</ins><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT ~TextIndicator();
</span><span class="cx"> 
</span><span class="lines">@@ -98,14 +108,8 @@
</span><span class="cx">     void setPresentationTransition(TextIndicatorPresentationTransition transition) { m_data.presentationTransition = transition; }
</span><span class="cx"> 
</span><span class="cx">     TextIndicatorData data() const { return m_data; }
</span><del>-    
-    bool wantsBounce() const;
-    bool wantsContentCrossfade() const;
-    bool wantsFadeIn() const;
-    bool wantsManualAnimation() const;
</del><span class="cx"> 
</span><del>-    void setWantsMargin(bool wantsMargin) { m_data.wantsMargin = wantsMargin; }
-    bool wantsMargin() const { return m_data.wantsMargin; }
</del><ins>+    bool indicatesCurrentSelection() const { return m_data.indicatesCurrentSelection; }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     TextIndicator(const TextIndicatorData&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCorepagemacServicesOverlayControllermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/mac/ServicesOverlayController.mm (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/mac/ServicesOverlayController.mm        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebCore/page/mac/ServicesOverlayController.mm        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -195,7 +195,7 @@
</span><span class="cx"> static IntRect textQuadsToBoundingRectForRange(Range&amp; range)
</span><span class="cx"> {
</span><span class="cx">     Vector&lt;FloatQuad&gt; textQuads;
</span><del>-    range.textQuads(textQuads);
</del><ins>+    range.absoluteTextQuads(textQuads);
</ins><span class="cx">     FloatRect boundingRect;
</span><span class="cx">     for (auto&amp; quad : textQuads)
</span><span class="cx">         boundingRect.unite(quad.boundingBox());
</span></span></pre></div>
<a id="trunkSourceWebCorepagemacTextIndicatorWindowh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/mac/TextIndicatorWindow.h (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/mac/TextIndicatorWindow.h        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebCore/page/mac/TextIndicatorWindow.h        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -26,19 +26,38 @@
</span><span class="cx"> #ifndef TextIndicatorWindow_h
</span><span class="cx"> #define TextIndicatorWindow_h
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC)
-
</del><span class="cx"> #import &quot;TextIndicator.h&quot;
</span><span class="cx"> #import &lt;wtf/Noncopyable.h&gt;
</span><span class="cx"> #import &lt;wtf/RefPtr.h&gt;
</span><span class="cx"> #import &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> #import &lt;wtf/RunLoop.h&gt;
</span><span class="cx"> 
</span><del>-@class NSView;
-@class WebTextIndicatorView;
</del><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"> 
</span><ins>+OBJC_CLASS NSView;
+OBJC_CLASS WebTextIndicatorView;
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+enum class TextIndicatorWindowLifetime : uint8_t {
+    // The TextIndicator should indicate the text until dismissed.
+    Permanent,
+
+    // The TextIndicator should briefly indicate the text and then automatically dismiss.
+    Temporary
+};
+
+enum class TextIndicatorWindowDismissalAnimation : uint8_t {
+    None,
+    FadeOut
+};
+
+#if PLATFORM(MAC)
+
</ins><span class="cx"> class TextIndicatorWindow {
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(TextIndicatorWindow);
</span><span class="cx"> 
</span><span class="lines">@@ -46,8 +65,8 @@
</span><span class="cx">     WEBCORE_EXPORT explicit TextIndicatorWindow(NSView *);
</span><span class="cx">     WEBCORE_EXPORT ~TextIndicatorWindow();
</span><span class="cx"> 
</span><del>-    WEBCORE_EXPORT void setTextIndicator(Ref&lt;TextIndicator&gt;, CGRect contentRect, TextIndicatorLifetime);
-    WEBCORE_EXPORT void clearTextIndicator(TextIndicatorDismissalAnimation);
</del><ins>+    WEBCORE_EXPORT void setTextIndicator(Ref&lt;TextIndicator&gt;, CGRect contentRect, TextIndicatorWindowLifetime);
+    WEBCORE_EXPORT void clearTextIndicator(TextIndicatorWindowDismissalAnimation);
</ins><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT void setAnimationProgress(float);
</span><span class="cx"> 
</span><span class="lines">@@ -64,8 +83,8 @@
</span><span class="cx">     RunLoop::Timer&lt;TextIndicatorWindow&gt; m_temporaryTextIndicatorTimer;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+#endif // PLATFORM(MAC)
+
</ins><span class="cx"> } // namespace WebKit
</span><span class="cx"> 
</span><span class="cx"> #endif // TextIndicatorWindow_h
</span><del>-
-#endif // PLATFORM(MAC)
</del></span></pre></div>
<a id="trunkSourceWebCorepagemacTextIndicatorWindowmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/mac/TextIndicatorWindow.mm (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/mac/TextIndicatorWindow.mm        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebCore/page/mac/TextIndicatorWindow.mm        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -124,6 +124,73 @@
</span><span class="cx">     return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static bool indicatorWantsBounce(const TextIndicator&amp; indicator)
+{
+    switch (indicator.presentationTransition()) {
+    case TextIndicatorPresentationTransition::BounceAndCrossfade:
+    case TextIndicatorPresentationTransition::Bounce:
+        return true;
+
+    case TextIndicatorPresentationTransition::FadeIn:
+    case TextIndicatorPresentationTransition::None:
+        return false;
+    }
+
+    ASSERT_NOT_REACHED();
+    return false;
+}
+
+static bool indicatorWantsContentCrossfade(const TextIndicator&amp; indicator)
+{
+    if (!indicator.data().contentImageWithHighlight)
+        return false;
+
+    switch (indicator.presentationTransition()) {
+    case TextIndicatorPresentationTransition::BounceAndCrossfade:
+        return true;
+
+    case TextIndicatorPresentationTransition::Bounce:
+    case TextIndicatorPresentationTransition::FadeIn:
+    case TextIndicatorPresentationTransition::None:
+        return false;
+    }
+
+    ASSERT_NOT_REACHED();
+    return false;
+}
+
+static bool indicatorWantsFadeIn(const TextIndicator&amp; indicator)
+{
+    switch (indicator.presentationTransition()) {
+    case TextIndicatorPresentationTransition::FadeIn:
+        return true;
+
+    case TextIndicatorPresentationTransition::Bounce:
+    case TextIndicatorPresentationTransition::BounceAndCrossfade:
+    case TextIndicatorPresentationTransition::None:
+        return false;
+    }
+
+    ASSERT_NOT_REACHED();
+    return false;
+}
+
+static bool indicatorWantsManualAnimation(const TextIndicator&amp; indicator)
+{
+    switch (indicator.presentationTransition()) {
+    case TextIndicatorPresentationTransition::FadeIn:
+        return true;
+
+    case TextIndicatorPresentationTransition::Bounce:
+    case TextIndicatorPresentationTransition::BounceAndCrossfade:
+    case TextIndicatorPresentationTransition::None:
+        return false;
+    }
+
+    ASSERT_NOT_REACHED();
+    return false;
+}
+
</ins><span class="cx"> - (instancetype)initWithFrame:(NSRect)frame textIndicator:(PassRefPtr&lt;TextIndicator&gt;)textIndicator margin:(NSSize)margin offset:(NSPoint)offset
</span><span class="cx"> {
</span><span class="cx">     if (!(self = [super initWithFrame:frame]))
</span><span class="lines">@@ -138,7 +205,7 @@
</span><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 (_textIndicator-&gt;wantsContentCrossfade())
</del><ins>+    if (indicatorWantsContentCrossfade(*_textIndicator))
</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">@@ -177,7 +244,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 (!_textIndicator-&gt;wantsMargin()) {
</del><ins>+        if (!_textIndicator-&gt;indicatesCurrentSelection()) {
</ins><span class="cx">             yellowHighlightRect.inflateX(-horizontalBorder);
</span><span class="cx">             yellowHighlightRect.inflateY(-verticalBorder);
</span><span class="cx">         }
</span><span class="lines">@@ -288,8 +355,8 @@
</span><span class="cx"> 
</span><span class="cx"> - (CFTimeInterval)_animationDuration
</span><span class="cx"> {
</span><del>-    if (_textIndicator-&gt;wantsBounce()) {
-        if (_textIndicator-&gt;wantsContentCrossfade())
</del><ins>+    if (indicatorWantsBounce(*_textIndicator)) {
+        if (indicatorWantsContentCrossfade(*_textIndicator))
</ins><span class="cx">             return bounceWithCrossfadeAnimationDuration;
</span><span class="cx">         return bounceAnimationDuration;
</span><span class="cx">     }
</span><span class="lines">@@ -304,9 +371,9 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)present
</span><span class="cx"> {
</span><del>-    bool wantsBounce = _textIndicator-&gt;wantsBounce();
-    bool wantsCrossfade = _textIndicator-&gt;wantsContentCrossfade();
-    bool wantsFadeIn = _textIndicator-&gt;wantsFadeIn();
</del><ins>+    bool wantsBounce = indicatorWantsBounce(*_textIndicator);
+    bool wantsCrossfade = indicatorWantsContentCrossfade(*_textIndicator);
+    bool wantsFadeIn = indicatorWantsFadeIn(*_textIndicator);
</ins><span class="cx">     CFTimeInterval animationDuration = [self _animationDuration];
</span><span class="cx"> 
</span><span class="cx">     _hasCompletedAnimation = false;
</span><span class="lines">@@ -326,7 +393,7 @@
</span><span class="cx"> 
</span><span class="cx">     [CATransaction begin];
</span><span class="cx">     for (CALayer *bounceLayer in _bounceLayers.get()) {
</span><del>-        if (_textIndicator-&gt;wantsManualAnimation())
</del><ins>+        if (indicatorWantsManualAnimation(*_textIndicator))
</ins><span class="cx">             bounceLayer.speed = 0;
</span><span class="cx"> 
</span><span class="cx">         if (!wantsFadeIn)
</span><span class="lines">@@ -398,7 +465,7 @@
</span><span class="cx"> 
</span><span class="cx"> TextIndicatorWindow::~TextIndicatorWindow()
</span><span class="cx"> {
</span><del>-    clearTextIndicator(TextIndicatorDismissalAnimation::FadeOut);
</del><ins>+    clearTextIndicator(TextIndicatorWindowDismissalAnimation::FadeOut);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void TextIndicatorWindow::setAnimationProgress(float progress)
</span><span class="lines">@@ -409,14 +476,14 @@
</span><span class="cx">     [m_textIndicatorView setAnimationProgress:progress];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TextIndicatorWindow::clearTextIndicator(TextIndicatorDismissalAnimation animation)
</del><ins>+void TextIndicatorWindow::clearTextIndicator(TextIndicatorWindowDismissalAnimation animation)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;TextIndicator&gt; textIndicator = WTF::move(m_textIndicator);
</span><span class="cx"> 
</span><span class="cx">     if ([m_textIndicatorView isFadingOut])
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (textIndicator &amp;&amp; textIndicator-&gt;wantsManualAnimation() &amp;&amp; [m_textIndicatorView hasCompletedAnimation] &amp;&amp; animation == TextIndicatorDismissalAnimation::FadeOut) {
</del><ins>+    if (textIndicator &amp;&amp; indicatorWantsManualAnimation(*textIndicator) &amp;&amp; [m_textIndicatorView hasCompletedAnimation] &amp;&amp; animation == TextIndicatorWindowDismissalAnimation::FadeOut) {
</ins><span class="cx">         startFadeOut();
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -424,7 +491,7 @@
</span><span class="cx">     closeWindow();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TextIndicatorWindow::setTextIndicator(Ref&lt;TextIndicator&gt; textIndicator, CGRect textBoundingRectInScreenCoordinates, TextIndicatorLifetime lifetime)
</del><ins>+void TextIndicatorWindow::setTextIndicator(Ref&lt;TextIndicator&gt; textIndicator, CGRect textBoundingRectInScreenCoordinates, TextIndicatorWindowLifetime lifetime)
</ins><span class="cx"> {
</span><span class="cx">     if (m_textIndicator == textIndicator.ptr())
</span><span class="cx">         return;
</span><span class="lines">@@ -436,7 +503,7 @@
</span><span class="cx">     CGFloat horizontalMargin = dropShadowBlurRadius * 2 + horizontalBorder;
</span><span class="cx">     CGFloat verticalMargin = dropShadowBlurRadius * 2 + verticalBorder;
</span><span class="cx">     
</span><del>-    if (m_textIndicator-&gt;wantsBounce()) {
</del><ins>+    if (indicatorWantsBounce(*m_textIndicator)) {
</ins><span class="cx">         horizontalMargin = std::max(horizontalMargin, textBoundingRectInScreenCoordinates.size.width * (midBounceScale - 1) + horizontalMargin);
</span><span class="cx">         verticalMargin = std::max(verticalMargin, textBoundingRectInScreenCoordinates.size.height * (midBounceScale - 1) + verticalMargin);
</span><span class="cx">     }
</span><span class="lines">@@ -463,7 +530,7 @@
</span><span class="cx">     if (m_textIndicator-&gt;presentationTransition() != TextIndicatorPresentationTransition::None)
</span><span class="cx">         [m_textIndicatorView present];
</span><span class="cx"> 
</span><del>-    if (lifetime == TextIndicatorLifetime::Temporary)
</del><ins>+    if (lifetime == TextIndicatorWindowLifetime::Temporary)
</ins><span class="cx">         m_temporaryTextIndicatorTimer.startOneShot(timeBeforeFadeStarts);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderObject.cpp        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -810,7 +810,7 @@
</span><span class="cx">     range-&gt;ownerDocument().updateLayout();
</span><span class="cx"> 
</span><span class="cx">     Vector&lt;FloatQuad&gt; quads;
</span><del>-    range-&gt;textQuads(quads);
</del><ins>+    range-&gt;absoluteTextQuads(quads);
</ins><span class="cx"> 
</span><span class="cx">     if (quads.isEmpty())
</span><span class="cx">         return FloatRect();
</span></span></pre></div>
<a id="trunkSourceWebKitiosChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ios/ChangeLog (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ios/ChangeLog        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebKit/ios/ChangeLog        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2015-08-13  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+        Refactor and improve TextIndicator to prepare for tests
+        https://bugs.webkit.org/show_bug.cgi?id=147622
+
+        Reviewed by Simon Fraser.
+
+        * WebCoreSupport/WebFrameIOS.mm:
+        (-[WebFrame closestCaretRectInMarkedTextRangeForPoint:]):
+        Adjust to Range method renames.
+
</ins><span class="cx"> 2015-08-05  Filip Pizlo  &lt;fpizlo@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, roll out http://trac.webkit.org/changeset/187972.
</span></span></pre></div>
<a id="trunkSourceWebKitiosWebCoreSupportWebFrameIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ios/WebCoreSupport/WebFrameIOS.mm (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ios/WebCoreSupport/WebFrameIOS.mm        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebKit/ios/WebCoreSupport/WebFrameIOS.mm        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -145,7 +145,7 @@
</span><span class="cx">         // Adjust pos and give it an appropriate affinity.
</span><span class="cx">         VisiblePosition pos;
</span><span class="cx">         Vector&lt;IntRect&gt; intRects;
</span><del>-        markedTextRange-&gt;textRects(intRects, NO);
</del><ins>+        markedTextRange-&gt;absoluteTextRects(intRects, NO);
</ins><span class="cx">         unsigned size = intRects.size();
</span><span class="cx">         CGRect firstRect = intRects[0];
</span><span class="cx">         CGRect lastRect  = intRects[size-1];
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebKit/mac/ChangeLog        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -1,3 +1,35 @@
</span><ins>+2015-08-13  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+        Refactor and improve TextIndicator to prepare for tests
+        https://bugs.webkit.org/show_bug.cgi?id=147622
+
+        Reviewed by Simon Fraser.
+
+        * WebView/WebFrame.mm:
+        (-[WebFrame _rectsForRange:]):
+        * WebView/WebHTMLView.mm:
+        (-[WebHTMLView _lookUpInDictionaryFromMenu:]):
+        (-[WebHTMLView quickLookWithEvent:]):
+        * WebView/WebImmediateActionController.mm:
+        (-[WebImmediateActionController webView:didHandleScrollWheel:]):
+        (-[WebImmediateActionController _cancelImmediateAction]):
+        (-[WebImmediateActionController immediateActionRecognizerDidCancelAnimation:]):
+        (-[WebImmediateActionController _defaultAnimationController]):
+        (-[WebImmediateActionController menuItemDidClose:]):
+        (-[WebImmediateActionController _animationControllerForDataDetectedText]):
+        (-[WebImmediateActionController _animationControllerForDataDetectedLink]):
+        (dictionaryPopupInfoForRange):
+        * WebView/WebView.mm:
+        (-[WebView _animationControllerForDictionaryLookupPopupInfo:]):
+        (-[WebView _setTextIndicator:]):
+        (-[WebView _setTextIndicator:withLifetime:]):
+        (-[WebView _clearTextIndicatorWithAnimation:]):
+        (-[WebView _showDictionaryLookupPopup:]):
+        (-[WebView _dictionaryLookupPopoverWillClose:]):
+        * WebView/WebViewInternal.h:
+        Adopt TextIndicatorOptions.
+        Adjust to Range method renames.
+
</ins><span class="cx"> 2015-08-13  Geoffrey Garen  &lt;ggaren@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Standardize on the phrase &quot;delete code&quot;
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebFramemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebFrame.mm (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebFrame.mm        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebKit/mac/WebView/WebFrame.mm        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -1102,7 +1102,7 @@
</span><span class="cx">     
</span><span class="cx">     
</span><span class="cx">     Vector&lt;IntRect&gt; intRects;
</span><del>-    range-&gt;textRects(intRects, NO);
</del><ins>+    range-&gt;absoluteTextRects(intRects, NO);
</ins><span class="cx">     unsigned size = intRects.size();
</span><span class="cx">     
</span><span class="cx">     NSMutableArray *rectArray = [NSMutableArray arrayWithCapacity:size];
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebHTMLViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebHTMLView.mm (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebHTMLView.mm        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebKit/mac/WebView/WebHTMLView.mm        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -5689,13 +5689,13 @@
</span><span class="cx">     DictionaryPopupInfo info;
</span><span class="cx">     info.attributedString = attrString;
</span><span class="cx">     info.origin = coreFrame-&gt;view()-&gt;contentsToWindow(enclosingIntRect(rect)).location();
</span><del>-    info.textIndicator = TextIndicator::createWithSelectionInFrame(*coreFrame, TextIndicatorPresentationTransition::BounceAndCrossfade);
</del><ins>+    info.textIndicator = TextIndicator::createWithSelectionInFrame(*coreFrame, TextIndicatorOptionIncludeSnapshotWithSelectionHighlight, TextIndicatorPresentationTransition::BounceAndCrossfade);
</ins><span class="cx">     [[self _webView] _showDictionaryLookupPopup:info];
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)quickLookWithEvent:(NSEvent *)event
</span><span class="cx"> {
</span><del>-    [[self _webView] _clearTextIndicatorWithAnimation:TextIndicatorDismissalAnimation::FadeOut];
</del><ins>+    [[self _webView] _clearTextIndicatorWithAnimation:TextIndicatorWindowDismissalAnimation::FadeOut];
</ins><span class="cx">     [super quickLookWithEvent:event];
</span><span class="cx"> }
</span><span class="cx"> #endif // !PLATFORM(IOS)
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebImmediateActionControllermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebImmediateActionController.mm (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebImmediateActionController.mm        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebKit/mac/WebView/WebImmediateActionController.mm        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -105,7 +105,7 @@
</span><span class="cx"> {
</span><span class="cx">     [_currentQLPreviewMenuItem close];
</span><span class="cx">     [self _clearImmediateActionState];
</span><del>-    [_webView _clearTextIndicatorWithAnimation:TextIndicatorDismissalAnimation::None];
</del><ins>+    [_webView _clearTextIndicatorWithAnimation:TextIndicatorWindowDismissalAnimation::None];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (NSImmediateActionGestureRecognizer *)immediateActionRecognizer
</span><span class="lines">@@ -120,7 +120,7 @@
</span><span class="cx">     [_immediateActionRecognizer setEnabled:YES];
</span><span class="cx"> 
</span><span class="cx">     [self _clearImmediateActionState];
</span><del>-    [_webView _clearTextIndicatorWithAnimation:TextIndicatorDismissalAnimation::FadeOut];
</del><ins>+    [_webView _clearTextIndicatorWithAnimation:TextIndicatorWindowDismissalAnimation::FadeOut];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)_clearImmediateActionState
</span><span class="lines">@@ -215,7 +215,7 @@
</span><span class="cx"> 
</span><span class="cx">     [_webView _setTextIndicatorAnimationProgress:0];
</span><span class="cx">     [self _clearImmediateActionState];
</span><del>-    [_webView _clearTextIndicatorWithAnimation:TextIndicatorDismissalAnimation::None];
</del><ins>+    [_webView _clearTextIndicatorWithAnimation:TextIndicatorWindowDismissalAnimation::None];
</ins><span class="cx">     [_webView _setMaintainsInactiveSelection:NO];
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -259,9 +259,9 @@
</span><span class="cx">             _type = WebImmediateActionLinkPreview;
</span><span class="cx"> 
</span><span class="cx">             RefPtr&lt;Range&gt; linkRange = rangeOfContents(*_hitTestResult.URLElement());
</span><del>-            RefPtr&lt;TextIndicator&gt; indicator = TextIndicator::createWithRange(*linkRange, TextIndicatorPresentationTransition::FadeIn);
</del><ins>+            RefPtr&lt;TextIndicator&gt; indicator = TextIndicator::createWithRange(*linkRange, TextIndicatorOptionDefault, TextIndicatorPresentationTransition::FadeIn);
</ins><span class="cx">             if (indicator)
</span><del>-                [_webView _setTextIndicator:*indicator withLifetime:TextIndicatorLifetime::Permanent];
</del><ins>+                [_webView _setTextIndicator:*indicator withLifetime:TextIndicatorWindowLifetime::Permanent];
</ins><span class="cx"> 
</span><span class="cx">             QLPreviewMenuItem *item = [NSMenuItem standardQuickLookMenuItem];
</span><span class="cx">             item.previewStyle = QLPreviewStylePopover;
</span><span class="lines">@@ -339,7 +339,7 @@
</span><span class="cx"> - (void)menuItemDidClose:(NSMenuItem *)menuItem
</span><span class="cx"> {
</span><span class="cx">     [self _clearImmediateActionState];
</span><del>-    [_webView _clearTextIndicatorWithAnimation:TextIndicatorDismissalAnimation::FadeOut];
</del><ins>+    [_webView _clearTextIndicatorWithAnimation:TextIndicatorWindowDismissalAnimation::FadeOut];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static IntRect elementBoundingBoxInWindowCoordinatesFromNode(Node* node)
</span><span class="lines">@@ -416,14 +416,14 @@
</span><span class="cx">             return nil;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    RefPtr&lt;TextIndicator&gt; detectedDataTextIndicator = TextIndicator::createWithRange(*detectedDataRange, TextIndicatorPresentationTransition::FadeIn);
</del><ins>+    RefPtr&lt;TextIndicator&gt; detectedDataTextIndicator = TextIndicator::createWithRange(*detectedDataRange, TextIndicatorOptionDefault, TextIndicatorPresentationTransition::FadeIn);
</ins><span class="cx"> 
</span><span class="cx">     _currentActionContext = [actionContext contextForView:_webView altMode:YES interactionStartedHandler:^() {
</span><span class="cx">     } interactionChangedHandler:^() {
</span><span class="cx">         if (detectedDataTextIndicator)
</span><del>-            [_webView _setTextIndicator:*detectedDataTextIndicator withLifetime:TextIndicatorLifetime::Permanent];
</del><ins>+            [_webView _setTextIndicator:*detectedDataTextIndicator withLifetime:TextIndicatorWindowLifetime::Permanent];
</ins><span class="cx">     } interactionStoppedHandler:^() {
</span><del>-        [_webView _clearTextIndicatorWithAnimation:TextIndicatorDismissalAnimation::FadeOut];
</del><ins>+        [_webView _clearTextIndicatorWithAnimation:TextIndicatorWindowDismissalAnimation::FadeOut];
</ins><span class="cx">     }];
</span><span class="cx"> 
</span><span class="cx">     [_currentActionContext setHighlightFrame:[_webView.window convertRectToScreen:detectedDataBoundingBox]];
</span><span class="lines">@@ -448,14 +448,14 @@
</span><span class="cx">     RefPtr&lt;Range&gt; linkRange = rangeOfContents(*_hitTestResult.URLElement());
</span><span class="cx">     if (!linkRange)
</span><span class="cx">         return nullptr;
</span><del>-    RefPtr&lt;TextIndicator&gt; indicator = TextIndicator::createWithRange(*linkRange, TextIndicatorPresentationTransition::FadeIn);
</del><ins>+    RefPtr&lt;TextIndicator&gt; indicator = TextIndicator::createWithRange(*linkRange, TextIndicatorOptionDefault, TextIndicatorPresentationTransition::FadeIn);
</ins><span class="cx"> 
</span><span class="cx">     _currentActionContext = [actionContext contextForView:_webView altMode:YES interactionStartedHandler:^() {
</span><span class="cx">     } interactionChangedHandler:^() {
</span><span class="cx">         if (indicator)
</span><del>-            [_webView _setTextIndicator:*indicator withLifetime:TextIndicatorLifetime::Permanent];
</del><ins>+            [_webView _setTextIndicator:*indicator withLifetime:TextIndicatorWindowLifetime::Permanent];
</ins><span class="cx">     } interactionStoppedHandler:^() {
</span><del>-        [_webView _clearTextIndicatorWithAnimation:TextIndicatorDismissalAnimation::FadeOut];
</del><ins>+        [_webView _clearTextIndicatorWithAnimation:TextIndicatorWindowDismissalAnimation::FadeOut];
</ins><span class="cx">     }];
</span><span class="cx"> 
</span><span class="cx">     [_currentActionContext setHighlightFrame:[_webView.window convertRectToScreen:elementBoundingBoxInWindowCoordinatesFromNode(_hitTestResult.URLElement())]];
</span><span class="lines">@@ -479,7 +479,7 @@
</span><span class="cx">     const RenderStyle&amp; style = renderer-&gt;style();
</span><span class="cx"> 
</span><span class="cx">     Vector&lt;FloatQuad&gt; quads;
</span><del>-    range.textQuads(quads);
</del><ins>+    range.absoluteTextQuads(quads);
</ins><span class="cx">     if (quads.isEmpty())
</span><span class="cx">         return popupInfo;
</span><span class="cx"> 
</span><span class="lines">@@ -505,7 +505,7 @@
</span><span class="cx">     }];
</span><span class="cx"> 
</span><span class="cx">     popupInfo.attributedString = scaledNSAttributedString.get();
</span><del>-    popupInfo.textIndicator = TextIndicator::createWithRange(range, presentationTransition);
</del><ins>+    popupInfo.textIndicator = TextIndicator::createWithRange(range, TextIndicatorOptionDefault, presentationTransition);
</ins><span class="cx">     return popupInfo;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebView.mm        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -8566,7 +8566,7 @@
</span><span class="cx">         if (!mutableOptions)
</span><span class="cx">             mutableOptions = adoptNS([[NSMutableDictionary alloc] init]);
</span><span class="cx">         [mutableOptions setObject:@YES forKey:getLUTermOptionDisableSearchTermIndicator()];
</span><del>-        [self _setTextIndicator:*dictionaryPopupInfo.textIndicator withLifetime:TextIndicatorLifetime::Permanent];
</del><ins>+        [self _setTextIndicator:*dictionaryPopupInfo.textIndicator withLifetime:TextIndicatorWindowLifetime::Permanent];
</ins><span class="cx">         return [getLULookupDefinitionModuleClass() lookupAnimationControllerForTerm:dictionaryPopupInfo.attributedString.get() atLocation:textBaselineOrigin options:mutableOptions.get()];
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -8586,10 +8586,10 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)_setTextIndicator:(TextIndicator&amp;)textIndicator
</span><span class="cx"> {
</span><del>-    [self _setTextIndicator:textIndicator withLifetime:TextIndicatorLifetime::Permanent];
</del><ins>+    [self _setTextIndicator:textIndicator withLifetime:TextIndicatorWindowLifetime::Permanent];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)_setTextIndicator:(TextIndicator&amp;)textIndicator withLifetime:(TextIndicatorLifetime)lifetime
</del><ins>+- (void)_setTextIndicator:(TextIndicator&amp;)textIndicator withLifetime:(TextIndicatorWindowLifetime)lifetime
</ins><span class="cx"> {
</span><span class="cx">     if (!_private-&gt;textIndicatorWindow)
</span><span class="cx">         _private-&gt;textIndicatorWindow = std::make_unique&lt;TextIndicatorWindow&gt;(self);
</span><span class="lines">@@ -8599,10 +8599,10 @@
</span><span class="cx">     _private-&gt;textIndicatorWindow-&gt;setTextIndicator(textIndicator, NSRectToCGRect(textBoundingRectInScreenCoordinates), lifetime);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)_clearTextIndicatorWithAnimation:(TextIndicatorDismissalAnimation)animation
</del><ins>+- (void)_clearTextIndicatorWithAnimation:(TextIndicatorWindowDismissalAnimation)animation
</ins><span class="cx"> {
</span><span class="cx">     if (_private-&gt;textIndicatorWindow)
</span><del>-        _private-&gt;textIndicatorWindow-&gt;clearTextIndicator(TextIndicatorDismissalAnimation::FadeOut);
</del><ins>+        _private-&gt;textIndicatorWindow-&gt;clearTextIndicator(TextIndicatorWindowDismissalAnimation::FadeOut);
</ins><span class="cx">     _private-&gt;textIndicatorWindow = nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -8632,7 +8632,7 @@
</span><span class="cx">         if (!mutableOptions)
</span><span class="cx">             mutableOptions = adoptNS([[NSMutableDictionary alloc] init]);
</span><span class="cx">         [mutableOptions setObject:@YES forKey:getLUTermOptionDisableSearchTermIndicator()];
</span><del>-        [self _setTextIndicator:*dictionaryPopupInfo.textIndicator withLifetime:TextIndicatorLifetime::Permanent];
</del><ins>+        [self _setTextIndicator:*dictionaryPopupInfo.textIndicator withLifetime:TextIndicatorWindowLifetime::Permanent];
</ins><span class="cx">         [getLULookupDefinitionModuleClass() showDefinitionForTerm:dictionaryPopupInfo.attributedString.get() atLocation:textBaselineOrigin options:mutableOptions.get()];
</span><span class="cx">     } else
</span><span class="cx">         [getLULookupDefinitionModuleClass() showDefinitionForTerm:dictionaryPopupInfo.attributedString.get() atLocation:textBaselineOrigin options:dictionaryPopupInfo.options.get()];
</span><span class="lines">@@ -8640,7 +8640,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)_dictionaryLookupPopoverWillClose:(NSNotification *)notification
</span><span class="cx"> {
</span><del>-    [self _clearTextIndicatorWithAnimation:TextIndicatorDismissalAnimation::FadeOut];
</del><ins>+    [self _clearTextIndicatorWithAnimation:TextIndicatorWindowDismissalAnimation::FadeOut];
</ins><span class="cx"> }
</span><span class="cx"> #endif // PLATFORM(MAC)
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebViewInternalh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebViewInternal.h (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebViewInternal.h        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebKit/mac/WebView/WebViewInternal.h        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -266,8 +266,8 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC) &amp;&amp; defined(__cplusplus)
</span><span class="cx"> - (void)_setTextIndicator:(WebCore::TextIndicator&amp;)textIndicator;
</span><del>-- (void)_setTextIndicator:(WebCore::TextIndicator&amp;)textIndicator withLifetime:(WebCore::TextIndicatorLifetime)lifetime;
-- (void)_clearTextIndicatorWithAnimation:(WebCore::TextIndicatorDismissalAnimation)animation;
</del><ins>+- (void)_setTextIndicator:(WebCore::TextIndicator&amp;)textIndicator withLifetime:(WebCore::TextIndicatorWindowLifetime)lifetime;
+- (void)_clearTextIndicatorWithAnimation:(WebCore::TextIndicatorWindowDismissalAnimation)animation;
</ins><span class="cx"> - (void)_setTextIndicatorAnimationProgress:(float)progress;
</span><span class="cx"> - (void)_showDictionaryLookupPopup:(const DictionaryPopupInfo&amp;)dictionaryPopupInfo;
</span><span class="cx"> #if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
</span></span></pre></div>
<a id="trunkSourceWebKitwinAccessibleTextImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/AccessibleTextImpl.cpp (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/AccessibleTextImpl.cpp        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebKit/win/AccessibleTextImpl.cpp        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -462,7 +462,7 @@
</span><span class="cx">     if (textRange.start.isNull() || textRange.end.isNull())
</span><span class="cx">         return S_FALSE;
</span><span class="cx"> 
</span><del>-    IntRect boundingBox = makeRange(textRange.start, textRange.end)-&gt;boundingBox();
</del><ins>+    IntRect boundingBox = makeRange(textRange.start, textRange.end)-&gt;absoluteBoundingBox();
</ins><span class="cx">     switch (scrollType) {
</span><span class="cx">     case IA2_SCROLL_TYPE_TOP_LEFT:
</span><span class="cx">         m_object-&gt;scrollToGlobalPoint(boundingBox.minXMinYCorner());
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebKit2/ChangeLog        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -1,3 +1,51 @@
</span><ins>+2015-08-13  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+        Refactor and improve TextIndicator to prepare for tests
+        https://bugs.webkit.org/show_bug.cgi?id=147622
+
+        Reviewed by Simon Fraser.
+
+        * Shared/WebCoreArgumentCoders.cpp:
+        (IPC::encodeOptionalImage):
+        (IPC::decodeOptionalImage):
+        (IPC::ArgumentCoder&lt;TextIndicatorData&gt;::encode):
+        (IPC::ArgumentCoder&lt;TextIndicatorData&gt;::decode):
+        Move encode/decodeOptionalImage to their own functions to avoid duplication.
+
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView _dictionaryLookupPopoverWillClose:]):
+        (-[WKView _setTextIndicator:]):
+        (-[WKView _setTextIndicator:withLifetime:]):
+        (-[WKView _clearTextIndicatorWithAnimation:]):
+        (-[WKView _dismissContentRelativeChildWindows]):
+        (-[WKView _dismissContentRelativeChildWindowsWithAnimation:]):
+        * UIProcess/API/mac/WKViewInternal.h:
+        * UIProcess/PageClient.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::setTextIndicator):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/ios/PageClientImplIOS.h:
+        * UIProcess/ios/PageClientImplIOS.mm:
+        (WebKit::PageClientImpl::setTextIndicator):
+        (WebKit::PageClientImpl::clearTextIndicator):
+        * UIProcess/mac/PageClientImpl.h:
+        * UIProcess/mac/PageClientImpl.mm:
+        (WebKit::PageClientImpl::setTextIndicator):
+        (WebKit::PageClientImpl::clearTextIndicator):
+        (WebKit::PageClientImpl::didPerformDictionaryLookup):
+        * UIProcess/mac/WKImmediateActionController.mm:
+        (-[WKImmediateActionController _animationControllerForText]):
+        * WebProcess/WebPage/FindController.cpp:
+        (WebKit::FindController::updateFindIndicator):
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::getPositionInformation):
+        (WebKit::shouldUseTextIndicatorForLink): Deleted.
+        * WebProcess/WebPage/mac/WebPageMac.mm:
+        (WebKit::WebPage::dictionaryPopupInfoForRange):
+        (WebKit::WebPage::performImmediateActionHitTestAtLocation):
+        Adopt TextIndicatorOptions.
+        Adjust to Range method renames.
+
</ins><span class="cx"> 2015-08-13  Jaehun Lim  &lt;ljaehun.lim@samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [CMake] Unreviewed build fix after r188404
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebCoreArgumentCoderscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -750,6 +750,29 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static void encodeOptionalImage(ArgumentEncoder&amp; encoder, Image* image)
+{
+    bool hasImage = !!image;
+    encoder &lt;&lt; hasImage;
+
+    if (hasImage)
+        encodeImage(encoder, image);
+}
+
+static bool decodeOptionalImage(ArgumentDecoder&amp; decoder, RefPtr&lt;Image&gt;&amp; image)
+{
+    image = nullptr;
+
+    bool hasImage;
+    if (!decoder.decode(hasImage))
+        return false;
+
+    if (!hasImage)
+        return true;
+
+    return decodeImage(decoder, image);
+}
+
</ins><span class="cx"> #if !PLATFORM(IOS)
</span><span class="cx"> void ArgumentCoder&lt;Cursor&gt;::encode(ArgumentEncoder&amp; encoder, const Cursor&amp; cursor)
</span><span class="cx"> {
</span><span class="lines">@@ -2116,18 +2139,12 @@
</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.wantsMargin;
</del><ins>+    encoder &lt;&lt; textIndicatorData.indicatesCurrentSelection;
</ins><span class="cx">     encoder.encodeEnum(textIndicatorData.presentationTransition);
</span><ins>+    encoder &lt;&lt; static_cast&lt;uint64_t&gt;(textIndicatorData.options);
</ins><span class="cx"> 
</span><del>-    bool hasImage = textIndicatorData.contentImage;
-    encoder &lt;&lt; hasImage;
-    if (hasImage)
-        encodeImage(encoder, textIndicatorData.contentImage.get());
-
-    bool hasImageWithHighlight = textIndicatorData.contentImageWithHighlight;
-    encoder &lt;&lt; hasImageWithHighlight;
-    if (hasImageWithHighlight)
-        encodeImage(encoder, textIndicatorData.contentImageWithHighlight.get());
</del><ins>+    encodeOptionalImage(encoder, textIndicatorData.contentImage.get());
+    encodeOptionalImage(encoder, textIndicatorData.contentImageWithHighlight.get());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool ArgumentCoder&lt;TextIndicatorData&gt;::decode(ArgumentDecoder&amp; decoder, TextIndicatorData&amp; textIndicatorData)
</span><span class="lines">@@ -2144,27 +2161,22 @@
</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.wantsMargin))
</del><ins>+    if (!decoder.decode(textIndicatorData.indicatesCurrentSelection))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     if (!decoder.decodeEnum(textIndicatorData.presentationTransition))
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    bool hasImage;
-    if (!decoder.decode(hasImage))
</del><ins>+    uint64_t options;
+    if (!decoder.decode(options))
</ins><span class="cx">         return false;
</span><del>-    if (!hasImage)
-        textIndicatorData.contentImage = nullptr;
-    if (hasImage &amp;&amp; !decodeImage(decoder, textIndicatorData.contentImage))
</del><ins>+    textIndicatorData.options = static_cast&lt;TextIndicatorOptions&gt;(options);
+
+    if (!decodeOptionalImage(decoder, textIndicatorData.contentImage))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    bool hasImageWithHighlight;
-    if (!decoder.decode(hasImageWithHighlight))
</del><ins>+    if (!decodeOptionalImage(decoder, textIndicatorData.contentImageWithHighlight))
</ins><span class="cx">         return false;
</span><del>-    if (!hasImageWithHighlight)
-        textIndicatorData.contentImageWithHighlight = nullptr;
-    if (hasImageWithHighlight &amp;&amp; !decodeImage(decoder, textIndicatorData.contentImageWithHighlight))
-        return false;
</del><span class="cx"> 
</span><span class="cx">     return true;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkPageClientImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -223,21 +223,6 @@
</span><span class="cx">     return WebColorPickerGtk::create(*page, color, rect);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PageClientImpl::setTextIndicator(Ref&lt;WebCore::TextIndicator&gt;, WebCore::TextIndicatorLifetime)
-{
-    notImplemented();
-}
-
-void PageClientImpl::clearTextIndicator(WebCore::TextIndicatorDismissalAnimation)
-{
-    notImplemented();
-}
-
-void PageClientImpl::setTextIndicatorAnimationProgress(float)
-{
-    notImplemented();
-}
-
</del><span class="cx"> void PageClientImpl::enterAcceleratedCompositingMode(const LayerTreeContext&amp;)
</span><span class="cx"> {
</span><span class="cx">     webkitWebViewBaseEnterAcceleratedCompositingMode(WEBKIT_WEB_VIEW_BASE(m_viewWidget));
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkPageClientImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -87,9 +87,6 @@
</span><span class="cx"> #if ENABLE(INPUT_TYPE_COLOR)
</span><span class="cx">     virtual RefPtr&lt;WebColorPicker&gt; createColorPicker(WebPageProxy*, const WebCore::Color&amp; intialColor, const WebCore::IntRect&amp;) override;
</span><span class="cx"> #endif
</span><del>-    virtual void setTextIndicator(Ref&lt;WebCore::TextIndicator&gt;, WebCore::TextIndicatorLifetime = WebCore::TextIndicatorLifetime::Permanent) override;
-    virtual void clearTextIndicator(WebCore::TextIndicatorDismissalAnimation = WebCore::TextIndicatorDismissalAnimation::FadeOut) override;
-    virtual void setTextIndicatorAnimationProgress(float) override;
</del><span class="cx">     virtual void selectionDidChange() override;
</span><span class="cx"> #if ENABLE(DRAG_SUPPORT)
</span><span class="cx">     virtual void startDrag(const WebCore::DragData&amp;, PassRefPtr&lt;ShareableBitmap&gt; dragImage) override;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPImacWKViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -2870,7 +2870,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)_dictionaryLookupPopoverWillClose:(NSNotification *)notification
</span><span class="cx"> {
</span><del>-    [self _clearTextIndicatorWithAnimation:TextIndicatorDismissalAnimation::None];
</del><ins>+    [self _clearTextIndicatorWithAnimation:TextIndicatorWindowDismissalAnimation::None];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)_accessibilityRegisterUIProcessTokens
</span><span class="lines">@@ -3258,10 +3258,10 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)_setTextIndicator:(TextIndicator&amp;)textIndicator
</span><span class="cx"> {
</span><del>-    [self _setTextIndicator:textIndicator withLifetime:TextIndicatorLifetime::Permanent];
</del><ins>+    [self _setTextIndicator:textIndicator withLifetime:TextIndicatorWindowLifetime::Permanent];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)_setTextIndicator:(TextIndicator&amp;)textIndicator withLifetime:(TextIndicatorLifetime)lifetime
</del><ins>+- (void)_setTextIndicator:(TextIndicator&amp;)textIndicator withLifetime:(TextIndicatorWindowLifetime)lifetime
</ins><span class="cx"> {
</span><span class="cx">     if (!_data-&gt;_textIndicatorWindow)
</span><span class="cx">         _data-&gt;_textIndicatorWindow = std::make_unique&lt;TextIndicatorWindow&gt;(self);
</span><span class="lines">@@ -3270,7 +3270,7 @@
</span><span class="cx">     _data-&gt;_textIndicatorWindow-&gt;setTextIndicator(textIndicator, NSRectToCGRect(textBoundingRectInScreenCoordinates), lifetime);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)_clearTextIndicatorWithAnimation:(TextIndicatorDismissalAnimation)animation
</del><ins>+- (void)_clearTextIndicatorWithAnimation:(TextIndicatorWindowDismissalAnimation)animation
</ins><span class="cx"> {
</span><span class="cx">     if (_data-&gt;_textIndicatorWindow)
</span><span class="cx">         _data-&gt;_textIndicatorWindow-&gt;clearTextIndicator(animation);
</span><span class="lines">@@ -4686,7 +4686,7 @@
</span><span class="cx"> #endif
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    [self _clearTextIndicatorWithAnimation:TextIndicatorDismissalAnimation::FadeOut];
</del><ins>+    [self _clearTextIndicatorWithAnimation:TextIndicatorWindowDismissalAnimation::FadeOut];
</ins><span class="cx"> 
</span><span class="cx"> #if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101000
</span><span class="cx">     [_data-&gt;_immediateActionController dismissContentRelativeChildWindows];
</span><span class="lines">@@ -4699,7 +4699,7 @@
</span><span class="cx"> {
</span><span class="cx">     // Calling _clearTextIndicatorWithAnimation here will win out over the animated clear in _dismissContentRelativeChildWindows.
</span><span class="cx">     // We can't invert these because clients can override (and have overridden) _dismissContentRelativeChildWindows, so it needs to be called.
</span><del>-    [self _clearTextIndicatorWithAnimation:withAnimation ? TextIndicatorDismissalAnimation::FadeOut : TextIndicatorDismissalAnimation::None];
</del><ins>+    [self _clearTextIndicatorWithAnimation:withAnimation ? TextIndicatorWindowDismissalAnimation::FadeOut : TextIndicatorWindowDismissalAnimation::None];
</ins><span class="cx">     [self _dismissContentRelativeChildWindows];
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPImacWKViewInternalh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -49,6 +49,8 @@
</span><span class="cx"> class Image;
</span><span class="cx"> class SharedBuffer;
</span><span class="cx"> class TextIndicator;
</span><ins>+enum class TextIndicatorWindowLifetime : uint8_t;
+enum class TextIndicatorWindowDismissalAnimation : uint8_t;
</ins><span class="cx"> struct KeypressCommand;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -86,8 +88,8 @@
</span><span class="cx"> - (NSRect)_convertToDeviceSpace:(NSRect)rect;
</span><span class="cx"> - (NSRect)_convertToUserSpace:(NSRect)rect;
</span><span class="cx"> - (void)_setTextIndicator:(WebCore::TextIndicator&amp;)textIndicator;
</span><del>-- (void)_setTextIndicator:(WebCore::TextIndicator&amp;)textIndicator withLifetime:(WebCore::TextIndicatorLifetime)lifetime;
-- (void)_clearTextIndicatorWithAnimation:(WebCore::TextIndicatorDismissalAnimation)animation;
</del><ins>+- (void)_setTextIndicator:(WebCore::TextIndicator&amp;)textIndicator withLifetime:(WebCore::TextIndicatorWindowLifetime)lifetime;
+- (void)_clearTextIndicatorWithAnimation:(WebCore::TextIndicatorWindowDismissalAnimation)animation;
</ins><span class="cx"> - (void)_setTextIndicatorAnimationProgress:(float)progress;
</span><span class="cx"> - (void)_selectionChanged;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCoordinatedGraphicsWebViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.cpp (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.cpp        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.cpp        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -451,21 +451,6 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-void WebView::setTextIndicator(Ref&lt;WebCore::TextIndicator&gt;, WebCore::TextIndicatorLifetime)
-{
-    notImplemented();
-}
-
-void WebView::clearTextIndicator(WebCore::TextIndicatorDismissalAnimation)
-{
-    notImplemented();
-}
-
-void WebView::setTextIndicatorAnimationProgress(float)
-{
-    notImplemented();
-}
-
</del><span class="cx"> void WebView::enterAcceleratedCompositingMode(const LayerTreeContext&amp;)
</span><span class="cx"> {
</span><span class="cx">     setActive(true);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCoordinatedGraphicsWebViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.h (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.h        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.h        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -185,10 +185,6 @@
</span><span class="cx">     virtual RefPtr&lt;WebColorPicker&gt; createColorPicker(WebPageProxy*, const WebCore::Color&amp; initialColor, const WebCore::IntRect&amp;) override;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    virtual void setTextIndicator(Ref&lt;WebCore::TextIndicator&gt;, WebCore::TextIndicatorLifetime = WebCore::TextIndicatorLifetime::Permanent) override;
-    virtual void clearTextIndicator(WebCore::TextIndicatorDismissalAnimation = WebCore::TextIndicatorDismissalAnimation::FadeOut) override;
-    virtual void setTextIndicatorAnimationProgress(float) override;
-
</del><span class="cx">     virtual void enterAcceleratedCompositingMode(const LayerTreeContext&amp;) override;
</span><span class="cx">     virtual void exitAcceleratedCompositingMode() override;
</span><span class="cx">     virtual void updateAcceleratedCompositingMode(const LayerTreeContext&amp;) override;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessPageClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/PageClient.h (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/PageClient.h        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebKit2/UIProcess/PageClient.h        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -49,6 +49,8 @@
</span><span class="cx"> class Cursor;
</span><span class="cx"> class TextIndicator;
</span><span class="cx"> class WebMediaSessionManager;
</span><ins>+enum class TextIndicatorWindowLifetime : uint8_t;
+enum class TextIndicatorWindowDismissalAnimation : uint8_t;
</ins><span class="cx"> struct Highlight;
</span><span class="cx"> struct ViewportAttributes;
</span><span class="cx"> }
</span><span class="lines">@@ -224,9 +226,11 @@
</span><span class="cx">     virtual RefPtr&lt;WebColorPicker&gt; createColorPicker(WebPageProxy*, const WebCore::Color&amp; initialColor, const WebCore::IntRect&amp;) = 0;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    virtual void setTextIndicator(Ref&lt;WebCore::TextIndicator&gt;, WebCore::TextIndicatorLifetime = WebCore::TextIndicatorLifetime::Permanent) = 0;
-    virtual void clearTextIndicator(WebCore::TextIndicatorDismissalAnimation = WebCore::TextIndicatorDismissalAnimation::FadeOut) = 0;
</del><ins>+#if PLATFORM(COCOA)
+    virtual void setTextIndicator(Ref&lt;WebCore::TextIndicator&gt;, WebCore::TextIndicatorWindowLifetime) = 0;
+    virtual void clearTextIndicator(WebCore::TextIndicatorWindowDismissalAnimation) = 0;
</ins><span class="cx">     virtual void setTextIndicatorAnimationProgress(float) = 0;
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     virtual void enterAcceleratedCompositingMode(const LayerTreeContext&amp;) = 0;
</span><span class="cx">     virtual void exitAcceleratedCompositingMode() = 0;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -144,6 +144,7 @@
</span><span class="cx"> #include &quot;ViewSnapshotStore.h&quot;
</span><span class="cx"> #include &lt;WebCore/MachSendRight.h&gt;
</span><span class="cx"> #include &lt;WebCore/RunLoopObserver.h&gt;
</span><ins>+#include &lt;WebCore/TextIndicatorWindow.h&gt;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="lines">@@ -4089,17 +4090,30 @@
</span><span class="cx"> 
</span><span class="cx"> void WebPageProxy::setTextIndicator(const TextIndicatorData&amp; indicatorData, uint64_t lifetime)
</span><span class="cx"> {
</span><del>-    m_pageClient.setTextIndicator(TextIndicator::create(indicatorData), static_cast&lt;TextIndicatorLifetime&gt;(lifetime));
</del><ins>+    // FIXME: Make TextIndicatorWindow a platform-independent presentational thing (&quot;TextIndicatorPresentation&quot;?).
+#if PLATFORM(COCOA)
+    m_pageClient.setTextIndicator(TextIndicator::create(indicatorData), static_cast&lt;TextIndicatorWindowLifetime&gt;(lifetime));
+#else
+    ASSERT_NOT_REACHED();
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPageProxy::clearTextIndicator()
</span><span class="cx"> {
</span><del>-    m_pageClient.clearTextIndicator();
</del><ins>+#if PLATFORM(COCOA)
+    m_pageClient.clearTextIndicator(TextIndicatorWindowDismissalAnimation::FadeOut);
+#else
+    ASSERT_NOT_REACHED();
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPageProxy::setTextIndicatorAnimationProgress(float progress)
</span><span class="cx"> {
</span><ins>+#if PLATFORM(COCOA)
</ins><span class="cx">     m_pageClient.setTextIndicatorAnimationProgress(progress);
</span><ins>+#else
+    ASSERT_NOT_REACHED();
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPageProxy::didFindString(const String&amp; string, uint32_t matchCount, int32_t matchIndex)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -733,7 +733,7 @@
</span><span class="cx">     void hideFindUI();
</span><span class="cx">     void countStringMatches(const String&amp;, FindOptions, unsigned maxMatchCount);
</span><span class="cx">     void didCountStringMatches(const String&amp;, uint32_t matchCount);
</span><del>-    void setTextIndicator(const WebCore::TextIndicatorData&amp;, uint64_t /* WebCore::TextIndicatorLifetime */ lifetime = (uint64_t)WebCore::TextIndicatorLifetime::Permanent);
</del><ins>+    void setTextIndicator(const WebCore::TextIndicatorData&amp;, uint64_t /* WebCore::TextIndicatorWindowLifetime */ lifetime = 0 /* Permanent */);
</ins><span class="cx">     void setTextIndicatorAnimationProgress(float);
</span><span class="cx">     void clearTextIndicator();
</span><span class="cx">     void didFindString(const String&amp;, uint32_t matchCount, int32_t matchIndex);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosPageClientImplIOSh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -99,8 +99,8 @@
</span><span class="cx"> #endif
</span><span class="cx">     virtual RefPtr&lt;WebPopupMenuProxy&gt; createPopupMenuProxy(WebPageProxy*) override;
</span><span class="cx">     virtual RefPtr&lt;WebContextMenuProxy&gt; createContextMenuProxy(WebPageProxy*) override;
</span><del>-    virtual void setTextIndicator(Ref&lt;WebCore::TextIndicator&gt;, WebCore::TextIndicatorLifetime = WebCore::TextIndicatorLifetime::Permanent) override;
-    virtual void clearTextIndicator(WebCore::TextIndicatorDismissalAnimation = WebCore::TextIndicatorDismissalAnimation::FadeOut) override;
</del><ins>+    virtual void setTextIndicator(Ref&lt;WebCore::TextIndicator&gt;, WebCore::TextIndicatorWindowLifetime) override;
+    virtual void clearTextIndicator(WebCore::TextIndicatorWindowDismissalAnimation) override;
</ins><span class="cx">     virtual void setTextIndicatorAnimationProgress(float) override;
</span><span class="cx"> 
</span><span class="cx">     virtual void enterAcceleratedCompositingMode(const LayerTreeContext&amp;) override;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosPageClientImplIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -453,11 +453,11 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PageClientImpl::setTextIndicator(Ref&lt;TextIndicator&gt; textIndicator, TextIndicatorLifetime)
</del><ins>+void PageClientImpl::setTextIndicator(Ref&lt;TextIndicator&gt; textIndicator, TextIndicatorWindowLifetime)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PageClientImpl::clearTextIndicator(TextIndicatorDismissalAnimation)
</del><ins>+void PageClientImpl::clearTextIndicator(TextIndicatorWindowDismissalAnimation)
</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 (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -127,8 +127,8 @@
</span><span class="cx">     virtual RefPtr&lt;WebColorPicker&gt; createColorPicker(WebPageProxy*, const WebCore::Color&amp; initialColor, const WebCore::IntRect&amp;) override;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    virtual void setTextIndicator(Ref&lt;WebCore::TextIndicator&gt;, WebCore::TextIndicatorLifetime = WebCore::TextIndicatorLifetime::Permanent) override;
-    virtual void clearTextIndicator(WebCore::TextIndicatorDismissalAnimation = WebCore::TextIndicatorDismissalAnimation::FadeOut) override;
</del><ins>+    virtual void setTextIndicator(Ref&lt;WebCore::TextIndicator&gt;, WebCore::TextIndicatorWindowLifetime) override;
+    virtual void clearTextIndicator(WebCore::TextIndicatorWindowDismissalAnimation) override;
</ins><span class="cx">     virtual void setTextIndicatorAnimationProgress(float) override;
</span><span class="cx"> 
</span><span class="cx">     virtual void enterAcceleratedCompositingMode(const LayerTreeContext&amp;) override;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacPageClientImplmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -61,6 +61,7 @@
</span><span class="cx"> #import &lt;WebCore/NotImplemented.h&gt;
</span><span class="cx"> #import &lt;WebCore/SharedBuffer.h&gt;
</span><span class="cx"> #import &lt;WebCore/TextIndicator.h&gt;
</span><ins>+#import &lt;WebCore/TextIndicatorWindow.h&gt;
</ins><span class="cx"> #import &lt;WebCore/TextUndoInsertionMarkupMac.h&gt;
</span><span class="cx"> #import &lt;WebKitSystemInterface.h&gt;
</span><span class="cx"> #import &lt;wtf/text/CString.h&gt;
</span><span class="lines">@@ -505,12 +506,12 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-void PageClientImpl::setTextIndicator(Ref&lt;TextIndicator&gt; textIndicator, WebCore::TextIndicatorLifetime lifetime)
</del><ins>+void PageClientImpl::setTextIndicator(Ref&lt;TextIndicator&gt; textIndicator, WebCore::TextIndicatorWindowLifetime lifetime)
</ins><span class="cx"> {
</span><span class="cx">     [m_wkView _setTextIndicator:textIndicator.get() withLifetime:lifetime];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PageClientImpl::clearTextIndicator(WebCore::TextIndicatorDismissalAnimation dismissalAnimation)
</del><ins>+void PageClientImpl::clearTextIndicator(WebCore::TextIndicatorWindowDismissalAnimation dismissalAnimation)
</ins><span class="cx"> {
</span><span class="cx">     [m_wkView _clearTextIndicatorWithAnimation:dismissalAnimation];
</span><span class="cx"> }
</span><span class="lines">@@ -598,7 +599,7 @@
</span><span class="cx">     [m_wkView _prepareForDictionaryLookup];
</span><span class="cx"> 
</span><span class="cx">     if (canLoadLUTermOptionDisableSearchTermIndicator() &amp;&amp; dictionaryPopupInfo.textIndicator.contentImage) {
</span><del>-        [m_wkView _setTextIndicator:TextIndicator::create(dictionaryPopupInfo.textIndicator) withLifetime:TextIndicatorLifetime::Permanent];
</del><ins>+        [m_wkView _setTextIndicator:TextIndicator::create(dictionaryPopupInfo.textIndicator) withLifetime:TextIndicatorWindowLifetime::Permanent];
</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">     } else
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacWKImmediateActionControllermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -41,6 +41,7 @@
</span><span class="cx"> #import &lt;WebCore/NSPopoverSPI.h&gt;
</span><span class="cx"> #import &lt;WebCore/QuickLookMacSPI.h&gt;
</span><span class="cx"> #import &lt;WebCore/SoftLinking.h&gt;
</span><ins>+#import &lt;WebCore/TextIndicatorWindow.h&gt;
</ins><span class="cx"> #import &lt;WebCore/URL.h&gt;
</span><span class="cx"> 
</span><span class="cx"> SOFT_LINK_FRAMEWORK_IN_UMBRELLA(Quartz, QuickLookUI)
</span><span class="lines">@@ -477,7 +478,7 @@
</span><span class="cx">     RetainPtr&lt;NSMutableDictionary&gt; mutableOptions = adoptNS([(NSDictionary *)dictionaryPopupInfo.options.get() mutableCopy]);
</span><span class="cx">     if (canLoadLUTermOptionDisableSearchTermIndicator() &amp;&amp; dictionaryPopupInfo.textIndicator.contentImage) {
</span><span class="cx">         RefPtr&lt;TextIndicator&gt; indicator = TextIndicator::create(dictionaryPopupInfo.textIndicator);
</span><del>-        [_wkView _setTextIndicator:*indicator withLifetime:TextIndicatorLifetime::Permanent];
</del><ins>+        [_wkView _setTextIndicator:*indicator withLifetime:TextIndicatorWindowLifetime::Permanent];
</ins><span class="cx">         [mutableOptions setObject:@YES forKey:getLUTermOptionDisableSearchTermIndicator()];
</span><span class="cx">         return [getLULookupDefinitionModuleClass() lookupAnimationControllerForTerm:dictionaryPopupInfo.attributedString.string.get() atLocation:textBaselineOrigin options:mutableOptions.get()];
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPImacWKDOMRangemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMRange.mm (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMRange.mm        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKDOMRange.mm        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -142,7 +142,7 @@
</span><span class="cx"> {
</span><span class="cx">     _impl-&gt;ownerDocument().updateLayoutIgnorePendingStylesheets();
</span><span class="cx">     Vector&lt;WebCore::IntRect&gt; rects;
</span><del>-    _impl-&gt;textRects(rects);
</del><ins>+    _impl-&gt;absoluteTextRects(rects);
</ins><span class="cx">     return WebKit::toNSArray(rects);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleDOMInjectedBundleRangeHandlecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -97,7 +97,7 @@
</span><span class="cx"> 
</span><span class="cx"> WebCore::IntRect InjectedBundleRangeHandle::boundingRectInWindowCoordinates() const
</span><span class="cx"> {
</span><del>-    FloatRect boundingRect = m_range-&gt;boundingRect();
</del><ins>+    FloatRect boundingRect = m_range-&gt;absoluteBoundingRect();
</ins><span class="cx">     Frame* frame = m_range-&gt;ownerDocument().frame();
</span><span class="cx">     return frame-&gt;view()-&gt;contentsToWindow(enclosingIntRect(boundingRect));
</span><span class="cx"> }
</span><span class="lines">@@ -117,7 +117,7 @@
</span><span class="cx">     frame-&gt;selection().setSelection(VisibleSelection(*m_range));
</span><span class="cx"> 
</span><span class="cx">     float scaleFactor = (options &amp; SnapshotOptionsExcludeDeviceScaleFactor) ? 1 : frame-&gt;page()-&gt;deviceScaleFactor();
</span><del>-    IntRect paintRect = enclosingIntRect(m_range-&gt;boundingRect());
</del><ins>+    IntRect paintRect = enclosingIntRect(m_range-&gt;absoluteBoundingRect());
</ins><span class="cx">     IntSize backingStoreSize = paintRect.size();
</span><span class="cx">     backingStoreSize.scale(scaleFactor);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageFindControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx"> #include &lt;WebCore/PageOverlayController.h&gt;
</span><span class="cx"> #include &lt;WebCore/PlatformMouseEvent.h&gt;
</span><span class="cx"> #include &lt;WebCore/PluginDocument.h&gt;
</span><del>-#include &lt;WebCore/TextIndicator.h&gt;
</del><ins>+#include &lt;WebCore/TextIndicatorWindow.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="lines">@@ -254,7 +254,7 @@
</span><span class="cx">     Vector&lt;Vector&lt;IntRect&gt;&gt; matchRects;
</span><span class="cx">     for (size_t i = 0; i &lt; m_findMatches.size(); ++i) {
</span><span class="cx">         Vector&lt;IntRect&gt; rects;
</span><del>-        m_findMatches[i]-&gt;textRects(rects);
</del><ins>+        m_findMatches[i]-&gt;absoluteTextRects(rects);
</ins><span class="cx">         matchRects.append(WTF::move(rects));
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -317,12 +317,12 @@
</span><span class="cx"> #if !PLATFORM(IOS)
</span><span class="cx"> bool FindController::updateFindIndicator(Frame&amp; selectedFrame, bool isShowingOverlay, bool shouldAnimate)
</span><span class="cx"> {
</span><del>-    RefPtr&lt;TextIndicator&gt; indicator = TextIndicator::createWithSelectionInFrame(selectedFrame, shouldAnimate ? TextIndicatorPresentationTransition::Bounce : TextIndicatorPresentationTransition::None);
</del><ins>+    RefPtr&lt;TextIndicator&gt; indicator = TextIndicator::createWithSelectionInFrame(selectedFrame, TextIndicatorOptionDefault, shouldAnimate ? TextIndicatorPresentationTransition::Bounce : TextIndicatorPresentationTransition::None);
</ins><span class="cx">     if (!indicator)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     m_findIndicatorRect = enclosingIntRect(indicator-&gt;selectionRectInRootViewCoordinates());
</span><del>-    m_webPage-&gt;send(Messages::WebPageProxy::SetTextIndicator(indicator-&gt;data(), static_cast&lt;uint64_t&gt;(isShowingOverlay ? TextIndicatorLifetime::Permanent : TextIndicatorLifetime::Temporary)));
</del><ins>+    m_webPage-&gt;send(Messages::WebPageProxy::SetTextIndicator(indicator-&gt;data(), static_cast&lt;uint64_t&gt;(isShowingOverlay ? TextIndicatorWindowLifetime::Permanent : TextIndicatorWindowLifetime::Temporary)));
</ins><span class="cx">     m_isShowingFindIndicator = true;
</span><span class="cx"> 
</span><span class="cx">     return true;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -2144,19 +2144,6 @@
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool shouldUseTextIndicatorForLink(Element&amp; element)
-{
-    if (element.renderer() &amp;&amp; !element.renderer()-&gt;isInline())
-        return false;
-
-    for (auto&amp; child : descendantsOfType&lt;Element&gt;(element)) {
-        if (child.renderer() &amp;&amp; !child.renderer()-&gt;isInline())
-            return false;
-    }
-
-    return true;
-}
-
</del><span class="cx"> void WebPage::getPositionInformation(const IntPoint&amp; point, InteractionInformationAtPosition&amp; info)
</span><span class="cx"> {
</span><span class="cx">     FloatPoint adjustedPoint;
</span><span class="lines">@@ -2208,15 +2195,15 @@
</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>-                    if (shouldUseTextIndicatorForLink(*linkElement)) {
-                        RefPtr&lt;Range&gt; linkRange = rangeOfContents(*linkElement);
-                        if (linkRange) {
-                            float deviceScaleFactor = corePage()-&gt;deviceScaleFactor();
-                            const float marginInPoints = 4;
-                            RefPtr&lt;TextIndicator&gt; textIndicator = TextIndicator::createWithRange(*linkRange, TextIndicatorPresentationTransition::None, marginInPoints * deviceScaleFactor);
-                            if (textIndicator)
-                                info.linkIndicator = textIndicator-&gt;data();
-                        }
</del><ins>+
+                    RefPtr&lt;Range&gt; linkRange = rangeOfContents(*linkElement);
+                    if (linkRange) {
+                        float deviceScaleFactor = corePage()-&gt;deviceScaleFactor();
+                        const float marginInPoints = 4;
+
+                        RefPtr&lt;TextIndicator&gt; textIndicator = TextIndicator::createWithRange(*linkRange, TextIndicatorOptionTightlyFitContent | TextIndicatorOptionRespectTextColor | TextIndicatorOptionPaintBackgrounds | TextIndicatorOptionUseBoundingRectAndPaintAllContentForComplexRanges, TextIndicatorPresentationTransition::None, marginInPoints * deviceScaleFactor);
+                        if (textIndicator)
+                            info.linkIndicator = textIndicator-&gt;data();
</ins><span class="cx">                     }
</span><span class="cx">                 } else if (element-&gt;renderer() &amp;&amp; element-&gt;renderer()-&gt;isRenderImage()) {
</span><span class="cx">                     auto&amp; renderImage = downcast&lt;RenderImage&gt;(*(element-&gt;renderer()));
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacWebPageMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm (188419 => 188420)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm        2015-08-14 00:01:23 UTC (rev 188419)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm        2015-08-14 00:06:28 UTC (rev 188420)
</span><span class="lines">@@ -549,7 +549,7 @@
</span><span class="cx">     const RenderStyle&amp; style = renderer-&gt;style();
</span><span class="cx"> 
</span><span class="cx">     Vector&lt;FloatQuad&gt; quads;
</span><del>-    range.textQuads(quads);
</del><ins>+    range.absoluteTextQuads(quads);
</ins><span class="cx">     if (quads.isEmpty())
</span><span class="cx">         return dictionaryPopupInfo;
</span><span class="cx"> 
</span><span class="lines">@@ -576,7 +576,11 @@
</span><span class="cx">         [scaledNSAttributedString addAttributes:scaledAttributes.get() range:range];
</span><span class="cx">     }];
</span><span class="cx"> 
</span><del>-    RefPtr&lt;TextIndicator&gt; textIndicator = TextIndicator::createWithRange(range, presentationTransition);
</del><ins>+    TextIndicatorOptions indicatorOptions = TextIndicatorOptionDefault;
+    if (presentationTransition == TextIndicatorPresentationTransition::BounceAndCrossfade)
+        indicatorOptions |= TextIndicatorOptionIncludeSnapshotWithSelectionHighlight;
+
+    RefPtr&lt;TextIndicator&gt; textIndicator = TextIndicator::createWithRange(range, indicatorOptions, presentationTransition);
</ins><span class="cx">     if (!textIndicator)
</span><span class="cx">         return dictionaryPopupInfo;
</span><span class="cx"> 
</span><span class="lines">@@ -1097,7 +1101,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, TextIndicatorPresentationTransition::FadeIn);
</del><ins>+        immediateActionResult.linkTextIndicator = TextIndicator::createWithRange(*linkRange, TextIndicatorOptionDefault, TextIndicatorPresentationTransition::FadeIn);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     NSDictionary *options = nil;
</span><span class="lines">@@ -1126,14 +1130,14 @@
</span><span class="cx">         immediateActionResult.detectedDataActionContext = actionContext;
</span><span class="cx"> 
</span><span class="cx">         Vector&lt;FloatQuad&gt; quads;
</span><del>-        mainResultRange-&gt;textQuads(quads);
</del><ins>+        mainResultRange-&gt;absoluteTextQuads(quads);
</ins><span class="cx">         FloatRect detectedDataBoundingBox;
</span><span class="cx">         FrameView* frameView = mainResultRange-&gt;ownerDocument().view();
</span><span class="cx">         for (const auto&amp; quad : quads)
</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, TextIndicatorPresentationTransition::FadeIn);
</del><ins>+        immediateActionResult.detectedDataTextIndicator = TextIndicator::createWithRange(*mainResultRange, TextIndicatorOptionDefault, TextIndicatorPresentationTransition::FadeIn);
</ins><span class="cx">         immediateActionResult.detectedDataOriginatingPageOverlay = overlay-&gt;pageOverlayID();
</span><span class="cx"> 
</span><span class="cx">         break;
</span><span class="lines">@@ -1146,7 +1150,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, TextIndicatorPresentationTransition::FadeIn);
</del><ins>+            immediateActionResult.detectedDataTextIndicator = TextIndicator::createWithRange(*detectedDataRange, TextIndicatorOptionDefault, TextIndicatorPresentationTransition::FadeIn);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>