Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2867fa859ff6be800a78a5db2a63c4cce8d38d20
      
https://github.com/WebKit/WebKit/commit/2867fa859ff6be800a78a5db2a63c4cce8d38d20
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-01-24 (Sat, 24 Jan 2026)

  Changed paths:
    A 
LayoutTests/svg/transforms/empty-transform-list-attribute-removal-expected.txt
    A LayoutTests/svg/transforms/empty-transform-list-attribute-removal.html
    M Source/WebCore/svg/SVGElement.cpp

  Log Message:
  -----------
  Fix transform attribute reappearing after explicit removal
https://bugs.webkit.org/show_bug.cgi?id=263712
rdar://117840533

Reviewed by Nikolas Zimmermann.

When an SVGTransformList is emptied via removeItem() and then the transform
attribute is explicitly removed, the attribute would incorrectly reappear
when queried in WebKit.

The bug occurred because synchronizeAttribute() would re-serialize the empty
transform list as an empty string attribute, recreating the attribute that
was just removed.

Fix by checking if the attribute exists before serializing an empty value.
If the list is empty and the attribute was explicitly removed, don't recreate
it. If the list is empty but the attribute still exists, serialize it to an
empty string to maintain proper synchronization.

Test: svg/transforms/empty-transform-list-attribute-removal.html

* Source/WebCore/svg/SVGElement.cpp:
(WebCore::SVGElement::synchronizeAttribute):
* LayoutTests/svg/transforms/empty-transform-list-attribute-removal.html: Added.
* 
LayoutTests/svg/transforms/empty-transform-list-attribute-removal-expected.txt: 
Added.

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



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

Reply via email to