<!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>[176639] branches/safari-600.3-branch/Source/WebKit2</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/176639">176639</a></dd>
<dt>Author</dt> <dd>dburkart@apple.com</dd>
<dt>Date</dt> <dd>2014-12-02 06:42:48 -0800 (Tue, 02 Dec 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merged <a href="http://trac.webkit.org/projects/webkit/changeset/176418">r176418</a>. rdar://problems/19042323</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari6003branchSourceWebKit2ChangeLog">branches/safari-600.3-branch/Source/WebKit2/ChangeLog</a></li>
<li><a href="#branchessafari6003branchSourceWebKit2SharedTextIndicatorcpp">branches/safari-600.3-branch/Source/WebKit2/Shared/TextIndicator.cpp</a></li>
<li><a href="#branchessafari6003branchSourceWebKit2SharedTextIndicatorh">branches/safari-600.3-branch/Source/WebKit2/Shared/TextIndicator.h</a></li>
<li><a href="#branchessafari6003branchSourceWebKit2UIProcessmacTextIndicatorWindowmm">branches/safari-600.3-branch/Source/WebKit2/UIProcess/mac/TextIndicatorWindow.mm</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari6003branchSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit2/ChangeLog (176638 => 176639)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit2/ChangeLog        2014-12-02 14:35:50 UTC (rev 176638)
+++ branches/safari-600.3-branch/Source/WebKit2/ChangeLog        2014-12-02 14:42:48 UTC (rev 176639)
</span><span class="lines">@@ -1,5 +1,34 @@
</span><span class="cx"> 2014-12-02 Dana Burkart <dburkart@apple.com>
</span><span class="cx">
</span><ins>+ Merge r176418. <rdar://problem/19042323>
+
+ 2014-11-20 Tim Horton <timothy_horton@apple.com>
+
+ TextIndicator should have getters for TextIndicator::Data properties
+ https://bugs.webkit.org/show_bug.cgi?id=138920
+
+ Reviewed by Beth Dakin.
+
+ Instead of having clients reach into the data(), add getters.
+ Remove frameRect(), which is identical to the textBoundingRectInWindowCoordinates getter.
+ Remove declarations for draw/drawContentImage, which were already removed.
+
+ * Shared/TextIndicator.cpp:
+ (WebKit::TextIndicator::frameRect): Deleted.
+ * Shared/TextIndicator.h:
+ (WebKit::TextIndicator::textBoundingRectInWindowCoordinates):
+ (WebKit::TextIndicator::textRectsInBoundingRectCoordinates):
+ (WebKit::TextIndicator::contentImageScaleFactor):
+ (WebKit::TextIndicator::contentImageWithHighlight):
+ (WebKit::TextIndicator::contentImage):
+ * UIProcess/mac/TextIndicatorWindow.mm:
+ (-[WKTextIndicatorView initWithFrame:textIndicator:margin:]):
+ (-[WKTextIndicatorView presentWithCompletionHandler:]):
+ (WebKit::TextIndicatorWindow::setTextIndicator):
+
+
+2014-12-02 Dana Burkart <dburkart@apple.com>
+
</ins><span class="cx"> Merge r176415. rdar://problem/18950441
</span><span class="cx">
</span><span class="cx"> 2014-11-20 Tim Horton <timothy_horton@apple.com>
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKit2SharedTextIndicatorcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit2/Shared/TextIndicator.cpp (176638 => 176639)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit2/Shared/TextIndicator.cpp        2014-12-02 14:35:50 UTC (rev 176638)
+++ branches/safari-600.3-branch/Source/WebKit2/Shared/TextIndicator.cpp        2014-12-02 14:42:48 UTC (rev 176639)
</span><span class="lines">@@ -211,11 +211,6 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-FloatRect TextIndicator::frameRect() const
-{
- return m_data.textBoundingRectInWindowCoordinates;
-}
-
</del><span class="cx"> void TextIndicator::Data::encode(IPC::ArgumentEncoder& encoder) const
</span><span class="cx"> {
</span><span class="cx"> encoder << selectionRectInWindowCoordinates;
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKit2SharedTextIndicatorh"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit2/Shared/TextIndicator.h (176638 => 176639)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit2/Shared/TextIndicator.h        2014-12-02 14:35:50 UTC (rev 176638)
+++ branches/safari-600.3-branch/Source/WebKit2/Shared/TextIndicator.h        2014-12-02 14:42:48 UTC (rev 176639)
</span><span class="lines">@@ -67,7 +67,6 @@
</span><span class="cx"> float contentImageScaleFactor;
</span><span class="cx"> RefPtr<ShareableBitmap> contentImageWithHighlight;
</span><span class="cx"> RefPtr<ShareableBitmap> contentImage;
</span><del>-
</del><span class="cx"> PresentationTransition presentationTransition;
</span><span class="cx">
</span><span class="cx"> void encode(IPC::ArgumentEncoder&) const;
</span><span class="lines">@@ -81,20 +80,20 @@
</span><span class="cx"> ~TextIndicator();
</span><span class="cx">
</span><span class="cx"> WebCore::FloatRect selectionRectInWindowCoordinates() const { return m_data.selectionRectInWindowCoordinates; }
</span><del>-
</del><ins>+ WebCore::FloatRect textBoundingRectInWindowCoordinates() const { return m_data.textBoundingRectInWindowCoordinates; }
+ const Vector<WebCore::FloatRect>& textRectsInBoundingRectCoordinates() const { return m_data.textRectsInBoundingRectCoordinates; }
+ float contentImageScaleFactor() const { return m_data.contentImageScaleFactor; }
+ ShareableBitmap *contentImageWithHighlight() const { return m_data.contentImageWithHighlight.get(); }
+ ShareableBitmap *contentImage() const { return m_data.contentImage.get(); }
</ins><span class="cx"> PresentationTransition presentationTransition() const { return m_data.presentationTransition; }
</span><ins>+
</ins><span class="cx"> void setPresentationTransition(PresentationTransition transition) { m_data.presentationTransition = transition; }
</span><span class="cx">
</span><del>- WebCore::FloatRect frameRect() const;
</del><span class="cx"> Data data() const { return m_data; }
</span><span class="cx">
</span><del>- void draw(WebCore::GraphicsContext&, const WebCore::IntRect& dirtyRect);
-
</del><span class="cx"> private:
</span><span class="cx"> TextIndicator(const TextIndicator::Data&);
</span><span class="cx">
</span><del>- void drawContentImage(WebCore::GraphicsContext&, WebCore::FloatRect textRect);
-
</del><span class="cx"> Data m_data;
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKit2UIProcessmacTextIndicatorWindowmm"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit2/UIProcess/mac/TextIndicatorWindow.mm (176638 => 176639)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit2/UIProcess/mac/TextIndicatorWindow.mm        2014-12-02 14:35:50 UTC (rev 176638)
+++ branches/safari-600.3-branch/Source/WebKit2/UIProcess/mac/TextIndicatorWindow.mm        2014-12-02 14:42:48 UTC (rev 176639)
</span><span class="lines">@@ -92,15 +92,15 @@
</span><span class="cx"> self.wantsLayer = YES;
</span><span class="cx"> self.layer.anchorPoint = CGPointZero;
</span><span class="cx">
</span><del>- bool wantsCrossfade = _textIndicator->data().presentationTransition == WebKit::TextIndicator::PresentationTransition::BounceAndCrossfade;
</del><ins>+ bool wantsCrossfade = _textIndicator->presentationTransition() == WebKit::TextIndicator::PresentationTransition::BounceAndCrossfade;
</ins><span class="cx">
</span><del>- FloatSize contentsImageLogicalSize = _textIndicator->data().contentImage->size();
- contentsImageLogicalSize.scale(1 / _textIndicator->data().contentImageScaleFactor);
</del><ins>+ FloatSize contentsImageLogicalSize = _textIndicator->contentImage()->size();
+ contentsImageLogicalSize.scale(1 / _textIndicator->contentImageScaleFactor());
</ins><span class="cx"> RetainPtr<CGImageRef> contentsImage;
</span><span class="cx"> if (wantsCrossfade)
</span><del>- contentsImage = _textIndicator->data().contentImageWithHighlight->makeCGImage();
</del><ins>+ contentsImage = _textIndicator->contentImageWithHighlight()->makeCGImage();
</ins><span class="cx"> else
</span><del>- contentsImage = _textIndicator->data().contentImage->makeCGImage();
</del><ins>+ contentsImage = _textIndicator->contentImage()->makeCGImage();
</ins><span class="cx">
</span><span class="cx"> RetainPtr<NSMutableArray> bounceLayers = adoptNS([[NSMutableArray alloc] init]);
</span><span class="cx">
</span><span class="lines">@@ -112,7 +112,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->data().textRectsInBoundingRectCoordinates) {
</del><ins>+ for (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">@@ -172,10 +172,10 @@
</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->data().textBoundingRectInWindowCoordinates.location() - _textIndicator->data().selectionRectInWindowCoordinates.location());
</del><ins>+ imageRect.move(_textIndicator->textBoundingRectInWindowCoordinates().location() - _textIndicator->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><del>- [textLayer setContentsScale:_textIndicator->data().contentImageScaleFactor];
</del><ins>+ [textLayer setContentsScale:_textIndicator->contentImageScaleFactor()];
</ins><span class="cx"> [textLayer setFrame:yellowHighlightRect];
</span><span class="cx"> [textLayer setCornerRadius:cornerRadius];
</span><span class="cx"> [bounceLayer setValue:textLayer.get() forKey:textLayerKey];
</span><span class="lines">@@ -190,7 +190,7 @@
</span><span class="cx">
</span><span class="cx"> - (void)presentWithCompletionHandler:(void(^)(void))completionHandler
</span><span class="cx"> {
</span><del>- bool wantsCrossfade = _textIndicator->data().presentationTransition == WebKit::TextIndicator::PresentationTransition::BounceAndCrossfade;
</del><ins>+ bool wantsCrossfade = _textIndicator->presentationTransition() == WebKit::TextIndicator::PresentationTransition::BounceAndCrossfade;
</ins><span class="cx"> double animationDuration = wantsCrossfade ? bounceWithCrossfadeAnimationDuration : bounceAnimationDuration;
</span><span class="cx"> RetainPtr<CAKeyframeAnimation> bounceAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform"];
</span><span class="cx"> [bounceAnimation setValues:@[
</span><span class="lines">@@ -204,7 +204,7 @@
</span><span class="cx"> RetainPtr<CABasicAnimation> fadeShadowInAnimation;
</span><span class="cx"> if (wantsCrossfade) {
</span><span class="cx"> crossfadeAnimation = [CABasicAnimation animationWithKeyPath:@"contents"];
</span><del>- RetainPtr<CGImageRef> contentsImage = _textIndicator->data().contentImage->makeCGImage();
</del><ins>+ RetainPtr<CGImageRef> contentsImage = _textIndicator->contentImage()->makeCGImage();
</ins><span class="cx"> [crossfadeAnimation setToValue:(id)contentsImage.get()];
</span><span class="cx"> [crossfadeAnimation setFillMode:kCAFillModeForwards];
</span><span class="cx"> [crossfadeAnimation setRemovedOnCompletion:NO];
</span><span class="lines">@@ -280,7 +280,7 @@
</span><span class="cx"> if (!m_textIndicator)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- NSRect contentRect = m_textIndicator->frameRect();
</del><ins>+ NSRect contentRect = m_textIndicator->textBoundingRectInWindowCoordinates();
</ins><span class="cx">
</span><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="lines">@@ -302,7 +302,7 @@
</span><span class="cx"> [[m_wkView window] addChildWindow:m_textIndicatorWindow.get() ordered:NSWindowAbove];
</span><span class="cx"> [m_textIndicatorWindow setReleasedWhenClosed:NO];
</span><span class="cx">
</span><del>- if (m_textIndicator->data().presentationTransition != TextIndicator::PresentationTransition::None) {
</del><ins>+ if (m_textIndicator->presentationTransition() != TextIndicator::PresentationTransition::None) {
</ins><span class="cx"> [m_textIndicatorView presentWithCompletionHandler:[animationCompletionHandler] {
</span><span class="cx"> animationCompletionHandler();
</span><span class="cx"> }];
</span></span></pre>
</div>
</div>
</body>
</html>