Data URL truncated at first octothorpe (#)

RESOLVED INVALID

Status

()

RESOLVED INVALID
4 years ago
a year ago

People

(Reporter: jhuffman, Unassigned)

Tracking

36 Branch
x86_64
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: DUPEME)

(Reporter)

Description

4 years ago
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.91 Safari/537.36
Firefox for Android

Steps to reproduce:

input the following into the url bar of FireFox.

data:image/svg+xml;utf8,<svg preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg" version="1.1" x="0" y="0" viewBox="0 0 45 315" enable-background="new 0 0 45 315" xml:space="preserve"><path fill-rule="evenodd" fill="#333333" clip-rule="evenodd" d="M0 0l45 158L0 315V0z"/></svg>


Actual results:

You will notice that it throws an "XML Parsing Error: unclosed token" exception even though it is a valid SVG. I have debugged the issue and it appears to be the hex fill color due to the hash tag. Users can use rgb or html supported text colors as a work around.


Expected results:

This exact image should render.

data:image/svg+xml;utf8,<svg preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg" version="1.1" x="0" y="0" viewBox="0 0 45 315" enable-background="new 0 0 45 315" xml:space="preserve"><path fill-rule="evenodd" fill="rgb(51,51,51)" clip-rule="evenodd" d="M0 0l45 158L0 315V0z"/></svg>
Component: Untriaged → Untriaged
Product: Firefox → Core
Summary: Throws "XML Parsing Error: unclosed token" when using a hash tag (#) in svgs → Data URL truncated at first octothorpe (#)
Whiteboard: DUPEME
Firefox is correct per the relevant specifications, # is the start of a URL fragment. A # character must be url escaped as %23 (as must various others).
Status: UNCONFIRMED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → INVALID
Moving from Core::Untriaged to Core::General https://bugzilla.mozilla.org/show_bug.cgi?id=1407598
Component: Untriaged → General
You need to log in before you can comment on or make changes to this bug.