[webkit-reviews] review granted: [Bug 244128] Add experimental feature to control image animation play/pause state : [Attachment 462256] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Sep 12 11:16:13 PDT 2022

Said Abou-Hallawa <sabouhallawa at apple.com> has granted Tyler Wilcock
<tyler_w at apple.com>'s request for review:
Bug 244128: Add experimental feature to control image animation play/pause

Attachment 462256: Patch


--- Comment #58 from Said Abou-Hallawa <sabouhallawa at apple.com> ---
Comment on attachment 462256
  --> https://bugs.webkit.org/attachment.cgi?id=462256

View in context: https://bugs.webkit.org/attachment.cgi?id=462256&action=review

> Source/WebCore/platform/graphics/BitmapImage.cpp:387
> +    return !shouldAnimate() && m_source->canUseAsyncDecoding() &&
!(frameCount() > 1);

I do not think this change is needed for this patch. Also I think it is okay to
treat "non-animating animated" images like static images. So I think we should
return true for images which are (frameCount() == 1 || !shouldAnimate()). And
this is equivalent to !canAnimate().

> Source/WebCore/platform/graphics/BitmapImage.cpp:640
> +    if (imageObserver() && !imageObserver()->allowsAnimation(*this))
> +	   return;

Why do we have this early return? We do a few bookkeeping and callbacks after
this new if-statement. I do not see why disallowing the animation make us skip
all this code.

More information about the webkit-reviews mailing list