Manually-animated TextIndicator fades out blue selection if you click inside it
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Jan 2015 00:16:12 +0000 (00:16 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Jan 2015 00:16:12 +0000 (00:16 +0000)
https://bugs.webkit.org/show_bug.cgi?id=140224
<rdar://problem/19317526>

Reviewed by Beth Dakin.

* page/mac/TextIndicatorWindow.mm:
(-[WebTextIndicatorView hasCompletedAnimation]):
(WebCore::TextIndicatorWindow::~TextIndicatorWindow):
Avoid fading out the TextIndicator if the animation hadn't completed.
Also, use wantsManualAnimation instead of duplicating the switch here.

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

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

index 6d61c68d56f1c8083a570918ae1119019bcaa08a..1b6a550b3665f7c95eb5b3a8e61dda990cd9ff30 100644 (file)
@@ -1,3 +1,17 @@
+2015-01-07  Timothy Horton  <timothy_horton@apple.com>
+
+        Manually-animated TextIndicator fades out blue selection if you click inside it
+        https://bugs.webkit.org/show_bug.cgi?id=140224
+        <rdar://problem/19317526>
+
+        Reviewed by Beth Dakin.
+
+        * page/mac/TextIndicatorWindow.mm:
+        (-[WebTextIndicatorView hasCompletedAnimation]):
+        (WebCore::TextIndicatorWindow::~TextIndicatorWindow):
+        Avoid fading out the TextIndicator if the animation hadn't completed.
+        Also, use wantsManualAnimation instead of duplicating the switch here.
+
 2015-01-07  Anders Carlsson  <andersca@apple.com>
 
         Remove AbstractSQLStatementBackend
index b4a7784c737f829676eba76b5e1869e9fba93f9d..075c082f390630fe5d12c9b1bbfeff23f841d279 100644 (file)
@@ -79,6 +79,7 @@ using namespace WebCore;
 - (void)hideWithCompletionHandler:(void(^)(void))completionHandler;
 
 - (void)setAnimationProgress:(float)progress;
+- (BOOL)hasCompletedAnimation;
 
 @end
 
@@ -251,6 +252,11 @@ static RetainPtr<CABasicAnimation> createFadeInAnimation(CFTimeInterval duration
     return fadeInAnimationDuration;
 }
 
+- (BOOL)hasCompletedAnimation
+{
+    return _hasCompletedAnimation;
+}
+
 - (void)present
 {
     bool wantsBounce = _textIndicator->wantsBounce();
@@ -347,16 +353,9 @@ TextIndicatorWindow::TextIndicatorWindow(NSView *targetView)
 
 TextIndicatorWindow::~TextIndicatorWindow()
 {
-    switch (m_textIndicator->presentationTransition()) {
-    case TextIndicatorPresentationTransition::Crossfade:
-    case TextIndicatorPresentationTransition::FadeIn:
+    if (m_textIndicator->wantsManualAnimation() && [m_textIndicatorView hasCompletedAnimation]) {
         startFadeOut();
         return;
-
-    case TextIndicatorPresentationTransition::Bounce:
-    case TextIndicatorPresentationTransition::BounceAndCrossfade:
-    case TextIndicatorPresentationTransition::None:
-        break;
     }
 
     closeWindow();