Using <feColorMatrix> to increase contrast of alpha channel for svgs shows as transparent in <img> tag (regression)
Categories
(Core :: Graphics: WebRender, defect, P3)
Tracking
()
People
(Reporter: cmbartschat, Unassigned)
References
(Blocks 2 open bugs)
Details
Attachments
(4 files)
User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0
Steps to reproduce:
Create a file called heart.svg with the following contents:
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
<defs>
<filter id='contrastAlpha'>
<feColorMatrix in="SourceGraphic"
type="matrix"
values="1 0 0 0 0
0 1 0 0 0
0 0 1 0 0
0 0 0 1000 -500" />
</filter>
</defs>
<g filter="url(#contrastAlpha)">
<path d="M 1 8 l 6.9 6.9 l 0.2 0 l 6.9 -6.9 l 0 -3 l -2 -2 l -3 0 l -2 2 l -2 -2 l -3 0 l -2 2 z" stroke="#000" stroke-width="2" fill="none"></path>
</g>
</svg>
When viewed directly, the svg displays correctly. However, when loaded in an <img> tag like:
<img src="heart.svg" style="outline: 2px solid red">
The image does not show up, only displaying the outline.
I'm on Windows 7, Firefox 79.0b3 (64-bit)
I used the mozregression gui (fantastic) which narrowed it down to:
Bug 1636482 - Allow WebRender on all versions of Windows. r=aosmond
Previously we were blocking older Windows and only allowing on Windows
10. This switches us to relying on the blocking to prevent WebRender
from riding the trains on Win7/8.
Differential Revision: https://phabricator.services.mozilla.com/D74409
Actual results:
Nothing is displayed, as if the image is completely transparent.
Expected results:
There should have been a heart icon with a black stroke and no fill displayed, with only fully black and fully transparent pixels (no antialiasing) as a result of the color matrix.
Reporter | ||
Comment 1•4 years ago
|
||
The filter appears to work correctly with values up to "508 -254" in the place of "1000 -500", with "509 -254.5" being partially broken, and "510 -255" being fully broken.
Comment 2•4 years ago
|
||
Bugbug thinks this bug should belong to this component, but please revert this change in case of error.
Reporter | ||
Comment 3•4 years ago
|
||
Reporter | ||
Comment 4•4 years ago
|
||
Comment 5•4 years ago
|
||
Using the svg from comment 0 either on it's own or inside an img, we used to display both, but in 2013 we stopped displaying both in this range
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=6ecf0c4dfcbe&tochange=3c44c1f43a67
Bug 924102 and Bug 924103 seem like good candidates for this.
With webrender we used to display blank for both the svg and inside an img tag, but with this fix range we started drawing the svg (but not inside an img tag):
Reporter | ||
Comment 6•4 years ago
|
||
I'm confused, are you saying that this svg wouldn't have been visible since 2013? It was completely fine for me up until yesterday in Firefox Developer Edition, and still displays correctly in the main version of Firefox.
Comment 7•4 years ago
|
||
I'm reporting what I saw on my system, it's seems like your system sees different results.
Reporter | ||
Comment 8•4 years ago
|
||
Ok, I understand. Please let me know if I can provide any additional information.
Updated•4 years ago
|
Comment 9•4 years ago
|
||
Can either of you reproduce this on Win7?
Comment 10•4 years ago
|
||
Can you please attach the contents of your about:support as a text file?
Updated•4 years ago
|
Reporter | ||
Comment 11•4 years ago
|
||
Comment 12•4 years ago
|
||
(In reply to Jessie [:jbonisteel] pls NI from comment #9)
Can either of you reproduce this on Win7?
I saw the problem on win7 and on win10 with WebRender.
Comment 13•4 years ago
•
|
||
I tried mozregression with the following command on my Win10 PC. But it did not work around regression range.
./mach mozregression --good 2018-03-01 --bad 2018-04-01 --pref gfx.webrender.all:true
I got the following range. The range is a bit wide because of the problem.
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=2667f0b010c959940d7a12b4311d54a6abd74ac5&tochange=8cced2a46f73238da13e41bcae8f6f801419bb7a
Comment 14•4 years ago
|
||
I was also able to reproduce this issue on Windows 7 as well in Beta 79.0b6 and our Nightly build 80.0a1 (2020-07-10) when WebRender is enabled.
Comment 15•4 years ago
|
||
Hey Nical - any thoughts on what could cause this issue?
Updated•4 years ago
|
Comment 16•4 years ago
|
||
@Nical: Ping
Comment 17•4 years ago
|
||
Not actively looking at this, removing from our release metas.
Updated•9 months ago
|
Updated•8 months ago
|
Description
•