TextIndicator (and other view-relative subwindows) is not dismissed on zoom gesture
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Dec 2014 23:16:04 +0000 (23:16 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Dec 2014 23:16:04 +0000 (23:16 +0000)
commit88cd9d38aca522f58dc354a54720001a76a134b4
treede6e52780eb81a9c4aa7bb21320cf8b5ea47018b
parent7bd306d5d45b5610f5af83f258a7025307c54e8c
TextIndicator (and other view-relative subwindows) is not dismissed on zoom gesture
https://bugs.webkit.org/show_bug.cgi?id=139580
<rdar://problem/19226350>

Reviewed by Anders Carlsson.

* UIProcess/PageClient.h:
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::dismissContentRelativeChildWindows):
(WebKit::PageClientImpl::dismissDictionaryLookupPanel): Deleted.
(WebKit::PageClientImpl::dismissActionMenuPopovers): Deleted.
Merge dismissDictionaryLookupPanel and dismissActionMenuPopovers into
_dismissContentRelativeChildWindows, which also dismisses TextIndicator and the
text correction panel. Dismissal of any child windows which are anchored to
the page content now bottlenecks through this function.

(WebKit::PageClientImpl::navigationGestureDidBegin):
Dismiss all anchored subwindows when starting a navigation gesture, not
just TextIndicator and action menu popovers.

* UIProcess/API/mac/WKView.mm:
(-[WKView scrollWheel:]):
No need to dismiss TextIndicator here; we've got this covered in the more-inclusive
WebPageProxy::pageDidScroll, and will now dismiss more things.

(-[WKView mouseDown:]):
Dismiss more things.

(-[WKView viewDidMoveToWindow]):
Dismiss more things.

(-[WKView _dismissContentRelativeChildWindows]):
The aforementioned combined dismissal function.

(-[WKView magnifyWithEvent:]):
(-[WKView smartMagnifyWithEvent:]):
(-[WKView setMagnification:centeredAtPoint:]):
(-[WKView setMagnification:]):
Any time the page magnification changes, dismiss all the things.

* UIProcess/API/mac/WKViewPrivate.h:
Expose _dismissContentRelativeChildWindows instead of _dismissActionMenuPopovers;
for all existing clients, it makes more sense to dismiss all view-relative subwindows
than just a subset of them.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::pageDidScroll):
(WebKit::WebPageProxy::resetStateAfterProcessExited):
Make use of dismissAnchoredSubwindows.

* UIProcess/mac/WKActionMenuController.h:
* UIProcess/mac/WKActionMenuController.mm:
(-[WKActionMenuController prepareForMenu:withEvent:]):
Dismiss more things.

(-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
(-[WKActionMenuController dismissActionMenuPopovers]): Deleted.
dismissActionMenuPopovers is folded into WKView's _dismissContentRelativeChildWindows.

(-[WKActionMenuController _showTextIndicator]): Deleted.
(-[WKActionMenuController _hideTextIndicator]): Deleted.
Fold _showTextIndicator and _hideTextIndicator into their only callers.
_isShowingTextIndicator was never necessary, because it's OK to change
the current TextIndicator at any time, and a newer one is always more relevant.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@177242 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/Cocoa/WKViewPrivate.h
Source/WebKit2/UIProcess/API/mac/WKView.mm
Source/WebKit2/UIProcess/PageClient.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/mac/PageClientImpl.h
Source/WebKit2/UIProcess/mac/PageClientImpl.mm
Source/WebKit2/UIProcess/mac/WKActionMenuController.h
Source/WebKit2/UIProcess/mac/WKActionMenuController.mm