<!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>[176810] 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/176810">176810</a></dd>
<dt>Author</dt> <dd>timothy_horton@apple.com</dd>
<dt>Date</dt> <dd>2014-12-04 11:58:14 -0800 (Thu, 04 Dec 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>TextIndicator::createWithSelectionInFrame does synchronous IPC in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=139252
&lt;rdar://problem/19140827&gt;

Reviewed by Anders Carlsson.

It turns out contentsToScreen requires sync IPC in Mac WebKit2, which we
really don't want to be doing here (especially since the UI process will often
be sitting in waitForAndDispatchImmediately waiting for didPerformActionMenuHitTest).

Go back to keeping TextIndicator rects in &quot;window&quot; coordinates and do the conversion
in each of the WebKits instead of trying to share that code.

* WebCore.exp.in:
* page/TextIndicator.cpp:
(WebCore::TextIndicator::createWithSelectionInFrame):
(WebCore::TextIndicator::TextIndicator):
* page/TextIndicator.h:
(WebCore::TextIndicator::selectionRectInWindowCoordinates):
(WebCore::TextIndicator::textBoundingRectInWindowCoordinates):
(WebCore::TextIndicator::selectionRectInScreenCoordinates): Deleted.
(WebCore::TextIndicator::textBoundingRectInScreenCoordinates): Deleted.
Go back to keeping the rects in &quot;window&quot; coordinates.

* page/mac/TextIndicatorWindow.h:
* page/mac/TextIndicatorWindow.mm:
(-[WebTextIndicatorView initWithFrame:textIndicator:margin:]):
(WebCore::TextIndicatorWindow::setTextIndicator):
Let callers pass in the contentRect instead of trying to share the code
to compute it, since it needs to be different for legacy and modern WebKit.

* WebView/WebView.mm:
(-[WebView _setTextIndicator:fadeOut:animationCompletionHandler:]):
Adjust to the WebCore changes.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder&lt;TextIndicatorData&gt;::encode):
(IPC::ArgumentCoder&lt;TextIndicatorData&gt;::decode):
* UIProcess/API/mac/WKView.mm:
(-[WKView _setTextIndicator:fadeOut:animationCompletionHandler:]):
* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::updateFindIndicator):
(WebKit::FindController::drawRect):
Adjust to the WebCore changes.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCorepageTextIndicatorcpp">trunk/Source/WebCore/page/TextIndicator.cpp</a></li>
<li><a href="#trunkSourceWebCorepageTextIndicatorh">trunk/Source/WebCore/page/TextIndicator.h</a></li>
<li><a href="#trunkSourceWebCorepagemacTextIndicatorWindowh">trunk/Source/WebCore/page/mac/TextIndicatorWindow.h</a></li>
<li><a href="#trunkSourceWebCorepagemacTextIndicatorWindowmm">trunk/Source/WebCore/page/mac/TextIndicatorWindow.mm</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebViewmm">trunk/Source/WebKit/mac/WebView/WebView.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedWebCoreArgumentCoderscpp">trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPImacWKViewmm">trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageFindControllercpp">trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (176809 => 176810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-12-04 19:57:08 UTC (rev 176809)
+++ trunk/Source/WebCore/ChangeLog        2014-12-04 19:58:14 UTC (rev 176810)
</span><span class="lines">@@ -1,3 +1,29 @@
</span><ins>+2014-12-04  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+        TextIndicator::createWithSelectionInFrame does synchronous IPC in WebKit2
+        https://bugs.webkit.org/show_bug.cgi?id=139252
+        &lt;rdar://problem/19140827&gt;
+
+        Reviewed by Anders Carlsson.
+
+        * WebCore.exp.in:
+        * page/TextIndicator.cpp:
+        (WebCore::TextIndicator::createWithSelectionInFrame):
+        (WebCore::TextIndicator::TextIndicator):
+        * page/TextIndicator.h:
+        (WebCore::TextIndicator::selectionRectInWindowCoordinates):
+        (WebCore::TextIndicator::textBoundingRectInWindowCoordinates):
+        (WebCore::TextIndicator::selectionRectInScreenCoordinates): Deleted.
+        (WebCore::TextIndicator::textBoundingRectInScreenCoordinates): Deleted.
+        Go back to keeping the rects in &quot;window&quot; coordinates.
+
+        * page/mac/TextIndicatorWindow.h:
+        * page/mac/TextIndicatorWindow.mm:
+        (-[WebTextIndicatorView initWithFrame:textIndicator:margin:]):
+        (WebCore::TextIndicatorWindow::setTextIndicator):
+        Let callers pass in the contentRect instead of trying to share the code
+        to compute it, since it needs to be different for legacy and modern WebKit.
+
</ins><span class="cx"> 2014-12-04  Oliver Hunt  &lt;oliver@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Serialization of MapData object provides unsafe access to internal types
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (176809 => 176810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-12-04 19:57:08 UTC (rev 176809)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-12-04 19:58:14 UTC (rev 176810)
</span><span class="lines">@@ -2311,7 +2311,7 @@
</span><span class="cx"> __ZN7WebCore17ScrollbarThemeMac24removeOverhangAreaShadowEP7CALayer
</span><span class="cx"> __ZN7WebCore17ScrollbarThemeMac27setUpOverhangAreaBackgroundEP7CALayerRKNS_5ColorE
</span><span class="cx"> __ZN7WebCore17ScrollbarThemeMac28removeOverhangAreaBackgroundEP7CALayer
</span><del>-__ZN7WebCore19TextIndicatorWindow16setTextIndicatorEN3WTF10PassRefPtrINS_13TextIndicatorEEEbNSt3__18functionIFvvEEE
</del><ins>+__ZN7WebCore19TextIndicatorWindow16setTextIndicatorEN3WTF10PassRefPtrINS_13TextIndicatorEEE6CGRectbNSt3__18functionIFvvEEE
</ins><span class="cx"> __ZN7WebCore19TextIndicatorWindowC1EP6NSView
</span><span class="cx"> __ZN7WebCore19TextIndicatorWindowD1Ev
</span><span class="cx"> __ZN7WebCore19applicationIsSafariEv
</span></span></pre></div>
<a id="trunkSourceWebCorepageTextIndicatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/TextIndicator.cpp (176809 => 176810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/TextIndicator.cpp        2014-12-04 19:57:08 UTC (rev 176809)
+++ trunk/Source/WebCore/page/TextIndicator.cpp        2014-12-04 19:58:14 UTC (rev 176810)
</span><span class="lines">@@ -146,7 +146,7 @@
</span><span class="cx"> 
</span><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><del>-    IntRect selectionRectInScreenCoordinates = frame.view()-&gt;contentsToScreen(selectionRect);
</del><ins>+    IntRect selectionRectInWindowCoordinates = frame.view()-&gt;contentsToWindow(selectionRect);
</ins><span class="cx"> 
</span><span class="cx">     Vector&lt;FloatRect&gt; textRects;
</span><span class="cx">     frame.selection().getClippedVisibleTextRectangles(textRects);
</span><span class="lines">@@ -154,23 +154,23 @@
</span><span class="cx">     // The bounding rect of all the text rects can be different than the selection
</span><span class="cx">     // rect when the selection spans multiple lines; the indicator doesn't actually
</span><span class="cx">     // care where the selection highlight goes, just where the text actually is.
</span><del>-    FloatRect textBoundingRectInScreenCoordinates;
-    Vector&lt;FloatRect&gt; textRectsInScreenCoordinates;
</del><ins>+    FloatRect textBoundingRectInWindowCoordinates;
+    Vector&lt;FloatRect&gt; textRectsInWindowCoordinates;
</ins><span class="cx">     for (const FloatRect&amp; textRect : textRects) {
</span><del>-        FloatRect textRectInScreenCoordinates = frame.view()-&gt;contentsToScreen(enclosingIntRect(textRect));
-        textRectsInScreenCoordinates.append(textRectInScreenCoordinates);
-        textBoundingRectInScreenCoordinates.unite(textRectInScreenCoordinates);
</del><ins>+        FloatRect textRectInWindowCoordinates = frame.view()-&gt;contentsToWindow(enclosingIntRect(textRect));
+        textRectsInWindowCoordinates.append(textRectInWindowCoordinates);
+        textBoundingRectInWindowCoordinates.unite(textRectInWindowCoordinates);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     Vector&lt;FloatRect&gt; textRectsInBoundingRectCoordinates;
</span><del>-    for (auto rect : textRectsInScreenCoordinates) {
-        rect.moveBy(-textBoundingRectInScreenCoordinates.location());
</del><ins>+    for (auto rect : textRectsInWindowCoordinates) {
+        rect.moveBy(-textBoundingRectInWindowCoordinates.location());
</ins><span class="cx">         textRectsInBoundingRectCoordinates.append(rect);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     TextIndicatorData data;
</span><del>-    data.selectionRectInScreenCoordinates = selectionRectInScreenCoordinates;
-    data.textBoundingRectInScreenCoordinates = textBoundingRectInScreenCoordinates;
</del><ins>+    data.selectionRectInWindowCoordinates = selectionRectInWindowCoordinates;
+    data.textBoundingRectInWindowCoordinates = textBoundingRectInWindowCoordinates;
</ins><span class="cx">     data.textRectsInBoundingRectCoordinates = textRectsInBoundingRectCoordinates;
</span><span class="cx">     data.contentImageScaleFactor = frame.page()-&gt;deviceScaleFactor();
</span><span class="cx">     data.contentImage = indicatorBitmap;
</span><span class="lines">@@ -183,7 +183,7 @@
</span><span class="cx"> TextIndicator::TextIndicator(const TextIndicatorData&amp; data)
</span><span class="cx">     : m_data(data)
</span><span class="cx"> {
</span><del>-    ASSERT(m_data.contentImageScaleFactor != 1 || m_data.contentImage-&gt;size() == enclosingIntRect(m_data.selectionRectInScreenCoordinates).size());
</del><ins>+    ASSERT(m_data.contentImageScaleFactor != 1 || m_data.contentImage-&gt;size() == enclosingIntRect(m_data.selectionRectInWindowCoordinates).size());
</ins><span class="cx"> 
</span><span class="cx">     if (textIndicatorsForTextRectsOverlap(m_data.textRectsInBoundingRectCoordinates)) {
</span><span class="cx">         m_data.textRectsInBoundingRectCoordinates[0] = unionRect(m_data.textRectsInBoundingRectCoordinates);
</span></span></pre></div>
<a id="trunkSourceWebCorepageTextIndicatorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/TextIndicator.h (176809 => 176810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/TextIndicator.h        2014-12-04 19:57:08 UTC (rev 176809)
+++ trunk/Source/WebCore/page/TextIndicator.h        2014-12-04 19:58:14 UTC (rev 176810)
</span><span class="lines">@@ -51,8 +51,8 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> struct TextIndicatorData {
</span><del>-    FloatRect selectionRectInScreenCoordinates;
-    FloatRect textBoundingRectInScreenCoordinates;
</del><ins>+    FloatRect selectionRectInWindowCoordinates;
+    FloatRect textBoundingRectInWindowCoordinates;
</ins><span class="cx">     Vector&lt;FloatRect&gt; textRectsInBoundingRectCoordinates;
</span><span class="cx">     float contentImageScaleFactor;
</span><span class="cx">     RefPtr&lt;Image&gt; contentImageWithHighlight;
</span><span class="lines">@@ -68,8 +68,8 @@
</span><span class="cx"> 
</span><span class="cx">     ~TextIndicator();
</span><span class="cx"> 
</span><del>-    FloatRect selectionRectInScreenCoordinates() const { return m_data.selectionRectInScreenCoordinates; }
-    FloatRect textBoundingRectInScreenCoordinates() const { return m_data.textBoundingRectInScreenCoordinates; }
</del><ins>+    FloatRect selectionRectInWindowCoordinates() const { return m_data.selectionRectInWindowCoordinates; }
+    FloatRect textBoundingRectInWindowCoordinates() const { return m_data.textBoundingRectInWindowCoordinates; }
</ins><span class="cx">     const Vector&lt;FloatRect&gt;&amp; textRectsInBoundingRectCoordinates() const { return m_data.textRectsInBoundingRectCoordinates; }
</span><span class="cx">     float contentImageScaleFactor() const { return m_data.contentImageScaleFactor; }
</span><span class="cx">     Image *contentImageWithHighlight() const { return m_data.contentImageWithHighlight.get(); }
</span></span></pre></div>
<a id="trunkSourceWebCorepagemacTextIndicatorWindowh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/mac/TextIndicatorWindow.h (176809 => 176810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/mac/TextIndicatorWindow.h        2014-12-04 19:57:08 UTC (rev 176809)
+++ trunk/Source/WebCore/page/mac/TextIndicatorWindow.h        2014-12-04 19:58:14 UTC (rev 176810)
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx">     explicit TextIndicatorWindow(NSView *);
</span><span class="cx">     ~TextIndicatorWindow();
</span><span class="cx"> 
</span><del>-    void setTextIndicator(PassRefPtr&lt;TextIndicator&gt;, bool fadeOut, std::function&lt;void ()&gt; animationCompletionHandler);
</del><ins>+    void setTextIndicator(PassRefPtr&lt;TextIndicator&gt;, NSRect contentRect, bool fadeOut, std::function&lt;void ()&gt; animationCompletionHandler);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     void closeWindow();
</span></span></pre></div>
<a id="trunkSourceWebCorepagemacTextIndicatorWindowmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/mac/TextIndicatorWindow.mm (176809 => 176810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/mac/TextIndicatorWindow.mm        2014-12-04 19:57:08 UTC (rev 176809)
+++ trunk/Source/WebCore/page/mac/TextIndicatorWindow.mm        2014-12-04 19:58:14 UTC (rev 176810)
</span><span class="lines">@@ -171,7 +171,7 @@
</span><span class="cx">         [textLayer setContents:(id)contentsImage.get()];
</span><span class="cx"> 
</span><span class="cx">         FloatRect imageRect = textRect;
</span><del>-        imageRect.move(_textIndicator-&gt;textBoundingRectInScreenCoordinates().location() - _textIndicator-&gt;selectionRectInScreenCoordinates().location());
</del><ins>+        imageRect.move(_textIndicator-&gt;textBoundingRectInWindowCoordinates().location() - _textIndicator-&gt;selectionRectInWindowCoordinates().location());
</ins><span class="cx">         [textLayer setContentsRect:CGRectMake(imageRect.x() / contentsImageLogicalSize.width(), imageRect.y() / contentsImageLogicalSize.height(), imageRect.width() / contentsImageLogicalSize.width(), imageRect.height() / contentsImageLogicalSize.height())];
</span><span class="cx">         [textLayer setContentsGravity:kCAGravityCenter];
</span><span class="cx">         [textLayer setContentsScale:_textIndicator-&gt;contentImageScaleFactor()];
</span><span class="lines">@@ -266,7 +266,7 @@
</span><span class="cx">     closeWindow();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void TextIndicatorWindow::setTextIndicator(PassRefPtr&lt;TextIndicator&gt; textIndicator, bool fadeOut, std::function&lt;void ()&gt; animationCompletionHandler)
</del><ins>+void TextIndicatorWindow::setTextIndicator(PassRefPtr&lt;TextIndicator&gt; textIndicator, NSRect contentRect, bool fadeOut, std::function&lt;void ()&gt; animationCompletionHandler)
</ins><span class="cx"> {
</span><span class="cx">     if (m_textIndicator == textIndicator)
</span><span class="cx">         return;
</span><span class="lines">@@ -279,7 +279,6 @@
</span><span class="cx">     if (!m_textIndicator)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    NSRect contentRect = m_textIndicator-&gt;textBoundingRectInScreenCoordinates();
</del><span class="cx">     CGFloat horizontalMargin = std::max(dropShadowBlurRadius * 2 + horizontalBorder, contentRect.size.width * 2);
</span><span class="cx">     CGFloat verticalMargin = std::max(dropShadowBlurRadius * 2 + verticalBorder, contentRect.size.height * 2);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (176809 => 176810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2014-12-04 19:57:08 UTC (rev 176809)
+++ trunk/Source/WebKit/mac/ChangeLog        2014-12-04 19:58:14 UTC (rev 176810)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2014-12-04  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+        TextIndicator::createWithSelectionInFrame does synchronous IPC in WebKit2
+        https://bugs.webkit.org/show_bug.cgi?id=139252
+        &lt;rdar://problem/19140827&gt;
+
+        Reviewed by Anders Carlsson.
+
+        * WebView/WebView.mm:
+        (-[WebView _setTextIndicator:fadeOut:animationCompletionHandler:]):
+        Adjust to the WebCore changes.
+
</ins><span class="cx"> 2014-12-03  Timothy Horton  &lt;timothy_horton@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Implement action menus for tel: URLs
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (176809 => 176810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebView.mm        2014-12-04 19:57:08 UTC (rev 176809)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm        2014-12-04 19:58:14 UTC (rev 176810)
</span><span class="lines">@@ -8601,7 +8601,8 @@
</span><span class="cx">     if (!_private-&gt;textIndicatorWindow)
</span><span class="cx">         _private-&gt;textIndicatorWindow = std::make_unique&lt;TextIndicatorWindow&gt;(self);
</span><span class="cx"> 
</span><del>-    _private-&gt;textIndicatorWindow-&gt;setTextIndicator(textIndicator, fadeOut, WTF::move(completionHandler));
</del><ins>+    NSRect contentRect = [self.window convertRectToScreen:textIndicator-&gt;textBoundingRectInWindowCoordinates()];
+    _private-&gt;textIndicatorWindow-&gt;setTextIndicator(textIndicator, contentRect, fadeOut, WTF::move(completionHandler));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)_clearTextIndicator
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (176809 => 176810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-12-04 19:57:08 UTC (rev 176809)
+++ trunk/Source/WebKit2/ChangeLog        2014-12-04 19:58:14 UTC (rev 176810)
</span><span class="lines">@@ -1,3 +1,28 @@
</span><ins>+2014-12-04  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+        TextIndicator::createWithSelectionInFrame does synchronous IPC in WebKit2
+        https://bugs.webkit.org/show_bug.cgi?id=139252
+        &lt;rdar://problem/19140827&gt;
+
+        Reviewed by Anders Carlsson.
+
+        It turns out contentsToScreen requires sync IPC in Mac WebKit2, which we
+        really don't want to be doing here (especially since the UI process will often
+        be sitting in waitForAndDispatchImmediately waiting for didPerformActionMenuHitTest).
+
+        Go back to keeping TextIndicator rects in &quot;window&quot; coordinates and do the conversion
+        in each of the WebKits instead of trying to share that code.
+
+        * Shared/WebCoreArgumentCoders.cpp:
+        (IPC::ArgumentCoder&lt;TextIndicatorData&gt;::encode):
+        (IPC::ArgumentCoder&lt;TextIndicatorData&gt;::decode):
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView _setTextIndicator:fadeOut:animationCompletionHandler:]):
+        * WebProcess/WebPage/FindController.cpp:
+        (WebKit::FindController::updateFindIndicator):
+        (WebKit::FindController::drawRect):
+        Adjust to the WebCore changes.
+
</ins><span class="cx"> 2014-12-04  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Simplify StorageManager callback functions
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebCoreArgumentCoderscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp (176809 => 176810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp        2014-12-04 19:57:08 UTC (rev 176809)
+++ trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp        2014-12-04 19:58:14 UTC (rev 176810)
</span><span class="lines">@@ -1963,8 +1963,8 @@
</span><span class="cx"> 
</span><span class="cx"> void ArgumentCoder&lt;TextIndicatorData&gt;::encode(ArgumentEncoder&amp; encoder, const TextIndicatorData&amp; textIndicatorData)
</span><span class="cx"> {
</span><del>-    encoder &lt;&lt; textIndicatorData.selectionRectInScreenCoordinates;
-    encoder &lt;&lt; textIndicatorData.textBoundingRectInScreenCoordinates;
</del><ins>+    encoder &lt;&lt; textIndicatorData.selectionRectInWindowCoordinates;
+    encoder &lt;&lt; textIndicatorData.textBoundingRectInWindowCoordinates;
</ins><span class="cx">     encoder &lt;&lt; textIndicatorData.textRectsInBoundingRectCoordinates;
</span><span class="cx">     encoder &lt;&lt; textIndicatorData.contentImageScaleFactor;
</span><span class="cx">     encoder.encodeEnum(textIndicatorData.presentationTransition);
</span><span class="lines">@@ -1982,10 +1982,10 @@
</span><span class="cx"> 
</span><span class="cx"> bool ArgumentCoder&lt;TextIndicatorData&gt;::decode(ArgumentDecoder&amp; decoder, TextIndicatorData&amp; textIndicatorData)
</span><span class="cx"> {
</span><del>-    if (!decoder.decode(textIndicatorData.selectionRectInScreenCoordinates))
</del><ins>+    if (!decoder.decode(textIndicatorData.selectionRectInWindowCoordinates))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    if (!decoder.decode(textIndicatorData.textBoundingRectInScreenCoordinates))
</del><ins>+    if (!decoder.decode(textIndicatorData.textBoundingRectInWindowCoordinates))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     if (!decoder.decode(textIndicatorData.textRectsInBoundingRectCoordinates))
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPImacWKViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (176809 => 176810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm        2014-12-04 19:57:08 UTC (rev 176809)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm        2014-12-04 19:58:14 UTC (rev 176810)
</span><span class="lines">@@ -3081,7 +3081,8 @@
</span><span class="cx">     if (!_data-&gt;_textIndicatorWindow)
</span><span class="cx">         _data-&gt;_textIndicatorWindow = std::make_unique&lt;TextIndicatorWindow&gt;(self);
</span><span class="cx"> 
</span><del>-    _data-&gt;_textIndicatorWindow-&gt;setTextIndicator(textIndicator, fadeOut, WTF::move(completionHandler));
</del><ins>+    NSRect contentRect = [self.window convertRectToScreen:[self convertRect:textIndicator-&gt;textBoundingRectInWindowCoordinates() toView:nil]];
+    _data-&gt;_textIndicatorWindow-&gt;setTextIndicator(textIndicator, contentRect, fadeOut, WTF::move(completionHandler));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)_setTextIndicator:(PassRefPtr&lt;TextIndicator&gt;)textIndicator fadeOut:(BOOL)fadeOut
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageFindControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp (176809 => 176810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp        2014-12-04 19:57:08 UTC (rev 176809)
+++ trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp        2014-12-04 19:58:14 UTC (rev 176810)
</span><span class="lines">@@ -318,7 +318,7 @@
</span><span class="cx">     if (!indicator)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    m_findIndicatorRect = enclosingIntRect(indicator-&gt;selectionRectInScreenCoordinates());
</del><ins>+    m_findIndicatorRect = enclosingIntRect(indicator-&gt;selectionRectInWindowCoordinates());
</ins><span class="cx">     m_webPage-&gt;send(Messages::WebPageProxy::SetTextIndicator(indicator-&gt;data(), !isShowingOverlay));
</span><span class="cx">     m_isShowingFindIndicator = true;
</span><span class="cx"> 
</span><span class="lines">@@ -450,7 +450,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (Frame* selectedFrame = frameWithSelection(m_webPage-&gt;corePage())) {
</span><del>-        IntRect findIndicatorRect = selectedFrame-&gt;view()-&gt;contentsToScreen(enclosingIntRect(selectedFrame-&gt;selection().selectionBounds()));
</del><ins>+        IntRect findIndicatorRect = selectedFrame-&gt;view()-&gt;contentsToWindow(enclosingIntRect(selectedFrame-&gt;selection().selectionBounds()));
</ins><span class="cx"> 
</span><span class="cx">         if (findIndicatorRect != m_findIndicatorRect)
</span><span class="cx">             hideFindIndicator();
</span></span></pre>
</div>
</div>

</body>
</html>