Changeset 64852 in webkit
- Timestamp:
- Aug 6, 2010 8:59:55 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r64850 r64852 1 2010-08-06 Martin Robinson <mrobinson@igalia.com> 2 3 Reviewed by Gustavo Noronha Silva. 4 5 [GTK] Support for image drags 6 https://bugs.webkit.org/show_bug.cgi?id=40788 7 8 Unskip and add baselines for tests that are now passing with image drag support. 9 10 * platform/gtk/Skipped: 11 * platform/gtk/editing/pasteboard/drag-image-to-contenteditable-in-iframe-expected.txt: Added. 12 * platform/gtk/editing/pasteboard/drag-selected-image-to-contenteditable-expected.txt: Added. 13 * platform/gtk/editing/selection/drag-to-contenteditable-iframe-expected.txt: Added. 14 * platform/gtk/fast/events/standalone-image-drag-to-editable-expected.txt: Added. 15 1 16 2010-08-06 Nikolas Zimmermann <nzimmermann@rim.com> 2 17 -
trunk/LayoutTests/platform/gtk/Skipped
r64845 r64852 5828 5828 http/tests/security/clipboard/clipboard-file-access.html 5829 5829 5830 # Tests that fail because image dragging does not yet work 5831 editing/pasteboard/drag-image-in-about-blank-frame.html 5832 editing/pasteboard/drag-image-to-contenteditable-in-iframe.html 5833 editing/pasteboard/drag-selected-image-to-contenteditable.html 5834 editing/selection/drag-to-contenteditable-iframe.html 5835 fast/events/standalone-image-drag-to-editable.html 5836 editing/pasteboard/drag-drop-iframe-refresh-crash.html 5830 # Still failing, looks like a bug in the EventSender drag-and-drop 5837 5831 fast/css/user-drag-none.html 5838 5832 -
trunk/WebCore/ChangeLog
r64846 r64852 1 2010-08-06 Martin Robinson <mrobinson@igalia.com> 2 3 Reviewed by Gustavo Noronha Silva. 4 5 [GTK] Support for image drags 6 https://bugs.webkit.org/show_bug.cgi?id=40788 7 8 Add image drag-and-drop support for WebKit GTK+. 9 10 * platform/gtk/ClipboardGtk.cpp: 11 (WebCore::ClipboardGtk::setDragImage): Filled this stub. 12 (WebCore::ClipboardGtk::setDragImageElement): Filled this stub. 13 (WebCore::ClipboardGtk::createDragImage): Filled this stub. 14 (WebCore::ClipboardGtk::declareAndWriteDragImage): Write the image URL, markup, and image itself to the data object member. 15 * platform/gtk/ClipboardGtk.h: Brought method declarations into line with the parent class. 16 1 17 2010-08-06 Yury Semikhatsky <yurys@chromium.org> 2 18 -
trunk/WebCore/platform/gtk/ClipboardGtk.cpp
r64152 r64852 24 24 #include "FileList.h" 25 25 #include "Frame.h" 26 #include "HTMLNames.h" 26 27 #include "Image.h" 27 28 #include "NotImplemented.h" … … 272 273 } 273 274 274 IntPoint ClipboardGtk::dragLocation() const 275 { 276 notImplemented();277 return IntPoint(0, 0); 278 } 279 280 CachedImage* ClipboardGtk::dragImage() const 281 { 282 notImplemented(); 283 return 0; 284 } 285 286 void ClipboardGtk::setDragImage(CachedImage*, const IntPoint&)287 { 288 notImplemented(); 289 } 290 291 Node* ClipboardGtk::dragImageElement() 292 { 293 notImplemented();294 return 0; 295 } 296 297 void ClipboardGtk::setDragImageElement(Node*, const IntPoint&) 298 { 299 notImplemented(); 300 } 301 302 DragImageRef ClipboardGtk::createDragImage(IntPoint&) const 303 { 304 notImplemented(); 305 return 0;275 void ClipboardGtk::setDragImage(CachedImage* image, const IntPoint& location) 276 { 277 setDragImage(image, 0, location); 278 } 279 280 void ClipboardGtk::setDragImageElement(Node* element, const IntPoint& location) 281 { 282 setDragImage(0, element, location); 283 } 284 285 void ClipboardGtk::setDragImage(CachedImage* image, Node* element, const IntPoint& location) 286 { 287 if (policy() != ClipboardImageWritable && policy() != ClipboardWritable) 288 return; 289 290 if (m_dragImage) 291 m_dragImage->removeClient(this); 292 m_dragImage = image; 293 if (m_dragImage) 294 m_dragImage->addClient(this); 295 296 m_dragLoc = location; 297 m_dragImageElement = element; 298 } 299 300 DragImageRef ClipboardGtk::createDragImage(IntPoint& location) const 301 { 302 location = m_dragLoc; 303 if (!m_dragImage) 304 return 0; 305 306 return createDragImageFromImage(m_dragImage->image()); 306 307 } 307 308 … … 321 322 } 322 323 323 void ClipboardGtk::declareAndWriteDragImage(Element* element, const KURL& url, const String& label, Frame*) 324 { 325 CachedImage* cachedImage = getCachedImage(element); 326 if (!cachedImage || !cachedImage->isLoaded()) 327 return; 328 329 GdkPixbuf* pixbuf = cachedImage->image()->getGdkPixbuf(); 324 void ClipboardGtk::declareAndWriteDragImage(Element* element, const KURL& url, const String& label, Frame* frame) 325 { 326 m_dataObject->setURL(url, label); 327 m_dataObject->setMarkup(createMarkup(element, IncludeNode, 0, AbsoluteURLs)); 328 329 CachedImage* image = getCachedImage(element); 330 if (!image || !image->isLoaded()) 331 return; 332 333 GRefPtr<GdkPixbuf> pixbuf = adoptGRef(image->image()->getGdkPixbuf()); 330 334 if (!pixbuf) 331 335 return; 332 336 333 GtkClipboard* imageClipboard = gtk_clipboard_get(gdk_atom_intern_static_string("WebKitClipboardImage")); 334 gtk_clipboard_clear(imageClipboard); 335 336 gtk_clipboard_set_image(imageClipboard, pixbuf); 337 g_object_unref(pixbuf); 338 339 writeURL(url, label, 0); 337 m_dataObject->setImage(pixbuf.get()); 340 338 } 341 339 -
trunk/WebCore/platform/gtk/ClipboardGtk.h
r64152 r64852 28 28 #define ClipboardGtk_h 29 29 30 #include "CachedResourceClient.h" 30 31 #include "Clipboard.h" 31 32 #include "DataObjectGtk.h" … … 40 41 // State available during IE's events for drag and drop and copy/paste 41 42 // Created from the EventHandlerGtk to be used by the dom 42 class ClipboardGtk : public Clipboard {43 class ClipboardGtk : public Clipboard, public CachedResourceClient { 43 44 public: 44 45 static PassRefPtr<ClipboardGtk> create(ClipboardAccessPolicy policy, GtkClipboard* clipboard, bool isForDragging, Frame* frame) … … 61 62 virtual PassRefPtr<FileList> files() const; 62 63 63 IntPoint dragLocation() const;64 CachedImage* dragImage() const;65 64 void setDragImage(CachedImage*, const IntPoint&); 66 Node* dragImageElement();67 65 void setDragImageElement(Node*, const IntPoint&); 66 void setDragImage(CachedImage*, Node*, const IntPoint&); 68 67 69 68 virtual DragImageRef createDragImage(IntPoint&) const; 69 #if ENABLE(DRAG_SUPPORT) 70 70 virtual void declareAndWriteDragImage(Element*, const KURL&, const String&, Frame*); 71 #endif 71 72 virtual void writeURL(const KURL&, const String&, Frame*); 72 73 virtual void writeRange(Range*, Frame*);
Note: See TracChangeset
for help on using the changeset viewer.