[Webkit-unassigned] [Bug 38711] DragData::asURL() shouldn't do file validity checks

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat May 15 21:06:02 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=38711





--- Comment #15 from Daniel Cheng <dcheng at chromium.org>  2010-05-15 21:06:00 PST ---
(In reply to comment #13)
> (From update of attachment 55903 [details])
> Please also ask someone who is familiar with WebNSPasteboardExtras.mm to take a look.
> 

I've asked oliver at apple.com to take a look.

> LayoutTests/ChangeLog:3
>  +          DragData::asURL() shouldn't do file validity checks
> Since you also touch WebNSPasteboardExtras.mm, could you please update the bug title and all ChangeLog to describe the problem in generic way?
> 

I updated the ChangeLogs to try to phrase the issue more clearly.

> LayoutTests/editing/pasteboard/file-input-files-access.html: 
>  +  <script src="../../fast/js/resources/js-test-post.js"></script>
> Why do we need to remove this?
> 

This is removed. Since the final drop test triggers a navigation, nothing executes after that. That's why the usual post-test script is manually embedded in onbeforeunload.

> LayoutTests/editing/pasteboard/script-tests/file-input-files-access.js:112
>  +      // It'd be easiest to use try-finally, but it doesn't work.
> This comment is somewhat confusing. Can you explain?
> 

I removed the comment, but originally, I was hoping that I could do:
try {
  // something that triggers navigation
} finally {
  // verify test results
}

But finally blocks do not execute if the UA is navigating away from the page.

> LayoutTests/editing/pasteboard/script-tests/file-input-files-access.js:115
>  +          // file input here.
> Don't need to fold into 2 lines.
> 

Fixed.

> WebKit/mac/Misc/WebNSPasteboardExtras.mm:150
>  +                  isDirectory)
> Don't need to fold into 2 lines.
> 

Fixed.

> WebKit/mac/ChangeLog:11
>  +          handling, since the Mac loader doesn't work correctly with them. 
> I think there is a risk condition here. If the directory does not exist at first, [NSPasteboard _web_bestURL] will return a file URL. Then the directory is created.

The original code has race conditions too. Maybe the file exists but is deleted before the loader processes it, or maybe something is initially a file and then gets deleted and a directory with the same name is created. There's no real easy way to solve this without changing the loader, and I am not comfortable changing the Mac loader.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list