mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 09:45:06 +02:00
LibWeb: Implement Element.getAttributeNodeNS
This commit is contained in:
committed by
Andrew Kaster
parent
a7316d3641
commit
7a26a889cb
Notes:
sideshowbarker
2024-07-16 18:06:41 +09:00
Author: https://github.com/shannonbooth Commit: https://github.com/SerenityOS/serenity/commit/7a26a889cb Pull-request: https://github.com/SerenityOS/serenity/pull/22748 Reviewed-by: https://github.com/ADKaster ✅
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>
|
||||
Reference in New Issue
Block a user