WebCore:
authorcblu <cblu@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Nov 2003 19:15:10 +0000 (19:15 +0000)
committercblu <cblu@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Nov 2003 19:15:10 +0000 (19:15 +0000)
commitb30d52628f61fcfe7f1015d227fae2dbacb07273
treeeb4282c97ab33b3cec8c2e19edd5d492e3fa07ae
parentb2e333f077211457c2586bc0b87000842a342958
WebCore:

Fixed:
<rdar://problem/3472403>: RTFD of copied text and images should use original image data not tiffs

        Reviewed by john.

        * kwq/KWQKHTMLPart.h:
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::fileWrapperForElement): call [_bridge _fileWrapperForURL:] to get cached data
        * kwq/WebCoreBridge.h: added _fileWrapperForURL: to the bridge protocol
        * kwq/WebCoreBridge.mm:
        (-[WebCoreBridge selectedAttributedString]): call the instance method attributedString
        (-[WebCoreBridge attributedStringFrom:startOffset:to:endOffset:]): call the instance method attributedString

WebKit:

Fixed:
<rdar://problem/3472403>: RTFD of copied text and images should use original image data not tiffs
<rdar://problem/3472435>: dragging local image file downloads it instead of copies it
<rdar://problem/3472450>: copied and dragged local image files are TIFF, not original image data

        Reviewed by john.

        * Misc.subproj/WebNSPasteboardExtras.h:
        * Misc.subproj/WebNSPasteboardExtras.m:
        (-[NSPasteboard _web_writeFileWrapperAsRTFDAttachment:]): new
        * Misc.subproj/WebNSViewExtras.h:
        * Misc.subproj/WebNSViewExtras.m:
        (-[NSView _web_dragImage:fileWrapper:rect:URL:title:event:]): take a file wrapper instead of data so [NSPasteboard _web_writeFileWrapperAsRTFDAttachment:] can be called
        * WebCoreSupport.subproj/WebBridge.m:
        (-[WebBridge fileWrapperForURL:]): call fileWrapperForURL on the WebView
        * WebView.subproj/WebDefaultContextMenuDelegate.m:
        (-[WebDefaultUIDelegate copyImageToClipboard:]): call [NSPasteboard _web_writeFileWrapperAsRTFDAttachment:]
        * WebView.subproj/WebHTMLView.m:
        (-[WebHTMLView _handleMouseDragged:]): when calling _web_dragImage, pass a file wrapper from fileWrapperForURL
        (-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]): call fileWrapperForURL
        * WebView.subproj/WebImageRepresentation.h:
        * WebView.subproj/WebImageRepresentation.m:
        (-[WebImageRepresentation fileWrapper]): new
        * WebView.subproj/WebImageView.m:
        (-[WebImageView writeImageToPasteboard:]): call [NSPasteboard _web_writeFileWrapperAsRTFDAttachment:]
        (-[WebImageView mouseDragged:]): pass the file wrapper to _web_dragImage
        * WebView.subproj/WebView.m:
        (-[WebView _fileWrapperForURL:]): new, returns a file wrapper from a local file or from the cache
        * WebView.subproj/WebViewPrivate.h:

WebBrowser:

Fixed:
<rdar://problem/3472437>: "Download Link to Disk..." should be "Save Link As..." if the link is local
<rdar://problem/3472439>: "Download Image to Disk..." should be "Save Image As..." if the image is local

        Reviewed by john.

        * BrowserDocument.h:
        * BrowserDocument.m:
        (-[BrowserDocument setFileWrapperToSave:MIMEType:]): new, when saving data, use a file wrapper so that we can save things other than data sources.
        (-[BrowserDocument setDataSourceToSave:]): now calls setFileWrapperToSave:MIMEType:
        (-[BrowserDocument isSavingPlainText]): checks the _savingMIMEType
        (-[BrowserDocument saveDocumentTo:]): calls setDataSourceToSave if there is no fileWrapperToSave
        (-[BrowserDocument document:didSave:contextInfo:]): calls setFileWrapperToSave:MIMEType:
        (-[BrowserDocument dataRepresentationOfType:]): returns the data of the wrapper
        (-[BrowserDocument displayName]): if saving, return the filename of the wrapper
        (-[BrowserDocument fileType]): use _savingMIMEType
        * ContextMenuHandler.m:
        (-[BrowserWebView webView:contextMenuItemsForElement:defaultMenuItems:]): provide "Save Image As..." and "Save Link As..." for local files
        (-[BrowserWebView saveFileWrapperForURLKey:menuItem:]): new
        (-[BrowserWebView saveImageAs:]): new
        (-[BrowserWebView saveLinkAs:]): new
        * English.lproj/Localizable.strings:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@5381 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
WebCore/ChangeLog-2005-08-23
WebCore/kwq/KWQKHTMLPart.h
WebCore/kwq/KWQKHTMLPart.mm
WebCore/kwq/WebCoreBridge.h
WebCore/kwq/WebCoreBridge.mm
WebKit/ChangeLog
WebKit/English.lproj/StringsNotToBeLocalized.txt
WebKit/Misc.subproj/WebNSPasteboardExtras.h
WebKit/Misc.subproj/WebNSPasteboardExtras.m
WebKit/Misc.subproj/WebNSViewExtras.h
WebKit/Misc.subproj/WebNSViewExtras.m
WebKit/WebCoreSupport.subproj/WebBridge.m
WebKit/WebView.subproj/WebDefaultContextMenuDelegate.m
WebKit/WebView.subproj/WebHTMLView.m
WebKit/WebView.subproj/WebImageRepresentation.h
WebKit/WebView.subproj/WebImageRepresentation.m
WebKit/WebView.subproj/WebImageView.m
WebKit/WebView.subproj/WebView.m
WebKit/WebView.subproj/WebViewPrivate.h