Open Bug 1682912 Opened 4 years ago Updated 3 years ago

CSS fill color on SVG Path not rendered when parent CSS class change

Categories

(Core :: Graphics: WebRender, defect)

Firefox 83
defect

Tracking

()

Tracking Status
firefox-esr78 --- disabled
firefox84 --- wontfix
firefox85 --- wontfix
firefox86 --- wontfix
firefox87 --- wontfix

People

(Reporter: info, Unassigned, NeedInfo)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: correctness, regression)

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

Steps to reproduce:

I set a fill color (for example fill: red;) as a css class and apply in a SVG <path> element, inline in my html file.
This SVG element is hidden by default with the attribute opacity: 0 and position: absolute outside the document/page, and will appear when Javascript change the class.

Actual results:

When Javascript changes that css class for a different one that has for example fill: green;, that SVG <path> didn't change to the green color. Unless I do hover or click on it (looks that any action to that element refresh the view and then show the green color)

Expected results:

When the css class change, the SVG <path> should apply that fill: color attribute.

I discovered this bug working on my website.
Here a temporary url to test:
http://nyiforu.cluster028.hosting.ovh.net

To reproduce the bug, scroll to more than half of the page and an Arrow2Top will appear at the right bottom side.
Then change the websime theme (by default light) to grey or dark (smalls squares inside the header of the page), and back again to scroll down... the arrow appears with the old color.

OS: Unspecified → Windows 10
Hardware: Unspecified → x86_64

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → SVG
Product: Firefox → Core

Please can you attach a minimal testcase to the bug. Preferably something 10-20 lines long rather than a complete website.

Flags: needinfo?(info)

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

Please can you attach a minimal testcase to the bug. Preferably something 10-20 lines long rather than a complete website.

I just copy/paste the code necessary to interact with the same behavior (sorry for the messy css/js)

https://codepen.io/ipuntoj/pen/BaLRZeo

Feel free to contact if any help needed!

Flags: needinfo?(info)

I really don't know what I'm supposed to do or see here.

Scroll down, and you will see a circle with the scroll-progress and an arrow inside at the right bottom area.
Scroll up (back to the top) and change the theme color ( 3 mini squares at the right top )
Scroll down again, and you will see that the arrow keeps the old color even if the css class has a different fill: color;

I bisected that manually since there were a couple suspect commits. It seems like a WebRender regression?

$ g bisect good
cd0999f15aef8e3d2a644a59ecbbed9896bcf108 is the first bad commit
commit cd0999f15aef8e3d2a644a59ecbbed9896bcf108
Author: Jeff Muizelaar <jmuizelaar@mozilla.com>
Date:   Tue Sep 17 20:06:39 2019 +0000

    Bug 1581953. Don't invalidate everything when the visible rect changes.
    
    Differential Revision: https://phabricator.services.mozilla.com/D46218

 gfx/layers/wr/WebRenderCommandBuilder.cpp | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

The issue does indeed not reproduce with WebRender disabled.

Status: UNCONFIRMED → NEW
Component: SVG → Graphics: WebRender
Ever confirmed: true
Flags: needinfo?(jmuizelaar)
Keywords: regression
Regressed by: 1581953
Has Regression Range: --- → yes
Severity: -- → S3
Keywords: correctness
OS: Windows 10 → All
Hardware: x86_64 → All
Flags: needinfo?(jmuizelaar)
Flags: needinfo?(jmuizelaar)
You need to log in before you can comment on or make changes to this bug.