mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 22:08:10 +00:00
LibWeb: Implement Element.getAttributeNodeNS
This commit is contained in:
parent
a7316d3641
commit
7a26a889cb
5 changed files with 37 additions and 1 deletions
23
Tests/LibWeb/Text/input/DOM/Element-getAttributeNodeNS.html
Normal file
23
Tests/LibWeb/Text/input/DOM/Element-getAttributeNodeNS.html
Normal file
|
@ -0,0 +1,23 @@
|
|||
<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>
|
Loading…
Add table
Add a link
Reference in a new issue