Implement yellow highlight for WebKit1 data detectors
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Dec 2014 20:48:39 +0000 (20:48 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Dec 2014 20:48:39 +0000 (20:48 +0000)
commit64603edd9d59c669d66dfb1e51a664a57d921a12
treeb28aad66a20dba77c55742be0b1dd45758114890
parenta97b3fe911ae8caddae9e775f0145435376c5f9b
Implement yellow highlight for WebKit1 data detectors
https://bugs.webkit.org/show_bug.cgi?id=138956
<rdar://problem/18992185>

Reviewed by Beth Dakin.

* page/TextIndicator.cpp:
(WebCore::TextIndicator::createWithSelectionInFrame):
(WebCore::TextIndicator::TextIndicator):
* page/TextIndicator.h:
(WebCore::TextIndicator::selectionRectInScreenCoordinates):
(WebCore::TextIndicator::textBoundingRectInScreenCoordinates):
(WebCore::TextIndicator::selectionRectInWindowCoordinates): Deleted.
(WebCore::TextIndicator::textBoundingRectInWindowCoordinates): Deleted.
Store TextIndicator rects in screen coordinates, since that's what we
want anyway, and this makes it easier to share this code between the WebKits.

* page/mac/TextIndicatorWindow.mm:
(-[WebTextIndicatorView initWithFrame:textIndicator:margin:]):
(WebCore::TextIndicatorWindow::setTextIndicator):
Avoid some rect conversion because the TextIndicator rects are already in screen coordinates.

* WebView/WebActionMenuController.h:
* WebView/WebActionMenuController.mm:
(-[WebActionMenuController webView:willHandleMouseDown:]):
(-[WebActionMenuController webView:didHandleScrollWheel:]):
(-[WebActionMenuController prepareForMenu:withEvent:]):
(-[WebActionMenuController didCloseMenu:withEvent:]):
(-[WebActionMenuController _defaultMenuItemsForDataDetectedText]):
(-[WebActionMenuController _showTextIndicator]):
(-[WebActionMenuController _hideTextIndicator]):
(-[WebActionMenuController _dismissActionMenuPopovers]):
Copy the WebKit2 WKActionMenuController TextIndicator implementation
into WebActionMenuController. The only significant difference is
that we build the TextIndicator right at menu construction time
instead of in the Web process.

* WebView/WebHTMLView.mm:
(-[WebHTMLView scrollWheel:]):
Let the WebActionMenuController know that we're handling a scroll.

(-[WebHTMLView mouseDown:]):
Let the WebActionMenuController know that we're handling a mouseDown.

* WebView/WebView.mm:
(-[WebView _setTextIndicator:fadeOut:animationCompletionHandler:]):
(-[WebView _clearTextIndicator]):
(-[WebView _actionMenuController]):
(-[WebView _convertRectFromRootView:]): Deleted.
* WebView/WebViewData.h:
* WebView/WebViewData.mm:
* WebView/WebViewInternal.h:
Keep a TextIndicatorWindow on WebView, just like WKView does.
Expose the WebActionMenuController on WebView (internally).

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<TextIndicatorData>::encode):
(IPC::ArgumentCoder<TextIndicatorData>::decode):
* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::updateFindIndicator):
(WebKit::FindController::drawRect):
Adjust to the fact that TextIndicator keeps screen-relative rects.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176599 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
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/WebActionMenuController.h
Source/WebKit/mac/WebView/WebActionMenuController.mm
Source/WebKit/mac/WebView/WebHTMLView.mm
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit/mac/WebView/WebViewData.h
Source/WebKit/mac/WebView/WebViewData.mm
Source/WebKit/mac/WebView/WebViewInternal.h
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebCoreArgumentCoders.cpp
Source/WebKit2/WebProcess/WebPage/FindController.cpp