Closed Bug 1129095 Opened 9 years ago Closed 5 months ago

SVG fill="url() colour" fallback fails with no page styles enabled

Categories

(Core :: SVG, defect)

37 Branch
x86_64
Linux
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: beta, Unassigned)

References

Details

Attachments

(1 file)

Attached image soundcloud.svg
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:37.0) Gecko/20100101 Firefox/37.0
Build ID: 20150128004009

Steps to reproduce:

Made an SVG that uses a gradient for a fill, referenced it with a url(#bg) and then disabled page styles. The gradient disappears and the object is left in a black state.
I expect at this point the url() is invalid, yet it doesn’t use the fallback colour following the url()



Expected results:

The image is using fill="url(#bg) #ff5500", looking through the SVG spec http://www.w3.org/TR/SVG/painting.html#SpecifyingPaint suggests if url(#bg) is not valid, it should use the paint method following the url().

However, if I put fill="url(#missing) #ff5500" it both works in page styles enabled and disabled states. So url(#bg) is not invalid, yet it isn’t being used…
Component: Untriaged → SVG
Product: Firefox → Core
Depends on: 607441
Severity: normal → S3

You've defined the colours in the linear gradient via a style rather than an attribute. Since styles are ignored your stop colours are all black. So the gradient is applied. If you define the stop colours as attributes, the gradient will work even with page styles disabled.

e.g. <stop offset="0" stop-color="#ff8800"/>

Status: UNCONFIRMED → RESOLVED
Closed: 5 months ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: