1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 02:44:58 +00:00
serenity/Tests/LibWeb/Text/input/DOM/Element-getAttributeNodeNS.html
2024-01-14 16:10:18 -07:00

23 lines
1 KiB
HTML

<script src="../include.js"></script>
<svg xmlns="http://www.w3.org/2000/svg">
<script id="with-xlink-href" xlink:href="test"></script>
<script id="no-xlink-href" href="test"></script>
</svg>
<script id="svg-script-element">
function dumpAttr(description, attr) {
if (attr === null) {
println(`${description} = 'null'`);
return;
}
println(`${description} = '${attr.constructor.name}': name = ${attr.name} value = ${attr.value}`);
}
test(() => {
const xlinkNS = document.getElementById("with-xlink-href");
dumpAttr('xlink:href getAttributeNode', xlinkNS.getAttributeNode("href"));
dumpAttr('xlink:href getAttributeNodeNS', xlinkNS.getAttributeNodeNS("http://www.w3.org/1999/xlink", "href"));
const noNS = document.getElementById("no-xlink-href");
dumpAttr('href getAttributeNode', noNS.getAttributeNode("href"));
dumpAttr('href getAttributeNodeNS', noNS.getAttributeNodeNS("http://www.w3.org/1999/xlink", "href"));
});
</script>