Closed Bug 1114526 Opened 10 years ago Closed 9 years ago

moz-elements are not updated with APNG changes, when the original element is not in the viewport

Categories

(Core :: Layout: Images, Video, and HTML Frames, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla42
Tracking Status
firefox42 --- fixed

People

(Reporter: apastor, Assigned: tnikkel)

Details

Attachments

(2 files)

Not sure if this is a valid issue, or is in this way by design, but I noticed that the searching signal icon (which is an APNG) doesn't get animated on the statusbar moz-element. Only when repainting the statusbar (because of a color change, battery change, etc).
Vivien, what do you think? Should a moz-element that includes a APNG get updated on every png change?
Flags: needinfo?(21)
Flags: needinfo?(21)
Product: Firefox OS → Core
Version: unspecified → Trunk
Component: General → Layout: Images
Attached file Test case
Note that this only happens when the original APNG is not in the the screen anymore.
Attachment #8625858 - Attachment mime type: text/plain → text/html
Summary: moz-elements are not updated with APNG changes → moz-elements are not updated with APNG changes, when the original element is not in the viewport
So I think it probably makes sense not animating PNG or GIF (I tested, and the behavior is the same) when they are not in the screen.

Robert I've been told that you are the right person to answer this :) Is there any way to force png/gif to keep animating even if they are not in the viewport? Can we somehow keep anymating if we detect that there are observers (mozelements) pointing to that element?

Thanks!
Flags: needinfo?(roc)
From code reading I think the bug is that ImageLoader::DoRedraw uses FrameLayerBuilder::IterateRetainedDataFor to redraw after an animated image changes frames. If the image is not visible this is a no-op. But we still need to call nsSVGEffects::InvalidateDirectRenderingObservers even if the frame has no retained data and is not visible. I'll write a patch soon.
Attached patch patchSplinter Review
Presumably it should be easy to write a reftest for this. I'll do that next.
Assignee: nobody → tnikkel
Attachment #8626296 - Flags: review?(matt.woodrow)
Attachment #8626296 - Flags: review?(matt.woodrow) → review+
Works like a charm! Thanks! :)
Keywords: checkin-needed
Flags: in-testsuite?
Flags: in-testsuite? → in-testsuite+
https://hg.mozilla.org/mozilla-central/rev/af896e5448e6
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
Product: Core → Core Graveyard
Product: Core Graveyard → Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: