Closed Bug 1673741 Opened 4 years ago Closed 6 months ago

data:image/svg+xml does not work on img

Categories

(Core :: Graphics: Canvas2D, defect, P3)

Firefox 82
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: blaine, Unassigned)

References

Details

(4 keywords)

Attachments

(1 file)

Attached file demo.html

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36

Steps to reproduce:

attached is a demonstration of the error that happens only on Firefox. The canvas cannot render the svg+xml data.

Actual results:

the error in the console:

The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol.
I also just updated to 82 and the 2nd image has half the width... not sure whats going on there.

Expected results:

The CANVAS image should get rendered exactly like the SVG and IMAGE. This works on other browsers (i.e., IE, Chrome, etc.)

Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0
20201027095021

Status: UNCONFIRMED → NEW
Has STR: --- → yes
Component: Untriaged → Canvas: 2D
Ever confirmed: true
Product: Firefox → Core

Thanks for confirming this. Also, while in the midst of fixing this, if there is a workaround, it would be much appreciated. thanks!

The severity field is not set for this bug.
:lsalzman, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(lsalzman)
Severity: -- → S3
Flags: needinfo?(lsalzman)
Priority: -- → P3

This works for me on Nightly.

Bisection:
Bug 700533 - Use a fallback size for canvas drawImage if the given image has no intrinsic size (e.g. certain SVG images). r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D182488

Status: NEW → RESOLVED
Closed: 6 months ago
Depends on: 700533
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: