Skip to content
  • allan.jensen@nokia.com's avatar
    X11 Global Selection · fc0f6afa
    allan.jensen@nokia.com authored
    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: http://svn.webkit.org/repository/webkit/trunk@127862 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    fc0f6afa