Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d6e2e670e84753c4fd93a700868105d80be12567
      
https://github.com/WebKit/WebKit/commit/d6e2e670e84753c4fd93a700868105d80be12567
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-08-31 (Mon, 31 Aug 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/svg/animations/smil-detach-releases-animated-presentation-attribute-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/svg/animations/smil-detach-releases-animated-presentation-attribute.html
    M Source/WebCore/svg/properties/SVGAttributeAnimator.cpp

  Log Message:
  -----------
  SMIL animation of a presentation attribute is never released when the element 
is detached mid-animation
https://bugs.webkit.org/show_bug.cgi?id=322922
rdar://185452156

Reviewed by Simon Fraser.

This patch aligns WebKit with Gecko / Firefox and Blink / Chromium.

A SMIL <animate> on a presentation attribute (e.g. fill) applies its value
through the element's animated SMIL style block, which the cascade injects at
inline-style priority and thus outranks the attribute (the base value). That
value is released only by SVGAttributeAnimator::removeAnimatedStyleProperty(),
via the animator's stop() during teardown.

That method early-returned when the target was disconnected -- but teardown
fires exactly when the element leaves the document, so the guard tripped, the
property was left in animatedSMILStyleProperties, and it re-applied on every
later style resolution. A reinserted (e.g. pooled and reused) element then
painted the frozen animated value permanently.

Drop the guard from the removal path so the value is released regardless of
connection state. This is safe: invalidateStyle() is already a no-op on a
disconnected element, and reinsertion triggers a fresh style resolution that no
longer sees the property. The apply paths keep their guard.

Test: 
imported/w3c/web-platform-tests/svg/animations/smil-detach-releases-animated-presentation-attribute.html

* 
LayoutTests/imported/w3c/web-platform-tests/svg/animations/smil-detach-releases-animated-presentation-attribute-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/svg/animations/smil-detach-releases-animated-presentation-attribute.html:
 Added.
* Source/WebCore/svg/properties/SVGAttributeAnimator.cpp:
(WebCore::SVGAttributeAnimator::removeAnimatedStyleProperty):

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



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

Reply via email to