ladybird/Tests/LibWeb/Text/input/DOM/Document-svg-title-element-first-child.html
ronak69 3ff6137121 LibWeb: Insert title as first child on setting title of svg document
Before, the new title element got appended instead of prepended, as
nullptr was passed as the "child" argument to the insert_before()
function.

This change makes two WPT tests pass in:
http://wpt.live/html/dom/documents/dom-tree-accessors/document.title-09.html
2024-10-14 07:13:58 +02:00

12 lines
455 B
HTML

<!DOCTYPE html>
<script src="../include.js"></script>
<script>
test(() => {
var SVG_NAMESPACE = "http://www.w3.org/2000/svg";
var doc = document.implementation.createDocument(SVG_NAMESPACE, "svg", null);
var child = doc.createElementNS(SVG_NAMESPACE, "x-child");
doc.documentElement.appendChild(child);
doc.title = "foo";
println(`title == ${doc.documentElement.firstChild.tagName}`);
});
</script>