<!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<TextIndicatorData>::encode):
(IPC::ArgumentCoder<TextIndicatorData>::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 <timothy_horton@apple.com>
+
+ 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 <jer.noble@apple.com>
</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<Range> dataRange = makeRange(range.start, range.end);
</span><del>- LayoutRect boundingBox = dataRange->boundingBox();
</del><ins>+ LayoutRect boundingBox = dataRange->absoluteBoundingBox();
</ins><span class="cx"> String rangeString = plainText(dataRange.get());
</span><span class="cx"> if (rangeString.length() > 1 && !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<Range> range = rangeOfContents(*coreNode);
</span><span class="cx">
</span><span class="cx"> const float margin = 4 / coreNode->document().page()->pageScaleFactor();
</span><del>- RefPtr<TextIndicator> textIndicator = TextIndicator::createWithRange(range, TextIndicatorPresentationTransition::None, margin);
</del><ins>+ RefPtr<TextIndicator> 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->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)->ownerDocument().updateLayoutIgnorePendingStylesheets();
</span><del>- return core(self)->boundingBox();
</del><ins>+ return core(self)->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<WebCore::IntRect> rects;
</span><span class="cx"> core(self)->ownerDocument().updateLayoutIgnorePendingStylesheets();
</span><del>- core(self)->textRects(rects);
</del><ins>+ core(self)->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->startContainer();
</span><span class="cx"> Vector<RenderedDocumentMarker*> markers = markersFor(node);
</span><del>- markers[markers.size() - 1]->setRenderedRect(range->boundingBox());
</del><ins>+ markers[markers.size() - 1]->setRenderedRect(range->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<Range> range = Range::create(document());
</span><span class="cx"> range->selectNodeContents(const_cast<Node*>(this), IGNORE_EXCEPTION);
</span><del>- range->textRects(rects);
</del><ins>+ range->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& ec)
</del><ins>+bool Range::intersectsNode(Node* refNode, ExceptionCode& 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<IntRect> 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 < 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<IntRect>& rects, bool useSelectionHeight, RangeInFixedPosition* inFixed) const
</del><ins>+void Range::absoluteTextRects(Vector<IntRect>& 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<FloatQuad>& quads, bool useSelectionHeight, RangeInFixedPosition* inFixed) const
</del><ins>+void Range::absoluteTextQuads(Vector<FloatQuad>& 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<FloatQuad> 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<ClientRect> 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<FloatQuad>& quads) const
</del><ins>+void Range::getBorderAndTextQuads(Vector<FloatQuad>& 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<Element>(*node).renderBoxModelObject()) {
</span><span class="cx"> Vector<FloatQuad> elementQuads;
</span><span class="cx"> renderBoxModelObject->absoluteQuads(elementQuads);
</span><del>- ownerDocument().adjustFloatQuadsForScrollAndAbsoluteZoomAndFrameScale(elementQuads, renderBoxModelObject->style());
</del><span class="cx">
</span><ins>+ if (space == CoordinateSpace::Client)
+ ownerDocument().adjustFloatQuadsForScrollAndAbsoluteZoomAndFrameScale(elementQuads, renderBoxModelObject->style());
+
</ins><span class="cx"> quads.appendVector(elementQuads);
</span><span class="cx"> }
</span><span class="cx"> } else if (is<Text>(*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->absoluteQuadsForRange(startOffset, endOffset);
</span><del>- ownerDocument().adjustFloatQuadsForScrollAndAbsoluteZoomAndFrameScale(textQuads, renderText->style());
</del><span class="cx">
</span><ins>+ if (space == CoordinateSpace::Client)
+ ownerDocument().adjustFloatQuadsForScrollAndAbsoluteZoomAndFrameScale(textQuads, renderText->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<FloatQuad> 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&);
</span><span class="cx"> static short compareBoundaryPoints(const RangeBoundaryPoint& boundaryA, const RangeBoundaryPoint& boundaryB, ExceptionCode&);
</span><span class="cx"> WEBCORE_EXPORT bool boundaryPointsValid() const;
</span><del>- bool intersectsNode(Node* refNode, ExceptionCode&);
</del><ins>+ bool intersectsNode(Node* refNode, ExceptionCode&) const;
</ins><span class="cx"> void deleteContents(ExceptionCode&);
</span><span class="cx"> PassRefPtr<DocumentFragment> extractContents(ExceptionCode&);
</span><span class="cx"> PassRefPtr<DocumentFragment> cloneContents(ExceptionCode&);
</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<IntRect>&, bool useSelectionHeight = false, RangeInFixedPosition* = nullptr) const;
- WEBCORE_EXPORT IntRect boundingBox() const;
</del><ins>+ WEBCORE_EXPORT void absoluteTextRects(Vector<IntRect>&, 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<FloatQuad>&, bool useSelectionHeight = false, RangeInFixedPosition* = nullptr) const;
- void getBorderAndTextQuads(Vector<FloatQuad>&) const;
- WEBCORE_EXPORT FloatRect boundingRect() const;
</del><ins>+ WEBCORE_EXPORT void absoluteTextQuads(Vector<FloatQuad>&, 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<SelectionRect>&);
</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<Node> processAncestorsAndTheirSiblings(ActionType, Node* container, ContentsProcessDirection, PassRefPtr<Node> clonedContainer, Node* commonRoot, ExceptionCode&);
</span><span class="cx">
</span><ins>+ enum class CoordinateSpace { Absolute, Client };
+ void getBorderAndTextQuads(Vector<FloatQuad>&, CoordinateSpace) const;
+ FloatRect boundingRectInternal(CoordinateSpace) const;
+
</ins><span class="cx"> Ref<Document> 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<FloatQuad> textQuads;
</span><del>- range->textQuads(textQuads);
</del><ins>+ range->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 < 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->firstNode()->renderer()->scrollRectToVisible(nextMatch->boundingBox(),
</del><ins>+ nextMatch->firstNode()->renderer()->scrollRectToVisible(nextMatch->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->view()->visibleContentRect(ScrollableArea::LegacyIOSDocumentVisibleRect);
</span><span class="cx">
</span><span class="cx"> Vector<FloatQuad> quads;
</span><del>- range->textQuads(quads, textRectHeight == TextRectangleHeight::SelectionHeight);
</del><ins>+ range->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 < 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<FloatQuad> quads;
</span><del>- mainResultRange->textQuads(quads);
</del><ins>+ mainResultRange->absoluteTextQuads(quads);
</ins><span class="cx"> detectedDataBoundingBox = FloatRect();
</span><span class="cx"> FrameView* frameView = mainResultRange->ownerDocument().view();
</span><span class="cx"> for (const auto& 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 "Document.h"
</span><span class="cx"> #include "Editor.h"
</span><ins>+#include "Element.h"
</ins><span class="cx"> #include "Frame.h"
</span><span class="cx"> #include "FrameSelection.h"
</span><span class="cx"> #include "FrameSnapshotting.h"
</span><span class="lines">@@ -36,19 +37,32 @@
</span><span class="cx"> #include "GraphicsContext.h"
</span><span class="cx"> #include "ImageBuffer.h"
</span><span class="cx"> #include "IntRect.h"
</span><ins>+#include "NodeTraversal.h"
</ins><span class="cx"> #include "Page.h"
</span><span class="cx"> #include "Range.h"
</span><ins>+#include "RenderObject.h"
</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&, Frame&, const Range&, unsigned margin);
+
+TextIndicator::TextIndicator(const TextIndicatorData& data)
+ : m_data(data)
+{
+}
+
+TextIndicator::~TextIndicator()
+{
+}
+
</ins><span class="cx"> Ref<TextIndicator> TextIndicator::create(const TextIndicatorData& 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<TextIndicator> TextIndicator::createWithRange(const Range& range, TextIndicatorPresentationTransition presentationTransition, unsigned margin)
</del><ins>+RefPtr<TextIndicator> TextIndicator::createWithRange(const Range& range, TextIndicatorOptions options, TextIndicatorPresentationTransition presentationTransition, unsigned margin)
</ins><span class="cx"> {
</span><span class="cx"> Frame* frame = range.startContainer()->document().frame();
</span><span class="cx">
</span><span class="lines">@@ -63,68 +77,133 @@
</span><span class="cx"> VisibleSelection oldSelection = frame->selection().selection();
</span><span class="cx"> frame->selection().setSelection(range);
</span><span class="cx">
</span><del>- RefPtr<TextIndicator> indicator = TextIndicator::createWithSelectionInFrame(*frame, presentationTransition, margin);
</del><ins>+ TextIndicatorData data;
</ins><span class="cx">
</span><del>- frame->selection().setSelection(oldSelection);
</del><ins>+ data.presentationTransition = presentationTransition;
+ data.indicatesCurrentSelection = !areRangesEqual(&range, oldSelection.toNormalizedRange().get());
+ data.options = options;
</ins><span class="cx">
</span><del>- if (indicator)
- indicator->setWantsMargin(!areRangesEqual(&range, oldSelection.toNormalizedRange().get()));
</del><ins>+ if (!initializeIndicator(data, *frame, range, margin))
+ return nullptr;
</ins><span class="cx">
</span><ins>+ RefPtr<TextIndicator> indicator = TextIndicator::create(data);
+
+ frame->selection().setSelection(oldSelection);
+
</ins><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> frame->editor().setIgnoreCompositionSelectionChange(false, Editor::RevealSelection::No);
</span><span class="cx"> frame->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<Image> snapshotSelectionWithHighlight(Frame& frame)
</del><ins>+RefPtr<TextIndicator> TextIndicator::createWithSelectionInFrame(Frame& frame, TextIndicatorOptions options, TextIndicatorPresentationTransition presentationTransition, unsigned margin)
</ins><span class="cx"> {
</span><del>- auto& selection = frame.selection();
-
- if (!selection.isRange())
</del><ins>+ RefPtr<Range> 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<ImageBuffer> 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& range)
+{
+ Node* stopNode = range.pastLastNode();
+ for (Node* node = range.firstNode(); node != stopNode; node = NodeTraversal::next(*node)) {
+ if (!node)
+ continue;
+ RenderObject* renderer = node->renderer();
+ if (!renderer)
+ continue;
+ if ((!renderer->isInline() || renderer->isReplaced()) && range.intersectsNode(node, ASSERT_NO_EXCEPTION))
+ return true;
+ }
+
+ return false;
+}
+
+static SnapshotOptions snapshotOptionsForTextIndicatorOptions(TextIndicatorOptions options)
+{
+ SnapshotOptions snapshotOptions = SnapshotOptionsNone;
+ if (!(options & TextIndicatorOptionRespectTextColor))
+ snapshotOptions |= SnapshotOptionsForceBlackText;
+
+ if (!(options & TextIndicatorOptionPaintAllContent)) {
+ if (options & TextIndicatorOptionPaintBackgrounds)
+ snapshotOptions |= SnapshotOptionsPaintSelectionAndBackgroundsOnly;
+ else
+ snapshotOptions |= SnapshotOptionsPaintSelectionOnly;
+ } else
+ snapshotOptions |= SnapshotOptionsExcludeSelectionHighlighting;
+
+ return snapshotOptions;
+}
+
+static RefPtr<Image> takeSnapshot(Frame& frame, IntRect rect, SnapshotOptions options, float& scaleFactor)
+{
+ std::unique_ptr<ImageBuffer> buffer = snapshotFrameRect(frame, rect, options);
+ if (!buffer)
</ins><span class="cx"> return nullptr;
</span><ins>+ scaleFactor = buffer->resolutionScale();
+ return buffer->copyImage(CopyBackingStore, Unscaled);
+}
</ins><span class="cx">
</span><del>- return snapshot->copyImage(CopyBackingStore, Unscaled);
</del><ins>+static bool takeSnapshots(TextIndicatorData& data, Frame& frame, IntRect snapshotRect)
+{
+ SnapshotOptions snapshotOptions = snapshotOptionsForTextIndicatorOptions(data.options);
+
+ data.contentImage = takeSnapshot(frame, snapshotRect, snapshotOptions, data.contentImageScaleFactor);
+ if (!data.contentImage)
+ return false;
+
+ if (data.options & 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<TextIndicator> TextIndicator::createWithSelectionInFrame(Frame& frame, TextIndicatorPresentationTransition presentationTransition, unsigned margin)
</del><ins>+static bool initializeIndicator(TextIndicatorData& data, Frame& frame, const Range& range, unsigned margin)
</ins><span class="cx"> {
</span><span class="cx"> Vector<FloatRect> 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 & 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 & TextIndicatorOptionUseBoundingRectAndPaintAllContentForComplexRanges) && 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()->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<FloatRect> textRectsInRootViewCoordinates;
</span><span class="cx"> for (const FloatRect& 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()->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<ImageBuffer> indicatorBuffer = snapshotFrameRect(frame, enclosingIntRect(textBoundingRectInDocumentCoordinates), snapshotOptions);
- if (!indicatorBuffer)
- return nullptr;
- RefPtr<Image> indicatorBitmap = indicatorBuffer->copyImage(CopyBackingStore, Unscaled);
- if (!indicatorBitmap)
- return nullptr;
-
- RefPtr<Image> 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()->contentsToRootView(enclosingIntRect(frame.selection().selectionBounds()));
</span><span class="cx"> data.textBoundingRectInRootViewCoordinates = textBoundingRectInRootViewCoordinates;
</span><span class="cx"> data.textRectsInBoundingRectCoordinates = textRectsInBoundingRectCoordinates;
</span><del>- data.contentImageScaleFactor = indicatorBuffer->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& 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 <wtf/RefCounted.h>
</span><span class="cx"> #include <wtf/Vector.h>
</span><span class="cx">
</span><del>-#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101000
-#define ENABLE_LEGACY_TEXT_INDICATOR_STYLE 1
-#else
-#define ENABLE_LEGACY_TEXT_INDICATOR_STYLE 0
-#endif
-
</del><span class="cx"> 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 << 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 << 1,
+
+ // Don't restrict painting to the given Range
+ TextIndicatorOptionPaintAllContent = 1 << 2,
+
+ // Take two snapshots:
+ // - one including the selection highlight and ignoring other painting-related options
+ // - one respecting the other painting-related options
+ TextIndicatorOptionIncludeSnapshotWithSelectionHighlight = 1 << 3,
+
+ // Tightly fit the content instead of expanding to cover the bounds of the selection highlight
+ TextIndicatorOptionTightlyFitContent = 1 << 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 << 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<Image> contentImageWithHighlight;
</span><span class="cx"> RefPtr<Image> 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<TextIndicator> {
</span><span class="cx"> public:
</span><span class="cx"> WEBCORE_EXPORT static Ref<TextIndicator> create(const TextIndicatorData&);
</span><del>- WEBCORE_EXPORT static RefPtr<TextIndicator> createWithSelectionInFrame(Frame&, TextIndicatorPresentationTransition, unsigned margin = 0);
- WEBCORE_EXPORT static RefPtr<TextIndicator> createWithRange(const Range&, TextIndicatorPresentationTransition, unsigned margin = 0);
</del><ins>+ WEBCORE_EXPORT static RefPtr<TextIndicator> createWithSelectionInFrame(Frame&, TextIndicatorOptions, TextIndicatorPresentationTransition, unsigned margin = 0);
+ WEBCORE_EXPORT static RefPtr<TextIndicator> createWithRange(const Range&, 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&);
</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& range)
</span><span class="cx"> {
</span><span class="cx"> Vector<FloatQuad> textQuads;
</span><del>- range.textQuads(textQuads);
</del><ins>+ range.absoluteTextQuads(textQuads);
</ins><span class="cx"> FloatRect boundingRect;
</span><span class="cx"> for (auto& 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 "TextIndicator.h"
</span><span class="cx"> #import <wtf/Noncopyable.h>
</span><span class="cx"> #import <wtf/RefPtr.h>
</span><span class="cx"> #import <wtf/RetainPtr.h>
</span><span class="cx"> #import <wtf/RunLoop.h>
</span><span class="cx">
</span><del>-@class NSView;
-@class WebTextIndicatorView;
</del><ins>+#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101000
+#define ENABLE_LEGACY_TEXT_INDICATOR_STYLE 1
+#else
+#define ENABLE_LEGACY_TEXT_INDICATOR_STYLE 0
+#endif
</ins><span class="cx">
</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<TextIndicator>, CGRect contentRect, TextIndicatorLifetime);
- WEBCORE_EXPORT void clearTextIndicator(TextIndicatorDismissalAnimation);
</del><ins>+ WEBCORE_EXPORT void setTextIndicator(Ref<TextIndicator>, 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<TextIndicatorWindow> 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& 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& 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& 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& 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<TextIndicator>)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->contentImage()->size();
</span><span class="cx"> contentsImageLogicalSize.scale(1 / _textIndicator->contentImageScaleFactor());
</span><span class="cx"> RetainPtr<CGImageRef> contentsImage;
</span><del>- if (_textIndicator->wantsContentCrossfade())
</del><ins>+ if (indicatorWantsContentCrossfade(*_textIndicator))
</ins><span class="cx"> contentsImage = _textIndicator->contentImageWithHighlight()->getCGImageRef();
</span><span class="cx"> else
</span><span class="cx"> contentsImage = _textIndicator->contentImage()->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->wantsMargin()) {
</del><ins>+ if (!_textIndicator->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->wantsBounce()) {
- if (_textIndicator->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->wantsBounce();
- bool wantsCrossfade = _textIndicator->wantsContentCrossfade();
- bool wantsFadeIn = _textIndicator->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->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<TextIndicator> 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 && textIndicator->wantsManualAnimation() && [m_textIndicatorView hasCompletedAnimation] && animation == TextIndicatorDismissalAnimation::FadeOut) {
</del><ins>+ if (textIndicator && indicatorWantsManualAnimation(*textIndicator) && [m_textIndicatorView hasCompletedAnimation] && 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<TextIndicator> textIndicator, CGRect textBoundingRectInScreenCoordinates, TextIndicatorLifetime lifetime)
</del><ins>+void TextIndicatorWindow::setTextIndicator(Ref<TextIndicator> 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->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->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->ownerDocument().updateLayout();
</span><span class="cx">
</span><span class="cx"> Vector<FloatQuad> quads;
</span><del>- range->textQuads(quads);
</del><ins>+ range->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 <timothy_horton@apple.com>
+
+ 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 <fpizlo@apple.com>
</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<IntRect> intRects;
</span><del>- markedTextRange->textRects(intRects, NO);
</del><ins>+ markedTextRange->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 <timothy_horton@apple.com>
+
+ 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 <ggaren@apple.com>
</span><span class="cx">
</span><span class="cx"> Standardize on the phrase "delete code"
</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<IntRect> intRects;
</span><del>- range->textRects(intRects, NO);
</del><ins>+ range->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->view()->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<Range> linkRange = rangeOfContents(*_hitTestResult.URLElement());
</span><del>- RefPtr<TextIndicator> indicator = TextIndicator::createWithRange(*linkRange, TextIndicatorPresentationTransition::FadeIn);
</del><ins>+ RefPtr<TextIndicator> 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<TextIndicator> detectedDataTextIndicator = TextIndicator::createWithRange(*detectedDataRange, TextIndicatorPresentationTransition::FadeIn);
</del><ins>+ RefPtr<TextIndicator> 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<Range> linkRange = rangeOfContents(*_hitTestResult.URLElement());
</span><span class="cx"> if (!linkRange)
</span><span class="cx"> return nullptr;
</span><del>- RefPtr<TextIndicator> indicator = TextIndicator::createWithRange(*linkRange, TextIndicatorPresentationTransition::FadeIn);
</del><ins>+ RefPtr<TextIndicator> 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& style = renderer->style();
</span><span class="cx">
</span><span class="cx"> Vector<FloatQuad> 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&)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&)textIndicator withLifetime:(TextIndicatorLifetime)lifetime
</del><ins>+- (void)_setTextIndicator:(TextIndicator&)textIndicator withLifetime:(TextIndicatorWindowLifetime)lifetime
</ins><span class="cx"> {
</span><span class="cx"> if (!_private->textIndicatorWindow)
</span><span class="cx"> _private->textIndicatorWindow = std::make_unique<TextIndicatorWindow>(self);
</span><span class="lines">@@ -8599,10 +8599,10 @@
</span><span class="cx"> _private->textIndicatorWindow->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->textIndicatorWindow)
</span><del>- _private->textIndicatorWindow->clearTextIndicator(TextIndicatorDismissalAnimation::FadeOut);
</del><ins>+ _private->textIndicatorWindow->clearTextIndicator(TextIndicatorWindowDismissalAnimation::FadeOut);
</ins><span class="cx"> _private->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) && defined(__cplusplus)
</span><span class="cx"> - (void)_setTextIndicator:(WebCore::TextIndicator&)textIndicator;
</span><del>-- (void)_setTextIndicator:(WebCore::TextIndicator&)textIndicator withLifetime:(WebCore::TextIndicatorLifetime)lifetime;
-- (void)_clearTextIndicatorWithAnimation:(WebCore::TextIndicatorDismissalAnimation)animation;
</del><ins>+- (void)_setTextIndicator:(WebCore::TextIndicator&)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&)dictionaryPopupInfo;
</span><span class="cx"> #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 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)->boundingBox();
</del><ins>+ IntRect boundingBox = makeRange(textRange.start, textRange.end)->absoluteBoundingBox();
</ins><span class="cx"> switch (scrollType) {
</span><span class="cx"> case IA2_SCROLL_TYPE_TOP_LEFT:
</span><span class="cx"> m_object->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 <timothy_horton@apple.com>
+
+ 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<TextIndicatorData>::encode):
+ (IPC::ArgumentCoder<TextIndicatorData>::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 <ljaehun.lim@samsung.com>
</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& encoder, Image* image)
+{
+ bool hasImage = !!image;
+ encoder << hasImage;
+
+ if (hasImage)
+ encodeImage(encoder, image);
+}
+
+static bool decodeOptionalImage(ArgumentDecoder& decoder, RefPtr<Image>& 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<Cursor>::encode(ArgumentEncoder& encoder, const Cursor& cursor)
</span><span class="cx"> {
</span><span class="lines">@@ -2116,18 +2139,12 @@
</span><span class="cx"> encoder << textIndicatorData.textBoundingRectInRootViewCoordinates;
</span><span class="cx"> encoder << textIndicatorData.textRectsInBoundingRectCoordinates;
</span><span class="cx"> encoder << textIndicatorData.contentImageScaleFactor;
</span><del>- encoder << textIndicatorData.wantsMargin;
</del><ins>+ encoder << textIndicatorData.indicatesCurrentSelection;
</ins><span class="cx"> encoder.encodeEnum(textIndicatorData.presentationTransition);
</span><ins>+ encoder << static_cast<uint64_t>(textIndicatorData.options);
</ins><span class="cx">
</span><del>- bool hasImage = textIndicatorData.contentImage;
- encoder << hasImage;
- if (hasImage)
- encodeImage(encoder, textIndicatorData.contentImage.get());
-
- bool hasImageWithHighlight = textIndicatorData.contentImageWithHighlight;
- encoder << 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<TextIndicatorData>::decode(ArgumentDecoder& decoder, TextIndicatorData& 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 && !decodeImage(decoder, textIndicatorData.contentImage))
</del><ins>+ textIndicatorData.options = static_cast<TextIndicatorOptions>(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 && !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<WebCore::TextIndicator>, WebCore::TextIndicatorLifetime)
-{
- notImplemented();
-}
-
-void PageClientImpl::clearTextIndicator(WebCore::TextIndicatorDismissalAnimation)
-{
- notImplemented();
-}
-
-void PageClientImpl::setTextIndicatorAnimationProgress(float)
-{
- notImplemented();
-}
-
</del><span class="cx"> void PageClientImpl::enterAcceleratedCompositingMode(const LayerTreeContext&)
</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<WebColorPicker> createColorPicker(WebPageProxy*, const WebCore::Color& intialColor, const WebCore::IntRect&) override;
</span><span class="cx"> #endif
</span><del>- virtual void setTextIndicator(Ref<WebCore::TextIndicator>, 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&, PassRefPtr<ShareableBitmap> 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&)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&)textIndicator withLifetime:(TextIndicatorLifetime)lifetime
</del><ins>+- (void)_setTextIndicator:(TextIndicator&)textIndicator withLifetime:(TextIndicatorWindowLifetime)lifetime
</ins><span class="cx"> {
</span><span class="cx"> if (!_data->_textIndicatorWindow)
</span><span class="cx"> _data->_textIndicatorWindow = std::make_unique<TextIndicatorWindow>(self);
</span><span class="lines">@@ -3270,7 +3270,7 @@
</span><span class="cx"> _data->_textIndicatorWindow->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->_textIndicatorWindow)
</span><span class="cx"> _data->_textIndicatorWindow->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 >= 101000
</span><span class="cx"> [_data->_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&)textIndicator;
</span><del>-- (void)_setTextIndicator:(WebCore::TextIndicator&)textIndicator withLifetime:(WebCore::TextIndicatorLifetime)lifetime;
-- (void)_clearTextIndicatorWithAnimation:(WebCore::TextIndicatorDismissalAnimation)animation;
</del><ins>+- (void)_setTextIndicator:(WebCore::TextIndicator&)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<WebCore::TextIndicator>, WebCore::TextIndicatorLifetime)
-{
- notImplemented();
-}
-
-void WebView::clearTextIndicator(WebCore::TextIndicatorDismissalAnimation)
-{
- notImplemented();
-}
-
-void WebView::setTextIndicatorAnimationProgress(float)
-{
- notImplemented();
-}
-
</del><span class="cx"> void WebView::enterAcceleratedCompositingMode(const LayerTreeContext&)
</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<WebColorPicker> createColorPicker(WebPageProxy*, const WebCore::Color& initialColor, const WebCore::IntRect&) override;
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- virtual void setTextIndicator(Ref<WebCore::TextIndicator>, 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&) override;
</span><span class="cx"> virtual void exitAcceleratedCompositingMode() override;
</span><span class="cx"> virtual void updateAcceleratedCompositingMode(const LayerTreeContext&) 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<WebColorPicker> createColorPicker(WebPageProxy*, const WebCore::Color& initialColor, const WebCore::IntRect&) = 0;
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- virtual void setTextIndicator(Ref<WebCore::TextIndicator>, WebCore::TextIndicatorLifetime = WebCore::TextIndicatorLifetime::Permanent) = 0;
- virtual void clearTextIndicator(WebCore::TextIndicatorDismissalAnimation = WebCore::TextIndicatorDismissalAnimation::FadeOut) = 0;
</del><ins>+#if PLATFORM(COCOA)
+ virtual void setTextIndicator(Ref<WebCore::TextIndicator>, 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&) = 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 "ViewSnapshotStore.h"
</span><span class="cx"> #include <WebCore/MachSendRight.h>
</span><span class="cx"> #include <WebCore/RunLoopObserver.h>
</span><ins>+#include <WebCore/TextIndicatorWindow.h>
</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& indicatorData, uint64_t lifetime)
</span><span class="cx"> {
</span><del>- m_pageClient.setTextIndicator(TextIndicator::create(indicatorData), static_cast<TextIndicatorLifetime>(lifetime));
</del><ins>+ // FIXME: Make TextIndicatorWindow a platform-independent presentational thing ("TextIndicatorPresentation"?).
+#if PLATFORM(COCOA)
+ m_pageClient.setTextIndicator(TextIndicator::create(indicatorData), static_cast<TextIndicatorWindowLifetime>(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& 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&, FindOptions, unsigned maxMatchCount);
</span><span class="cx"> void didCountStringMatches(const String&, uint32_t matchCount);
</span><del>- void setTextIndicator(const WebCore::TextIndicatorData&, uint64_t /* WebCore::TextIndicatorLifetime */ lifetime = (uint64_t)WebCore::TextIndicatorLifetime::Permanent);
</del><ins>+ void setTextIndicator(const WebCore::TextIndicatorData&, 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&, 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<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy*) override;
</span><span class="cx"> virtual RefPtr<WebContextMenuProxy> createContextMenuProxy(WebPageProxy*) override;
</span><del>- virtual void setTextIndicator(Ref<WebCore::TextIndicator>, WebCore::TextIndicatorLifetime = WebCore::TextIndicatorLifetime::Permanent) override;
- virtual void clearTextIndicator(WebCore::TextIndicatorDismissalAnimation = WebCore::TextIndicatorDismissalAnimation::FadeOut) override;
</del><ins>+ virtual void setTextIndicator(Ref<WebCore::TextIndicator>, 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&) 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<TextIndicator> textIndicator, TextIndicatorLifetime)
</del><ins>+void PageClientImpl::setTextIndicator(Ref<TextIndicator> 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<WebColorPicker> createColorPicker(WebPageProxy*, const WebCore::Color& initialColor, const WebCore::IntRect&) override;
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- virtual void setTextIndicator(Ref<WebCore::TextIndicator>, WebCore::TextIndicatorLifetime = WebCore::TextIndicatorLifetime::Permanent) override;
- virtual void clearTextIndicator(WebCore::TextIndicatorDismissalAnimation = WebCore::TextIndicatorDismissalAnimation::FadeOut) override;
</del><ins>+ virtual void setTextIndicator(Ref<WebCore::TextIndicator>, 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&) 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 <WebCore/NotImplemented.h>
</span><span class="cx"> #import <WebCore/SharedBuffer.h>
</span><span class="cx"> #import <WebCore/TextIndicator.h>
</span><ins>+#import <WebCore/TextIndicatorWindow.h>
</ins><span class="cx"> #import <WebCore/TextUndoInsertionMarkupMac.h>
</span><span class="cx"> #import <WebKitSystemInterface.h>
</span><span class="cx"> #import <wtf/text/CString.h>
</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<TextIndicator> textIndicator, WebCore::TextIndicatorLifetime lifetime)
</del><ins>+void PageClientImpl::setTextIndicator(Ref<TextIndicator> 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() && 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 <WebCore/NSPopoverSPI.h>
</span><span class="cx"> #import <WebCore/QuickLookMacSPI.h>
</span><span class="cx"> #import <WebCore/SoftLinking.h>
</span><ins>+#import <WebCore/TextIndicatorWindow.h>
</ins><span class="cx"> #import <WebCore/URL.h>
</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<NSMutableDictionary> mutableOptions = adoptNS([(NSDictionary *)dictionaryPopupInfo.options.get() mutableCopy]);
</span><span class="cx"> if (canLoadLUTermOptionDisableSearchTermIndicator() && dictionaryPopupInfo.textIndicator.contentImage) {
</span><span class="cx"> RefPtr<TextIndicator> 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->ownerDocument().updateLayoutIgnorePendingStylesheets();
</span><span class="cx"> Vector<WebCore::IntRect> rects;
</span><del>- _impl->textRects(rects);
</del><ins>+ _impl->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->boundingRect();
</del><ins>+ FloatRect boundingRect = m_range->absoluteBoundingRect();
</ins><span class="cx"> Frame* frame = m_range->ownerDocument().frame();
</span><span class="cx"> return frame->view()->contentsToWindow(enclosingIntRect(boundingRect));
</span><span class="cx"> }
</span><span class="lines">@@ -117,7 +117,7 @@
</span><span class="cx"> frame->selection().setSelection(VisibleSelection(*m_range));
</span><span class="cx">
</span><span class="cx"> float scaleFactor = (options & SnapshotOptionsExcludeDeviceScaleFactor) ? 1 : frame->page()->deviceScaleFactor();
</span><del>- IntRect paintRect = enclosingIntRect(m_range->boundingRect());
</del><ins>+ IntRect paintRect = enclosingIntRect(m_range->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 <WebCore/PageOverlayController.h>
</span><span class="cx"> #include <WebCore/PlatformMouseEvent.h>
</span><span class="cx"> #include <WebCore/PluginDocument.h>
</span><del>-#include <WebCore/TextIndicator.h>
</del><ins>+#include <WebCore/TextIndicatorWindow.h>
</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<Vector<IntRect>> matchRects;
</span><span class="cx"> for (size_t i = 0; i < m_findMatches.size(); ++i) {
</span><span class="cx"> Vector<IntRect> rects;
</span><del>- m_findMatches[i]->textRects(rects);
</del><ins>+ m_findMatches[i]->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& selectedFrame, bool isShowingOverlay, bool shouldAnimate)
</span><span class="cx"> {
</span><del>- RefPtr<TextIndicator> indicator = TextIndicator::createWithSelectionInFrame(selectedFrame, shouldAnimate ? TextIndicatorPresentationTransition::Bounce : TextIndicatorPresentationTransition::None);
</del><ins>+ RefPtr<TextIndicator> 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->selectionRectInRootViewCoordinates());
</span><del>- m_webPage->send(Messages::WebPageProxy::SetTextIndicator(indicator->data(), static_cast<uint64_t>(isShowingOverlay ? TextIndicatorLifetime::Permanent : TextIndicatorLifetime::Temporary)));
</del><ins>+ m_webPage->send(Messages::WebPageProxy::SetTextIndicator(indicator->data(), static_cast<uint64_t>(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& element)
-{
- if (element.renderer() && !element.renderer()->isInline())
- return false;
-
- for (auto& child : descendantsOfType<Element>(element)) {
- if (child.renderer() && !child.renderer()->isInline())
- return false;
- }
-
- return true;
-}
-
</del><span class="cx"> void WebPage::getPositionInformation(const IntPoint& point, InteractionInformationAtPosition& 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<WebImage> snapshot = snapshotNode(*element, SnapshotOptionsShareable, 600 * 1024))
</span><span class="cx"> info.image = snapshot->bitmap();
</span><span class="cx">
</span><del>- if (shouldUseTextIndicatorForLink(*linkElement)) {
- RefPtr<Range> linkRange = rangeOfContents(*linkElement);
- if (linkRange) {
- float deviceScaleFactor = corePage()->deviceScaleFactor();
- const float marginInPoints = 4;
- RefPtr<TextIndicator> textIndicator = TextIndicator::createWithRange(*linkRange, TextIndicatorPresentationTransition::None, marginInPoints * deviceScaleFactor);
- if (textIndicator)
- info.linkIndicator = textIndicator->data();
- }
</del><ins>+
+ RefPtr<Range> linkRange = rangeOfContents(*linkElement);
+ if (linkRange) {
+ float deviceScaleFactor = corePage()->deviceScaleFactor();
+ const float marginInPoints = 4;
+
+ RefPtr<TextIndicator> textIndicator = TextIndicator::createWithRange(*linkRange, TextIndicatorOptionTightlyFitContent | TextIndicatorOptionRespectTextColor | TextIndicatorOptionPaintBackgrounds | TextIndicatorOptionUseBoundingRectAndPaintAllContentForComplexRanges, TextIndicatorPresentationTransition::None, marginInPoints * deviceScaleFactor);
+ if (textIndicator)
+ info.linkIndicator = textIndicator->data();
</ins><span class="cx"> }
</span><span class="cx"> } else if (element->renderer() && element->renderer()->isRenderImage()) {
</span><span class="cx"> auto& renderImage = downcast<RenderImage>(*(element->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& style = renderer->style();
</span><span class="cx">
</span><span class="cx"> Vector<FloatQuad> 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<TextIndicator> textIndicator = TextIndicator::createWithRange(range, presentationTransition);
</del><ins>+ TextIndicatorOptions indicatorOptions = TextIndicatorOptionDefault;
+ if (presentationTransition == TextIndicatorPresentationTransition::BounceAndCrossfade)
+ indicatorOptions |= TextIndicatorOptionIncludeSnapshotWithSelectionHighlight;
+
+ RefPtr<TextIndicator> 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() && URLElement) {
</span><span class="cx"> RefPtr<Range> 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<FloatQuad> quads;
</span><del>- mainResultRange->textQuads(quads);
</del><ins>+ mainResultRange->absoluteTextQuads(quads);
</ins><span class="cx"> FloatRect detectedDataBoundingBox;
</span><span class="cx"> FrameView* frameView = mainResultRange->ownerDocument().view();
</span><span class="cx"> for (const auto& quad : quads)
</span><span class="cx"> detectedDataBoundingBox.unite(frameView->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->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 && 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>