servo/components/script_bindings/webidls/SVGImageElement.webidl
Andrei Volykhin 6468734aea
svg: Add mock SVGImageElement interface (#36975)
Add mock SVGImageElement interface to fix TIMEOUT WPT tests
which are related to ImageBitmap (html/canvas/*).
https://svgwg.org/svg2-draft/embedded.html#InterfaceSVGImageElement

Rationality of this change to fire event "error" on any attempt to fetch
image resource on href attribute change to not block WPT tests
execution.

Some WPT tests use the legacy namespace attribute "xlink:href", so
support for it was added to source code.
https://svgwg.org/svg2-draft/linking.html#XLinkHrefAttribute
 - setAttributeNS("http://www.w3.org/1999/xlink", 'xlink:href', src);

Testing: Covered by existed WPT tests
 - fetch/metadata/generated/svg-image*
 - html/canvas/element/manual/*
 - html/dom/idlharness.https.html
 - html/semantics/embedded-content/the-canvas-element/*
 - html/webappapis/scripting/events/event-handler-all-global-events.html
 - mozilla/interfaces.https.html

Fixes: https://github.com/servo/servo/issues/35881

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
2025-05-13 10:43:10 +00:00

16 lines
779 B
Text

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
// https://svgwg.org/svg2-draft/embedded.html#InterfaceSVGImageElement
[Exposed=Window, Pref="dom_svg_enabled"]
interface SVGImageElement : SVGGraphicsElement {
//[SameObject] readonly attribute SVGAnimatedLength x;
//[SameObject] readonly attribute SVGAnimatedLength y;
//[SameObject] readonly attribute SVGAnimatedLength width;
//[SameObject] readonly attribute SVGAnimatedLength height;
//[SameObject] readonly attribute SVGAnimatedPreserveAspectRatio preserveAspectRatio;
//attribute DOMString? crossOrigin;
};
//SVGImageElement includes SVGURIReference;