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>
This commit is contained in:
Andrei Volykhin 2025-05-13 13:43:10 +03:00 committed by GitHub
parent e4f62d5c16
commit 6468734aea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 262 additions and 811 deletions

View file

@ -1,460 +1,16 @@
[event-handler-all-global-events.html]
[onabort: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onabort: the default value must be null]
expected: FAIL
[onauxclick: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onauxclick: the default value must be null]
expected: FAIL
[onblur: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onblur: the default value must be null]
expected: FAIL
[oncancel: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[oncancel: the default value must be null]
expected: FAIL
[oncanplay: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[oncanplay: the default value must be null]
expected: FAIL
[oncanplaythrough: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[oncanplaythrough: the default value must be null]
expected: FAIL
[onchange: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onchange: the default value must be null]
expected: FAIL
[onclick: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onclick: the default value must be null]
expected: FAIL
[onclose: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onclose: the default value must be null]
expected: FAIL
[oncontextlost: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[oncontextlost: the default value must be null]
expected: FAIL
[oncontextmenu: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[oncontextmenu: the default value must be null]
expected: FAIL
[oncontextrestored: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[oncontextrestored: the default value must be null]
expected: FAIL
[oncuechange: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[oncuechange: the default value must be null]
expected: FAIL
[ondblclick: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[ondblclick: the default value must be null]
expected: FAIL
[ondrag: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[ondrag: the default value must be null]
expected: FAIL
[ondragend: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[ondragend: the default value must be null]
expected: FAIL
[ondragenter: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[ondragenter: the default value must be null]
expected: FAIL
[ondragleave: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[ondragleave: the default value must be null]
expected: FAIL
[ondragover: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[ondragover: the default value must be null]
expected: FAIL
[ondragstart: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[ondragstart: the default value must be null]
expected: FAIL
[ondrop: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[ondrop: the default value must be null]
expected: FAIL
[ondurationchange: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[ondurationchange: the default value must be null]
expected: FAIL
[onemptied: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onemptied: the default value must be null]
expected: FAIL
[onended: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onended: the default value must be null]
expected: FAIL
[onfocus: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onfocus: the default value must be null]
expected: FAIL
[onformdata: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onformdata: the default value must be null]
expected: FAIL
[oninput: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[oninput: the default value must be null]
expected: FAIL
[oninvalid: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[oninvalid: the default value must be null]
expected: FAIL
[onkeydown: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onkeydown: the default value must be null]
expected: FAIL
[onkeypress: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onkeypress: the default value must be null]
expected: FAIL
[onkeyup: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onkeyup: the default value must be null]
expected: FAIL
[onload: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onload: the default value must be null]
expected: FAIL
[onloadeddata: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onloadeddata: the default value must be null]
expected: FAIL
[onloadedmetadata: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onloadedmetadata: the default value must be null]
expected: FAIL
[onloadstart: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onloadstart: the default value must be null]
expected: FAIL
[onmousedown: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onmousedown: the default value must be null]
expected: FAIL
[onmouseenter: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onmouseenter: the default value must be null]
expected: FAIL
[onmouseleave: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onmouseleave: the default value must be null]
expected: FAIL
[onmousemove: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onmousemove: the default value must be null]
expected: FAIL
[onmouseout: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onmouseout: the default value must be null]
expected: FAIL
[onmouseover: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onmouseover: the default value must be null]
expected: FAIL
[onmouseup: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onmouseup: the default value must be null]
expected: FAIL
[onpause: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onpause: the default value must be null]
expected: FAIL
[onplay: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onplay: the default value must be null]
expected: FAIL
[onplaying: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onplaying: the default value must be null]
expected: FAIL
[onprogress: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onprogress: the default value must be null]
expected: FAIL
[onratechange: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onratechange: the default value must be null]
expected: FAIL
[onreset: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onreset: the default value must be null]
expected: FAIL
[onresize: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onresize: the default value must be null]
expected: FAIL
[onscroll: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onscroll: the default value must be null]
expected: FAIL
[onsecuritypolicyviolation: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onsecuritypolicyviolation: the default value must be null]
expected: FAIL
[onseeked: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onseeked: the default value must be null]
expected: FAIL
[onseeking: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onseeking: the default value must be null]
expected: FAIL
[onselect: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onselect: the default value must be null]
expected: FAIL
[onslotchange: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onslotchange: the default value must be null]
expected: FAIL
[onstalled: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onstalled: the default value must be null]
expected: FAIL
[onsubmit: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onsubmit: the default value must be null]
expected: FAIL
[onsuspend: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onsuspend: the default value must be null]
expected: FAIL
[ontimeupdate: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[ontimeupdate: the default value must be null]
expected: FAIL
[ontoggle: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[ontoggle: the default value must be null]
expected: FAIL
[onvolumechange: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onvolumechange: the default value must be null]
expected: FAIL
[onwaiting: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onwaiting: the default value must be null]
expected: FAIL
[onwebkitanimationend: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onwebkitanimationend: the default value must be null]
expected: FAIL
[onwebkitanimationend: the content attribute must execute when an event is dispatched]
expected: FAIL
[onwebkitanimationiteration: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onwebkitanimationiteration: the default value must be null]
expected: FAIL
[onwebkitanimationiteration: the content attribute must execute when an event is dispatched]
expected: FAIL
[onwebkitanimationstart: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onwebkitanimationstart: the default value must be null]
expected: FAIL
[onwebkitanimationstart: the content attribute must execute when an event is dispatched]
expected: FAIL
[onwebkittransitionend: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onwebkittransitionend: the default value must be null]
expected: FAIL
[onwebkittransitionend: the content attribute must execute when an event is dispatched]
expected: FAIL
[onwheel: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onwheel: the default value must be null]
expected: FAIL
[onbeforeinput: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onbeforeinput: the default value must be null]
expected: FAIL
[onbeforematch: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onbeforematch: the default value must be null]
expected: FAIL
[onscrollend: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onscrollend: the default value must be null]
expected: FAIL
[oncopy: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[oncopy: the default value must be null]
expected: FAIL
[oncut: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[oncut: the default value must be null]
expected: FAIL
[onpaste: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onpaste: the default value must be null]
expected: FAIL
[onbeforetoggle: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[onbeforetoggle: the default value must be null]
expected: FAIL
[onwebkitanimationend: dispatching an Event at a <meta> element must trigger element.onwebkitanimationend]
expected: FAIL
@ -466,9 +22,3 @@
[onwebkittransitionend: dispatching an Event at a <meta> element must trigger element.onwebkittransitionend]
expected: FAIL
[oncommand: must be on the appropriate locations for GlobalEventHandlers]
expected: FAIL
[oncommand: the default value must be null]
expected: FAIL