Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 3b9b086f63576bf9d807ab74bbad3a9e29d614d7
      
https://github.com/WebKit/WebKit/commit/3b9b086f63576bf9d807ab74bbad3a9e29d614d7
  Author: Taher Ali <[email protected]>
  Date:   2026-09-10 (Thu, 10 Sep 2026)

  Changed paths:
    A LayoutTests/svg/animations/css-animated-svg-image-animating-expected.txt
    A LayoutTests/svg/animations/css-animated-svg-image-animating.html
    A LayoutTests/svg/animations/resources/cssAnimation.svg
    A LayoutTests/svg/animations/resources/noAnimation.svg
    A LayoutTests/svg/animations/static-svg-image-not-animating-expected.txt
    A LayoutTests/svg/animations/static-svg-image-not-animating.html
    M Source/WebCore/svg/SVGDocumentExtensions.cpp
    M Source/WebCore/svg/SVGDocumentExtensions.h
    M Source/WebCore/svg/SVGSVGElement.cpp
    M Source/WebCore/svg/SVGSVGElement.h
    M Source/WebCore/svg/animation/SMILTimeContainer.cpp
    M Source/WebCore/svg/animation/SMILTimeContainer.h
    M Source/WebCore/svg/graphics/SVGImage.cpp

  Log Message:
  -----------
  SVGImage::isAnimating() returns true for SVG images that have no animations
https://bugs.webkit.org/show_bug.cgi?id=323866
rdar://187106396

Reviewed by Simon Fraser.

isAnimating() only checked whether the SMIL timeline had begun and was not
paused, which is true for every SVG document once it finishes loading.
SVG in <img> or a CSS url() reported that it was animating. Additionally,
an SVG image ignored CSS animations.

This PR checks that the SVG image document actually has SMIL animations
and that they are running. It also accounts for CSS animations in the image 
document.

Test: svg/animations/static-svg-image-not-animating.html

* LayoutTests/svg/animations/resources/noAnimation.svg: Added.
* LayoutTests/svg/animations/static-svg-image-not-animating-expected.txt: Added.
* LayoutTests/svg/animations/static-svg-image-not-animating.html: Added.

* Source/WebCore/svg/SVGDocumentExtensions.cpp:
(WebCore::SVGDocumentExtensions::hasActiveSMILAnimations const):
* Source/WebCore/svg/SVGDocumentExtensions.h:

We query SVGDocumentExtensions rather than root element, since SVGSMILElement 
binds to
the nearest ancestor <svg>, so SMIL inside a nested <svg> is not reachable from
the outermost element's container

* Source/WebCore/svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::hasActiveAnimation const): Deleted.

Has no remaining callers so it's safe to remove

* Source/WebCore/svg/SVGSVGElement.h:
* Source/WebCore/svg/animation/SMILTimeContainer.cpp:
(WebCore::SMILTimeContainer::hasAnimations const):
* Source/WebCore/svg/animation/SMILTimeContainer.h:
* Source/WebCore/svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::isAnimating const):
* LayoutTests/svg/animations/css-animated-svg-image-animating-expected.txt: 
Added.
* LayoutTests/svg/animations/css-animated-svg-image-animating.html: Added.
* LayoutTests/svg/animations/resources/cssAnimation.svg: Added.

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to