Bug 202791
| Summary: | SMIL animations of href / xlink:href of <image> have no visual effect | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Nikolas Zimmermann <zimmermann> |
| Component: | SVG | Assignee: | 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
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 | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/96316808>
Ahmad Saleem
Fixed in Blink by giving up on AtomString& and just returning ("href()").
https://src.chromium.org/viewvc/blink?view=revision&revision=157025
Ahmad Saleem
(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
Pull request: https://github.com/WebKit/WebKit/pull/61066
EWS
Committed 310236@main (4a210d1278f1): <https://commits.webkit.org/310236@main>
Reviewed commits have been landed. Closing PR #61066 and removing active labels.
Brent Fulgham
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
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/