Rendering of a context-fill gradient in marker is inconsistent at varying zoom levels (devicePixelRatio values)
Categories
(Core :: SVG, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox141 | --- | fixed |
People
(Reporter: jfkthame, Assigned: jfkthame)
Details
Attachments
(2 files)
See attached testcase (which is based on an issue observed in svg/painting/reftests/paint-context-006.svg: that test would fail if run on a high-dpi screen, although it passes in CI at low-dpi).
The image shows a large rectangle filled with a red-blue gradient, and two smaller rectangles that partially overlap it. The two smaller rectangles actually belong to a marker associated with the path that draws the large rectangle. The upper one uses fill="context-fill", while the lower one uses fill="url(#lg)" (which is the same gradient reference as the main rectangle uses).
Note how zooming the image in/out affects the rendering of the gradient in the upper marker rect (the one specified as context-fill), whereas the lower one is unaffected.
When devicePixelRatio is 1.0 (i.e. at 50% zoom on a Retina screen; the corresponding zoom value will presumably vary depending on device resolution), the upper marker rect appears to blend seamlessly with the main rectangle: a single continuous gradient fills the two areas. But at other zoom levels, this breaks down and we see separate gradients in the two areas, with the one in the marker rect varying as the zoom changes.
In contrast, Chrome makes the context-fill marker's gradient merge with the main rectangle's gradient at all zoom levels.
| Assignee | ||
Comment 1•6 months ago
|
||
(Note that just viewing the bugzilla preview of the attachment does not exhibit the issue; open it as a standalone SVG in a new tab to see the behavior described.)
| Assignee | ||
Comment 2•6 months ago
|
||
This makes the context-fill gradient used in the marker match how it's painted
in the context, regardless of the zoom or other transforms present. (This also
matches the rendering I see in Chrome.)
Includes a test that fails without the patch.
Updated•6 months ago
|
Comment 5•6 months ago
|
||
| bugherder | ||
Updated•5 months ago
|
| Assignee | ||
Updated•5 months ago
|
Description
•