Commit 4eee8692 authored by oliver's avatar oliver

2007-03-16 Oliver Hunt <oliver@apple.com>

        Reviewed by Hyatt.
WebCore:
        The old canSaveAsWebArchive call was necessary as stand alone
        images used to be rendered by ImageDocument.

        Fixes rdar://problem/5061252

        * dom/Clipboard.cpp:
        * dom/Clipboard.h:
        (WebCore::Clipboard::setDragHasStarted):
        * page/DragClient.h:
        (WebCore::DragClient::declareAndWriteDragImage):
        * platform/mac/ClipboardMac.mm:
        (WebCore::ClipboardMac::declareAndWriteDragImage):
WebKit:
        * WebCoreSupport/WebDragClient.h:
        * WebCoreSupport/WebDragClient.mm:
        (WebDragClient::declareAndWriteDragImage):
        * WebKit.xcodeproj/project.pbxproj:
LayoutTests:
        Updating layout test to allow stand alone image to be
        dragged into a content editable div

        * fast/events/standalone-image-drag-to-editable-expected.checksum:
        * fast/events/standalone-image-drag-to-editable-expected.png:
        * fast/events/standalone-image-drag-to-editable-expected.txt:
        * fast/events/standalone-image-drag-to-editable.html:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20258 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 7a0b2361
2007-03-16 Oliver Hunt <oliver@apple.com>
Reviewed by Hyatt.
Updating layout test to allow stand alone image to be
dragged into a content editable div
* fast/events/standalone-image-drag-to-editable-expected.checksum:
* fast/events/standalone-image-drag-to-editable-expected.png:
* fast/events/standalone-image-drag-to-editable-expected.txt:
* fast/events/standalone-image-drag-to-editable.html:
2007-03-16 Brady Eidson <beidson@apple.com>
Reviewed by Braveheart
cc3eba118e35da125ce57556bd6b2357
\ No newline at end of file
4a57cb19311dff5dd8d33d89d165cc9b
\ No newline at end of file
......@@ -14,9 +14,9 @@ layer at (0,0) size 800x600
text run at (1,1) width 689: "This layout test is checks that we don't crash when a stand alone image is dragged into a content editable div. "
RenderBR {BR} at (690,15) size 0x0
RenderInline {A} at (0,0) size 149x18 [color=#0000EE]
RenderText {#text} at (1,19) size 149x18
text run at (1,19) width 149: "rdar://problem/5021127"
RenderText {#text} at (0,0) size 0x0
RenderText {#text} at (1,30) size 149x18
text run at (1,30) width 149: "rdar://problem/5021127"
RenderImage {IMG} at (150,19) size 25x25
RenderFrame {FRAME} at (0,104) size 800x100
layer at (0,0) size 798x96
RenderView at (0,0) size 798x96
......
......@@ -8,7 +8,7 @@
eventSender.mouseMoveTo(20, 120);
eventSender.mouseDown();
eventSender.leapForward(500);
eventSender.mouseMoveTo(20, 30);
eventSender.mouseMoveTo(20, 50);
eventSender.mouseUp();
window.layoutTestController.notifyDone();
}
......
2007-03-16 Oliver Hunt <oliver@apple.com>
Reviewed by Hyatt.
The old canSaveAsWebArchive call was necessary as stand alone
images used to be rendered by ImageDocument.
Fixes rdar://problem/5061252
* dom/Clipboard.cpp:
* dom/Clipboard.h:
(WebCore::Clipboard::setDragHasStarted):
* page/DragClient.h:
(WebCore::DragClient::declareAndWriteDragImage):
* platform/mac/ClipboardMac.mm:
(WebCore::ClipboardMac::declareAndWriteDragImage):
2007-03-16 Anders Carlsson <acarlsson@apple.com>
Reviewed by Maciej.
......
......@@ -42,16 +42,6 @@ Clipboard::Clipboard(ClipboardAccessPolicy policy, bool isForDragging)
{
}
bool Clipboard::canSaveAsWebArchive(Frame* frame)
{
ASSERT(frame);
String mimeType = frame->loader()->responseMIMEType();
return !(DOMImplementation::isTextMIMEType(mimeType) ||
Image::supportsType(mimeType) ||
PlugInInfoStore::supportsMIMEType(mimeType));
}
void Clipboard::setAccessPolicy(ClipboardAccessPolicy policy)
{
// once you go numb, can never go back
......
......@@ -89,7 +89,6 @@ namespace WebCore {
void setDestinationOperation(DragOperation);
void setDragHasStarted() { m_dragStarted = true; }
static bool canSaveAsWebArchive(Frame*);
protected:
ClipboardAccessPolicy policy() const { return m_policy; }
......
......@@ -69,7 +69,7 @@ namespace WebCore {
//Mac specific helper functions to allow access to functionality in webkit -- such as
//web archives and NSPasteboard extras
//not abstract as that would require another #if PLATFORM(MAC) for the SVGImage client empty impl
virtual void declareAndWriteDragImage(NSPasteboard*, DOMElement*, NSURL*, NSString*, Frame*, bool canSaveAsWebArchive) {};
virtual void declareAndWriteDragImage(NSPasteboard*, DOMElement*, NSURL*, NSString*, Frame*) {};
#endif
virtual ~DragClient() {};
......
......@@ -332,7 +332,7 @@ void ClipboardMac::declareAndWriteDragImage(Element* element, const KURL& url, c
{
ASSERT(frame);
if (Page* page = frame->page())
page->dragController()->client()->declareAndWriteDragImage(m_pasteboard.get(), [DOMElement _wrapElement:element], url.getNSURL(), title, frame, Clipboard::canSaveAsWebArchive(frame));
page->dragController()->client()->declareAndWriteDragImage(m_pasteboard.get(), [DOMElement _wrapElement:element], url.getNSURL(), title, frame);
}
DragImageRef ClipboardMac::createDragImage(IntPoint& loc) const
......
2007-03-16 Oliver Hunt <oliver@apple.com>
Reviewed by Hyatt.
The old canSaveAsWebArchive call was necessary as stand alone
images used to be rendered by ImageDocument.
Fixes rdar://problem/5061252
* WebCoreSupport/WebDragClient.h:
* WebCoreSupport/WebDragClient.mm:
(WebDragClient::declareAndWriteDragImage):
* WebKit.xcodeproj/project.pbxproj:
2007-03-15 Brady Eidson <beidson@apple.com>
Reviewed by Maciej
......
......@@ -37,7 +37,7 @@ public:
virtual WebCore::DragSourceAction dragSourceActionMaskForPoint(const WebCore::IntPoint& windowPoint);
virtual void startDrag(WebCore::DragImageRef dragImage, const WebCore::IntPoint& dragPos, const WebCore::IntPoint& eventPos, WebCore::Clipboard*, WebCore::Frame*, bool linkDrag);
virtual WebCore::DragImageRef createDragImageForLink(WebCore::KURL& url, const WebCore::String& label, WebCore::Frame*);
virtual void declareAndWriteDragImage(NSPasteboard*, DOMElement*, NSURL*, NSString*, WebCore::Frame*, bool canSaveAsWebArchive);
virtual void declareAndWriteDragImage(NSPasteboard*, DOMElement*, NSURL*, NSString*, WebCore::Frame*);
private:
WebView* m_webView;
};
......@@ -118,21 +118,13 @@ DragImageRef WebDragClient::createDragImageForLink(KURL& url, const String& titl
}
void WebDragClient::declareAndWriteDragImage(NSPasteboard* pasteboard, DOMElement* element, NSURL* URL, NSString* title, WebCore::Frame* frame, bool canSaveAsWebArchive)
void WebDragClient::declareAndWriteDragImage(NSPasteboard* pasteboard, DOMElement* element, NSURL* URL, NSString* title, WebCore::Frame* frame)
{
ASSERT(pasteboard);
ASSERT(element);
id source = (WebHTMLView*)[[kit(frame) frameView] documentView];
WebArchive *archive = [element webArchive];
WebArchive *archive;
// If the image element comes from an ImageDocument, we don't want to
// create a web archive from the image element.
if (canSaveAsWebArchive)
archive = [element webArchive];
else
archive = [WebArchiver archiveMainResourceForFrame:kit(frame)];
ASSERT(archive);
[pasteboard _web_declareAndWriteDragImageForElement:element URL:URL title:title archive:archive source:source];
}
......
......@@ -1296,7 +1296,6 @@
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 149C283208902B0F008A9EFC /* Build configuration list for PBXProject "WebKit" */;
compatibilityVersion = "Xcode 2.4";
hasScannedForEncodings = 1;
knownRegions = (
English,
......@@ -1311,7 +1310,6 @@
productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
projectDirPath = "";
projectRoot = "";
shouldCheckCompatibility = 1;
targets = (
9398100A0824BF01008DF038 /* WebKit */,
);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment