Reviewed by Maciej.
- test for http://bugs.webkit.org/show_bug.cgi?id=10725
Image data in from RTFD clipboard data thrown away
* editing/pasteboard/paste-RTFD-expected.checksum: Added.
* editing/pasteboard/paste-RTFD-expected.png: Added.
* editing/pasteboard/paste-RTFD-expected.txt: Added.
* editing/pasteboard/paste-RTFD.html: Added.
* editing/pasteboard/paste-TIFF-expected.checksum: Added.
* editing/pasteboard/paste-TIFF-expected.png: Added.
* editing/pasteboard/paste-TIFF-expected.txt: Added.
* editing/pasteboard/paste-TIFF.html: Added.
* editing/resources/RTFD-pasteboard-data.dat: Added.
* editing/resources/TIFF-pasteboard-data.dat: Added.
WebCore:
Reviewed by Maciej.
Part of fix for http://bugs.webkit.org/show_bug.cgi?id=10725
Image data in from RTFD clipboard data thrown away
ResourceHandles no longer need to be able to defer loading as that is
now handled by the ResourceLoader.
* loader/MainResourceLoader.cpp:
(WebCore::MainResourceLoader::loadNow): updated to remove defersLoading argument.
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::releaseResources): release the deferred request.
(WebCore::ResourceLoader::load): defer creating the ResourceHandle instead of
asking the ResourceHandle to defer loading.
(WebCore::ResourceLoader::setDefersLoading): create the ResourceHandle if we have deferred creating it.
* loader/ResourceLoader.h:
* platform/network/ResourceHandle.cpp: ResourceHandle's don't need to know about deferLoading.
(WebCore::ResourceHandle::ResourceHandle):
(WebCore::ResourceHandle::create):
* platform/network/ResourceHandle.h: ditto.
* platform/network/ResourceHandleInternal.h: ditto.
(WebCore::ResourceHandleInternal::ResourceHandleInternal):
* platform/network/mac/ResourceHandleMac.mm: ditto.
(WebCore::ResourceHandle::start):
WebKit:
Reviewed by Maciej.
Part of fix for http://bugs.webkit.org/show_bug.cgi?id=10725
Image data in from RTFD clipboard data thrown away
The URLs for images in RTFD data must not be loaded until the resources
have been added to the WebUnarchivingState. This can't happen until
after the RTFD data has been parsed, so we must delay loading while this
RTFD data is being parsed to a document fragment.
* WebView/WebHTMLView.mm:
(uniqueURLWithRelativePart):
(-[WebHTMLView _documentFragmentFromPasteboard:inContext:allowPlainText:chosePlainText:]): defer loading the resources while RTFD data is being parsed.
(+[NSURL _web_uniqueWebDataURL]): Added this back because AppKit uses it.
* WebView/WebUnarchivingState.m:
(-[WebUnarchivingState archivedResourceForURL:]): orkaround for workaround for rdar://problem/
4699166 so that other people can use archivedResourceForURL: too.
WebKitTools:
Reviewed by Maciej.
Enables layout test for: http://bugs.webkit.org/show_bug.cgi?id=10725
Image data in from RTFD clipboard data thrown away
- This method is needed because NSArray's ar bridged to JS Array's,
which in turn are bridged back to WebScriptObject's when passed from
JS to ObjC. Hence it is not possbile to pass an NSArray from JS.
* DumpRenderTree/DumpRenderTree.m:
(-[DumpRenderTreePasteboard declareType:owner:]): Added a convenience method for JS.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@19244
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-01-29 Graham Dennis <graham.dennis@gmail.com>
+
+ Reviewed by Maciej.
+
+ - test for http://bugs.webkit.org/show_bug.cgi?id=10725
+ Image data in from RTFD clipboard data thrown away
+
+ * editing/pasteboard/paste-RTFD-expected.checksum: Added.
+ * editing/pasteboard/paste-RTFD-expected.png: Added.
+ * editing/pasteboard/paste-RTFD-expected.txt: Added.
+ * editing/pasteboard/paste-RTFD.html: Added.
+ * editing/pasteboard/paste-TIFF-expected.checksum: Added.
+ * editing/pasteboard/paste-TIFF-expected.png: Added.
+ * editing/pasteboard/paste-TIFF-expected.txt: Added.
+ * editing/pasteboard/paste-TIFF.html: Added.
+ * editing/resources/RTFD-pasteboard-data.dat: Added.
+ * editing/resources/TIFF-pasteboard-data.dat: Added.
+
2007-01-29 Justin Garcia <justin.garcia@apple.com>
Reviewed by harrison
--- /dev/null
+1a19af1ed3bdc0e1b11382b229301784
\ No newline at end of file
--- /dev/null
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 3 of DIV > BODY > HTML > #document
+EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 0 of P > DIV > DIV > BODY > HTML > #document to 0 of P > DIV > DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x584
+ RenderBlock {DIV} at (0,0) size 784x260 [border: (2px solid #FF0000)]
+ RenderBlock {DIV} at (14,14) size 756x0
+ RenderBlock {DIV} at (14,14) size 756x28
+ RenderBR {BR} at (0,0) size 0x28
+ RenderBlock {DIV} at (14,42) size 756x204
+ RenderBlock {P} at (0,0) size 756x14
+ RenderBR {BR} at (0,0) size 0x14
+ RenderBlock {P} at (0,14) size 756x14
+ RenderText {#text} at (0,0) size 86x14
+ text run at (0,0) width 86: "this is some text"
+ RenderBlock {P} at (0,28) size 756x14
+ RenderBR {BR} at (0,0) size 0x14
+ RenderBlock {P} at (0,42) size 756x120
+ RenderImage {IMG} at (0,0) size 180x120
+ RenderBlock {P} at (0,162) size 756x14
+ RenderBR {BR} at (0,0) size 0x14
+ RenderBlock {P} at (0,176) size 756x14
+ RenderText {#text} at (0,0) size 117x14
+ text run at (0,0) width 117: "this is some more text"
+ RenderBlock {P} at (0,190) size 756x14
+ RenderBR {BR} at (0,0) size 0x14
+ RenderBlock (anonymous) at (0,204) size 756x0
+ RenderBlock {DIV} at (0,260) size 784x0
+caret: position 0 of child 0 {BR} of child 12 {P} of child 4 {DIV} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
--- /dev/null
+<html>
+<head>
+<style>
+.editing {
+ border: 2px solid red;
+ padding: 12px;
+ font-size: 24px;
+}
+</style>
+<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
+<script>
+
+function print(message) {
+ var paragraph = document.createElement('p');
+ paragraph.appendChild(document.createTextNode(message));
+ document.getElementById('console').appendChild(paragraph);
+}
+
+function editingTest() {
+ if (!window.objCPlugin)
+ return print('FAIL - no objCPlugin');
+
+ objCPlugin.removeBridgeRestrictions_(window);
+ if (!window.objc)
+ return print('FAIL - no window.objc');
+
+ // get the data for the pasteboard
+ var myURL = document.URL;
+ var resourceURL = myURL.replace('pasteboard/paste-RTFD.html','resources/RTFD-pasteboard-data.dat');
+ var data = objc('NSData').dataWithContentsOfURL_(objc('NSURL').URLWithString_(resourceURL));
+
+ // This actually returns DumpRenderTree's local pasteboard
+ var pasteboard = objc('NSPasteboard').generalPasteboard();
+ var pasteboardType = 'NeXT RTFD pasteboard type';
+
+ pasteboard.declareType_owner_(pasteboardType, 0);
+ pasteboard.setData_forType_(data, pasteboardType);
+
+ pasteCommand();
+
+
+}
+</script>
+
+<title>RTFD paste test</title>
+</head>
+<body>
+<div contentEditable="true" id="root" class="editing">
+<div id="test"> </div>
+</div>
+<div id='console'/>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
\ No newline at end of file
--- /dev/null
+28119df9c2edf952117a5b89bbf20575
\ No newline at end of file
--- /dev/null
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 3 of DIV > BODY > HTML > #document
+EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document givenAction:WebViewInsertActionPasted
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of DIV > BODY > HTML > #document to 0 of DIV > BODY > HTML > #document toDOMRange:range from 1 of DIV > BODY > HTML > #document to 1 of DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+ RenderBody {BODY} at (8,8) size 784x584
+ RenderBlock {DIV} at (0,0) size 784x125 [border: (2px solid #FF0000)]
+ RenderBlock (anonymous) at (14,14) size 756x97
+ RenderImage {IMG} at (0,0) size 593x97
+ RenderBlock {DIV} at (14,111) size 756x0
+ RenderBlock {DIV} at (0,125) size 784x0
+caret: position 1 of child 0 {IMG} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
--- /dev/null
+<html>
+<head>
+<style>
+.editing {
+ border: 2px solid red;
+ padding: 12px;
+ font-size: 24px;
+}
+</style>
+<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
+<script>
+
+function print(message) {
+ var paragraph = document.createElement('p');
+ paragraph.appendChild(document.createTextNode(message));
+ document.getElementById('console').appendChild(paragraph);
+}
+
+function editingTest() {
+ if (!window.objCPlugin)
+ return print('FAIL - no objCPlugin');
+
+ objCPlugin.removeBridgeRestrictions_(window);
+ if (!window.objc)
+ return print('FAIL - no window.objc');
+
+ // get the data for the pasteboard
+ var myURL = document.URL;
+ var resourceURL = myURL.replace('pasteboard/paste-TIFF.html','resources/TIFF-pasteboard-data.dat');
+ var data = objc('NSData').dataWithContentsOfURL_(objc('NSURL').URLWithString_(resourceURL));
+
+ // This actually returns DumpRenderTree's local pasteboard
+ var pasteboard = objc('NSPasteboard').generalPasteboard();
+ var pasteboardType = 'NeXT TIFF v4.0 pasteboard type';
+
+ pasteboard.declareType_owner_(pasteboardType, 0);
+ pasteboard.setData_forType_(data, pasteboardType);
+
+ pasteCommand();
+
+
+}
+</script>
+
+<title>Image (TIFF) paste test</title>
+</head>
+<body>
+<div contentEditable="true" id="root" class="editing">
+<div id="test"> </div>
+</div>
+<div id='console'/>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
\ No newline at end of file
+2007-01-30 Graham Dennis <graham.dennis@gmail.com>
+
+ Reviewed by Maciej.
+
+ Part of fix for http://bugs.webkit.org/show_bug.cgi?id=10725
+ Image data in from RTFD clipboard data thrown away
+
+ ResourceHandles no longer need to be able to defer loading as that is
+ now handled by the ResourceLoader.
+
+ * loader/MainResourceLoader.cpp:
+ (WebCore::MainResourceLoader::loadNow): updated to remove defersLoading argument.
+ * loader/ResourceLoader.cpp:
+ (WebCore::ResourceLoader::releaseResources): release the deferred request.
+ (WebCore::ResourceLoader::load): defer creating the ResourceHandle instead of
+ asking the ResourceHandle to defer loading.
+ (WebCore::ResourceLoader::setDefersLoading): create the ResourceHandle if we have deferred creating it.
+ * loader/ResourceLoader.h:
+ * platform/network/ResourceHandle.cpp: ResourceHandle's don't need to know about deferLoading.
+ (WebCore::ResourceHandle::ResourceHandle):
+ (WebCore::ResourceHandle::create):
+ * platform/network/ResourceHandle.h: ditto.
+ * platform/network/ResourceHandleInternal.h: ditto.
+ (WebCore::ResourceHandleInternal::ResourceHandleInternal):
+ * platform/network/mac/ResourceHandleMac.mm: ditto.
+ (WebCore::ResourceHandle::start):
+
2007-01-29 Brady Eidson <beidson@apple.com>
Reviewed by Alice
else if (shouldLoadEmpty || frameLoader()->representationExistsForURLScheme(url.protocol()))
handleEmptyLoad(url, !shouldLoadEmpty);
else
- m_handle = ResourceHandle::create(r, this, m_frame.get(), false, true);
+ m_handle = ResourceHandle::create(r, this, m_frame.get(), true);
return false;
}
/*
* Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
+ * (C) 2007 Graham Dennis (graham.dennis@gmail.com)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
#endif
m_handle = 0;
m_resourceData = 0;
+ m_deferredRequest = 0;
}
bool ResourceLoader::load(const ResourceRequest& r)
{
ASSERT(!m_handle);
+ ASSERT(m_deferrerdRequest.isNull());
ASSERT(!frameLoader()->isArchiveLoadPending(this));
m_originalURL = r.url();
if (frameLoader()->willUseArchive(this, clientRequest, m_originalURL))
return true;
- m_handle = ResourceHandle::create(clientRequest, this, m_frame.get(), m_defersLoading);
+ if (m_defersLoading) {
+ m_deferredRequest = clientRequest;
+ return true;
+ }
+
+ m_handle = ResourceHandle::create(clientRequest, this, m_frame.get());
return true;
}
void ResourceLoader::setDefersLoading(bool defers)
{
m_defersLoading = defers;
- if (m_handle)
- m_handle->setDefersLoading(defers);
+ if (!defers && !m_deferredRequest.isNull()) {
+ ResourceRequest request(m_deferredRequest);
+ m_deferredRequest = 0;
+ load(request);
+ }
}
FrameLoader* ResourceLoader::frameLoader() const
KURL m_originalURL;
RefPtr<SharedBuffer> m_resourceData;
bool m_defersLoading;
+ ResourceRequest m_deferredRequest;
};
}
namespace WebCore {
-ResourceHandle::ResourceHandle(const ResourceRequest& request, ResourceHandleClient* client, bool defersLoading, bool mightDownloadFromHandle)
- : d(new ResourceHandleInternal(this, request, client, defersLoading, mightDownloadFromHandle))
+ResourceHandle::ResourceHandle(const ResourceRequest& request, ResourceHandleClient* client, bool mightDownloadFromHandle)
+ : d(new ResourceHandleInternal(this, request, client, mightDownloadFromHandle))
{
}
-PassRefPtr<ResourceHandle> ResourceHandle::create(const ResourceRequest& request, ResourceHandleClient* client, Frame* frame, bool defersLoading, bool mightDownloadFromHandle)
+PassRefPtr<ResourceHandle> ResourceHandle::create(const ResourceRequest& request, ResourceHandleClient* client, Frame* frame, bool mightDownloadFromHandle)
{
- RefPtr<ResourceHandle> newLoader(new ResourceHandle(request, client, defersLoading, mightDownloadFromHandle));
+ RefPtr<ResourceHandle> newLoader(new ResourceHandle(request, client, mightDownloadFromHandle));
if (newLoader->start(frame))
return newLoader.release();
class ResourceHandle : public Shared<ResourceHandle> {
private:
- ResourceHandle(const ResourceRequest&, ResourceHandleClient*, bool defersLoading, bool mightDownloadFromHandle);
+ ResourceHandle(const ResourceRequest&, ResourceHandleClient*, bool mightDownloadFromHandle);
public:
// FIXME: should not need the Frame
- static PassRefPtr<ResourceHandle> create(const ResourceRequest&, ResourceHandleClient*, Frame*, bool defersLoading, bool mightDownloadFromHandle = false);
+ static PassRefPtr<ResourceHandle> create(const ResourceRequest&, ResourceHandleClient*, Frame*, bool mightDownloadFromHandle = false);
static void loadResourceSynchronously(const ResourceRequest&, ResourceError&, ResourceResponse&, Vector<char>& data);
static bool willLoadFromCache(ResourceRequest&);
void cancel();
ResourceHandleClient* client() const;
- void setDefersLoading(bool);
const HTTPHeaderMap& requestHeaders() const;
const KURL& url() const;
class ResourceHandleInternal : Noncopyable {
public:
- ResourceHandleInternal(ResourceHandle* loader, const ResourceRequest& request, ResourceHandleClient* c, bool defersLoading, bool mightDownloadFromHandle)
+ ResourceHandleInternal(ResourceHandle* loader, const ResourceRequest& request, ResourceHandleClient* c, bool mightDownloadFromHandle)
: m_client(c)
, m_request(request)
, status(0)
- , m_defersLoading(defersLoading)
, m_mightDownloadFromHandle(mightDownloadFromHandle)
#if USE(CFNETWORK)
, m_connection(0)
int status;
- bool m_defersLoading;
bool m_mightDownloadFromHandle;
#if USE(CFNETWORK)
RetainPtr<CFURLConnectionRef> m_connection;
#endif
d->m_connection = connection;
[connection release];
- if (d->m_defersLoading)
- wkSetNSURLConnectionDefersCallbacks(d->m_connection.get(), YES);
if (d->m_connection)
return true;
[d->m_connection.get() cancel];
}
-void ResourceHandle::setDefersLoading(bool defers)
-{
- d->m_defersLoading = defers;
- wkSetNSURLConnectionDefersCallbacks(d->m_connection.get(), defers);
-}
-
WebCoreResourceHandleAsDelegate *ResourceHandle::delegate()
{
if (!d->m_delegate) {
+2007-01-30 Graham Dennis <graham.dennis@gmail.com>
+
+ Reviewed by Maciej.
+
+ Part of fix for http://bugs.webkit.org/show_bug.cgi?id=10725
+ Image data in from RTFD clipboard data thrown away
+
+ The URLs for images in RTFD data must not be loaded until the resources
+ have been added to the WebUnarchivingState. This can't happen until
+ after the RTFD data has been parsed, so we must delay loading while this
+ RTFD data is being parsed to a document fragment.
+
+ * WebView/WebHTMLView.mm:
+ (uniqueURLWithRelativePart):
+ (-[WebHTMLView _documentFragmentFromPasteboard:inContext:allowPlainText:chosePlainText:]): defer loading the resources while RTFD data is being parsed.
+ (+[NSURL _web_uniqueWebDataURL]): Added this back because AppKit uses it.
+ * WebView/WebUnarchivingState.m:
+ (-[WebUnarchivingState archivedResourceForURL:]): orkaround for workaround for rdar://problem/4699166 so that other people can use archivedResourceForURL: too.
+
2007-01-29 Jim Correia <jim.correia@pobox.com>
Reviewed by Mark.
(-[WebView undoManager]):
* WebView/WebViewPrivate.h:
+>>>>>>> .r19243
2007-01-29 Ada Chan <adachan@apple.com>
Reviewed by Brady.
/*
* Copyright (C) 2005, 2006, 2007 Apple Inc. All rights reserved.
- * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
+ * (C) 2006, 2007 Graham Dennis (graham.dennis@gmail.com)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
extern "C" {
+// Fake URL scheme.
+static NSString *WebDataProtocolScheme = @"webkit-fake-url";
+
// need to declare this because AppKit does not make it available as API or SPI
extern NSString *NSMarkedClauseSegmentAttributeName;
extern NSString *NSTextInputReplacementRangeAttributeName;
CFUUIDRef UUIDRef = CFUUIDCreate(kCFAllocatorDefault);
NSString *UUIDString = (NSString *)CFUUIDCreateString(kCFAllocatorDefault, UUIDRef);
CFRelease(UUIDRef);
- NSURL *URL = [NSURL URLWithString:[NSString stringWithFormat:@"-webkit-fake-url://%@/%@", UUIDString, relativePart]];
+ NSURL *URL = [NSURL URLWithString:[NSString stringWithFormat:@"%@://%@/%@", WebDataProtocolScheme, UUIDString, relativePart]];
CFRelease(UUIDString);
return URL;
[[self class] _excludedElementsForAttributedStringConversion], NSExcludedElementsDocumentAttribute,
self, @"WebResourceHandler", nil];
NSArray *subresources;
+
+ BOOL wasDeferringCallbacks = [[self _webView] defersCallbacks];
+ if (!wasDeferringCallbacks)
+ [[self _webView] setDefersCallbacks:YES];
+
DOMDocumentFragment *fragment = [string _documentFromRange:NSMakeRange(0, [string length])
document:[[self _frame] DOMDocument]
documentAttributes:documentAttributes
subresources:&subresources];
+
+ NSEnumerator *e = [subresources objectEnumerator];
+ WebResource *r;
+ while ((r = [e nextObject])) {
+ [[self _dataSource] addSubresource:r];
+ }
+
+ if (!wasDeferringCallbacks)
+ [[self _webView] setDefersCallbacks:NO];
+
[documentAttributes release];
[string release];
return fragment;
}
@end
+
+// This is used by AppKit and is included here so that WebDataProtocolScheme is only defined once.
+@implementation NSURL (WebDataURL)
+
++ (NSURL *)_web_uniqueWebDataURL
+{
+ CFUUIDRef UUIDRef = CFUUIDCreate(kCFAllocatorDefault);
+ NSString *UUIDString = (NSString *)CFUUIDCreateString(kCFAllocatorDefault, UUIDRef);
+ CFRelease(UUIDRef);
+ NSURL *URL = [NSURL URLWithString:[NSString stringWithFormat:@"%@://%@", WebDataProtocolScheme, UUIDString]];
+ CFRelease(UUIDString);
+ return URL;
+}
+
+@end
/*
* Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
+ * (C) 2007 Graham Dennis (graham.dennis@gmail.com)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
- (WebResource *)archivedResourceForURL:(NSURL *)URL
{
// FIXME: <rdar://problem/4699166> REGRESSION: Background images in Mail stationery do not load
- // This should be [URL _web_originalDataAsString]
- return [archivedResources objectForKey:URL];
+ // This should be just return [URL _web_originalDataAsString]
+ WebResource *resource = [archivedResources objectForKey:URL];
+ if (!resource)
+ resource = [archivedResources objectForKey:[URL _web_originalDataAsString]];
+ return resource;
}
- (WebArchive *)popSubframeArchiveWithFrameName:(NSString *)frameName
+2007-01-29 Graham Dennis <graham.dennis@gmail.com>
+
+ Reviewed by Maciej.
+
+ Enables layout test for: http://bugs.webkit.org/show_bug.cgi?id=10725
+ Image data in from RTFD clipboard data thrown away
+
+ - This method is needed because NSArray's ar bridged to JS Array's,
+ which in turn are bridged back to WebScriptObject's when passed from
+ JS to ObjC. Hence it is not possbile to pass an NSArray from JS.
+
+ * DumpRenderTree/DumpRenderTree.m:
+ (-[DumpRenderTreePasteboard declareType:owner:]): Added a convenience method for JS.
+
2007-01-25 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
/*
* Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved.
+ * (C) 2007 Graham Dennis (graham.dennis@gmail.com)
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@end
@interface DumpRenderTreePasteboard : NSPasteboard
+- (int)declareType:(NSString *)type owner:(id)newOwner;
@end
@interface DumpRenderTreeEvent : NSEvent
return pasteboard;
}
+// Convenience method for JS so that it doesn't have to try and create a NSArray on the objc side instead
+// of the usual WebScriptObject that is passed around
+- (int)declareType:(NSString *)type owner:(id)newOwner
+{
+ return [self declareTypes:[NSArray arrayWithObject:type] owner:newOwner];
+}
+
@end
@implementation LocalPasteboard