LibWeb: Use right interface for custom SVG and MathML elements

The DOM spec gets overridden by both the SVG2 and MathML core specs in
that unknown elements should not inherit DOM::Element, but
SVG::SVGElement and MathML::MathMLElement respectively.
This commit is contained in:
Jelle Raaijmakers 2024-10-31 10:35:07 +01:00 committed by Tim Ledbetter
commit 76e638b4ca
Notes: github-actions[bot] 2024-10-31 09:59:53 +00:00
3 changed files with 34 additions and 17 deletions

View file

@ -0,0 +1,13 @@
<!doctype html>
<script src="../include.js"></script>
<script>
test(() => {
const printElement = (element) => {
println(`Element nodeName: ${element.nodeName} namespaceURI: ${element.namespaceURI} __proto__: ${element.__proto__}`);
};
printElement(document.createElementNS('http://www.w3.org/1999/xhtml', 'foo'));
printElement(document.createElementNS('http://www.w3.org/2000/svg', 'foo'));
printElement(document.createElementNS('http://www.w3.org/1998/Math/MathML', 'foo'));
});
</script>