Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4a210d1278f1dc12bbad797be4fb4ce8f954f8b8
      
https://github.com/WebKit/WebKit/commit/4a210d1278f1dc12bbad797be4fb4ce8f954f8b8
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-03-30 (Mon, 30 Mar 2026)

  Changed paths:
    A LayoutTests/svg/animations/animate-image-href-expected.html
    A LayoutTests/svg/animations/animate-image-href.html
    M Source/WebCore/dom/Element.cpp
    M Source/WebCore/dom/Element.h
    M Source/WebCore/editing/glib/EditorGLib.cpp
    M Source/WebCore/html/HTMLEmbedElement.cpp
    M Source/WebCore/html/HTMLEmbedElement.h
    M Source/WebCore/html/HTMLImageElement.cpp
    M Source/WebCore/html/HTMLImageElement.h
    M Source/WebCore/html/HTMLObjectElement.cpp
    M Source/WebCore/html/HTMLObjectElement.h
    M Source/WebCore/html/HTMLVideoElement.cpp
    M Source/WebCore/html/HTMLVideoElement.h
    M Source/WebCore/loader/ImageLoader.cpp
    M Source/WebCore/loader/ImageLoader.h
    M Source/WebCore/svg/SVGImageElement.cpp
    M Source/WebCore/svg/SVGImageElement.h

  Log Message:
  -----------
  SMIL animations of href / xlink:href of <image> have no visual effect
https://bugs.webkit.org/show_bug.cgi?id=202791
rdar://96316808

Reviewed by Ryosuke Niwa.

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

Merge: 
https://chromium.googlesource.com/chromium/src.git/+/93976b6624f40024070bea7dde68e81a3d366173

SVGImageElement::imageSourceURL() returned the non-animating base
attribute value via getAttribute(), so SMIL animations of the <image>
element href/xlink:href had no effect. Changed it to return the
animating value via SVGURIReference::href().

This required changing the return type of imageSourceURL() from
const AtomString& to String across the Element virtual hierarchy
to avoid returning a reference to a local object.

Drive-by fix: changed auto& to auto in
HTMLImageElement::setBestFitURLAndDPRFromImageCandidate() to avoid
a dangling reference to the now-returned-by-value result.

Test: svg/animations/animate-image-href.html

* LayoutTests/svg/animations/animate-image-href-expected.html: Added.
* LayoutTests/svg/animations/animate-image-href.html: Added.
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::imageSourceURL const):
* Source/WebCore/dom/Element.h:
* Source/WebCore/editing/glib/EditorGLib.cpp:
(WebCore::elementURL):
* Source/WebCore/html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::imageSourceURL const):
* Source/WebCore/html/HTMLEmbedElement.h:
* Source/WebCore/html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::imageSourceURL const):
(WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
* Source/WebCore/html/HTMLImageElement.h:
* Source/WebCore/html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::imageSourceURL const):
* Source/WebCore/html/HTMLObjectElement.h:
* Source/WebCore/html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::imageSourceURL const):
* Source/WebCore/html/HTMLVideoElement.h:
* Source/WebCore/svg/SVGImageElement.cpp:
(WebCore::SVGImageElement::imageSourceURL const):
* Source/WebCore/svg/SVGImageElement.h:

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



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

Reply via email to