[TextIndicator] Yellow highlight takes too long to fade out on scroll
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Apr 2015 23:27:21 +0000 (23:27 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Apr 2015 23:27:21 +0000 (23:27 +0000)
commit672a7d2c9901478a98228e81096fa1b684e8809b
tree69bc18f4d554c397c3cfc9612ff8d274bd6e637c
parent9164893c219b7597d4cad3851342455d7da6ddfc
[TextIndicator] Yellow highlight takes too long to fade out on scroll
https://bugs.webkit.org/show_bug.cgi?id=144358
<rdar://problem/19451011>

Reviewed by Beth Dakin.

* page/TextIndicator.h:
Add Lifetime and DismissalAnimation enums.

(WebCore::TextIndicator::contentImageWithHighlight):
(WebCore::TextIndicator::contentImage):
Fix style.

* page/mac/TextIndicatorWindow.h:
* page/mac/TextIndicatorWindow.mm:
(WebCore::TextIndicatorWindow::TextIndicatorWindow):
(WebCore::TextIndicatorWindow::~TextIndicatorWindow):
(WebCore::TextIndicatorWindow::clearTextIndicator):
(WebCore::TextIndicatorWindow::setTextIndicator):
(WebCore::TextIndicatorWindow::closeWindow):
(WebCore::TextIndicatorWindow::startFadeOut):
Rename m_startFadeOutTimer to m_temporaryTextIndicatorTimer (and related).
This is just about temporary-lifetime TextIndicators, like the ones
you get when the find-in-page UI is hidden but you hit Cmd-G.

Add clearTextIndicator, which takes a DismissalAnimation, providing
clients an opportunity to avoid the normal fade-out animation, if it
was going to happen.

* WebView/WebActionMenuController.mm:
(-[WebActionMenuController _showTextIndicator]):
* WebView/WebHTMLView.mm:
(-[WebHTMLView quickLookWithEvent:]):
* WebView/WebImmediateActionController.mm:
(-[WebImmediateActionController _defaultAnimationController]):
(-[WebImmediateActionController _animationControllerForDataDetectedText]):
(-[WebImmediateActionController _animationControllerForDataDetectedLink]):
Pull _clearTextIndicatorWithAnimation out, make it avoid using a dismissal animation
if we're called from didHandleScrollWheel.

* WebView/WebView.mm:
(-[WebView _animationControllerForDictionaryLookupPopupInfo:]):
(-[WebView _setTextIndicator:]):
(-[WebView _setTextIndicator:withLifetime:]):
(-[WebView _clearTextIndicator]):
(-[WebView _showDictionaryLookupPopup:]):
(-[WebView _dictionaryLookupPopoverWillClose:]):
(-[WebView _setTextIndicator:fadeOut:]): Deleted.
* WebView/WebViewInternal.h:
Make _setTextIndicator take a reference.
Add a variant of _setTextIndicator that takes a Lifetime.
Make _clearTextIndicatorWithAnimation take a DismissalAnimation.

* UIProcess/API/Cocoa/WKViewPrivate.h:
* UIProcess/API/mac/WKView.mm:
(-[WKView renewGState]):
(-[WKView viewDidMoveToWindow]):
(-[WKView _dictionaryLookupPopoverWillClose:]):
(-[WKView _setTextIndicator:]):
(-[WKView _setTextIndicator:withLifetime:]):
(-[WKView _clearTextIndicatorWithAnimation:]):
(-[WKView magnifyWithEvent:]):
(-[WKView smartMagnifyWithEvent:]):
(-[WKView setMagnification:centeredAtPoint:]):
(-[WKView setMagnification:]):
(-[WKView _dismissContentRelativeChildWindows]):
(-[WKView _dismissContentRelativeChildWindowsWithAnimation:]):
(-[WKView _setTextIndicator:fadeOut:]): Deleted.
* UIProcess/API/mac/WKViewInternal.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::pageDidScroll):
(WebKit::WebPageProxy::setTextIndicator):
(WebKit::WebPageProxy::clearTextIndicator):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::setTextIndicator):
(WebKit::PageClientImpl::clearTextIndicator):
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::setTextIndicator):
(WebKit::PageClientImpl::clearTextIndicator):
(WebKit::PageClientImpl::didPerformDictionaryLookup):
(WebKit::PageClientImpl::dismissContentRelativeChildWindows):
* UIProcess/mac/WKActionMenuController.mm:
(-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
* UIProcess/mac/WKImmediateActionController.mm:
(-[WKImmediateActionController _defaultAnimationController]):
(-[WKImmediateActionController _animationControllerForDataDetectedText]):
(-[WKImmediateActionController _animationControllerForDataDetectedLink]):
(-[WKImmediateActionController _animationControllerForText]):
* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::updateFindIndicator):
Make _setTextIndicator take a reference.
Add a variant of _setTextIndicator that takes a Lifetime.
Make _clearTextIndicatorWithAnimation take a DismissalAnimation.
Make dismissContentRelativeChildWindows take a parameter indicating
whether the dismissal should include animation or not (currently
only applies to TextIndicator).
Don't animate when dismissal occurs because of scrolling, zooming,
or other things in which the content will have changed significantly
underneath the indicator and shouldn't have a slowly-fading-out yellow highlight.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
29 files changed:
Source/WebCore/ChangeLog
Source/WebCore/page/TextIndicator.h
Source/WebCore/page/mac/TextIndicatorWindow.h
Source/WebCore/page/mac/TextIndicatorWindow.mm
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebActionMenuController.mm
Source/WebKit/mac/WebView/WebHTMLView.mm
Source/WebKit/mac/WebView/WebImmediateActionController.mm
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit/mac/WebView/WebViewInternal.h
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/Cocoa/WKViewPrivate.h
Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp
Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h
Source/WebKit2/UIProcess/API/mac/WKView.mm
Source/WebKit2/UIProcess/API/mac/WKViewInternal.h
Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.cpp
Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.h
Source/WebKit2/UIProcess/PageClient.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebPageProxy.messages.in
Source/WebKit2/UIProcess/ios/PageClientImplIOS.h
Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm
Source/WebKit2/UIProcess/mac/PageClientImpl.h
Source/WebKit2/UIProcess/mac/PageClientImpl.mm
Source/WebKit2/UIProcess/mac/WKActionMenuController.mm
Source/WebKit2/UIProcess/mac/WKImmediateActionController.mm
Source/WebKit2/WebProcess/WebPage/FindController.cpp