X11 Global Selection
authorallan.jensen@nokia.com <allan.jensen@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Sep 2012 12:51:44 +0000 (12:51 +0000)
committerallan.jensen@nokia.com <allan.jensen@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Sep 2012 12:51:44 +0000 (12:51 +0000)
commitfaaf2c90d86e8249aec8ee5cd6ddf16779bc7a27
tree8f714bc82a19a9666ed5e431ced76a1b1391a603
parent32ec04cdb6ecc552e6ce4f8a2e0c155186d070ba
X11 Global Selection
https://bugs.webkit.org/show_bug.cgi?id=88238

Reviewed by Tony Chang.

Source/WebCore:

In X11 global selection is the ability to share the active selection
between applications and pasting with middle mouse-button.

This patch moves the implementations of global selection from the
separate implementations in Qt WebKit, Chromium and GTK to WebCore,
by implementing a new EditorCommand for pasting the global selection.

Test: editing/pasteboard/paste-global-selection.html

* editing/EditorCommand.cpp:
(WebCore::executePasteGlobalSelection):
(WebCore::createCommandMap):
* page/EditorClient.h:
(EditorClient):
(WebCore::EditorClient::supportsGlobalSelection):
* platform/Pasteboard.h:
(WebCore::Pasteboard::isSelectionMode):
(WebCore::Pasteboard::setSelectionMode):
* platform/gtk/PasteboardGtk.cpp:
(WebCore::Pasteboard::writeSelection):
(WebCore::Pasteboard::writeURL):
(WebCore::Pasteboard::isSelectionMode):
(WebCore::Pasteboard::setSelectionMode):

Source/WebKit/chromium:

Use new editor command for pasting global selection.

* src/EditorClientImpl.cpp:
(WebKit::EditorClientImpl::supportsGlobalSelection):
* src/EditorClientImpl.h:
(EditorClientImpl):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::handleMouseUp):

Source/WebKit/qt:

Use new editor command for pasting global selection, and update it using
the respondToChangedSelection callback.

* Api/qwebpage.cpp:
(QWebPagePrivate::handleClipboard):
* WebCoreSupport/EditorClientQt.cpp:
(WebCore::EditorClientQt::respondToChangedSelection):
(WebCore::EditorClientQt::supportsGlobalSelection):
* WebCoreSupport/EditorClientQt.h:
(EditorClientQt):

Source/WebKit2:

Implements the hooks for supporting global selections in Qt WebKit2.

* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::respondToChangedSelection):
(WebKit::WebEditorClient::updateGlobalSelection):
(WebKit::WebEditorClient::supportsGlobalSelection):
* WebProcess/WebCoreSupport/WebEditorClient.h:
* WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
(WebKit::WebEditorClient::updateGlobalSelection):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::handleMouseEvent):
* WebProcess/WebPage/WebPage.h:
(WebPage):
* WebProcess/WebPage/qt/WebPageQt.cpp:
(WebKit::WebPage::handleMouseReleaseEvent):

LayoutTests:

Adds a test for the new editor-command, and disables it an all platforms where it is not supported.

* editing/pasteboard/paste-global-selection-expected.txt: Added.
* editing/pasteboard/paste-global-selection.html: Added.
* platform/chromium/TestExpectations:
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/Skipped:
* platform/qt-mac/Skipped:
* platform/win/Skipped:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@127862 268f45cc-cd09-0410-ab3c-d52691b4dbfc
29 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/pasteboard/paste-global-selection-expected.txt [new file with mode: 0644]
LayoutTests/editing/pasteboard/paste-global-selection.html [new file with mode: 0644]
LayoutTests/platform/chromium/TestExpectations
LayoutTests/platform/efl/TestExpectations
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/mac/Skipped
LayoutTests/platform/qt-mac/Skipped
LayoutTests/platform/win/Skipped
Source/WebCore/ChangeLog
Source/WebCore/editing/EditorCommand.cpp
Source/WebCore/page/EditorClient.h
Source/WebCore/platform/Pasteboard.h
Source/WebCore/platform/gtk/PasteboardGtk.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/EditorClientImpl.cpp
Source/WebKit/chromium/src/EditorClientImpl.h
Source/WebKit/chromium/src/WebViewImpl.cpp
Source/WebKit/qt/Api/qwebpage.cpp
Source/WebKit/qt/ChangeLog
Source/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
Source/WebKit/qt/WebCoreSupport/EditorClientQt.h
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h
Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp