New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 767775 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Oct 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows , Mac
Pri: 1
Type: Bug-Regression



Sign in to add a comment

Can't drag svg img out

Reported by yiye...@gmail.com, Sep 22 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36

Steps to reproduce the problem:
1. open the main.html file with chrome 61
2. drag the image to desktop

What is the expected behavior?
all the image can be dragged to desktop

What went wrong?
1.  first image(svg) can't drag to the desktop
2.  but in chrome 56 , svg image can be dragged to desktop

Did this work before? Yes 56

Does this work in other browsers? Yes

Chrome version: 61.0.3163.100  Channel: stable
OS Version: OS X 10.13.0
Flash Version:
 
main.html
1.0 KB View Download
 Issue 767777  has been merged into this issue.
Cc: ranjitkan@chromium.org
 Issue 767776  has been merged into this issue.
Components: Blink>DataTransfer
Labels: -Pri-2 M-63 Needs-Triage-M61 Pri-1
Owner: dcheng@chromium.org
Status: Assigned (was: Unconfirmed)
Able to reproduce the issue and is a regression broken in M58. Below are the bisect details for the same:

Bisect info:
============
58.0.3006.0 - Good Build
58.0.3007.0 - Bad Build

Using per revision bisect obtained the following results:

CHANGELOG URL: https://chromium.googlesource.com/chromium/src/+log/fb3db819dfcac399579102ecb93917c48d6769ce..3dd8561d357d05ba538137ed8736b8732e27c0d8

@ dcheng: Assigning to you, request you to please take a look into it.

Thanks.!

Labels: hasbisect-per-revision
Cc: shrike@chromium.org
Labels: Hotlist-HighSierra

Comment 6 by fre...@dimension.sg, Sep 27 2017

It works on Safari.

Comment 7 by dcheng@chromium.org, Sep 29 2017

Labels: OS-Windows
Seems to broken on Windows as well. Blah...

Comment 8 by dcheng@chromium.org, Oct 16 2017

It's because svg is not currently considered a well-known image MIME type...

https://cs.chromium.org/chromium/src/content/public/common/drop_data.cc?rcl=eb592fb15ca50171c3a3d45225405010cdb933b8&l=66

Comment 9 by dcheng@chromium.org, Oct 16 2017

Ah, slight correction: it's because image/svg+xml is considered a non-image MIME type (since it's XML) rather than an image MIME type by blink::IsSupportedImageMimeType...
Project Member

Comment 10 by bugdroid1@chromium.org, Oct 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c6765c28e1b241cadcae9d8d6ec90f88adb9d6ac

commit c6765c28e1b241cadcae9d8d6ec90f88adb9d6ac
Author: Daniel Cheng <dcheng@chromium.org>
Date: Tue Oct 17 07:55:36 2017

Use a prefix check to determine if a well-known MIME type is an image.

The original code used a different way to check that the extension is an
image extension (and not something else, like .exe), but this depended
on being able to directly access the blink::Image class. When the name
calculation was moved into the browser, blink::IsSupportedImageType was
used instead to ensure that a user doesn't drag out an image and get
something surprising like an executable instead.

However, it turns out that blink::IsSupportedImageType doesn't consider
SVG an image type--since it's actually an XML file. To get around this,
just simply check that the MIME type begins with image/. This is safe
enough, since the filename calculation only takes well-known MIME
types into consideration.

Bug:  767775 
Change-Id: I5c71d8ae2daa9a413beab9c3c1cb393760383323
Reviewed-on: https://chromium-review.googlesource.com/721615
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#509317}
[modify] https://crrev.com/c6765c28e1b241cadcae9d8d6ec90f88adb9d6ac/content/public/common/drop_data.cc
[add] https://crrev.com/c6765c28e1b241cadcae9d8d6ec90f88adb9d6ac/content/public/common/drop_data_unittest.cc
[modify] https://crrev.com/c6765c28e1b241cadcae9d8d6ec90f88adb9d6ac/content/test/BUILD.gn

Status: Fixed (was: Assigned)

Sign in to add a comment