[webkit-changes] [WebKit/WebKit] 55b3d1: Add experimental feature to control image animatio...

Tyler Wilcock noreply at github.com
Wed Sep 14 01:08:08 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 55b3d145b200da84bc53e06eb13832850e0579c0
      https://github.com/WebKit/WebKit/commit/55b3d145b200da84bc53e06eb13832850e0579c0
  Author: Tyler Wilcock <tyler_w at apple.com>
  Date:   2022-09-14 (Wed, 14 Sep 2022)

  Changed paths:
    A LayoutTests/fast/images/animations-resume-from-last-displayed-frame-expected.txt
    A LayoutTests/fast/images/animations-resume-from-last-displayed-frame.html
    A LayoutTests/fast/images/individual-animation-toggle-expected.txt
    A LayoutTests/fast/images/individual-animation-toggle.html
    A LayoutTests/fast/images/page-wide-animation-toggle-expected.txt
    A LayoutTests/fast/images/page-wide-animation-toggle.html
    A LayoutTests/fast/images/resources/animated-4-frames.gif
    A LayoutTests/fast/images/resources/animation.gif
    M Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml
    M Source/WebCore/html/HTMLImageElement.cpp
    M Source/WebCore/html/HTMLImageElement.h
    M Source/WebCore/loader/cache/CachedImage.cpp
    M Source/WebCore/loader/cache/CachedImage.h
    M Source/WebCore/loader/cache/CachedImageClient.h
    M Source/WebCore/page/FrameView.cpp
    M Source/WebCore/page/FrameView.h
    M Source/WebCore/page/Page.cpp
    M Source/WebCore/page/Page.h
    M Source/WebCore/page/SettingsBase.cpp
    M Source/WebCore/page/SettingsBase.h
    M Source/WebCore/platform/graphics/BitmapImage.cpp
    M Source/WebCore/platform/graphics/Image.h
    M Source/WebCore/platform/graphics/ImageObserver.h
    M Source/WebCore/rendering/RenderElement.cpp
    M Source/WebCore/rendering/RenderElement.h
    M Source/WebCore/rendering/RenderImage.cpp
    M Source/WebCore/rendering/RenderImage.h
    M Source/WebCore/rendering/RenderView.cpp
    M Source/WebCore/rendering/RenderView.h
    M Source/WebCore/testing/Internals.cpp
    M Source/WebCore/testing/Internals.h
    M Source/WebCore/testing/Internals.idl

  Log Message:
  -----------
  Add experimental feature to control image animation play/pause state
https://bugs.webkit.org/show_bug.cgi?id=244128
rdar://98887677

Reviewed by Said Abou-Hallawa.

This patch adds a new experimental feature that enables control of image
animation play / pause state. Animations can be paused or played
globally and individually.

Note these new controls are exposed only via Internals (for testing
purposes) with this patch. There will be follow-up patches to expose
these controls via user interface.

Patch authored by Josh Hoffman with slight modifications by me (Tyler
Wilcock).

* LayoutTests/fast/images/animations-resume-from-last-displayed-frame-expected.txt: Added.
* LayoutTests/fast/images/animations-resume-from-last-displayed-frame.html: Added.
* LayoutTests/fast/images/individual-animation-toggle-expected.txt: Added.
* LayoutTests/fast/images/individual-animation-toggle.html: Added.
* LayoutTests/fast/images/page-wide-animation-toggle-expected.txt: Added.
* LayoutTests/fast/images/page-wide-animation-toggle.html: Added.
* LayoutTests/fast/images/resources/animated-4-frames.gif: Added.
* LayoutTests/fast/images/resources/animation.gif: Added.
* Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml:
* Source/WebCore/html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::image const):
(WebCore::HTMLImageElement::allowsAnimation const):
(WebCore::HTMLImageElement::setAllowsAnimation):
(WebCore::HTMLImageElement::resetAllowsAnimation):
* Source/WebCore/html/HTMLImageElement.h:
* Source/WebCore/loader/cache/CachedImage.cpp:
(WebCore::CachedImage::CachedImageObserver::allowsAnimation const):
(WebCore::CachedImage::allowsAnimation const):
* Source/WebCore/loader/cache/CachedImage.h:
* Source/WebCore/loader/cache/CachedImageClient.h:
(WebCore::CachedImageClient::allowsAnimation const):
* Source/WebCore/page/FrameView.cpp:
(WebCore::FrameView::repaintVisibleImageAnimations):
(WebCore::FrameView::repaintVisibleImageAnimationsIncludingSubframes):
* Source/WebCore/page/FrameView.h:
* Source/WebCore/page/Page.cpp:
(WebCore::Page::setImageAnimationEnabled):
(WebCore::Page::repaintAnimatedImages):
* Source/WebCore/page/Page.h:
(WebCore::Page::imageAnimationEnabled const):
* Source/WebCore/page/SettingsBase.cpp:
(WebCore::SettingsBase::setImageAnimationControlEnabledChanged):
* Source/WebCore/page/SettingsBase.h:
* Source/WebCore/platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::shouldAnimate const):
Now also checks CachedImageObserver::allowsAnimation.
(WebCore::BitmapImage::canUseAsyncDecodingForLargeImages const):
(WebCore::BitmapImage::imageFrameAvailableAtIndex):
* Source/WebCore/platform/graphics/Image.h:
(WebCore::Image::allowsAnimation const):
(WebCore::Image::setAllowsAnimation):
* Source/WebCore/platform/graphics/ImageObserver.h:
(WebCore::ImageObserver::allowsAnimation const):
* Source/WebCore/rendering/RenderElement.cpp:
(WebCore::RenderElement::allowsAnimation const):
* Source/WebCore/rendering/RenderElement.h:
* Source/WebCore/rendering/RenderImage.cpp:
(WebCore::RenderImage::hasAnimatedImage const):
(WebCore::RenderImage::allowsAnimation const):
* Source/WebCore/rendering/RenderImage.h:
* Source/WebCore/rendering/RenderView.cpp:
(WebCore::RenderView::repaintImageAnimationsIfNeeded):
* Source/WebCore/rendering/RenderView.h:
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::setImageAnimationEnabled):
(WebCore::Internals::resumeImageAnimation):
(WebCore::Internals::pauseImageAnimation):
* Source/WebCore/testing/Internals.h:
* Source/WebCore/testing/Internals.idl:

Canonical link: https://commits.webkit.org/254469@main




More information about the webkit-changes mailing list