Closed
Bug 1245461
Opened 10 years ago
Closed 10 years ago
Inline-SVG having an hexadecimal color fails to "load"
Categories
(Firefox :: Untriaged, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: neovov, Unassigned)
Details
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.97 Safari/537.36
Steps to reproduce:
1. Set a background-image with an inline SVG, for example: background-image: url("data:image/svg+xml;charset=UTF-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 13 7'><path fill='#FF0000' d='M0 0h13L6.5 7 0 0z'/></svg>");
2. Using rgb, rgba() or a named color works
3. Loading the data-URI in a tab show a parsing problem with the hash mark
Some tests on Codepen : http://codepen.io/anon/pen/pgZMKj
Actual results:
The image doesn't work, firebug says the image could not be loaded
Expected results:
The image should be displayed :)
Comment 1•10 years ago
|
||
# is a reserved character for the start of a fragment identifier. The url is invalid and firefox should not and does not display it for that reason. You must URL encode your data if you want it to work.
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → INVALID
Updated•10 years ago
|
Status: RESOLVED → VERIFIED
Comment 2•10 years ago
|
||
Reopening because I think this is a compatibility issue since Safari and Chrome both display this fine.
Status: VERIFIED → REOPENED
Ever confirmed: true
Resolution: INVALID → ---
Comment 3•10 years ago
|
||
Chrome and Firefox are aware of their bug, their URL parsing is severely broken, feel free to talk to bzbarsky if you want more information.
The specification is clear and we implement it. https://tools.ietf.org/html/rfc3986#section-3.5
Status: REOPENED → RESOLVED
Closed: 10 years ago → 10 years ago
Resolution: --- → INVALID
Comment 4•10 years ago
|
||
Thanks.
So the workaround is to replace #F00 by %23F00.
Comment 5•10 years ago
|
||
yes, but it's not so much a workaround as the right thing to do. Still works in Chrome and Safari.
Thanks for the clarifications.
I should have thought about URL encoding.
You need to log in
before you can comment on or make changes to this bug.
Description
•