[Services with UI] Action menu does not appear if selection includes both text and...
authorenrica@apple.com <enrica@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Aug 2014 23:08:38 +0000 (23:08 +0000)
committerenrica@apple.com <enrica@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Aug 2014 23:08:38 +0000 (23:08 +0000)
commita4216b94fb309e21e9c066c81dd7b3316843629d
treec2be67149a6f169f35d08ad7dcc99ada0a3c6942
parent6361f9c50fa86ebd2ab0eb9b7b4a224727ee138b
[Services with UI] Action menu does not appear if selection includes both text and an image.
https://bugs.webkit.org/show_bug.cgi?id=135731
<rdar://problem/17837491>

Reviewed by Brady Eidson.

Source/WebCore:

When collecting selection rects via SelectionRectGatherer we should also note if the selection
contains non text elements. This way the Notifier class can send that information to ServicesOverlayController
to properly handle the highlight for the service.

* editing/SelectionRectGatherer.cpp:
(WebCore::SelectionRectGatherer::SelectionRectGatherer):
(WebCore::SelectionRectGatherer::Notifier::~Notifier):
(WebCore::SelectionRectGatherer::clearAndCreateNotifier):
* editing/SelectionRectGatherer.h:
(WebCore::SelectionRectGatherer::setTextOnly):
(WebCore::SelectionRectGatherer::isTextOnly):
* page/EditorClient.h:
(WebCore::EditorClient::selectionRectsDidChange):
* rendering/RenderView.cpp:
(WebCore::RenderView::applySubtreeSelection):

Source/WebKit2:

Adding a new setting to ServicesController to communicate to the WebProcess if
there are services installed that can handle a combination of text and images.
This way ServicesOverlayController can decide if it appropriate to show the hightlight
based on the type of selection (text only or non text only). This information is retrieved
when the selection rects are collected by SelectionGatherer and used by
SelectionGatherer::Notifier to communicate the selection change.

* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
* Shared/WebProcessCreationParameters.h:
* UIProcess/mac/ServicesController.h:
(WebKit::ServicesController::hasRichContentServices):
* UIProcess/mac/ServicesController.mm:
(WebKit::ServicesController::ServicesController):
(WebKit::ServicesController::refreshExistingServices):
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::selectionRectsDidChange):
* WebProcess/WebCoreSupport/WebEditorClient.h:
* WebProcess/WebPage/ServicesOverlayController.h:
* WebProcess/WebPage/mac/ServicesOverlayController.mm:
(WebKit::ServicesOverlayController::ServicesOverlayController):
(WebKit::ServicesOverlayController::selectionRectsDidChange):
(WebKit::ServicesOverlayController::drawSelectionHighlight):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::WebProcess):
(WebKit::WebProcess::initializeWebProcess):
(WebKit::WebProcess::setEnabledServices):
* WebProcess/WebProcess.h:
(WebKit::WebProcess::hasRichContentServices):
* WebProcess/WebProcess.messages.in:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@172301 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed:
Source/WebCore/ChangeLog
Source/WebCore/editing/SelectionRectGatherer.cpp
Source/WebCore/editing/SelectionRectGatherer.h
Source/WebCore/page/EditorClient.h
Source/WebCore/rendering/RenderView.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebProcessCreationParameters.cpp
Source/WebKit2/Shared/WebProcessCreationParameters.h
Source/WebKit2/UIProcess/mac/ServicesController.h
Source/WebKit2/UIProcess/mac/ServicesController.mm
Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h
Source/WebKit2/WebProcess/WebPage/ServicesOverlayController.h
Source/WebKit2/WebProcess/WebPage/mac/ServicesOverlayController.mm
Source/WebKit2/WebProcess/WebProcess.cpp
Source/WebKit2/WebProcess/WebProcess.h
Source/WebKit2/WebProcess/WebProcess.messages.in