SVG fill: currentColor is incorrect if parent is an a:visited element

RESOLVED FIXED in Firefox 65



5 months ago
5 months ago


(Reporter: marius, Assigned: heycam)



63 Branch
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(firefox-esr60 unaffected, firefox63 wontfix, firefox64 wontfix, firefox65+ fixed, firefox66+ fixed)



(2 attachments)



5 months ago
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.0 Chrome/69.0.3497.128 Safari/537.36

Steps to reproduce:

When using an svg element inside a link element with the css property of fill: currentColor, the color is not actually respected if the link has been visited.

For a test case please see the attached file.

Once the link gets clicked, the color should change to follow the color of the link text.

Actual results:

Even if the link is visited the svg fill color is kept to the base color of an <a/> element.

Expected results:

The svg fill color should change if the link has been visited to the color of a:visited css rule.


5 months ago
Component: Untriaged → SVG
Ever confirmed: true
Keywords: regression
Product: Firefox → Core

Comment 1

5 months ago
[Tracking Requested - why for this release]:

Regression window:

Regressed by:Bug 1467622

Your bunch of patch seems to cause the regression. Can you please look into this?
Blocks: 1467622
Flags: needinfo?(dglastonbury)
OS: Unspecified → All


5 months ago
Component: SVG → CSS Parsing and Computation


5 months ago
Flags: needinfo?(cam)
I'm busy on WebRender, so I've asked :heycam if he has spare cycles to look into the issue for me.
Assignee: nobody → cam
Flags: needinfo?(xidorn+moz)
Thanks, heycam!
Flags: needinfo?(xidorn+moz)

Comment 7

5 months ago
Pushed by
Resolve currentcolor in fill and stroke against visited-dependent color r=xidorn
It might be nice to also have a test that unvisited links use the unvisited color.

Comment 9

5 months ago
Last Resolved: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
Please nominate this for Beta approval when you get a chance.
Flags: needinfo?(cam)
Flags: in-testsuite+

Comment 11

5 months ago
Comment on attachment 9031777 [details]
Bug 1512597 - Resolve currentcolor in fill and stroke against visited-dependent color

[Beta/Release Uplift Approval Request]

Feature/Bug causing the regression: Bug 1467622

User impact if declined: Incorrect styling in certain SVG documents using :visited styles

Is this code covered by automated tests?: Yes

Has the fix been verified in Nightly?: Yes

Needs manual test from QE?: No

If yes, steps to reproduce: 

List of other uplifts needed: None

Risk to taking this patch: Low

Why is the change risky/not risky? (and alternatives if risky): Very small change, with tests.

String changes made/needed:
Flags: needinfo?(cam)
Attachment #9031777 - Flags: approval-mozilla-beta?
Comment on attachment 9031777 [details]
Bug 1512597 - Resolve currentcolor in fill and stroke against visited-dependent color

[Triage Comment]
Fixes incorrect styling in certain SVG documents using :visited styles. Approved for 65.0b8.
Attachment #9031777 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.