Changeset 127862 in webkit


Ignore:
Timestamp:
Sep 7, 2012 5:51:44 AM (12 years ago)
Author:
allan.jensen@nokia.com
Message:

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:
Location:
trunk
Files:
2 added
27 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r127858 r127862  
     12012-09-07  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
     2
     3        X11 Global Selection
     4        https://bugs.webkit.org/show_bug.cgi?id=88238
     5
     6        Reviewed by Tony Chang.
     7
     8        Adds a test for the new editor-command, and disables it an all platforms where it is not supported.
     9
     10        * editing/pasteboard/paste-global-selection-expected.txt: Added.
     11        * editing/pasteboard/paste-global-selection.html: Added.
     12        * platform/chromium/TestExpectations:
     13        * platform/efl/TestExpectations:
     14        * platform/gtk/TestExpectations:
     15        * platform/mac/Skipped:
     16        * platform/qt-mac/Skipped:
     17        * platform/win/Skipped:
     18
    1192012-09-06  Vsevolod Vlasov  <vsevik@chromium.org>
    220
  • trunk/LayoutTests/platform/chromium/TestExpectations

    r127803 r127862  
    890890WONTFIX : platform/gtk/plugins/invalidate-rect-with-null-npp-argument.html = TEXT
    891891
     892// Mac and Win does not have global selection.
     893WONTFIX MAC WIN : editing/pasteboard/paste-global-selection.html = TEXT
     894
    892895// Skipping rules for ANDROID are in platform/chromium-android/TestExpectations.
    893896
  • trunk/LayoutTests/platform/efl/TestExpectations

    r127855 r127862  
    10871087// Fails after r127534.
    10881088BUGWK95813 : fast/innerHTML/innerHTML-iframe.html = TEXT
     1089
     1090// EFL does not yet support global selection
     1091BUGWK88238 SKIP : editing/pasteboard/paste-global-selection.html = TEXT
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r127834 r127862  
    424424BUGWK92942 SKIP : fast/dom/Proximity = PASS
    425425BUGWK92942 SKIP : fast/events/constructors/device-proximity-event-constructor.html = PASS
     426
     427// Mac and Win does not have global selections.
     428WONTFIX MAC WIN : editing/pasteboard/paste-global-selection.html = TEXT
    426429
    427430//////////////////////////////////////////////////////////////////////////////////////////
  • trunk/LayoutTests/platform/mac/Skipped

    r127380 r127862  
    10341034platform/mac/editing/spelling/delete-autocorrected-word-2.html
    10351035
     1036// Mac does not have global selections.
     1037editing/pasteboard/paste-global-selection.html
     1038
    10361039# --- WebGL ---
    10371040# Currently failing WebGL tests <rdar://problem/9355460>
  • trunk/LayoutTests/platform/qt-mac/Skipped

    r124696 r127862  
    44# requires video.buffered to be able to return multiple timeranges
    55http/tests/media/video-buffered.html
     6
     7// Mac does not have global selection
     8editing/pasteboard/paste-global-selection.html
    69
    710# flakey tests
  • trunk/LayoutTests/platform/win/Skipped

    r127830 r127862  
    22212221# Dialog element is not yet enabled.
    22222222fast/dom/HTMLDialogElement
     2223
     2224// Windows does not have global selection.
     2225editing/pasteboard/paste-global-selection.html
  • trunk/Source/WebCore/ChangeLog

    r127861 r127862  
     12012-09-07  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
     2
     3        X11 Global Selection
     4        https://bugs.webkit.org/show_bug.cgi?id=88238
     5
     6        Reviewed by Tony Chang.
     7
     8        In X11 global selection is the ability to share the active selection
     9        between applications and pasting with middle mouse-button.
     10
     11        This patch moves the implementations of global selection from the
     12        separate implementations in Qt WebKit, Chromium and GTK to WebCore,
     13        by implementing a new EditorCommand for pasting the global selection.
     14
     15        Test: editing/pasteboard/paste-global-selection.html
     16
     17        * editing/EditorCommand.cpp:
     18        (WebCore::executePasteGlobalSelection):
     19        (WebCore::createCommandMap):
     20        * page/EditorClient.h:
     21        (EditorClient):
     22        (WebCore::EditorClient::supportsGlobalSelection):
     23        * platform/Pasteboard.h:
     24        (WebCore::Pasteboard::isSelectionMode):
     25        (WebCore::Pasteboard::setSelectionMode):
     26        * platform/gtk/PasteboardGtk.cpp:
     27        (WebCore::Pasteboard::writeSelection):
     28        (WebCore::Pasteboard::writeURL):
     29        (WebCore::Pasteboard::isSelectionMode):
     30        (WebCore::Pasteboard::setSelectionMode):
     31
    1322012-09-06  Vsevolod Vlasov  <vsevik@chromium.org>
    233
  • trunk/Source/WebCore/editing/EditorCommand.cpp

    r126967 r127862  
    5050#include "KillRing.h"
    5151#include "Page.h"
     52#include "Pasteboard.h"
    5253#include "RenderBox.h"
    5354#include "ReplaceSelectionCommand.h"
     
    914915    } else
    915916        frame->editor()->paste();
     917    return true;
     918}
     919
     920static bool executePasteGlobalSelection(Frame* frame, Event*, EditorCommandSource source, const String&)
     921{
     922    if (!frame->editor()->client()->supportsGlobalSelection())
     923        return false;
     924    ASSERT_UNUSED(source, source == CommandFromMenuOrKeyBinding);
     925    UserTypingGestureIndicator typingGestureIndicator(frame);
     926
     927    bool oldSelectionMode = Pasteboard::generalPasteboard()->isSelectionMode();
     928    Pasteboard::generalPasteboard()->setSelectionMode(true);
     929    frame->editor()->paste();
     930    Pasteboard::generalPasteboard()->setSelectionMode(oldSelectionMode);
    916931    return true;
    917932}
     
    15451560        { "PasteAndMatchStyle", { executePasteAndMatchStyle, supportedPaste, enabledPaste, stateNone, valueNull, notTextInsertion, allowExecutionWhenDisabled } },
    15461561        { "PasteAsPlainText", { executePasteAsPlainText, supportedPaste, enabledPaste, stateNone, valueNull, notTextInsertion, allowExecutionWhenDisabled } },
     1562        { "PasteGlobalSelection", { executePasteGlobalSelection, supportedFromMenuOrKeyBinding, enabledPaste, stateNone, valueNull, notTextInsertion, allowExecutionWhenDisabled } },
    15471563        { "Print", { executePrint, supported, enabled, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
    15481564        { "Redo", { executeRedo, supported, enabledRedo, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
  • trunk/Source/WebCore/page/EditorClient.h

    r119687 r127862  
    156156    virtual void willSetInputMethodState() = 0;
    157157    virtual void setInputMethodState(bool enabled) = 0;
     158
     159    // Support for global selections, used on platforms like the X Window System that treat
     160    // selection as a type of clipboard.
     161    virtual bool supportsGlobalSelection() { return false; }
    158162};
    159163
  • trunk/Source/WebCore/platform/Pasteboard.h

    r125247 r127862  
    101101    String plainText(Frame* = 0);
    102102   
    103 #if PLATFORM(QT) || PLATFORM(CHROMIUM)
     103#if PLATFORM(QT) || PLATFORM(CHROMIUM) || PLATFORM(GTK)
    104104    bool isSelectionMode() const;
    105     void setSelectionMode(bool selectionMode);
     105    void setSelectionMode(bool);
     106#else
     107    bool isSelectionMode() const { return false; }
     108    void setSelectionMode(bool) { }
    106109#endif
    107110
  • trunk/Source/WebCore/platform/gtk/PasteboardGtk.cpp

    r127757 r127862  
    5959{
    6060    PasteboardHelper* helper = PasteboardHelper::defaultPasteboardHelper();
    61     GtkClipboard* clipboard = helper->getClipboard(frame);
     61    GtkClipboard* clipboard = helper->getCurrentClipboard(frame);
    6262
    6363    DataObjectGtk* dataObject = DataObjectGtk::forClipboard(clipboard);
     
    8686
    8787    PasteboardHelper* helper = PasteboardHelper::defaultPasteboardHelper();
    88     GtkClipboard* clipboard = helper->getClipboard(frame);
     88    GtkClipboard* clipboard = helper->getCurrentClipboard(frame);
    8989
    9090    DataObjectGtk* dataObject = DataObjectGtk::forClipboard(clipboard);
     
    200200}
    201201
    202 }
     202bool Pasteboard::isSelectionMode() const
     203{
     204    return PasteboardHelper::defaultPasteboardHelper()->usePrimarySelectionClipboard();
     205}
     206
     207void Pasteboard::setSelectionMode(bool selectionMode)
     208{
     209    PasteboardHelper::defaultPasteboardHelper()->setUsePrimarySelectionClipboard(selectionMode);
     210}
     211
     212}
  • trunk/Source/WebKit/chromium/ChangeLog

    r127843 r127862  
     12012-09-07  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
     2
     3        X11 Global Selection
     4        https://bugs.webkit.org/show_bug.cgi?id=88238
     5
     6        Reviewed by Tony Chang.
     7
     8        Use new editor command for pasting global selection.
     9
     10        * src/EditorClientImpl.cpp:
     11        (WebKit::EditorClientImpl::supportsGlobalSelection):
     12        * src/EditorClientImpl.h:
     13        (EditorClientImpl):
     14        * src/WebViewImpl.cpp:
     15        (WebKit::WebViewImpl::handleMouseUp):
     16
    1172012-09-07  Yoshifumi Inoue  <yosin@chromium.org>
    218
  • trunk/Source/WebKit/chromium/src/EditorClientImpl.cpp

    r127757 r127862  
    850850}
    851851
     852bool EditorClientImpl::supportsGlobalSelection()
     853{
     854#if OS(UNIX) && !OS(DARWIN)
     855    return true;
     856#else
     857    return false;
     858#endif
     859}
     860
    852861void EditorClientImpl::willSetInputMethodState()
    853862{
  • trunk/Source/WebKit/chromium/src/EditorClientImpl.h

    r119192 r127862  
    114114    virtual void setInputMethodState(bool enabled);
    115115    virtual void requestCheckingOfString(WTF::PassRefPtr<WebCore::TextCheckingRequest>);
     116    virtual bool supportsGlobalSelection() OVERRIDE;
    116117
    117118    virtual WebCore::TextCheckerClient* textChecker() { return this; }
  • trunk/Source/WebKit/chromium/src/WebViewImpl.cpp

    r127794 r127862  
    644644        if (!hitTestResult.scrollbar() && !hitTestResult.isLiveLink() && focused && !view->scrollbarAtPoint(clickPoint)) {
    645645            Editor* editor = focused->editor();
    646             Pasteboard* pasteboard = Pasteboard::generalPasteboard();
    647             bool oldSelectionMode = pasteboard->isSelectionMode();
    648             pasteboard->setSelectionMode(true);
    649             editor->command(AtomicString("Paste")).execute();
    650             pasteboard->setSelectionMode(oldSelectionMode);
     646            editor->command(AtomicString("PasteGlobalSelection")).execute();
    651647        }
    652648    }
  • trunk/Source/WebKit/qt/Api/qwebpage.cpp

    r126926 r127862  
    758758#ifndef QT_NO_CLIPBOARD
    759759    if (QApplication::clipboard()->supportsSelection()) {
    760         bool oldSelectionMode = Pasteboard::generalPasteboard()->isSelectionMode();
    761         Pasteboard::generalPasteboard()->setSelectionMode(true);
    762760        WebCore::Frame* focusFrame = page->focusController()->focusedOrMainFrame();
    763         if (button == Qt::LeftButton) {
    764             if (focusFrame && (focusFrame->editor()->canCopy() || focusFrame->editor()->canDHTMLCopy())) {
    765                 Pasteboard::generalPasteboard()->writeSelection(focusFrame->editor()->selectedRange().get(), focusFrame->editor()->canSmartCopyOrDelete(), focusFrame);
    766                 ev->setAccepted(true);
    767             }
    768         } else if (button == Qt::MidButton) {
    769             if (focusFrame && (focusFrame->editor()->canPaste() || focusFrame->editor()->canDHTMLPaste())) {
    770                 focusFrame->editor()->paste();
     761        if (button == Qt::MidButton) {
     762            if (focusFrame) {
     763                focusFrame->editor()->command(AtomicString("PasteGlobalSelection")).execute();
    771764                ev->setAccepted(true);
    772765            }
    773766        }
    774         Pasteboard::generalPasteboard()->setSelectionMode(oldSelectionMode);
    775767    }
    776768#endif
  • trunk/Source/WebKit/qt/ChangeLog

    r127757 r127862  
     12012-09-07  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
     2
     3        X11 Global Selection
     4        https://bugs.webkit.org/show_bug.cgi?id=88238
     5
     6        Reviewed by Tony Chang.
     7
     8        Use new editor command for pasting global selection, and update it using
     9        the respondToChangedSelection callback.
     10
     11        * Api/qwebpage.cpp:
     12        (QWebPagePrivate::handleClipboard):
     13        * WebCoreSupport/EditorClientQt.cpp:
     14        (WebCore::EditorClientQt::respondToChangedSelection):
     15        (WebCore::EditorClientQt::supportsGlobalSelection):
     16        * WebCoreSupport/EditorClientQt.h:
     17        (EditorClientQt):
     18
    1192012-09-05  Sam Weinig  <sam@webkit.org>
    220
  • trunk/Source/WebKit/qt/WebCoreSupport/EditorClientQt.cpp

    r108462 r127862  
    4343#include "NotImplemented.h"
    4444#include "Page.h"
     45#include "Pasteboard.h"
    4546#include "PlatformKeyboardEvent.h"
    4647#include "QWebPageClient.h"
     
    5051#include "StylePropertySet.h"
    5152#include "WindowsKeyboardCodes.h"
     53#include "qguiapplication.h"
    5254#include "qwebpage.h"
    5355#include "qwebpage_p.h"
    5456
     57#include <QClipboard>
    5558#include <QUndoStack>
    5659#include <stdio.h>
     
    210213//     selection.formatForDebugger(buffer, sizeof(buffer));
    211214//     printf("%s\n", buffer);
     215
     216    if (supportsGlobalSelection() && frame->selection()->isRange()) {
     217        bool oldSelectionMode = Pasteboard::generalPasteboard()->isSelectionMode();
     218        Pasteboard::generalPasteboard()->setSelectionMode(true);
     219        Pasteboard::generalPasteboard()->writeSelection(frame->selection()->toNormalizedRange().get(), frame->editor()->canSmartCopyOrDelete(), frame);
     220        Pasteboard::generalPasteboard()->setSelectionMode(oldSelectionMode);
     221    }
    212222
    213223    m_page->d->updateEditorActions();
     
    633643}
    634644
     645bool EditorClientQt::supportsGlobalSelection()
     646{
     647    return qApp->clipboard()->supportsSelection();
     648}
     649
    635650}
    636651
  • trunk/Source/WebKit/qt/WebCoreSupport/EditorClientQt.h

    r117572 r127862  
    106106    virtual TextCheckerClient* textChecker() { return &m_textCheckerClient; }
    107107
     108    virtual bool supportsGlobalSelection() OVERRIDE;
     109
    108110    bool isEditing() const;
    109111
  • trunk/Source/WebKit2/ChangeLog

    r127845 r127862  
     12012-09-07  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
     2
     3        X11 Global Selection
     4        https://bugs.webkit.org/show_bug.cgi?id=88238
     5
     6        Reviewed by Tony Chang.
     7
     8        Implements the hooks for supporting global selections in Qt WebKit2.
     9
     10        * WebProcess/WebCoreSupport/WebEditorClient.cpp:
     11        (WebKit::WebEditorClient::respondToChangedSelection):
     12        (WebKit::WebEditorClient::updateGlobalSelection):
     13        (WebKit::WebEditorClient::supportsGlobalSelection):
     14        * WebProcess/WebCoreSupport/WebEditorClient.h:
     15        * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
     16        (WebKit::WebEditorClient::updateGlobalSelection):
     17        * WebProcess/WebPage/WebPage.cpp:
     18        (WebKit::handleMouseEvent):
     19        * WebProcess/WebPage/WebPage.h:
     20        (WebPage):
     21        * WebProcess/WebPage/qt/WebPageQt.cpp:
     22        (WebKit::WebPage::handleMouseReleaseEvent):
     23
    1242012-09-07  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
    225
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp

    r127098 r127862  
    4949#include <WebCore/UserTypingGestureIndicator.h>
    5050
     51#if PLATFORM(QT)
     52#include <QClipboard>
     53#include <QGuiApplication>
     54#include <WebCore/Pasteboard.h>
     55#endif
     56
    5157using namespace WebCore;
    5258using namespace HTMLNames;
     
    196202    unsigned end;
    197203    m_page->send(Messages::WebPageProxy::DidChangeCompositionSelection(frame->editor()->getCompositionSelection(start, end)));
    198 #elif PLATFORM(GTK)
    199     setSelectionPrimaryClipboardIfNeeded(frame);
    200 #endif
    201 }
     204#elif PLATFORM(GTK) || PLATFORM(QT)
     205    updateGlobalSelection(frame);
     206#endif
     207}
     208
     209#if PLATFORM(QT)
     210// FIXME: Use this function for other X11-based platforms that need to manually update the global selection.
     211void WebEditorClient::updateGlobalSelection(Frame* frame)
     212{
     213    if (supportsGlobalSelection() && frame->selection()->isRange()) {
     214        bool oldSelectionMode = Pasteboard::generalPasteboard()->isSelectionMode();
     215        Pasteboard::generalPasteboard()->setSelectionMode(true);
     216        Pasteboard::generalPasteboard()->writeSelection(frame->selection()->toNormalizedRange().get(), frame->editor()->canSmartCopyOrDelete(), frame);
     217        Pasteboard::generalPasteboard()->setSelectionMode(oldSelectionMode);
     218    }
     219}
     220#endif
    202221
    203222void WebEditorClient::didEndEditing()
     
    463482}
    464483
     484bool WebEditorClient::supportsGlobalSelection()
     485{
     486#if PLATFORM(QT)
     487    return qApp->clipboard()->supportsSelection();
     488#elif PLATFORM(GTK) && PLATFORM(X11)
     489    return true;
     490#else
     491    // FIXME: Return true on other X11 platforms when they support global selection.
     492    return false;
     493#endif
     494}
     495
    465496} // namespace WebKit
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.h

    r122400 r127862  
    125125    bool executePendingEditorCommands(WebCore::Frame*, Vector<WTF::String>, bool) OVERRIDE;
    126126    void getEditorCommandsForKeyEvent(const WebCore::KeyboardEvent*, Vector<WTF::String>&) OVERRIDE;
    127     void setSelectionPrimaryClipboardIfNeeded(WebCore::Frame*) OVERRIDE;
     127#endif
     128#if PLATFORM(GTK) || PLATFORM(QT)
     129    void updateGlobalSelection(WebCore::Frame*);
    128130#endif
    129131
     
    150152    virtual bool shouldShowUnicodeMenu() OVERRIDE;
    151153#endif
     154
     155    virtual bool supportsGlobalSelection() OVERRIDE;
     156
    152157    WebPage* m_page;
    153158};
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp

    r110865 r127862  
    171171#endif
    172172
    173 void WebEditorClient::setSelectionPrimaryClipboardIfNeeded(Frame* frame)
     173void WebEditorClient::updateGlobalSelection(Frame* frame)
    174174{
    175175#if PLATFORM(X11)
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r127432 r127862  
    13531353        }
    13541354        case PlatformEvent::MouseReleased:
     1355#if PLATFORM(QT)
     1356            if (page->handleMouseReleaseEvent(platformMouseEvent))
     1357                return true;
     1358#endif
    13551359            return frame->eventHandler()->handleMouseReleaseEvent(platformMouseEvent);
    13561360        case PlatformEvent::MouseMoved:
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h

    r126343 r127862  
    461461#endif
    462462
     463#if PLATFORM(QT)
     464    bool handleMouseReleaseEvent(const WebCore::PlatformMouseEvent&);
     465#endif
     466
    463467    void setCompositionForTesting(const String& compositionString, uint64_t from, uint64_t length);
    464468    bool hasCompositionForTesting();
  • trunk/Source/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp

    r123216 r127862  
    3535#include "WebPopupMenu.h"
    3636#include "WebProcess.h"
     37#include <QClipboard>
     38#include <QGuiApplication>
    3739#include <WebCore/DOMWrapperWorld.h>
    3840#include <WebCore/FocusController.h>
     
    439441}
    440442
     443bool WebPage::handleMouseReleaseEvent(const PlatformMouseEvent& platformMouseEvent)
     444{
     445    if (platformMouseEvent.button() != WebCore::MiddleButton)
     446        return false;
     447
     448    if (qApp->clipboard()->supportsSelection()) {
     449        WebCore::Frame* focusFrame = m_page->focusController()->focusedOrMainFrame();
     450        if (focusFrame) {
     451            focusFrame->editor()->command(AtomicString("PasteGlobalSelection")).execute();
     452            return true;
     453        }
     454    }
     455    return false;
     456}
     457
    441458} // namespace WebKit
Note: See TracChangeset for help on using the changeset viewer.