[Webkit-unassigned] [Bug 244128] Add experimental feature to disable Bitmap image animations

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Sep 9 10:06:28 PDT 2022


https://bugs.webkit.org/show_bug.cgi?id=244128

--- Comment #54 from Joshua Hoffman <jhoffman23 at apple.com> ---
(In reply to Said Abou-Hallawa from comment #53)

> > Source/WebCore/rendering/RenderView.cpp:884
> > +            element.repaint();
> 
> Should we check whether the background image is animated or not? Also I
> think we should "continue" if we repaint the element.

I totally agree that we should continue after repainting. In terms of checking the background images, which would be less expensive: repainting anything with a background image or iterating through all of the fill layers and asking each image if it is animated? The later was why I held off on checking isAnimated.


> > LayoutTests/fast/images/disable-animations-resuming-frame.html:22
> > +                debug("Image frame: " + imageFrame + " was displayed.");
> > +                image.removeEventListener("webkitImageFrameReady", listener, true);
> > +                resolve(frame + 1);
> 
> Can something like this work?
> 
> debug("Image frame: " + imageFrame + " was displayed.");
> image.removeEventListener("webkitImageFrameReady", listener, true);
> internals.pauseImageAnimation(image);
> setTimeout((image, imageFrame) => {
>     shouldBeTrue("internals.imageFrameIndex(image) == imageFrame");
>     internals.resumeImageAnimation(image);
>     resolve(frame + 1);
> }, 50, image, imageFrame);

I tried this out (with both the ImageAnimationEnabled setting and without), and I haven't got this logic working. `WebkitImageFrameReady` is firing after the the frame advances, so the internals.imageFrameIndex call inside the listener is always returning a frame one more than imageFrame.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220909/c73b490c/attachment.htm>


More information about the webkit-unassigned mailing list