Changeset 87848 in webkit
- Timestamp:
- Jun 1, 2011 2:13:06 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r87846 r87848 1 2011-06-01 Daniel Cheng <dcheng@chromium.org> 2 3 Reviewed by Tony Chang. 4 5 [chromium] Use correct file name for dragging out images. 6 https://bugs.webkit.org/show_bug.cgi?id=24887 7 8 * fast/events/drag-image-filename-expected.txt: Added. 9 * fast/events/drag-image-filename.html: Added. 10 * platform/gtk/Skipped: 11 * platform/mac/Skipped: 12 * platform/qt/Skipped: 13 * platform/win/Skipped: 14 1 15 2011-06-01 Levi Weintraub <leviw@chromium.org> 2 16 -
trunk/LayoutTests/platform/gtk/Skipped
r87835 r87848 1149 1149 fast/events/5056619.html 1150 1150 1151 # EventSender::dumpFilenameBeingDragged not implemented. 1152 # https://bugs.webkit.org/show_bug.cgi?id=61826 1153 fast/events/drag-image-filename.html 1154 1151 1155 # Tests that fail because they assume a certain number of mouse 1152 1156 # movements during drags or fail only in Xvfb -
trunk/LayoutTests/platform/mac/Skipped
r87772 r87848 192 192 editing/pasteboard/file-drag-to-editable.html 193 193 194 # EventSender::dumpFilenameBeingDragged not implemented. 195 # https://bugs.webkit.org/show_bug.cgi?id=61827 196 fast/events/drag-image-filename.html 197 194 198 # Hits an assert in FrameLoader.cpp. https://bugs.webkit.org/show_bug.cgi?id=31387 195 199 http/tests/multipart/policy-ignore-crash.php -
trunk/LayoutTests/platform/qt/Skipped
r87792 r87848 172 172 svg/as-image/drag-svg-as-image.html 173 173 fast/forms/slider-delete-while-dragging-thumb.html 174 175 # EventSender::dumpFilenameBeingDragged not implemented. 176 # https://bugs.webkit.org/show_bug.cgi?id=61828 177 fast/events/drag-image-filename.html 174 178 175 179 # ------- missing drag-and-drop support -
trunk/LayoutTests/platform/win/Skipped
r87817 r87848 126 126 fast/events/standalone-image-drag-to-editable.html 127 127 http/tests/security/drag-drop-same-unique-origin.html 128 129 # EventSender::dumpFilenameBeingDragged not implemented. 130 # https://bugs.webkit.org/show_bug.cgi?id=61829 131 fast/events/drag-image-filename.html 128 132 129 133 # <rdar://problem/5643675> window.scrollTo scrolls a window with no scrollbars -
trunk/Source/WebCore/ChangeLog
r87846 r87848 1 2011-06-01 Daniel Cheng <dcheng@chromium.org> 2 3 Reviewed by Tony Chang. 4 5 [chromium] Use correct file name for dragging out images. 6 https://bugs.webkit.org/show_bug.cgi?id=24887 7 8 We try to guess an appropriate filename when dragging out images. In order, we try to use: 9 - The filename suggested in the HTTP header. 10 - The last path component of the source URL. 11 - The alt text. 12 This matches the behavior of the other WebKit ports. 13 14 Test: fast/events/drag-image-filename.html 15 16 * platform/chromium/ClipboardChromium.cpp: 17 (WebCore::writeImageToDataObject): 18 * platform/chromium/ClipboardChromiumMac.cpp: 19 (WebCore::isInvalidFileCharacter): 20 (WebCore::ClipboardChromium::validateFileName): 21 1 22 2011-06-01 Levi Weintraub <leviw@chromium.org> 2 23 … … 650 671 * platform/graphics/gpu/TilingData.cpp: 651 672 652 <<<<<<< .mine653 673 2011-05-31 Justin Novosad <junov@chromium.org> 654 674 … … 663 683 * platform/graphics/gpu/TilingData.cpp: 664 684 665 =======666 685 2011-05-31 Rob Buis <rbuis@rim.com> 667 686 -
trunk/Source/WebCore/platform/chromium/ClipboardChromium.cpp
r86330 r87848 225 225 dataObject->setFileContent(imageBuffer); 226 226 227 // Determine the filename for the file contents of the image. We try to 228 // use the alt tag if one exists, otherwise we fall back on the suggested 229 // filename in the http header, and finally we resort to using the filename 230 // in the URL. 227 // Determine the filename for the file contents of the image. 228 String filename = cachedImage->response().suggestedFilename(); 229 if (filename.isEmpty()) 230 filename = url.lastPathComponent(); 231 if (filename.isEmpty()) 232 filename = element->getAttribute(altAttr); 233 else { 234 // Strip any existing extension. Assume that alt text is usually not a filename. 235 int extensionIndex = filename.reverseFind('.'); 236 if (extensionIndex != -1) 237 filename.truncate(extensionIndex); 238 } 239 filename = ClipboardChromium::validateFileName(filename, dataObject); 240 231 241 String extension = MIMETypeRegistry::getPreferredExtensionForMIMEType( 232 242 cachedImage->response().mimeType()); 233 243 dataObject->setFileExtension(extension.isEmpty() ? emptyString() : "." + extension); 234 String title = element->getAttribute(altAttr); 235 if (title.isEmpty()) 236 title = cachedImage->response().suggestedFilename(); 237 238 title = ClipboardChromium::validateFileName(title, dataObject); 239 dataObject->setFileContentFilename(title + dataObject->fileExtension()); 244 245 dataObject->setFileContentFilename(filename + dataObject->fileExtension()); 240 246 } 241 247 -
trunk/Source/WebCore/platform/chromium/ClipboardChromiumMac.cpp
r41150 r87848 29 29 30 30 #include "ChromiumDataObject.h" 31 #include "NotImplemented.h"32 31 33 32 namespace WebCore { 33 34 35 // Filename length and character-set limits vary by filesystem, and there's no 36 // real way to tell what filesystem is in use. Since HFS+ is by far the most 37 // common, we'll abide by its limits, which are 255 Unicode characters (slightly 38 // simplified; really it uses Normalization Form D, but the differences aren't 39 // really worth dealing with here.) 40 static const unsigned MaxHFSFilenameLength = 255; 41 42 43 static bool isInvalidFileCharacter(UChar c) 44 { 45 // HFS+ basically allows anything but '/'. For sanity's sake we'll disallow 46 // control characters. 47 return c < ' ' || c == 0x7F || c == '/'; 48 } 34 49 35 50 String ClipboardChromium::validateFileName(const String& title, ChromiumDataObject* dataObject) 36 51 { 37 notImplemented(); 38 return title; 52 // Remove any invalid file system characters, especially "/". 53 String result = title.removeCharacters(isInvalidFileCharacter); 54 String extension = dataObject->fileExtension().removeCharacters(&isInvalidFileCharacter); 55 56 // Remove a ridiculously-long extension. 57 if (extension.length() >= MaxHFSFilenameLength) 58 extension = ""; 59 60 // Truncate an overly-long filename. 61 int overflow = result.length() + extension.length() - MaxHFSFilenameLength; 62 if (overflow > 0) 63 result.remove(result.length() - overflow, overflow); 64 65 dataObject->setFileExtension(extension); 66 return result; 39 67 } 40 68 -
trunk/Tools/ChangeLog
r87847 r87848 1 2011-06-01 Daniel Cheng <dcheng@chromium.org> 2 3 Reviewed by Tony Chang. 4 5 [chromium] Use correct file name for dragging out images. 6 https://bugs.webkit.org/show_bug.cgi?id=24887 7 8 * DumpRenderTree/chromium/EventSender.cpp: 9 (EventSender::EventSender): 10 (EventSender::dumpFilenameBeingDragged): 11 * DumpRenderTree/chromium/EventSender.h: 12 1 13 2011-06-01 Dirk Pranke <dpranke@chromium.org> 2 14 -
trunk/Tools/DumpRenderTree/chromium/EventSender.cpp
r86930 r87848 260 260 bindMethod("continuousMouseScrollBy", &EventSender::continuousMouseScrollBy); 261 261 bindMethod("dispatchMessage", &EventSender::dispatchMessage); 262 bindMethod("dumpFilenameBeingDragged", &EventSender::dumpFilenameBeingDragged); 262 263 bindMethod("enableDOMUIEventLogging", &EventSender::enableDOMUIEventLogging); 263 264 bindMethod("fireKeyboardEventsToElement", &EventSender::fireKeyboardEventsToElement); … … 343 344 // Finish processing events. 344 345 replaySavedEvents(); 346 } 347 348 void EventSender::dumpFilenameBeingDragged(const CppArgumentList&, CppVariant*) 349 { 350 printf("Filename being dragged: %s\n", currentDragData.fileContentFilename().utf8().data()); 345 351 } 346 352 -
trunk/Tools/DumpRenderTree/chromium/EventSender.h
r86930 r87848 62 62 // Simulate drag&drop system call. 63 63 void doDragDrop(const WebKit::WebDragData&, WebKit::WebDragOperationsMask); 64 65 // Test helper for dragging out images. 66 void dumpFilenameBeingDragged(const CppArgumentList&, CppVariant*); 64 67 65 68 // JS callback methods.
Note: See TracChangeset
for help on using the changeset viewer.