Reviewed by Ken.
authorsullivan <sullivan@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Mar 2005 18:53:42 +0000 (18:53 +0000)
committersullivan <sullivan@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Mar 2005 18:53:42 +0000 (18:53 +0000)
commit911877ffba9b8319737f7078c5ebbddea68482c5
tree7a5e0566cb74ecf6ed7015168471d7dc47458685
parent514582547cef9bf312eaa23d694c72138533da20
    Reviewed by Ken.

        - fixed <rdar://problem/4031826> REGRESSION (Mail): standalone images from
        Safari can't be pasted into Mail (WebKit part of fix)

        We were always declaring webarchive-related pasteboard types, even in the standalone
        image cases where we had no webarchive. Unfortunately, the WebView pasteboard-related
        API doesn't prevent this kind of thing from happening, because the code that
        declares the types isn't guaranteed to be anywhere near the code that writes
        the pasteboard data.

        After this fix, I discovered that pasting standalone images into Mail still doesn't
        work right, but the remaining issues seem to be entirely in Mail. I wrote up 4041671
        to cover these.

        * Misc.subproj/WebNSPasteboardExtras.h:
        (+[NSPasteboard _web_writableTypesForImageIncludingArchive:]):
        Added boolean parameter; clients must specify whether or not there's an
        archive involved, because the array of types is different if there is.

        * Misc.subproj/WebNSPasteboardExtras.m:
        (_web_writableTypesForImageWithoutArchive):
        new static function, constructs (once) and returns the array of types
        for images that don't have archives
        (_web_writableTypesForImageWithArchive):
        new static function, constructs (once) and returns the array of types
        for images that do have archives
        (+[NSPasteboard _web_writableTypesForImageIncludingArchive:]):
        added boolean parameter, now calls one of the two new static functions

        (-[NSPasteboard _web_writeImage:URL:title:archive:types:]):
        added asserts that we aren't declaring the archive types if we don't have archive data

        (-[NSPasteboard _web_declareAndWriteDragImage:URL:title:archive:source:]):
        updated to pass parameter to _web_writableTypesForImageIncludingArchive:

        * WebView.subproj/WebDefaultContextMenuDelegate.m:
        (-[WebDefaultUIDelegate copyImageToClipboard:]):
        updated to pass parameter to _web_writableTypesForImageIncludingArchive:

        * WebView.subproj/WebImageView.m:
        (-[WebImageView copy:]):
        updated to pass parameter to _web_writableTypesForImageIncludingArchive:

        * WebView.subproj/WebView.m:
        (-[WebView pasteboardTypesForElement:]):
        updated to pass parameter to _web_writableTypesForImageIncludingArchive:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8825 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebKit/ChangeLog
WebKit/Misc.subproj/WebNSPasteboardExtras.h
WebKit/Misc.subproj/WebNSPasteboardExtras.m
WebKit/WebView.subproj/WebDefaultContextMenuDelegate.m
WebKit/WebView.subproj/WebImageView.m
WebKit/WebView.subproj/WebView.m