[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)
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


No differences found