Bug 202791

Summary: SMIL animations of href / xlink:href of <image> have no visual effect
Product: WebKit Reporter: Nikolas Zimmermann <zimmermann>
Component: SVGAssignee: Ahmad Saleem <ahmad.saleem792>
Status: RESOLVED FIXED    
Severity: Normal CC: ahmad.saleem792, bfulgham, rwlbuis, sabouhallawa, webkit-bug-importer, zimmermann
Priority: P2 Keywords: BrowserCompat, InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
URL: https://dev.w3.org/SVG/profiles/1.1F2/test/harness/htmlObjectApproved/animate-elem-39-t.html

Nikolas Zimmermann
Reported 2019-10-10 03:19:44 PDT
LayoutTests/svg/W3C-SVG-1.1/animate-elem-39-t.svg shows that SMIL animations of the <image> element href / xlink:href have no effect. A quick investigation shows that imageSourceURL() is the culprit, since it simply returns getAttribute(SVGNames::hrefAttr, XLinkNames::hrefAttr) -- which is equal to the serialized baseVal of the underlying SVGAnimatedString, never reflecting the animVal. SVGURIReference::href() returns the right value, and also correctly handles href vs. xlink:href, since the baseVal is either reflecting href, or if xlink:href (if any of them is set). The only issue is that imageSourceURL() returns a reference to a const AtomString, and thus we cannot simply return href(). A quick hack to fix SMIL animations on the aforementioned testcase is: const AtomString& SVGImageElement::imageSourceURL() const { static NeverDestroyed<AtomString> tempAtom("tempAtom", AtomString::ConstructFromLiteral); AtomString& mutableAtom = tempAtom; mutableAtom = href(); return tempAtom; } We either have to give up the "const AtomString&" return value, or add a new AtomString m_imageSourceURL member to SVGImageElement. And obviously we need more test coverage!
Attachments
Radar WebKit Bug Importer
Comment 1 2022-07-01 15:10:35 PDT
Ahmad Saleem
Comment 2 2023-06-30 14:13:55 PDT
Fixed in Blink by giving up on AtomString& and just returning ("href()"). https://src.chromium.org/viewvc/blink?view=revision&revision=157025
Ahmad Saleem
Comment 3 2024-09-09 18:11:30 PDT
(In reply to Ahmad Saleem from comment #2) > Fixed in Blink by giving up on AtomString& and just returning ("href()"). > > https://src.chromium.org/viewvc/blink?view=revision&revision=157025 SVG link is gone - https://source.chromium.org/chromium/chromium/src/+/93976b6624f40024070bea7dde68e81a3d366173
Ahmad Saleem
Comment 4 2026-03-20 21:44:08 PDT
EWS
Comment 5 2026-03-30 09:30:31 PDT
Committed 310236@main (4a210d1278f1): <https://commits.webkit.org/310236@main> Reviewed commits have been landed. Closing PR #61066 and removing active labels.
Brent Fulgham
Comment 6 2026-04-29 10:09:18 PDT
This change is present in Safari Technology Preview 242. Please install that revision or newer to confirm the fix. Release notes: https://webkit.org/blog/17934/release-notes-for-safari-technology-preview-242/
Brent Fulgham
Comment 7 2026-04-29 11:46:08 PDT
This change is present in Safari Technology Preview 241. Please install that revision or newer to confirm the fix. Release notes: https://webkit.org/blog/17917/release-notes-for-safari-technology-preview-241/
Note You need to log in before you can comment on or make changes to this bug.