Open Bug 1535822 Opened 6 years ago Updated 2 years ago

SVG fragments not working on mask-image CSS

Categories

(Core :: SVG, defect, P3)

65 Branch
defect

Tracking

()

People

(Reporter: alexios, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: parity-edge)

Attachments

(6 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0

Steps to reproduce:

I create an HTML element with width and height and then applied
background: url("../images/icons/combined.svg#arrow") no-repeat center center;
The above works correctly

I then used background: #90A4AE;mask-image: url("../images/icons/arrow.svg"); in order to change the icon's color
This worked as well

When I tried to combine multiple icons in one SVG, I used background: #90A4AE;mask-image: url("../images/icons/combined.svg#arrow");
This does not produce the icon with a changed color, rather it stays white (the background). I should not that when I move my mouse over the image in the inspector window (CSS panel), it displays the image correctly. I have also tested the URL directly in the browser, it works fine.

Actual results:

The background works correctly, SVG with single icon works correctly, but when I apply the SVG with multiple icons, no icons appear. If I remove the fragment, the first icon is showing normally

Expected results:

I should have seen the arrow icon in my third example

Please can you attach some tescases to the bug rather than just providing descriptions of testcases.

Attached image Single icon in SVG
Attached file Test case
Comment on attachment 9051542 [details] Test case I cannot reproduce the error online because of CORS, output is Content Security Policy: Ignoring “'unsafe-inline'” within script-src or style-src: nonce-source or hash-source specified Content Security Policy: This site (https://bug1535822.bmoattachments.org) has a Report-Only policy without a report URI. CSP will not block and cannot report violations of this policy. Content Security Policy: The page’s settings observed the loading of a resource at https://bugzilla.mozilla.org/attachment.cgi?id=9051541 (“img-src”). A CSP report is being sent. Content Security Policy: The page’s settings observed the loading of a resource at https://bugzilla.mozilla.org/attachment.cgi?id=9051540#arrow (“img-src”). A CSP report is being sent. Content Security Policy: The page’s settings observed the loading of a resource at https://bugzilla.mozilla.org/attachment.cgi?id=9051541 (“img-src”). A CSP report is being sent. Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://bugzilla.mozilla.org/attachment.cgi?id=9051540#arrow. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).[Learn More] Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://bugzilla.mozilla.org/attachment.cgi?id=9051541. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).[Learn More] Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://bugzilla.mozilla.org/attachment.cgi?id=9051540#arrow. (Reason: CORS request did not succeed).[Learn More] Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://bugzilla.mozilla.org/attachment.cgi?id=9051541. (Reason: CORS request did not succeed).[Learn More] Content Security Policy: The page’s settings observed the loading of a resource at https://bugzilla.mozilla.org/attachment.cgi?id=9051541 (“img-src”). A CSP report is being sent.

(In reply to Robert Longson [:longsonr] from comment #1)

Please can you attach some tescases to the bug rather than just providing descriptions of testcases.

I tried to create a webpage that shows the error. Unfortunately, I get CORS errors online. If you save the files on your computer and change paths of mask-image to the local SVGs, you can observe that the single icon as mask is displayed correctly but the multi icon is not.

Blocks: mask-image
Status: UNCONFIRMED → NEW
Has STR: --- → yes
Component: Untriaged → Layout
Ever confirmed: true
Product: Firefox → Core
Keywords: parity-edge

This looks a lot like bug 1486252, which landed with tests. Has this regressed?

Hmm, somehow the test-case works for me if I have webrender enabled, but not without... So it's likely an SVG / graphics issue.

Component: Layout → SVG
See Also: → 1486252

I see the same. Alice's test doesn't work for me in non-webrender before or after bug 1486252 landing either.

Priority: -- → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: