Closed Bug 1846910 Opened 2 years ago Closed 1 year ago

Animated GIF with static SVG filter applied only animates briefly before stopping

Categories

(Core :: Graphics: WebRender, defect)

Firefox 115
defect

Tracking

()

VERIFIED FIXED
129 Branch
Tracking Status
firefox-esr102 --- wontfix
firefox-esr115 --- wontfix
firefox116 --- wontfix
firefox117 --- wontfix
firefox118 --- wontfix
firefox127 --- wontfix
firefox128 --- wontfix
firefox129 --- verified

People

(Reporter: simontang, Unassigned)

References

(Depends on 1 open bug, Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/115.0

Steps to reproduce:

Check the attached HTML file for an example reproduction of the issue.

  1. Place an animated GIF in an HTML document with <img src="..." style="filter: url(#my-filter")
  2. Include an inline SVG in the same document with a filter that contains feMergeNode or feDisplacementMap
  3. View the page

Note that to reproduce this bug, an SVG filter must be used, not a basic filter such as style="blur(10px)". Also note that this bug affects only some filter primitives, such as feMergeNode, but not some others such as feGaussianBlur or feDropShadow.

If the filter itself contains animation (i.e. <animate attributeName="y" ...>) then the animated GIF will be animated normally.

Actual results:

The animated GIF stops being re-rendered after about a second and remains on whichever frame was shown at the time that the rendering stopped.

When the user does something like dragging mouse selection to trigger a re-render, then the GIF will animate for under a second and then "freeze" again.

Expected results:

The animated GIF should have been animating continuously.

This is similar to https://bugzilla.mozilla.org/show_bug.cgi?id=1242256.

The Bugbug bot thinks this bug should belong to the 'Core::SVG' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → SVG
Product: Firefox → Core

Confirmed.
The animation occurs if you continuously click inside the page.

Regression range: https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=4cc4cb51f18d94cca1121abc491032b2053be3eb&tochange=1bbf4362b266645db009c5895b8dd5a41ebb09a9

Suspects: bug 1548056

Tentatively marking dependency on bug 1409486

Status: UNCONFIRMED → NEW
Component: SVG → Graphics: WebRender
Depends on: wr-svg-filter-perf
Ever confirmed: true
Keywords: regression
Regressed by: 1548056
See Also: → 1813318

Set release status flags based on info from the regressing bug 1548056

When we get the notification for the new frame of the animated image we end up here

https://searchfox.org/mozilla-central/rev/da1e39f50ef43145623938141c970437b226da9e/layout/generic/nsImageFrame.cpp#1217

and try to handle the invalidation by going through the webrender user data. For regular webrender content this will update the image key and send the new image that way. For image inside blobs we'll hit this

https://searchfox.org/mozilla-central/rev/da1e39f50ef43145623938141c970437b226da9e/gfx/layers/wr/WebRenderUserData.cpp#61

and just set the invalid bit on the user data. That bit is only checked in one place

https://searchfox.org/mozilla-central/rev/da1e39f50ef43145623938141c970437b226da9e/gfx/layers/wr/WebRenderCommandBuilder.cpp#2522

However that is only called on the root item that generates the blob, so if the image is nested deeper in the display list under that item we won't ever check that bit.

It should be sufficient to check here if the fallback data is invalid

https://searchfox.org/mozilla-central/rev/da1e39f50ef43145623938141c970437b226da9e/gfx/layers/wr/WebRenderCommandBuilder.cpp#2347

but we have to be careful to clear that bit.

The severity field is not set for this bug.
:gw, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(gwatson)
Severity: -- → S3
Flags: needinfo?(gwatson)

This is fixed.
Bisection:

2024-06-27T18:47:22.622000: DEBUG : Found commit message:
Bug 1896503 - Implement FilterInstance code to send SVG filter graph to WebRender r=mstange,gw

Differential Revision: https://phabricator.services.mozilla.com/D174208

Status: NEW → RESOLVED
Closed: 1 year ago
Depends on: 1896503
Resolution: --- → FIXED
Target Milestone: --- → 129 Branch

I've replicated this issue using Nightly 128.0a1 on Windows 10 x64 following the STR from Comment 0.
Although the issue no longer persists in the latest Nightly 130.0a1, it can still be reproduced in Firefox 129.0b8.
@ahale, could you please confirm if this should also be addressed in Firefox 129.0b8 ?

Flags: needinfo?(ahale)

The code that fixed this is currently only preffed on on nightly builds. So it is expected that beta builds aren't fixed yet.

Thank you for confirming.
Verified as fixed in Nightly 129.0a1 and 130.0a1 versions on Windows 10 x64, macOS 11, and Ubuntu 22.04, as the issue no longer occurs.

Status: RESOLVED → VERIFIED
Flags: needinfo?(ahale)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: