Open Bug 1918814 Opened 5 days ago Updated 4 days ago

SVG images with no intrinsic size or ratio should render with their host document's devicePixelRatio, so that they e.g. scale as-expected under full page zoom + HiDPI

Categories

(Core :: SVG, defect)

defect

Tracking

()

People

(Reporter: dholbert, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Attached file testcase 1

STR:

  1. Load attached testcase.
  2. Zoom in using full-page zoom. (Or: apply some non-default HiDPI scaling at the OS level, and compare Firefox to other browsers)

EXPECTED RESULTS:
The blue circle should scale up as you zoom in, and should remain the same size relative to its orange border.

ACTUAL RESULTS:
The blue circle (i.e. the SVG content) remains the same size and does not scale up.
(And/or: if you're testing by applying a HiDPI scale, the blue circle will look smaller in Firefox than in other browsers.)

I've got an analysis of what I think is happening over in bug 1878012 comment 5. I think we're rendering with a 1:1 device-pixel-to-CSS-pixel ratio inside of the SVG document, or something along those lines. We should probably pass the actual host document's devicePixelRatio down as part of the context that we give to SVG images, and use that when painting (as if the user had just done a full-page-zoom in the internal wrapped SVG document).

To my surprise, this works just fine for CSS 'background'. Here's an alternate testcase that uses 'background' and gives EXPECTED RESULTS in Firefox.

So maybe we've got some handling for this already and we just fail to use it properly with img somehow...

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: