Diff
Modified: trunk/Source/WebCore/CMakeListsEfl.txt (96338 => 96339)
--- trunk/Source/WebCore/CMakeListsEfl.txt 2011-09-29 17:16:35 UTC (rev 96338)
+++ trunk/Source/WebCore/CMakeListsEfl.txt 2011-09-29 17:35:41 UTC (rev 96339)
@@ -20,7 +20,6 @@
bindings/js/ScriptControllerEfl.cpp
page/efl/DragControllerEfl.cpp
page/efl/EventHandlerEfl.cpp
- page/efl/FrameEfl.cpp
platform/Cursor.cpp
platform/efl/ClipboardEfl.cpp
platform/efl/ContextMenuEfl.cpp
Modified: trunk/Source/WebCore/ChangeLog (96338 => 96339)
--- trunk/Source/WebCore/ChangeLog 2011-09-29 17:16:35 UTC (rev 96338)
+++ trunk/Source/WebCore/ChangeLog 2011-09-29 17:35:41 UTC (rev 96339)
@@ -1,3 +1,37 @@
+2011-09-29 Martin Robinson <[email protected]>
+
+ [GTK] Dragging a selection does not produce a drag image
+ https://bugs.webkit.org/show_bug.cgi?id=69064
+
+ Reviewed by Andreas Kling.
+
+ Moved Chromium's generic implementation of Frame::nodeImage and
+ Frame::dragImageForSeletion to Frame.cpp and simply excluded via
+ #ifdefs platforms that do not have their own implementation. Removed
+ all empty implementations of these functions and Qt's which was
+ functionally identical.
+
+ No new tests. Drag-and-drop drag image functionality changes
+ are incredibly difficult to test in a non-manual way.
+
+ * CMakeListsEfl.txt: Delist FrameEfl.cpp.
+ * GNUmakefile.list.am: Delist FrameGtk.cpp.
+ * WebCore.gypi: Delist removed Frame*.cpp.
+ * WebCore.pro: Delist FrameQt.cpp.
+ * page/Frame.cpp: Moved FrameChromium implementation here.
+ (WebCore::ScopedFramePaintingState::ScopedFramePaintingState):
+ (WebCore::ScopedFramePaintingState::~ScopedFramePaintingState):
+ (WebCore::Frame::nodeImage):
+ (WebCore::Frame::dragImageForSelection):
+ * page/chromium/FrameChromium.cpp: Removed.
+ * page/efl/FrameEfl.cpp: Removed.
+ * page/gtk/FrameGtk.cpp: Removed.
+ * page/qt/FrameQt.cpp: Removed.
+ * page/wx/FrameWx.cpp: Removed.
+ * platform/gtk/ClipboardGtk.cpp:
+ (WebCore::ClipboardGtk::createDragImage): Call nodeImage to get
+ the drag image for a node.
+
2011-09-29 Noel Gordon <[email protected]>
[chromium skia] PNGImageEncoder: hoist constants out of the encoding loop
Modified: trunk/Source/WebCore/GNUmakefile.list.am (96338 => 96339)
--- trunk/Source/WebCore/GNUmakefile.list.am 2011-09-29 17:16:35 UTC (rev 96338)
+++ trunk/Source/WebCore/GNUmakefile.list.am 2011-09-29 17:35:41 UTC (rev 96339)
@@ -3954,7 +3954,6 @@
Source/WebCore/editing/gtk/FrameSelectionGtk.cpp \
Source/WebCore/page/gtk/DragControllerGtk.cpp \
Source/WebCore/page/gtk/EventHandlerGtk.cpp \
- Source/WebCore/page/gtk/FrameGtk.cpp \
Source/WebCore/platform/cairo/WidgetBackingStore.h \
Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp \
Source/WebCore/platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h \
Modified: trunk/Source/WebCore/WebCore.gypi (96338 => 96339)
--- trunk/Source/WebCore/WebCore.gypi 2011-09-29 17:16:35 UTC (rev 96338)
+++ trunk/Source/WebCore/WebCore.gypi 2011-09-29 17:35:41 UTC (rev 96339)
@@ -2967,13 +2967,10 @@
'page/chromium/ChromeClientChromium.h',
'page/chromium/DragControllerChromium.cpp',
'page/chromium/EventHandlerChromium.cpp',
- 'page/chromium/FrameChromium.cpp',
'page/efl/DragControllerEfl.cpp',
'page/efl/EventHandlerEfl.cpp',
- 'page/efl/FrameEfl.cpp',
'page/gtk/DragControllerGtk.cpp',
'page/gtk/EventHandlerGtk.cpp',
- 'page/gtk/FrameGtk.cpp',
'page/mac/ChromeMac.mm',
'page/mac/DragControllerMac.mm',
'page/mac/EventHandlerMac.mm',
@@ -2981,7 +2978,6 @@
'page/mac/PageMac.cpp',
'page/qt/DragControllerQt.cpp',
'page/qt/EventHandlerQt.cpp',
- 'page/qt/FrameQt.cpp',
'page/win/DragControllerWin.cpp',
'page/win/EventHandlerWin.cpp',
'page/win/FrameCGWin.cpp',
@@ -2991,7 +2987,6 @@
'page/wince/FrameWinCE.cpp',
'page/wx/DragControllerWx.cpp',
'page/wx/EventHandlerWx.cpp',
- 'page/wx/FrameWx.cpp',
'platform/Arena.cpp',
'platform/Arena.h',
'platform/AsyncFileSystem.cpp',
Modified: trunk/Source/WebCore/WebCore.pro (96338 => 96339)
--- trunk/Source/WebCore/WebCore.pro 2011-09-29 17:16:35 UTC (rev 96338)
+++ trunk/Source/WebCore/WebCore.pro 2011-09-29 17:35:41 UTC (rev 96339)
@@ -2582,7 +2582,6 @@
accessibility/qt/AccessibilityObjectQt.cpp \
page/qt/DragControllerQt.cpp \
page/qt/EventHandlerQt.cpp \
- page/qt/FrameQt.cpp \
platform/graphics/qt/TransformationMatrixQt.cpp \
platform/graphics/qt/ColorQt.cpp \
platform/graphics/qt/FontQt.cpp \
Modified: trunk/Source/WebCore/page/Frame.cpp (96338 => 96339)
--- trunk/Source/WebCore/page/Frame.cpp 2011-09-29 17:16:35 UTC (rev 96338)
+++ trunk/Source/WebCore/page/Frame.cpp 2011-09-29 17:35:41 UTC (rev 96339)
@@ -9,6 +9,7 @@
* Copyright (C) 2005 Alexey Proskuryakov <[email protected]>
* Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
* Copyright (C) 2008 Eric Seidel <[email protected]>
+ * Copyright (C) 2008 Google Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -58,6 +59,7 @@
#include "HTMLNames.h"
#include "HTMLTableCellElement.h"
#include "HitTestResult.h"
+#include "ImageBuffer.h"
#include "InspectorInstrumentation.h"
#include "Logging.h"
#include "MediaFeatureNames.h"
@@ -1058,4 +1060,85 @@
m_page->chrome()->client()->numWheelEventHandlersChanged(count);
}
+#if !PLATFORM(MAC) && !PLATFORM(WIN) && !PLATFORM(WX)
+struct ScopedFramePaintingState {
+ ScopedFramePaintingState(Frame* theFrame, RenderObject* theRenderer)
+ : frame(theFrame)
+ , renderer(theRenderer)
+ , paintBehavior(frame->view()->paintBehavior())
+ , backgroundColor(frame->view()->baseBackgroundColor())
+ {
+ }
+
+ ~ScopedFramePaintingState()
+ {
+ if (renderer)
+ renderer->updateDragState(false);
+ frame->view()->setPaintBehavior(paintBehavior);
+ frame->view()->setBaseBackgroundColor(backgroundColor);
+ frame->view()->setNodeToDraw(0);
+ }
+
+ Frame* frame;
+ RenderObject* renderer;
+ PaintBehavior paintBehavior;
+ Color backgroundColor;
+};
+
+DragImageRef Frame::nodeImage(Node* node)
+{
+ RenderObject* renderer = node->renderer();
+ if (!renderer)
+ return 0;
+
+ const ScopedFramePaintingState state(this, renderer);
+
+ renderer->updateDragState(true);
+ m_view->setPaintBehavior(state.paintBehavior | PaintBehaviorFlattenCompositingLayers);
+
+ // When generating the drag image for an element, ignore the document background.
+ m_view->setBaseBackgroundColor(colorWithOverrideAlpha(Color::white, 1.0));
+ m_doc->updateLayout();
+ m_view->setNodeToDraw(node); // Enable special sub-tree drawing mode.
+
+ IntRect topLevelRect;
+ IntRect paintingRect = renderer->paintingRootRect(topLevelRect);
+
+ OwnPtr<ImageBuffer> buffer(ImageBuffer::create(paintingRect.size()));
+ if (!buffer)
+ return 0;
+ buffer->context()->translate(-paintingRect.x(), -paintingRect.y());
+ buffer->context()->clip(FloatRect(0, 0, paintingRect.maxX(), paintingRect.maxY()));
+
+ m_view->paintContents(buffer->context(), paintingRect);
+
+ RefPtr<Image> image = buffer->copyImage();
+ return createDragImageFromImage(image.get());
+}
+
+DragImageRef Frame::dragImageForSelection()
+{
+ if (!selection()->isRange())
+ return 0;
+
+ const ScopedFramePaintingState state(this, 0);
+ m_view->setPaintBehavior(PaintBehaviorSelectionOnly);
+ m_doc->updateLayout();
+
+ IntRect paintingRect = enclosingIntRect(selection()->bounds());
+
+ OwnPtr<ImageBuffer> buffer(ImageBuffer::create(paintingRect.size()));
+ if (!buffer)
+ return 0;
+ buffer->context()->translate(-paintingRect.x(), -paintingRect.y());
+ buffer->context()->clip(FloatRect(0, 0, paintingRect.maxX(), paintingRect.maxY()));
+
+ m_view->paintContents(buffer->context(), paintingRect);
+
+ RefPtr<Image> image = buffer->copyImage();
+ return createDragImageFromImage(image.get());
+}
+
+#endif
+
} // namespace WebCore
Deleted: trunk/Source/WebCore/page/chromium/FrameChromium.cpp (96338 => 96339)
--- trunk/Source/WebCore/page/chromium/FrameChromium.cpp 2011-09-29 17:16:35 UTC (rev 96338)
+++ trunk/Source/WebCore/page/chromium/FrameChromium.cpp 2011-09-29 17:35:41 UTC (rev 96339)
@@ -1,120 +0,0 @@
-/*
- * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
- * Copyright (C) 2008 Google Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "Frame.h"
-
-#include "Document.h"
-#include "FloatRect.h"
-#include "GraphicsContext.h"
-#include "ImageBuffer.h"
-#include "RenderView.h"
-#include "Settings.h"
-
-namespace WebCore {
-
-namespace {
-
-struct ScopedState {
- ScopedState(Frame* theFrame, RenderObject* theRenderer)
- : frame(theFrame)
- , renderer(theRenderer)
- , paintBehavior(frame->view()->paintBehavior())
- , backgroundColor(frame->view()->baseBackgroundColor())
- {
- }
-
- ~ScopedState()
- {
- if (renderer)
- renderer->updateDragState(false);
- frame->view()->setPaintBehavior(paintBehavior);
- frame->view()->setBaseBackgroundColor(backgroundColor);
- frame->view()->setNodeToDraw(0);
- }
-
- Frame* frame;
- RenderObject* renderer;
- PaintBehavior paintBehavior;
- Color backgroundColor;
-};
-
-} // namespace
-
-DragImageRef Frame::nodeImage(Node* node)
-{
- RenderObject* renderer = node->renderer();
- if (!renderer)
- return 0;
-
- const ScopedState state(this, renderer);
-
- renderer->updateDragState(true);
- m_view->setPaintBehavior(state.paintBehavior | PaintBehaviorFlattenCompositingLayers);
- // When generating the drag image for an element, ignore the document background.
- m_view->setBaseBackgroundColor(colorWithOverrideAlpha(Color::white, 1.0));
- m_doc->updateLayout();
- m_view->setNodeToDraw(node); // Enable special sub-tree drawing mode.
-
- IntRect topLevelRect;
- IntRect paintingRect = renderer->paintingRootRect(topLevelRect);
-
- OwnPtr<ImageBuffer> buffer(ImageBuffer::create(paintingRect.size()));
- if (!buffer)
- return 0;
- buffer->context()->translate(-paintingRect.x(), -paintingRect.y());
- buffer->context()->clip(FloatRect(0, 0, paintingRect.maxX(), paintingRect.maxY()));
-
- m_view->paintContents(buffer->context(), paintingRect);
-
- RefPtr<Image> image = buffer->copyImage();
- return createDragImageFromImage(image.get());
-}
-
-DragImageRef Frame::dragImageForSelection()
-{
- if (!selection()->isRange())
- return 0;
-
- const ScopedState state(this, 0);
- m_view->setPaintBehavior(PaintBehaviorSelectionOnly);
- m_doc->updateLayout();
-
- IntRect paintingRect = enclosingIntRect(selection()->bounds());
-
- OwnPtr<ImageBuffer> buffer(ImageBuffer::create(paintingRect.size()));
- if (!buffer)
- return 0;
- buffer->context()->translate(-paintingRect.x(), -paintingRect.y());
- buffer->context()->clip(FloatRect(0, 0, paintingRect.maxX(), paintingRect.maxY()));
-
- m_view->paintContents(buffer->context(), paintingRect);
-
- RefPtr<Image> image = buffer->copyImage();
- return createDragImageFromImage(image.get());
-}
-
-} // namespace WebCore
Deleted: trunk/Source/WebCore/page/efl/FrameEfl.cpp (96338 => 96339)
--- trunk/Source/WebCore/page/efl/FrameEfl.cpp 2011-09-29 17:16:35 UTC (rev 96338)
+++ trunk/Source/WebCore/page/efl/FrameEfl.cpp 2011-09-29 17:35:41 UTC (rev 96339)
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
- * Copyright (C) 2009-2010 ProFUSION embedded systems
- * Copyright (C) 2009-2010 Samsung Electronics
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "Frame.h"
-
-#include "NotImplemented.h"
-
-namespace WebCore {
-
-DragImageRef Frame::nodeImage(Node* node)
-{
- notImplemented();
- return 0;
-}
-
-DragImageRef Frame::dragImageForSelection()
-{
- notImplemented();
- return 0;
-}
-
-}
Deleted: trunk/Source/WebCore/page/gtk/FrameGtk.cpp (96338 => 96339)
--- trunk/Source/WebCore/page/gtk/FrameGtk.cpp 2011-09-29 17:16:35 UTC (rev 96338)
+++ trunk/Source/WebCore/page/gtk/FrameGtk.cpp 2011-09-29 17:35:41 UTC (rev 96339)
@@ -1,43 +0,0 @@
-/*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "Frame.h"
-
-#include "NotImplemented.h"
-
-namespace WebCore {
-
-DragImageRef Frame::nodeImage(Node*)
-{
- notImplemented();
- return 0;
-}
-
-DragImageRef Frame::dragImageForSelection()
-{
- notImplemented();
- return 0;
-}
-
-}
Deleted: trunk/Source/WebCore/page/qt/FrameQt.cpp (96338 => 96339)
--- trunk/Source/WebCore/page/qt/FrameQt.cpp 2011-09-29 17:16:35 UTC (rev 96338)
+++ trunk/Source/WebCore/page/qt/FrameQt.cpp 2011-09-29 17:35:41 UTC (rev 96339)
@@ -1,68 +0,0 @@
-/*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "Document.h"
-#include "Frame.h"
-#include "FrameView.h"
-#include "GraphicsContext.h"
-#include "Image.h"
-#include "ImageBuffer.h"
-
-#include "NotImplemented.h"
-
-namespace WebCore {
-
-DragImageRef Frame::nodeImage(Node*)
-{
- notImplemented();
- return 0;
-}
-
-DragImageRef Frame::dragImageForSelection()
-{
- if (!selection()->isRange())
- return 0;
-
- m_doc->updateLayout();
-
- IntRect paintingRect = enclosingIntRect(selection()->bounds());
- OwnPtr<ImageBuffer> buffer(ImageBuffer::create(paintingRect.size()));
- if (!buffer)
- return 0;
-
- GraphicsContext* context = buffer->context();
- context->translate(-paintingRect.x(), -paintingRect.y());
- context->clip(FloatRect(0, 0, paintingRect.maxX(), paintingRect.maxY()));
-
- PaintBehavior previousPaintBehavior = m_view->paintBehavior();
- m_view->setPaintBehavior(PaintBehaviorSelectionOnly);
- m_view->paintContents(context, paintingRect);
- m_view->setPaintBehavior(previousPaintBehavior);
-
- RefPtr<Image> image = buffer->copyImage();
- return createDragImageFromImage(image.get());
-}
-
-}
-// vim: ts=4 sw=4 et
Deleted: trunk/Source/WebCore/page/wx/FrameWx.cpp (96338 => 96339)
--- trunk/Source/WebCore/page/wx/FrameWx.cpp 2011-09-29 17:16:35 UTC (rev 96338)
+++ trunk/Source/WebCore/page/wx/FrameWx.cpp 2011-09-29 17:35:41 UTC (rev 96339)
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2009 Kevin Ollivier <[email protected]>. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "Frame.h"
-#include "NotImplemented.h"
-
-namespace WebCore {
-
-DragImageRef Frame::nodeImage(Node*)
-{
- notImplemented();
- return 0;
-}
-
-DragImageRef Frame::dragImageForSelection()
-{
- notImplemented();
- return 0;
-}
-
-}
Modified: trunk/Source/WebCore/platform/gtk/ClipboardGtk.cpp (96338 => 96339)
--- trunk/Source/WebCore/platform/gtk/ClipboardGtk.cpp 2011-09-29 17:16:35 UTC (rev 96338)
+++ trunk/Source/WebCore/platform/gtk/ClipboardGtk.cpp 2011-09-29 17:35:41 UTC (rev 96339)
@@ -259,10 +259,13 @@
DragImageRef ClipboardGtk::createDragImage(IntPoint& location) const
{
location = m_dragLoc;
- if (!m_dragImage)
- return 0;
- return createDragImageFromImage(m_dragImage->image());
+ if (m_dragImage)
+ return createDragImageFromImage(m_dragImage->image());
+ if (m_dragImageElement && m_frame)
+ return m_frame->nodeImage(m_dragImageElement.get());
+
+ return 0; // We do not have enough information to create a drag image, use the default icon.
}
static CachedImage* getCachedImage(Element* element)