Bug 58842

Summary: Dropping a file in a WKView (WebKit2) doesn't load the file
Product: WebKit Reporter: Enrica Casucci <enrica>
Component: WebKit2Assignee: Enrica Casucci <enrica>
Status: RESOLVED FIXED    
Severity: Normal CC: jeffm
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Windows 7   
Attachments:
Description Flags
Patch mjs: review+

Enrica Casucci
Reported 2011-04-18 15:30:16 PDT
Dragging a local .html into the current page doesn't show a "+" green circle nor does it allow dragging and dropping the site. This does work however when dragged and dropped to the toolbar. Repro steps: 1. Launch Safari on Windows 2. Drag and drop a local .html file into into current page. --Result: Local .html file is not displayed. Blue '+ Copy' displayed when hovering local .html file over current page instead of expected green '+'. --Note: Drag and drop of local .html files into bookmarks toolbar functions as expected. <rdar://problem/8514409>
Attachments
Patch (1.75 KB, patch)
2011-04-18 15:39 PDT, Enrica Casucci
mjs: review+
Enrica Casucci
Comment 1 2011-04-18 15:39:50 PDT
Jeff Miller
Comment 2 2011-04-18 15:49:49 PDT
Comment on attachment 90104 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=90104&action=review > Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp:447 > + RetainPtr<CFStringRef> pathAsCFString(AdoptCF, CFStringCreateWithCharacters(kCFAllocatorDefault, (const UniChar *)stringData.charactersWithNullTermination(), wcslen(stringData.charactersWithNullTermination()))); Can't you just do: RetainPtr<CFStringRef> pathAsCFString(AdoptCF, stringData.createCFString());
Jeff Miller
Comment 3 2011-04-18 15:56:33 PDT
(In reply to comment #2) > (From update of attachment 90104 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=90104&action=review > > > Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp:447 > > + RetainPtr<CFStringRef> pathAsCFString(AdoptCF, CFStringCreateWithCharacters(kCFAllocatorDefault, (const UniChar *)stringData.charactersWithNullTermination(), wcslen(stringData.charactersWithNullTermination()))); > > Can't you just do: RetainPtr<CFStringRef> pathAsCFString(AdoptCF, stringData.createCFString()); Ignore that comment, I see that the problem you're addressing is that there is an extra null at the end, and createCFString() is using String::length(), which would be wrong.
Maciej Stachowiak
Comment 4 2011-04-18 15:57:02 PDT
Comment on attachment 90104 [details] Patch r=me but please consider Jeff's suggestion when landing.
Enrica Casucci
Comment 5 2011-04-18 16:06:46 PDT
In his last comment, Jeff told me to ignore his previous comment. In fact what I'm removing is the use of String.length() to get rid of the extra 0 at the end. Thanks for the review.
Enrica Casucci
Comment 6 2011-04-18 16:09:44 PDT
Note You need to log in before you can comment on or make changes to this bug.