<!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>[178493] branches/safari-600.5-branch/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/178493">178493</a></dd>
<dt>Author</dt> <dd>bshafiei@apple.com</dd>
<dt>Date</dt> <dd>2015-01-15 00:48:05 -0800 (Thu, 15 Jan 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merged <a href="http://trac.webkit.org/projects/webkit/changeset/178290">r178290</a>. rdar://problem/19441243</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari6005branchSourceWebCoreChangeLog">branches/safari-600.5-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari6005branchSourceWebCorepageTextIndicatorcpp">branches/safari-600.5-branch/Source/WebCore/page/TextIndicator.cpp</a></li>
<li><a href="#branchessafari6005branchSourceWebCorepageTextIndicatorh">branches/safari-600.5-branch/Source/WebCore/page/TextIndicator.h</a></li>
<li><a href="#branchessafari6005branchSourceWebCorepagemacTextIndicatorWindowmm">branches/safari-600.5-branch/Source/WebCore/page/mac/TextIndicatorWindow.mm</a></li>
<li><a href="#branchessafari6005branchSourceWebKitmacChangeLog">branches/safari-600.5-branch/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#branchessafari6005branchSourceWebKitmacWebViewWebViewmm">branches/safari-600.5-branch/Source/WebKit/mac/WebView/WebView.mm</a></li>
<li><a href="#branchessafari6005branchSourceWebKit2ChangeLog">branches/safari-600.5-branch/Source/WebKit2/ChangeLog</a></li>
<li><a href="#branchessafari6005branchSourceWebKit2SharedWebCoreArgumentCoderscpp">branches/safari-600.5-branch/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp</a></li>
<li><a href="#branchessafari6005branchSourceWebKit2UIProcessAPImacWKViewmm">branches/safari-600.5-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm</a></li>
<li><a href="#branchessafari6005branchSourceWebKit2WebProcessWebPageFindControllercpp">branches/safari-600.5-branch/Source/WebKit2/WebProcess/WebPage/FindController.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari6005branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.5-branch/Source/WebCore/ChangeLog (178492 => 178493)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.5-branch/Source/WebCore/ChangeLog        2015-01-15 08:41:33 UTC (rev 178492)
+++ branches/safari-600.5-branch/Source/WebCore/ChangeLog        2015-01-15 08:48:05 UTC (rev 178493)
</span><span class="lines">@@ -1,3 +1,31 @@
</span><ins>+2015-01-15 Babak Shafiei <bshafiei@apple.com>
+
+ Merge r178290. rdar://problem/19441243
+
+ 2015-01-12 Timothy Horton <timothy_horton@apple.com>
+
+ Multi-rect TextIndicators are vertically flipped in WebKit1
+ https://bugs.webkit.org/show_bug.cgi?id=140350
+ <rdar://problem/19441243>
+
+ Reviewed by Beth Dakin.
+
+ * page/TextIndicator.cpp:
+ (WebCore::TextIndicator::createWithSelectionInFrame):
+ (WebCore::TextIndicator::TextIndicator):
+ * page/TextIndicator.h:
+ (WebCore::TextIndicator::selectionRectInRootViewCoordinates):
+ (WebCore::TextIndicator::textBoundingRectInRootViewCoordinates):
+ (WebCore::TextIndicator::selectionRectInWindowCoordinates): Deleted.
+ (WebCore::TextIndicator::textBoundingRectInWindowCoordinates): Deleted.
+ * page/mac/TextIndicatorWindow.mm:
+ (-[WebTextIndicatorView initWithFrame:textIndicator:margin:]):
+ (WebCore::TextIndicatorWindow::setTextIndicator):
+ Compute, store, and use TextIndicator's selectionRect and textBoundingRect
+ in root view coordinates instead of window coordinates; this way, each
+ WebKit can do the conversion itself, and the rootView vs. window flipping
+ isn't wrongly factored into textRectsInBoundingRectCoordinates.
+
</ins><span class="cx"> 2015-01-14 Babak Shafiei <bshafiei@apple.com>
</span><span class="cx">
</span><span class="cx"> Merge r173796.
</span></span></pre></div>
<a id="branchessafari6005branchSourceWebCorepageTextIndicatorcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.5-branch/Source/WebCore/page/TextIndicator.cpp (178492 => 178493)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.5-branch/Source/WebCore/page/TextIndicator.cpp        2015-01-15 08:41:33 UTC (rev 178492)
+++ branches/safari-600.5-branch/Source/WebCore/page/TextIndicator.cpp        2015-01-15 08:48:05 UTC (rev 178493)
</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 selectionRectInWindowCoordinates = frame.view()->contentsToWindow(selectionRect);
</del><ins>+ IntRect selectionRectInRootViewCoordinates = frame.view()->contentsToRootView(selectionRect);
</ins><span class="cx">
</span><span class="cx"> Vector<FloatRect> 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 textBoundingRectInWindowCoordinates;
- Vector<FloatRect> textRectsInWindowCoordinates;
</del><ins>+ FloatRect textBoundingRectInRootViewCoordinates;
+ Vector<FloatRect> textRectsInRootViewCoordinates;
</ins><span class="cx"> for (const FloatRect& textRect : textRects) {
</span><del>- FloatRect textRectInWindowCoordinates = frame.view()->contentsToWindow(enclosingIntRect(textRect));
- textRectsInWindowCoordinates.append(textRectInWindowCoordinates);
- textBoundingRectInWindowCoordinates.unite(textRectInWindowCoordinates);
</del><ins>+ FloatRect textRectInRootViewCoordinates = frame.view()->contentsToRootView(enclosingIntRect(textRect));
+ textRectsInRootViewCoordinates.append(textRectInRootViewCoordinates);
+ textBoundingRectInRootViewCoordinates.unite(textRectInRootViewCoordinates);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Vector<FloatRect> textRectsInBoundingRectCoordinates;
</span><del>- for (auto rect : textRectsInWindowCoordinates) {
- rect.moveBy(-textBoundingRectInWindowCoordinates.location());
</del><ins>+ for (auto rect : textRectsInRootViewCoordinates) {
+ rect.moveBy(-textBoundingRectInRootViewCoordinates.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.selectionRectInWindowCoordinates = selectionRectInWindowCoordinates;
- data.textBoundingRectInWindowCoordinates = textBoundingRectInWindowCoordinates;
</del><ins>+ data.selectionRectInRootViewCoordinates = selectionRectInRootViewCoordinates;
+ data.textBoundingRectInRootViewCoordinates = textBoundingRectInRootViewCoordinates;
</ins><span class="cx"> data.textRectsInBoundingRectCoordinates = textRectsInBoundingRectCoordinates;
</span><span class="cx"> data.contentImageScaleFactor = frame.page()->deviceScaleFactor();
</span><span class="cx"> data.contentImage = indicatorBitmap;
</span><span class="lines">@@ -183,7 +183,7 @@
</span><span class="cx"> TextIndicator::TextIndicator(const TextIndicatorData& data)
</span><span class="cx"> : m_data(data)
</span><span class="cx"> {
</span><del>- ASSERT(m_data.contentImageScaleFactor != 1 || m_data.contentImage->size() == enclosingIntRect(m_data.selectionRectInWindowCoordinates).size());
</del><ins>+ ASSERT(m_data.contentImageScaleFactor != 1 || m_data.contentImage->size() == enclosingIntRect(m_data.selectionRectInRootViewCoordinates).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="branchessafari6005branchSourceWebCorepageTextIndicatorh"></a>
<div class="modfile"><h4>Modified: branches/safari-600.5-branch/Source/WebCore/page/TextIndicator.h (178492 => 178493)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.5-branch/Source/WebCore/page/TextIndicator.h        2015-01-15 08:41:33 UTC (rev 178492)
+++ branches/safari-600.5-branch/Source/WebCore/page/TextIndicator.h        2015-01-15 08:48:05 UTC (rev 178493)
</span><span class="lines">@@ -57,8 +57,8 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> struct TextIndicatorData {
</span><del>- FloatRect selectionRectInWindowCoordinates;
- FloatRect textBoundingRectInWindowCoordinates;
</del><ins>+ FloatRect selectionRectInRootViewCoordinates;
+ FloatRect textBoundingRectInRootViewCoordinates;
</ins><span class="cx"> Vector<FloatRect> textRectsInBoundingRectCoordinates;
</span><span class="cx"> float contentImageScaleFactor;
</span><span class="cx"> RefPtr<Image> contentImageWithHighlight;
</span><span class="lines">@@ -74,8 +74,8 @@
</span><span class="cx">
</span><span class="cx"> ~TextIndicator();
</span><span class="cx">
</span><del>- FloatRect selectionRectInWindowCoordinates() const { return m_data.selectionRectInWindowCoordinates; }
- FloatRect textBoundingRectInWindowCoordinates() const { return m_data.textBoundingRectInWindowCoordinates; }
</del><ins>+ FloatRect selectionRectInRootViewCoordinates() const { return m_data.selectionRectInRootViewCoordinates; }
+ FloatRect textBoundingRectInRootViewCoordinates() const { return m_data.textBoundingRectInRootViewCoordinates; }
</ins><span class="cx"> const Vector<FloatRect>& 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="branchessafari6005branchSourceWebCorepagemacTextIndicatorWindowmm"></a>
<div class="modfile"><h4>Modified: branches/safari-600.5-branch/Source/WebCore/page/mac/TextIndicatorWindow.mm (178492 => 178493)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.5-branch/Source/WebCore/page/mac/TextIndicatorWindow.mm        2015-01-15 08:41:33 UTC (rev 178492)
+++ branches/safari-600.5-branch/Source/WebCore/page/mac/TextIndicatorWindow.mm        2015-01-15 08:48:05 UTC (rev 178493)
</span><span class="lines">@@ -116,7 +116,7 @@
</span><span class="cx"> RetainPtr<CGColorRef> gradientDarkColor = [NSColor colorWithDeviceRed:.929 green:.8 blue:0 alpha:1].CGColor;
</span><span class="cx"> RetainPtr<CGColorRef> gradientLightColor = [NSColor colorWithDeviceRed:.949 green:.937 blue:0 alpha:1].CGColor;
</span><span class="cx">
</span><del>- for (auto& textRect : _textIndicator->textRectsInBoundingRectCoordinates()) {
</del><ins>+ for (const auto& textRect : _textIndicator->textRectsInBoundingRectCoordinates()) {
</ins><span class="cx"> FloatRect bounceLayerRect = textRect;
</span><span class="cx"> bounceLayerRect.move(_margin.width, _margin.height);
</span><span class="cx"> bounceLayerRect.inflateX(horizontalBorder);
</span><span class="lines">@@ -176,7 +176,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->textBoundingRectInWindowCoordinates().location() - _textIndicator->selectionRectInWindowCoordinates().location());
</del><ins>+ imageRect.move(_textIndicator->textBoundingRectInRootViewCoordinates().location() - _textIndicator->selectionRectInRootViewCoordinates().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->contentImageScaleFactor()];
</span><span class="lines">@@ -369,14 +369,13 @@
</span><span class="cx"> [m_textIndicatorView setAnimationProgress:progress];
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void TextIndicatorWindow::setTextIndicator(PassRefPtr<TextIndicator> textIndicator, CGRect contentRect, bool fadeOut)
</del><ins>+void TextIndicatorWindow::setTextIndicator(PassRefPtr<TextIndicator> textIndicator, CGRect textBoundingRectInScreenCoordinates, bool fadeOut)
</ins><span class="cx"> {
</span><span class="cx"> if (m_textIndicator == textIndicator)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> m_textIndicator = textIndicator;
</span><span class="cx">
</span><del>- // Get rid of the old window.
</del><span class="cx"> closeWindow();
</span><span class="cx">
</span><span class="cx"> if (!m_textIndicator)
</span><span class="lines">@@ -386,11 +385,11 @@
</span><span class="cx"> CGFloat verticalMargin = dropShadowBlurRadius * 2 + verticalBorder;
</span><span class="cx">
</span><span class="cx"> if (m_textIndicator->wantsBounce()) {
</span><del>- horizontalMargin = std::max(horizontalMargin, contentRect.size.width * (midBounceScale - 1) + horizontalMargin);
- verticalMargin = std::max(verticalMargin, contentRect.size.height * (midBounceScale - 1) + verticalMargin);
</del><ins>+ horizontalMargin = std::max(horizontalMargin, textBoundingRectInScreenCoordinates.size.width * (midBounceScale - 1) + horizontalMargin);
+ verticalMargin = std::max(verticalMargin, textBoundingRectInScreenCoordinates.size.height * (midBounceScale - 1) + verticalMargin);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- contentRect = CGRectInset(contentRect, -horizontalMargin, -verticalMargin);
</del><ins>+ CGRect contentRect = CGRectInset(textBoundingRectInScreenCoordinates, -horizontalMargin, -verticalMargin);
</ins><span class="cx"> NSRect windowContentRect = [NSWindow contentRectForFrameRect:NSIntegralRect(NSRectFromCGRect(contentRect)) styleMask:NSBorderlessWindowMask];
</span><span class="cx"> m_textIndicatorWindow = adoptNS([[NSWindow alloc] initWithContentRect:windowContentRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO]);
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari6005branchSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.5-branch/Source/WebKit/mac/ChangeLog (178492 => 178493)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.5-branch/Source/WebKit/mac/ChangeLog        2015-01-15 08:41:33 UTC (rev 178492)
+++ branches/safari-600.5-branch/Source/WebKit/mac/ChangeLog        2015-01-15 08:48:05 UTC (rev 178493)
</span><span class="lines">@@ -1,5 +1,21 @@
</span><span class="cx"> 2015-01-15 Babak Shafiei <bshafiei@apple.com>
</span><span class="cx">
</span><ins>+ Merge r178290. rdar://problem/19441243
+
+ 2015-01-12 Timothy Horton <timothy_horton@apple.com>
+
+ Multi-rect TextIndicators are vertically flipped in WebKit1
+ https://bugs.webkit.org/show_bug.cgi?id=140350
+ <rdar://problem/19441243>
+
+ Reviewed by Beth Dakin.
+
+ * WebView/WebView.mm:
+ (-[WebView _setTextIndicator:fadeOut:]):
+ Convert the textBoundingRect from root view to screen coordinates.
+
+2015-01-15 Babak Shafiei <bshafiei@apple.com>
+
</ins><span class="cx"> Merge r178126. rdar://problem/19412705
</span><span class="cx">
</span><span class="cx"> 2015-01-08 Timothy Horton <timothy_horton@apple.com>
</span></span></pre></div>
<a id="branchessafari6005branchSourceWebKitmacWebViewWebViewmm"></a>
<div class="modfile"><h4>Modified: branches/safari-600.5-branch/Source/WebKit/mac/WebView/WebView.mm (178492 => 178493)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.5-branch/Source/WebKit/mac/WebView/WebView.mm        2015-01-15 08:41:33 UTC (rev 178492)
+++ branches/safari-600.5-branch/Source/WebKit/mac/WebView/WebView.mm        2015-01-15 08:48:05 UTC (rev 178493)
</span><span class="lines">@@ -8655,8 +8655,9 @@
</span><span class="cx"> if (!_private->textIndicatorWindow)
</span><span class="cx"> _private->textIndicatorWindow = std::make_unique<TextIndicatorWindow>(self);
</span><span class="cx">
</span><del>- NSRect contentRect = [self.window convertRectToScreen:textIndicator->textBoundingRectInWindowCoordinates()];
- _private->textIndicatorWindow->setTextIndicator(textIndicator, NSRectToCGRect(contentRect), fadeOut);
</del><ins>+ NSRect textBoundingRectInWindowCoordinates = [self convertRect:[self _convertRectFromRootView:textIndicator->textBoundingRectInRootViewCoordinates()] toView:nil];
+ NSRect textBoundingRectInScreenCoordinates = [self.window convertRectToScreen:textBoundingRectInWindowCoordinates];
+ _private->textIndicatorWindow->setTextIndicator(textIndicator, NSRectToCGRect(textBoundingRectInScreenCoordinates), fadeOut);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)_clearTextIndicator
</span></span></pre></div>
<a id="branchessafari6005branchSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.5-branch/Source/WebKit2/ChangeLog (178492 => 178493)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.5-branch/Source/WebKit2/ChangeLog        2015-01-15 08:41:33 UTC (rev 178492)
+++ branches/safari-600.5-branch/Source/WebKit2/ChangeLog        2015-01-15 08:48:05 UTC (rev 178493)
</span><span class="lines">@@ -1,3 +1,30 @@
</span><ins>+2015-01-15 Babak Shafiei <bshafiei@apple.com>
+
+ Merge r178290. rdar://problem/19441243
+
+ 2015-01-12 Timothy Horton <timothy_horton@apple.com>
+
+ Multi-rect TextIndicators are vertically flipped in WebKit1
+ https://bugs.webkit.org/show_bug.cgi?id=140350
+ <rdar://problem/19441243>
+
+ Reviewed by Beth Dakin.
+
+ * Shared/WebCoreArgumentCoders.cpp:
+ (IPC::ArgumentCoder<TextIndicatorData>::encode):
+ (IPC::ArgumentCoder<TextIndicatorData>::decode):
+ Adjust to the field name changes.
+
+ * UIProcess/API/mac/WKView.mm:
+ (-[WKView _setTextIndicator:fadeOut:]):
+ Convert the textBoundingRect from root view to screen coordinates.
+
+ * WebProcess/WebPage/FindController.cpp:
+ (WebKit::FindController::updateFindIndicator):
+ (WebKit::FindController::drawRect):
+ Adjust to the new name, and use contentsToRootView when comparing against
+ the stored m_findIndicatorRect.
+
</ins><span class="cx"> 2015-01-14 Dana Burkart <dburkart@apple.com>
</span><span class="cx">
</span><span class="cx"> Merged r175400. <rdar://problem/19424166>
</span></span></pre></div>
<a id="branchessafari6005branchSourceWebKit2SharedWebCoreArgumentCoderscpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.5-branch/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp (178492 => 178493)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.5-branch/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp        2015-01-15 08:41:33 UTC (rev 178492)
+++ branches/safari-600.5-branch/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp        2015-01-15 08:48:05 UTC (rev 178493)
</span><span class="lines">@@ -2172,8 +2172,8 @@
</span><span class="cx">
</span><span class="cx"> void ArgumentCoder<TextIndicatorData>::encode(ArgumentEncoder& encoder, const TextIndicatorData& textIndicatorData)
</span><span class="cx"> {
</span><del>- encoder << textIndicatorData.selectionRectInWindowCoordinates;
- encoder << textIndicatorData.textBoundingRectInWindowCoordinates;
</del><ins>+ encoder << textIndicatorData.selectionRectInRootViewCoordinates;
+ encoder << textIndicatorData.textBoundingRectInRootViewCoordinates;
</ins><span class="cx"> encoder << textIndicatorData.textRectsInBoundingRectCoordinates;
</span><span class="cx"> encoder << textIndicatorData.contentImageScaleFactor;
</span><span class="cx"> encoder.encodeEnum(textIndicatorData.presentationTransition);
</span><span class="lines">@@ -2191,10 +2191,10 @@
</span><span class="cx">
</span><span class="cx"> bool ArgumentCoder<TextIndicatorData>::decode(ArgumentDecoder& decoder, TextIndicatorData& textIndicatorData)
</span><span class="cx"> {
</span><del>- if (!decoder.decode(textIndicatorData.selectionRectInWindowCoordinates))
</del><ins>+ if (!decoder.decode(textIndicatorData.selectionRectInRootViewCoordinates))
</ins><span class="cx"> return false;
</span><span class="cx">
</span><del>- if (!decoder.decode(textIndicatorData.textBoundingRectInWindowCoordinates))
</del><ins>+ if (!decoder.decode(textIndicatorData.textBoundingRectInRootViewCoordinates))
</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="branchessafari6005branchSourceWebKit2UIProcessAPImacWKViewmm"></a>
<div class="modfile"><h4>Modified: branches/safari-600.5-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm (178492 => 178493)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.5-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm        2015-01-15 08:41:33 UTC (rev 178492)
+++ branches/safari-600.5-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm        2015-01-15 08:48:05 UTC (rev 178493)
</span><span class="lines">@@ -3104,8 +3104,8 @@
</span><span class="cx"> if (!_data->_textIndicatorWindow)
</span><span class="cx"> _data->_textIndicatorWindow = std::make_unique<TextIndicatorWindow>(self);
</span><span class="cx">
</span><del>- NSRect contentRect = [self.window convertRectToScreen:[self convertRect:textIndicator->textBoundingRectInWindowCoordinates() toView:nil]];
- _data->_textIndicatorWindow->setTextIndicator(textIndicator, NSRectToCGRect(contentRect), fadeOut);
</del><ins>+ NSRect textBoundingRectInScreenCoordinates = [self.window convertRectToScreen:[self convertRect:textIndicator->textBoundingRectInRootViewCoordinates() toView:nil]];
+ _data->_textIndicatorWindow->setTextIndicator(textIndicator, NSRectToCGRect(textBoundingRectInScreenCoordinates), fadeOut);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)_setTextIndicatorAnimationProgress:(float)progress
</span></span></pre></div>
<a id="branchessafari6005branchSourceWebKit2WebProcessWebPageFindControllercpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.5-branch/Source/WebKit2/WebProcess/WebPage/FindController.cpp (178492 => 178493)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.5-branch/Source/WebKit2/WebProcess/WebPage/FindController.cpp        2015-01-15 08:41:33 UTC (rev 178492)
+++ branches/safari-600.5-branch/Source/WebKit2/WebProcess/WebPage/FindController.cpp        2015-01-15 08:48:05 UTC (rev 178493)
</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->selectionRectInWindowCoordinates());
</del><ins>+ m_findIndicatorRect = enclosingIntRect(indicator->selectionRectInRootViewCoordinates());
</ins><span class="cx"> m_webPage->send(Messages::WebPageProxy::SetTextIndicator(indicator->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->corePage())) {
</span><del>- IntRect findIndicatorRect = selectedFrame->view()->contentsToWindow(enclosingIntRect(selectedFrame->selection().selectionBounds()));
</del><ins>+ IntRect findIndicatorRect = selectedFrame->view()->contentsToRootView(enclosingIntRect(selectedFrame->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>