Deselection of text causes a noticeable jump on force touch machines
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 21 Jun 2015 06:43:14 +0000 (06:43 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 21 Jun 2015 06:43:14 +0000 (06:43 +0000)
commitbe55b4904a3860b6810065362222a14372356daf
tree1f2f8f8e485763bf98046e1c37a3cd2e4d93c479
parent742fce797cb403169880e2f7a29853f8b7db2833
Deselection of text causes a noticeable jump on force touch machines
https://bugs.webkit.org/show_bug.cgi?id=146173
<rdar://problem/20992842>

Reviewed by Sam Weinig.

Source/WebCore:

When we have a TextIndicator of type Crossfade, we end up putting
a layer with the blue highlight + text painted into it on top of the
content, and cross-fading that layer to the yellow-highlighted text.

This is necessary for BounceAndCrossfade TextIndicators, because the
blue highlight has to bounce, but is not necessary for Crossfade-only
ones; we can just fade in the yellow highlight on top of the
existing blue page highlight, and all is well.

So, get rid of the Crossfade TextIndicator type and use FadeIn, separately
keeping track of whether or not we can add a margin (we still can't
add a margin to TextIndicators that indicate the page's current selection,
because the blue highlight cannot have the margin applied to it, and we
want the bounds to match exactly).

* page/TextIndicator.cpp:
(WebCore::TextIndicator::createWithRange):
If the range is the same as the selection, turn off the margin.
We were previously doing this based on the presentation transition, but now
there's no difference in presentation transition in this case.

(WebCore::TextIndicator::createWithSelectionInFrame):
(WebCore::TextIndicator::wantsBounce):
(WebCore::TextIndicator::wantsContentCrossfade):
(WebCore::TextIndicator::wantsFadeIn):
(WebCore::TextIndicator::wantsManualAnimation):
* page/TextIndicator.h:
Get rid of TextIndicatorPresentationTransition::Crossfade.

(WebCore::TextIndicator::setWantsMargin):
(WebCore::TextIndicator::wantsMargin):
Keep track of whether we want a margin.

* page/mac/TextIndicatorWindow.mm:
(-[WebTextIndicatorView initWithFrame:textIndicator:margin:]):
Determine if we should use a margin based on wantsMargin instead of the
presentation transition.

Source/WebKit/mac:

* WebView/WebImmediateActionController.mm:
(-[WebImmediateActionController _animationControllerForText]):
Get rid of TextIndicatorPresentationTransition::Crossfade.

Source/WebKit2:

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<TextIndicatorData>::encode):
(IPC::ArgumentCoder<TextIndicatorData>::decode):
Encode/decode wantsMargin.

* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performImmediateActionHitTestAtLocation):
(WebKit::textIndicatorTransitionForImmediateAction): Deleted.
Get rid of TextIndicatorPresentationTransition::Crossfade.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185804 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/page/TextIndicator.cpp
Source/WebCore/page/TextIndicator.h
Source/WebCore/page/mac/TextIndicatorWindow.mm
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebImmediateActionController.mm
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebCoreArgumentCoders.cpp
Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm