Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: b61039ea91066dedbd9b8c01487c43a89041d4d3
https://github.com/WebKit/WebKit/commit/b61039ea91066dedbd9b8c01487c43a89041d4d3
Author: Taher Ali <[email protected]>
Date: 2026-01-06 (Tue, 06 Jan 2026)
Changed paths:
A LayoutTests/svg/clip-path-duplicate-id-removal-expected.html
A LayoutTests/svg/clip-path-duplicate-id-removal.html
M Source/WebCore/dom/TreeScope.cpp
M Source/WebCore/dom/TreeScope.h
M Source/WebCore/rendering/svg/legacy/LegacyRenderSVGResourceContainer.cpp
Log Message:
-----------
Fix clip-path reference breaking when removing SVG element with duplicate ID
https://bugs.webkit.org/show_bug.cgi?id=305001
rdar://147015037
Reviewed by Simon Fraser.
When multiple SVG resource elements share the same ID, removing any
one breaks references for all elements using that ID, even though
other definitions remain in the DOM.
To fix this, we now verify the resource being removed matches the one
registered before removing.
Fixes the appearance of user avatar clipping in Slack i.e the
green activity ring. Slack uses multiple SVG clipPath definitions
with the same ID, and when elements are added/removed during virtual
scrolling, clip-path references would break.
Test: svg/clip-path-duplicate-id-removal.html
* LayoutTests/svg/clip-path-duplicate-id-removal-expected.html: Added.
* LayoutTests/svg/clip-path-duplicate-id-removal.html: Added.
* Source/WebCore/dom/TreeScope.cpp:
(WebCore::TreeScope::removeSVGResource):
* Source/WebCore/dom/TreeScope.h:
* Source/WebCore/rendering/svg/legacy/LegacyRenderSVGResourceContainer.cpp:
(WebCore::LegacyRenderSVGResourceContainer::willBeDestroyed):
(WebCore::LegacyRenderSVGResourceContainer::idChanged):
Canonical link: https://commits.webkit.org/305197@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications