REGRESSION (r183517): Yellow find-in-page highlight gets stuck forever
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 May 2015 06:26:24 +0000 (06:26 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 May 2015 06:26:24 +0000 (06:26 +0000)
https://bugs.webkit.org/show_bug.cgi?id=144651
<rdar://problem/20755722>

Reviewed by Dan Bernstein.

* page/mac/TextIndicatorWindow.h:
* page/mac/TextIndicatorWindow.mm:
(WebCore::TextIndicatorWindow::clearTextIndicator):
(WebCore::TextIndicatorWindow::setTextIndicator):
(WebCore::TextIndicatorWindow::closeWindow):
(WebCore::TextIndicatorWindow::startFadeOut):
We can't keep m_fadingOut on TextIndicatorWindow, since it is reused.
Keep it on the WebTextIndicatorView instead.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183859 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/page/mac/TextIndicatorWindow.h
Source/WebCore/page/mac/TextIndicatorWindow.mm

index 7de7926..24d2e66 100644 (file)
@@ -1,3 +1,20 @@
+2015-05-05  Timothy Horton  <timothy_horton@apple.com>
+
+        REGRESSION (r183517): Yellow find-in-page highlight gets stuck forever
+        https://bugs.webkit.org/show_bug.cgi?id=144651
+        <rdar://problem/20755722>
+
+        Reviewed by Dan Bernstein.
+
+        * page/mac/TextIndicatorWindow.h:
+        * page/mac/TextIndicatorWindow.mm:
+        (WebCore::TextIndicatorWindow::clearTextIndicator):
+        (WebCore::TextIndicatorWindow::setTextIndicator):
+        (WebCore::TextIndicatorWindow::closeWindow):
+        (WebCore::TextIndicatorWindow::startFadeOut):
+        We can't keep m_fadingOut on TextIndicatorWindow, since it is reused.
+        Keep it on the WebTextIndicatorView instead.
+
 2015-05-05  Žan Doberšek  <zdobersek@igalia.com>
 
         Add missing vtable override specifiers under Source/WebCore/html
index 98f920e..0ebc209 100644 (file)
@@ -62,8 +62,6 @@ private:
     RetainPtr<WebTextIndicatorView> m_textIndicatorView;
 
     RunLoop::Timer<TextIndicatorWindow> m_temporaryTextIndicatorTimer;
-
-    bool m_fadingOut { false };
 };
 
 } // namespace WebKit
index 37a8891..cf575c3 100644 (file)
@@ -82,6 +82,8 @@ using namespace WebCore;
 - (void)setAnimationProgress:(float)progress;
 - (BOOL)hasCompletedAnimation;
 
+@property (nonatomic, setter=setFadingOut:) BOOL isFadingOut;
+
 @end
 
 @implementation WebTextIndicatorView
@@ -369,7 +371,7 @@ void TextIndicatorWindow::clearTextIndicator(TextIndicatorDismissalAnimation ani
 {
     RefPtr<TextIndicator> textIndicator = WTF::move(m_textIndicator);
 
-    if (m_fadingOut)
+    if ([m_textIndicatorView isFadingOut])
         return;
 
     if (textIndicator && textIndicator->wantsManualAnimation() && [m_textIndicatorView hasCompletedAnimation] && animation == TextIndicatorDismissalAnimation::FadeOut) {
@@ -385,10 +387,10 @@ void TextIndicatorWindow::setTextIndicator(Ref<TextIndicator> textIndicator, CGR
     if (m_textIndicator == textIndicator.ptr())
         return;
 
-    m_textIndicator = textIndicator.ptr();
-
     closeWindow();
 
+    m_textIndicator = textIndicator.ptr();
+
     CGFloat horizontalMargin = dropShadowBlurRadius * 2 + horizontalBorder;
     CGFloat verticalMargin = dropShadowBlurRadius * 2 + verticalBorder;
     
@@ -426,7 +428,7 @@ void TextIndicatorWindow::closeWindow()
     if (!m_textIndicatorWindow)
         return;
 
-    if (m_fadingOut)
+    if ([m_textIndicatorView isFadingOut])
         return;
 
     m_temporaryTextIndicatorTimer.stop();
@@ -438,7 +440,7 @@ void TextIndicatorWindow::closeWindow()
 
 void TextIndicatorWindow::startFadeOut()
 {
-    m_fadingOut = true;
+    [m_textIndicatorView setFadingOut:YES];
     RetainPtr<NSWindow> indicatorWindow = m_textIndicatorWindow;
     [m_textIndicatorView hideWithCompletionHandler:[indicatorWindow] {
         [[indicatorWindow parentWindow] removeChildWindow:indicatorWindow.get()];