[webkit-reviews] review denied: [Bug 24887] Wrong filename when dragging an image to the Desktop. : [Attachment 29114] Image drag and drop file name on Windows

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Mar 31 09:34:52 PDT 2009


Dimitri Glazkov (Google) <dglazkov at chromium.org> has denied Marc-André Decoste
<mad at chromium.org>'s request for review:
Bug 24887: Wrong filename when dragging an image to the Desktop.
https://bugs.webkit.org/show_bug.cgi?id=24887

Attachment 29114:  Image drag and drop file name on Windows
https://bugs.webkit.org/attachment.cgi?id=29114&action=review

------- Additional Comments from Dimitri Glazkov (Google)
<dglazkov at chromium.org>
Per ap comments on #webkit, suggestedFilename() should take precedence over
actual filename, because it uses the filename value from Content-Disposition
header. Also spacing nits.

> +    if (imageURL.isEmpty() == false) {
> +	 fileName =
KURL(element->document()->completeURL(parseURL(imageURL))).lastPathComponent();


4 spaces

> +    } else {
> +	 fileName = element->getAttribute(altAttr);
> +	 if (fileName.isEmpty())

4 spaces.

> +    if (extension_index != -1) {
> +	 extension = fileName.substring(extension_index + 1);
> +	 fileName.truncate(extension_index);

4 spaces.

> +    } else {    
> +	 extension = MIMETypeRegistry::getPreferredExtensionForMIMEType(
>	   cachedImage->response().mimeType());

4 spaces.

> +    if (fileName.isEmpty())
> +	 return 0;

4 spaces.

> +    String extension;
> +    if (extension_index != -1) {
> +	 extension = fileName.substring(extension_index);
> +	 fileName.truncate(extension_index);

4 spaces.

> +    } else {
> +	 extension = image->image()->filenameExtension();
> +	 if (extension.isEmpty()) {

4 spaces.

> +	     return 0;
> +	 }
> +	 extension.insert(".", 0);

4 spaces.

> +    if (imageURL.isEmpty() == false) {
> +	 fileName =
KURL(element->document()->completeURL(parseURL(imageURL))).lastPathComponent();


Ditto.

> +    } else {
> +	 fileName = element->getAttribute(altAttr);
> +	 if (fileName.isEmpty())

Ditto.

> +    HGLOBAL imageFileDescriptor =
createGlobalImageFileDescriptor(url.string(), fileName, cachedImage);
>      if (!imageFileDescriptor)
>	   return;

Ditto.


More information about the webkit-reviews mailing list