Skip to content
  • alice.liu@apple.com's avatar
    WebCore: · c408431d
    alice.liu@apple.com authored
    2008-12-10  Alice Liu  <alice.liu@apple.com>
    
            fixed https://bugs.webkit.org/show_bug.cgi?id=20685
    
            Reviewed by Darin Adler.
    
            Manual test case is manual-tests/drag-image-to-desktop.html
    
            Added new files to projects
            * WebCore.vcproj/WebCore.vcproj:
            * WebCore.xcodeproj/project.pbxproj:
    
            * page/DragController.cpp:
            (WebCore::DragController::startDrag):
            * platform/MIMETypeRegistry.cpp:
            (WebCore::initializeSupportedImageMIMETypes):
            (WebCore::initializeSupportedImageMIMETypesForEncoding):
    
            These changes add a method to obtain the extension for an image
            * platform/graphics/BitmapImage.cpp:
            (WebCore::BitmapImage::filenameExtension):
            * platform/graphics/BitmapImage.h:
            * platform/graphics/Image.h:
            (WebCore::Image::filenameExtension):
            * platform/graphics/ImageSource.h:
            * platform/graphics/cairo/ImageSourceCairo.cpp:
            (WebCore::ImageSource::filenameExtension):
            * platform/graphics/cg/ImageSourceCG.cpp:
            (WebCore::ImageSource::filenameExtension):
    
            These changes added a utility that returns the preferred extension for a UTI
            * platform/graphics/cg/ImageSourceCG.h: Added.
            * platform/graphics/cg/ImageSourceCGMac.mm: Added.
            (WebCore::MIMETypeForImageSourceType):
            (WebCore::preferredExtensionForImageSourceType):
            * platform/graphics/cg/ImageSourceCGWin.cpp: Added.
            (WebCore::MIMETypeForImageSourceType):
            (WebCore::preferredExtensionForImageSourceType):
    
            * platform/mac/MIMETypeRegistryMac.mm:
            moved getMIMETypeForUTI to ImageSourceCGMac.mm
    
            Ask image for its file extension instead of relying on MIME type and file path
            * platform/win/ClipboardWin.cpp:
            (WebCore::createGlobalImageFileDescriptor):
    
            Remove extraneous code from getPreferredExtensionForMIMEType.
            Also moved getMIMETypeForUTI to ImageSourceCGWin.cpp
            * platform/win/MIMETypeRegistryWin.cpp:
            (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType):
    
    WebKit/mac:
    
    2008-12-10  Alice Liu  <alice.liu@apple.com>
    
            fixed https://bugs.webkit.org/show_bug.cgi?id=20685
    
            Reviewed by Darin Adler.
    
            * Misc/WebNSPasteboardExtras.mm:
            Ask image for its file extension instead of falling back on MIME type and file path.
            Also moved this code to before setting the pasteboard data so as not to set any if
            no extension can be determined.
            (-[NSPasteboard _web_declareAndWriteDragImageForElement:URL:title:archive:source:]):
    
            * WebView/WebHTMLView.mm:
            Fixed a separate but related long-standing bug of how the filename for the promised
            drag data is determined by asking the image for a proper file extension. 
            (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@39185 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    c408431d