Files
serenity/Tests/LibWeb/Text/input/DOM/DOMParser-xmlns.html
Maciej acec03db1f LibXML: Set XMLNS namespace for xmlns attribute
This is what Blink and Gecko do, and is required for serialization
(innerHTML etc.) of XML elements to work.

(cherry picked from commit cad3b085a89b6a7f1e06f8e5d039959e7f26faa2)
2024-11-08 21:51:25 -05:00

12 lines
465 B
HTML

<!DOCTYPE html>
<script src="../include.js"></script>
<script>
test(() => {
const svgstr = `<svg xmlns="http://www.w3.org/2000/svg" xmlns:test="foo"></svg>`;
const svg = new DOMParser().parseFromString(svgstr, "image/svg+xml").documentElement;
for (const attr of svg.attributes) {
println(`namespaceURI=${attr.namespaceURI} prefix=${attr.prefix} localName=${attr.localName} value=${attr.value}`);
}
});
</script>