ladybird/Tests/LibWeb/Text/input/DOM/cloneNode-with-goofy-attribute.html
Andreas Kling 193fc7ef98 LibWeb: Allow cloneNode() to clone elements with weird attributes
We can't rely on Element.setAttribute() in cloneNode() since that will
throw on weird attribute names. Instead, just follow the spec and copy
attributes into cloned elements verbatim.

This fixes a crash when loading the "issues" tab on GitHub repos.
They are actually sending us unintentionally broken markup, but we
should still support cloning it. :^)
2024-04-21 19:51:24 +02:00

9 lines
236 B
HTML

<script src="../include.js"></script>
<svg><circle id=c a(></svg>
<script>
test(() => {
let cloned = c.cloneNode()
println(c.attributes[1].localName)
println(cloned.attributes[1].localName)
});
</script>