Selection services cannot be invoked when force click is enabled
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 19 Jun 2015 23:40:32 +0000 (23:40 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 19 Jun 2015 23:40:32 +0000 (23:40 +0000)
commitdb373d5751cba49a493e4ce360102753b03f0e93
treebeda8f5d9419db9e2f4e3e49ec11c404875ee5bd
parenta5b79589720303c5a7ef262559e78dffffc66dba
Selection services cannot be invoked when force click is enabled
https://bugs.webkit.org/show_bug.cgi?id=146166
<rdar://problem/21468362>

Reviewed by Darin Adler.

* page/mac/ServicesOverlayController.h:
Turn Highlight::Type into something we can use for dirty flags.

* page/mac/ServicesOverlayController.mm:
(WebCore::ServicesOverlayController::Highlight::createForSelection):
(WebCore::ServicesOverlayController::Highlight::createForTelephoneNumber):
(WebCore::ServicesOverlayController::ServicesOverlayController):
(WebCore::ServicesOverlayController::selectionRectsDidChange):
(WebCore::ServicesOverlayController::selectedTelephoneNumberRangesChanged):
(WebCore::ServicesOverlayController::invalidateHighlightsOfType):
(WebCore::ServicesOverlayController::buildPotentialHighlightsIfNeeded):
(WebCore::ServicesOverlayController::remainingTimeUntilHighlightShouldBeShown):
(WebCore::ServicesOverlayController::buildPhoneNumberHighlights):
(WebCore::ServicesOverlayController::buildSelectionHighlight):
(WebCore::ServicesOverlayController::findTelephoneNumberHighlightContainingSelectionHighlight):
(WebCore::ServicesOverlayController::determineActiveHighlight):
(WebCore::ServicesOverlayController::didScrollFrame):
(WebCore::ServicesOverlayController::handleClick):
Coalesce highlight rebuilding so that things (like TextIndicator creation)
that change the selection and then reset it immediately don't cause us
to lose the active highlight.

This also means that if the selection changes multiple times in a runloop
(easily possible from script), we won't waste a lot of time rebuilding highlights.

(WebCore::ServicesOverlayController::didRebuildPotentialHighlights):
Merged into buildPotentialHighlightsIfNeeded.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185778 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/page/mac/ServicesOverlayController.h
Source/WebCore/page/mac/ServicesOverlayController.mm