Diff
Modified: trunk/Source/WebCore/ChangeLog (154749 => 154750)
--- trunk/Source/WebCore/ChangeLog 2013-08-28 15:20:32 UTC (rev 154749)
+++ trunk/Source/WebCore/ChangeLog 2013-08-28 15:30:01 UTC (rev 154750)
@@ -1,3 +1,54 @@
+2013-08-28 Darin Adler <[email protected]>
+
+ Eliminate Pasteboard::generalPasteboard
+ https://bugs.webkit.org/show_bug.cgi?id=120392
+
+ Reviewed by Anders Carlsson.
+
+ * WebCore.exp.in: Removed the generalPasteboard function.
+ It didn't need to be exported, because no one was using it.
+
+ * editing/Editor.cpp:
+ (WebCore::Editor::paste): Added an overload that takes a Pasteboard.
+ (WebCore::Editor::copyURL): Ditto.
+ * editing/Editor.h: Added overloads.
+
+ * editing/EditorCommand.cpp:
+ (WebCore::executePasteGlobalSelection): Put this function inside the same
+ platform #if that the global selection code in the Pasteboard class was in.
+ Changed to use Pasteboard::createForGlobalSelection instead of using the
+ Pasteboard::setSelectionMode approach.
+ (WebCore::createCommandMap): Put PasteGlobalSelection inside the platform #if.
+
+ * inspector/InjectedScriptHost.cpp:
+ (WebCore::InjectedScriptHost::copyText): Use Pasteboard::createForCopyAndPaste()
+ instead of Pasteboard::generalPasteboard().
+ * inspector/InspectorFrontendHost.cpp:
+ (WebCore::InspectorFrontendHost::copyText): Ditto.
+
+ * platform/Pasteboard.h: Removed generalPasteboard. Replaced isSelectionMode
+ and setSelectionMode with createForGlobalSelection.
+
+ * platform/blackberry/PasteboardBlackBerry.cpp: Deleted generalPasteboard.
+ * platform/efl/PasteboardEfl.cpp: Deleted generalPasteboard.
+
+ * platform/gtk/PasteboardGtk.cpp: Deleted selectionClipboard, primaryClipboard,
+ generalPasteboard, isSelectionMode, and setSelectionMode.
+ (WebCore::Pasteboard::createForGlobalSelection): Added.
+ * platform/gtk/PasteboardHelper.cpp: Deleted m_usePrimarySelectionClipboard,
+ getCurrentClipboard, and getClipboard.
+ * platform/gtk/PasteboardHelper.h: Deleted the above, plus
+ setUsePrimarySelectionClipboard and usePrimarySelectionClipboard.
+
+ * platform/ios/PasteboardIOS.mm: Deleted generalPasteboard.
+ * platform/mac/PasteboardMac.mm: Deleted generalPasteboard.
+
+ * platform/qt/PasteboardQt.cpp: Deleted generalPasteboard, isSelectionMode,
+ and setSelectionMode.
+ (WebCore::Pasteboard::createForGlobalSelection): Added.
+
+ * platform/win/PasteboardWin.cpp: Deleted generalPasteboard.
+
2013-08-28 Antti Koivisto <[email protected]>
Share attach loops between Elements and ShadowRoots
Modified: trunk/Source/WebCore/WebCore.exp.in (154749 => 154750)
--- trunk/Source/WebCore/WebCore.exp.in 2013-08-28 15:20:32 UTC (rev 154749)
+++ trunk/Source/WebCore/WebCore.exp.in 2013-08-28 15:30:01 UTC (rev 154750)
@@ -79,7 +79,6 @@
__ZN7WebCore10MouseEvent6createERKN3WTF12AtomicStringENS1_10PassRefPtrINS_9DOMWindowEEERKNS_18PlatformMouseEventEiNS5_INS_4NodeEEE
__ZN7WebCore10MouseEvent6createERKN3WTF12AtomicStringEbbdNS1_10PassRefPtrINS_9DOMWindowEEEiiiiibbbbtNS5_INS_11EventTargetEEENS5_INS_9ClipboardEEEb
__ZN7WebCore10Pasteboard14writePlainTextERKN3WTF6StringENS0_18SmartReplaceOptionE
-__ZN7WebCore10Pasteboard17generalPasteboardEv
__ZN7WebCore10RenderPart9setWidgetEN3WTF10PassRefPtrINS_6WidgetEEE
__ZN7WebCore10RenderView10compositorEv
__ZN7WebCore10RenderView7hitTestERKNS_14HitTestRequestERNS_13HitTestResultE
Modified: trunk/Source/WebCore/editing/Editor.cpp (154749 => 154750)
--- trunk/Source/WebCore/editing/Editor.cpp 2013-08-28 15:20:32 UTC (rev 154749)
+++ trunk/Source/WebCore/editing/Editor.cpp 2013-08-28 15:30:01 UTC (rev 154750)
@@ -37,9 +37,6 @@
#include "ClipboardEvent.h"
#include "CompositionEvent.h"
#include "CreateLinkCommand.h"
-#if ENABLE(DELETION_UI)
-#include "DeleteButtonController.h"
-#endif
#include "DeleteSelectionCommand.h"
#include "DictationAlternative.h"
#include "DictationCommand.h"
@@ -95,6 +92,10 @@
#include <wtf/unicode/CharacterNames.h>
#include <wtf/unicode/Unicode.h>
+#if ENABLE(DELETION_UI)
+#include "DeleteButtonController.h"
+#endif
+
namespace WebCore {
using namespace std;
@@ -1076,6 +1077,11 @@
void Editor::paste()
{
+ paste(*Pasteboard::createForCopyAndPaste());
+}
+
+void Editor::paste(Pasteboard& pasteboard)
+{
ASSERT(m_frame.document());
if (tryDHTMLPaste())
return; // DHTML did the whole operation
@@ -1085,9 +1091,9 @@
CachedResourceLoader* loader = m_frame.document()->cachedResourceLoader();
ResourceCacheValidationSuppressor validationSuppressor(loader);
if (m_frame.selection().isContentRichlyEditable())
- pasteWithPasteboard(Pasteboard::createForCopyAndPaste().get(), true);
+ pasteWithPasteboard(&pasteboard, true);
else
- pasteAsPlainTextWithPasteboard(Pasteboard::createForCopyAndPaste().get());
+ pasteAsPlainTextWithPasteboard(&pasteboard);
}
void Editor::pasteAsPlainText()
@@ -1135,9 +1141,14 @@
void Editor::copyURL(const KURL& url, const String& title)
{
- Pasteboard::createForCopyAndPaste()->writeURL(url, title, &m_frame);
+ copyURL(url, title, *Pasteboard::createForCopyAndPaste());
}
+void Editor::copyURL(const KURL& url, const String& title, Pasteboard& pasteboard)
+{
+ pasteboard.writeURL(url, title, &m_frame);
+}
+
void Editor::copyImage(const HitTestResult& result)
{
KURL url = ""
Modified: trunk/Source/WebCore/editing/Editor.h (154749 => 154750)
--- trunk/Source/WebCore/editing/Editor.h 2013-08-28 15:20:32 UTC (rev 154749)
+++ trunk/Source/WebCore/editing/Editor.h 2013-08-28 15:30:01 UTC (rev 154750)
@@ -129,10 +129,12 @@
void cut();
void copy();
void paste();
+ void paste(Pasteboard&);
void pasteAsPlainText();
void performDelete();
- void copyURL(const KURL&, const String&);
+ void copyURL(const KURL&, const String& title);
+ void copyURL(const KURL&, const String& title, Pasteboard&);
void copyImage(const HitTestResult&);
void indent();
Modified: trunk/Source/WebCore/editing/EditorCommand.cpp (154749 => 154750)
--- trunk/Source/WebCore/editing/EditorCommand.cpp 2013-08-28 15:20:32 UTC (rev 154749)
+++ trunk/Source/WebCore/editing/EditorCommand.cpp 2013-08-28 15:30:01 UTC (rev 154750)
@@ -918,20 +918,22 @@
return true;
}
+#if PLATFORM(GTK) || PLATFORM(QT)
+
static bool executePasteGlobalSelection(Frame& frame, Event*, EditorCommandSource source, const String&)
{
+ // FIXME: This check should be in an enable function, not here.
if (!frame.editor().client()->supportsGlobalSelection())
return false;
+
ASSERT_UNUSED(source, source == CommandFromMenuOrKeyBinding);
UserTypingGestureIndicator typingGestureIndicator(frame);
-
- bool oldSelectionMode = Pasteboard::generalPasteboard()->isSelectionMode();
- Pasteboard::generalPasteboard()->setSelectionMode(true);
- frame.editor().paste();
- Pasteboard::generalPasteboard()->setSelectionMode(oldSelectionMode);
+ frame.editor().paste(*Pasteboard::createForGlobalSelection());
return true;
}
+#endif
+
static bool executePasteAndMatchStyle(Frame& frame, Event*, EditorCommandSource source, const String&)
{
if (source == CommandFromMenuOrKeyBinding) {
@@ -1559,7 +1561,6 @@
{ "Paste", { executePaste, supportedPaste, enabledPaste, stateNone, valueNull, notTextInsertion, allowExecutionWhenDisabled } },
{ "PasteAndMatchStyle", { executePasteAndMatchStyle, supportedPaste, enabledPaste, stateNone, valueNull, notTextInsertion, allowExecutionWhenDisabled } },
{ "PasteAsPlainText", { executePasteAsPlainText, supportedPaste, enabledPaste, stateNone, valueNull, notTextInsertion, allowExecutionWhenDisabled } },
- { "PasteGlobalSelection", { executePasteGlobalSelection, supportedFromMenuOrKeyBinding, enabledPaste, stateNone, valueNull, notTextInsertion, allowExecutionWhenDisabled } },
{ "Print", { executePrint, supported, enabled, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
{ "Redo", { executeRedo, supported, enabledRedo, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
{ "RemoveFormat", { executeRemoveFormat, supported, enabledRangeInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
@@ -1594,6 +1595,10 @@
{ "Yank", { executeYank, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
{ "YankAndSelect", { executeYankAndSelect, supportedFromMenuOrKeyBinding, enabledInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
+#if PLATFORM(GTK) || PLATFORM(QT)
+ { "PasteGlobalSelection", { executePasteGlobalSelection, supportedFromMenuOrKeyBinding, enabledPaste, stateNone, valueNull, notTextInsertion, allowExecutionWhenDisabled } },
+#endif
+
#if PLATFORM(MAC)
{ "TakeFindStringFromSelection", { executeTakeFindStringFromSelection, supportedFromMenuOrKeyBinding, enabledTakeFindStringFromSelection, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
#endif
Modified: trunk/Source/WebCore/inspector/InjectedScriptHost.cpp (154749 => 154750)
--- trunk/Source/WebCore/inspector/InjectedScriptHost.cpp 2013-08-28 15:20:32 UTC (rev 154749)
+++ trunk/Source/WebCore/inspector/InjectedScriptHost.cpp 2013-08-28 15:30:01 UTC (rev 154750)
@@ -120,7 +120,7 @@
void InjectedScriptHost::copyText(const String& text)
{
- Pasteboard::generalPasteboard()->writePlainText(text, Pasteboard::CannotSmartReplace);
+ Pasteboard::createForCopyAndPaste()->writePlainText(text, Pasteboard::CannotSmartReplace);
}
ScriptValue InjectedScriptHost::InspectableObject::get(ScriptState*)
Modified: trunk/Source/WebCore/inspector/InspectorFrontendHost.cpp (154749 => 154750)
--- trunk/Source/WebCore/inspector/InspectorFrontendHost.cpp 2013-08-28 15:20:32 UTC (rev 154749)
+++ trunk/Source/WebCore/inspector/InspectorFrontendHost.cpp 2013-08-28 15:30:01 UTC (rev 154750)
@@ -224,7 +224,7 @@
void InspectorFrontendHost::copyText(const String& text)
{
- Pasteboard::generalPasteboard()->writePlainText(text, Pasteboard::CannotSmartReplace);
+ Pasteboard::createForCopyAndPaste()->writePlainText(text, Pasteboard::CannotSmartReplace);
}
void InspectorFrontendHost::openInNewTab(const String& url)
Modified: trunk/Source/WebCore/platform/Pasteboard.h (154749 => 154750)
--- trunk/Source/WebCore/platform/Pasteboard.h 2013-08-28 15:20:32 UTC (rev 154749)
+++ trunk/Source/WebCore/platform/Pasteboard.h 2013-08-28 15:30:01 UTC (rev 154750)
@@ -110,9 +110,6 @@
bool isForCopyAndPaste() const { return !m_isForDragAndDrop; }
#endif
- // Deprecated. Use createForCopyAndPaste instead.
- static Pasteboard* generalPasteboard();
-
static PassOwnPtr<Pasteboard> createForCopyAndPaste();
static PassOwnPtr<Pasteboard> createPrivate(); // Corresponds to the "unique pasteboard" concept on Mac. Used in editing, not sure exactly for what purpose.
@@ -160,12 +157,8 @@
void setFrame(Frame*);
#endif
-#if PLATFORM(QT) || PLATFORM(GTK)
- bool isSelectionMode() const;
- void setSelectionMode(bool);
-#else
- bool isSelectionMode() const { return false; }
- void setSelectionMode(bool) { }
+#if PLATFORM(GTK) || PLATFORM(QT)
+ static PassOwnPtr<Pasteboard> createForGlobalSelection();
#endif
#if PLATFORM(WIN)
Modified: trunk/Source/WebCore/platform/blackberry/PasteboardBlackBerry.cpp (154749 => 154750)
--- trunk/Source/WebCore/platform/blackberry/PasteboardBlackBerry.cpp 2013-08-28 15:20:32 UTC (rev 154749)
+++ trunk/Source/WebCore/platform/blackberry/PasteboardBlackBerry.cpp 2013-08-28 15:30:01 UTC (rev 154750)
@@ -30,12 +30,6 @@
namespace WebCore {
-Pasteboard* Pasteboard::generalPasteboard()
-{
- static Pasteboard* pasteboard = new Pasteboard();
- return pasteboard;
-}
-
Pasteboard::Pasteboard()
{
}
Modified: trunk/Source/WebCore/platform/efl/PasteboardEfl.cpp (154749 => 154750)
--- trunk/Source/WebCore/platform/efl/PasteboardEfl.cpp 2013-08-28 15:20:32 UTC (rev 154749)
+++ trunk/Source/WebCore/platform/efl/PasteboardEfl.cpp 2013-08-28 15:30:01 UTC (rev 154750)
@@ -29,15 +29,8 @@
namespace WebCore {
-Pasteboard* Pasteboard::generalPasteboard()
-{
- static Pasteboard* pasteboard = new Pasteboard();
- return pasteboard;
-}
-
Pasteboard::Pasteboard()
{
- notImplemented();
}
void Pasteboard::writePlainText(const String&, SmartReplaceOption)
Modified: trunk/Source/WebCore/platform/gtk/PasteboardGtk.cpp (154749 => 154750)
--- trunk/Source/WebCore/platform/gtk/PasteboardGtk.cpp 2013-08-28 15:20:32 UTC (rev 154749)
+++ trunk/Source/WebCore/platform/gtk/PasteboardGtk.cpp 2013-08-28 15:30:01 UTC (rev 154750)
@@ -67,6 +67,11 @@
return create(gtk_clipboard_get(GDK_SELECTION_CLIPBOARD));
}
+PassOwnPtr<Pasteboard> Pasteboard::createForGlobalSelection()
+{
+ return create(gtk_clipboard_get(GDK_SELECTION_PRIMARY));
+}
+
PassOwnPtr<Pasteboard> Pasteboard::createPrivate()
{
return create(DataObjectGtk::create());
@@ -82,23 +87,6 @@
return create(dragData.platformData());
}
-static Pasteboard* selectionClipboard()
-{
- static Pasteboard* pasteboard = Pasteboard::create(gtk_clipboard_get(GDK_SELECTION_CLIPBOARD)).leakPtr();
- return pasteboard;
-}
-
-static Pasteboard* primaryClipboard()
-{
- static Pasteboard* pasteboard = Pasteboard::create(gtk_clipboard_get(GDK_SELECTION_PRIMARY)).leakPtr();
- return pasteboard;
-}
-
-Pasteboard* Pasteboard::generalPasteboard()
-{
- return PasteboardHelper::defaultPasteboardHelper()->usePrimarySelectionClipboard() ? primaryClipboard() : selectionClipboard();
-}
-
Pasteboard::Pasteboard(PassRefPtr<DataObjectGtk> dataObject)
: m_dataObject(dataObject)
, m_gtkClipboard(0)
@@ -343,16 +331,6 @@
return m_dataObject->text();
}
-bool Pasteboard::isSelectionMode() const
-{
- return PasteboardHelper::defaultPasteboardHelper()->usePrimarySelectionClipboard();
-}
-
-void Pasteboard::setSelectionMode(bool selectionMode)
-{
- PasteboardHelper::defaultPasteboardHelper()->setUsePrimarySelectionClipboard(selectionMode);
-}
-
bool Pasteboard::hasData()
{
if (m_gtkClipboard)
Modified: trunk/Source/WebCore/platform/gtk/PasteboardHelper.cpp (154749 => 154750)
--- trunk/Source/WebCore/platform/gtk/PasteboardHelper.cpp 2013-08-28 15:20:32 UTC (rev 154749)
+++ trunk/Source/WebCore/platform/gtk/PasteboardHelper.cpp 2013-08-28 15:30:01 UTC (rev 154750)
@@ -74,7 +74,6 @@
PasteboardHelper::PasteboardHelper()
: m_targetList(gtk_target_list_new(0, 0))
- , m_usePrimarySelectionClipboard(false)
{
initGdkAtoms();
@@ -99,18 +98,6 @@
return client ? gtk_widget_get_display(client) : gdk_display_get_default();
}
-GtkClipboard* PasteboardHelper::getCurrentClipboard(Frame* frame)
-{
- if (m_usePrimarySelectionClipboard)
- return getPrimarySelectionClipboard(frame);
- return getClipboard(frame);
-}
-
-GtkClipboard* PasteboardHelper::getClipboard(Frame* frame) const
-{
- return gtk_clipboard_get_for_display(displayFromFrame(frame), GDK_SELECTION_CLIPBOARD);
-}
-
GtkClipboard* PasteboardHelper::getPrimarySelectionClipboard(Frame* frame) const
{
return gtk_clipboard_get_for_display(displayFromFrame(frame), GDK_SELECTION_PRIMARY);
Modified: trunk/Source/WebCore/platform/gtk/PasteboardHelper.h (154749 => 154750)
--- trunk/Source/WebCore/platform/gtk/PasteboardHelper.h 2013-08-28 15:20:32 UTC (rev 154749)
+++ trunk/Source/WebCore/platform/gtk/PasteboardHelper.h 2013-08-28 15:30:01 UTC (rev 154750)
@@ -38,13 +38,8 @@
virtual ~PasteboardHelper();
static PasteboardHelper* defaultPasteboardHelper();
- void setUsePrimarySelectionClipboard(bool usePrimary) { m_usePrimarySelectionClipboard = usePrimary; }
- bool usePrimarySelectionClipboard() { return m_usePrimarySelectionClipboard; }
-
enum SmartPasteInclusion { IncludeSmartPaste, DoNotIncludeSmartPaste };
- GtkClipboard* getCurrentClipboard(Frame*);
- GtkClipboard* getClipboard(Frame*) const;
GtkClipboard* getPrimarySelectionClipboard(Frame*) const;
GtkTargetList* targetList() const;
GtkTargetList* targetListForDataObject(DataObjectGtk*, SmartPasteInclusion = DoNotIncludeSmartPaste);
@@ -59,7 +54,6 @@
private:
GtkTargetList* m_targetList;
- bool m_usePrimarySelectionClipboard;
};
}
Modified: trunk/Source/WebCore/platform/ios/PasteboardIOS.mm (154749 => 154750)
--- trunk/Source/WebCore/platform/ios/PasteboardIOS.mm 2013-08-28 15:20:32 UTC (rev 154749)
+++ trunk/Source/WebCore/platform/ios/PasteboardIOS.mm 2013-08-28 15:30:01 UTC (rev 154750)
@@ -100,12 +100,6 @@
NSString *WebArchivePboardType = @"Apple Web Archive pasteboard type";
-Pasteboard* Pasteboard::generalPasteboard()
-{
- static Pasteboard* pasteboard = new Pasteboard;
- return pasteboard;
-}
-
Pasteboard::Pasteboard()
: m_frame(0)
{
Modified: trunk/Source/WebCore/platform/mac/PasteboardMac.mm (154749 => 154750)
--- trunk/Source/WebCore/platform/mac/PasteboardMac.mm 2013-08-28 15:20:32 UTC (rev 154749)
+++ trunk/Source/WebCore/platform/mac/PasteboardMac.mm 2013-08-28 15:30:01 UTC (rev 154750)
@@ -115,12 +115,6 @@
return types;
}
-Pasteboard* Pasteboard::generalPasteboard()
-{
- static Pasteboard* pasteboard = new Pasteboard(NSGeneralPboard);
- return pasteboard;
-}
-
Pasteboard::Pasteboard(const String& pasteboardName)
: m_pasteboardName(pasteboardName)
, m_changeCount(platformStrategies()->pasteboardStrategy()->changeCount(m_pasteboardName))
Modified: trunk/Source/WebCore/platform/qt/PasteboardQt.cpp (154749 => 154750)
--- trunk/Source/WebCore/platform/qt/PasteboardQt.cpp 2013-08-28 15:20:32 UTC (rev 154749)
+++ trunk/Source/WebCore/platform/qt/PasteboardQt.cpp 2013-08-28 15:30:01 UTC (rev 154750)
@@ -73,6 +73,13 @@
#endif
}
+PassOwnPtr<Pasteboard> Pasteboard::createForGlobalSelection()
+{
+ OwnPtr<Pasteboard> pasteboard = createForCopyAndPaste();
+ pasteboard->m_selectionMode = true;
+ return pasteboard.release();
+}
+
PassOwnPtr<Pasteboard> Pasteboard::createPrivate()
{
return create();
@@ -105,14 +112,6 @@
m_readableData = 0;
}
-Pasteboard* Pasteboard::generalPasteboard()
-{
- static Pasteboard* pasteboard = 0;
- if (!pasteboard)
- pasteboard = new Pasteboard(0, false);
- return pasteboard;
-}
-
void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete, Frame* frame, ShouldSerializeSelectedTextForClipboard shouldSerializeSelectedTextForClipboard)
{
QMimeData* md = new QMimeData;
@@ -230,16 +229,6 @@
#endif
}
-bool Pasteboard::isSelectionMode() const
-{
- return m_selectionMode;
-}
-
-void Pasteboard::setSelectionMode(bool selectionMode)
-{
- m_selectionMode = selectionMode;
-}
-
const QMimeData* Pasteboard::readData() const
{
ASSERT(!(m_readableData && m_writableData));
Modified: trunk/Source/WebCore/platform/win/PasteboardWin.cpp (154749 => 154750)
--- trunk/Source/WebCore/platform/win/PasteboardWin.cpp 2013-08-28 15:20:32 UTC (rev 154749)
+++ trunk/Source/WebCore/platform/win/PasteboardWin.cpp 2013-08-28 15:30:01 UTC (rev 154750)
@@ -90,12 +90,6 @@
return lresult;
}
-Pasteboard* Pasteboard::generalPasteboard()
-{
- static Pasteboard* pasteboard = new Pasteboard;
- return pasteboard;
-}
-
PassOwnPtr<Pasteboard> Pasteboard::createForCopyAndPaste()
{
OwnPtr<Pasteboard> pasteboard = adoptPtr(new Pasteboard);
Modified: trunk/Source/WebKit/qt/ChangeLog (154749 => 154750)
--- trunk/Source/WebKit/qt/ChangeLog 2013-08-28 15:20:32 UTC (rev 154749)
+++ trunk/Source/WebKit/qt/ChangeLog 2013-08-28 15:30:01 UTC (rev 154750)
@@ -1,3 +1,16 @@
+2013-08-28 Darin Adler <[email protected]>
+
+ Eliminate Pasteboard::generalPasteboard
+ https://bugs.webkit.org/show_bug.cgi?id=120392
+
+ Reviewed by Anders Carlsson.
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::respondToChangedSelection):
+ * WebCoreSupport/QWebPageAdapter.cpp:
+ (QWebPageAdapter::triggerAction):
+ Use createForGlobalSelection instead of generalPasteboard and setSelectionMode.
+
2013-08-28 Commit Queue <[email protected]>
Unreviewed, rolling out r154593.
Modified: trunk/Source/WebKit/qt/WebCoreSupport/EditorClientQt.cpp (154749 => 154750)
--- trunk/Source/WebKit/qt/WebCoreSupport/EditorClientQt.cpp 2013-08-28 15:20:32 UTC (rev 154749)
+++ trunk/Source/WebKit/qt/WebCoreSupport/EditorClientQt.cpp 2013-08-28 15:30:01 UTC (rev 154750)
@@ -203,12 +203,8 @@
// selection.formatForDebugger(buffer, sizeof(buffer));
// printf("%s\n", buffer);
- if (supportsGlobalSelection() && frame->selection().isRange()) {
- bool oldSelectionMode = Pasteboard::generalPasteboard()->isSelectionMode();
- Pasteboard::generalPasteboard()->setSelectionMode(true);
- Pasteboard::generalPasteboard()->writeSelection(frame->selection().toNormalizedRange().get(), frame->editor().canSmartCopyOrDelete(), frame);
- Pasteboard::generalPasteboard()->setSelectionMode(oldSelectionMode);
- }
+ if (supportsGlobalSelection() && frame->selection().isRange())
+ Pasteboard::createForGlobalSelection()->writeSelection(frame->selection().toNormalizedRange().get(), frame->editor().canSmartCopyOrDelete(), frame);
m_page->respondToChangedSelection();
if (!frame->editor().ignoreCompositionSelectionChange())
Modified: trunk/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp (154749 => 154750)
--- trunk/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp 2013-08-28 15:20:32 UTC (rev 154749)
+++ trunk/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp 2013-08-28 15:30:01 UTC (rev 154750)
@@ -1074,16 +1074,12 @@
openNewWindow(url, &frame);
break;
}
- case CopyLinkToClipboard: {
+ case CopyLinkToClipboard:
#if defined(Q_WS_X11)
- bool oldSelectionMode = Pasteboard::generalPasteboard()->isSelectionMode();
- Pasteboard::generalPasteboard()->setSelectionMode(true);
- editor.copyURL(hitTestResult->linkUrl, hitTestResult->linkText);
- Pasteboard::generalPasteboard()->setSelectionMode(oldSelectionMode);
+ editor.copyURL(hitTestResult->linkUrl, hitTestResult->linkText, *Pasteboard::createForGlobalSelection());
#endif
editor.copyURL(hitTestResult->linkUrl, hitTestResult->linkText);
break;
- }
case OpenImageInNewWindow:
openNewWindow(hitTestResult->imageUrl, &frame);
break;
Modified: trunk/Source/WebKit2/ChangeLog (154749 => 154750)
--- trunk/Source/WebKit2/ChangeLog 2013-08-28 15:20:32 UTC (rev 154749)
+++ trunk/Source/WebKit2/ChangeLog 2013-08-28 15:30:01 UTC (rev 154750)
@@ -1,3 +1,14 @@
+2013-08-28 Darin Adler <[email protected]>
+
+ Eliminate Pasteboard::generalPasteboard
+ https://bugs.webkit.org/show_bug.cgi?id=120392
+
+ Reviewed by Anders Carlsson.
+
+ * WebProcess/WebCoreSupport/WebEditorClient.cpp:
+ (WebKit::WebEditorClient::updateGlobalSelection):
+ Use createForGlobalSelection instead of generalPasteboard and setSelectionMode.
+
2013-08-28 Ábrahám Gábor <[email protected]>
Fix unused variable warning.
Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp (154749 => 154750)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp 2013-08-28 15:20:32 UTC (rev 154749)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp 2013-08-28 15:30:01 UTC (rev 154750)
@@ -203,16 +203,14 @@
}
#if PLATFORM(QT)
+
// FIXME: Use this function for other X11-based platforms that need to manually update the global selection.
void WebEditorClient::updateGlobalSelection(Frame* frame)
{
- if (supportsGlobalSelection() && frame->selection().isRange()) {
- bool oldSelectionMode = Pasteboard::generalPasteboard()->isSelectionMode();
- Pasteboard::generalPasteboard()->setSelectionMode(true);
- Pasteboard::generalPasteboard()->writeSelection(frame->selection().toNormalizedRange().get(), frame->editor().canSmartCopyOrDelete(), frame);
- Pasteboard::generalPasteboard()->setSelectionMode(oldSelectionMode);
- }
+ if (supportsGlobalSelection() && frame->selection().isRange())
+ Pasteboard::createForGlobalSelection()->writeSelection(frame->selection().toNormalizedRange().get(), frame->editor().canSmartCopyOrDelete(), frame);
}
+
#endif
void WebEditorClient::didEndEditing()