diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 50805951529..a7267ca0086 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -1740,8 +1740,10 @@ impl DocumentMethods for Document { let name = QualName::new(ns!(SVG), atom!("title")); let elem = Element::create(name, None, self, ElementCreator::ScriptCreated); - root.upcast::() - .AppendChild(elem.upcast()) + let parent = root.upcast::(); + let child = elem.upcast::(); + parent + .InsertBefore(child, parent.GetFirstChild().r()) .unwrap() } } diff --git a/tests/wpt/metadata/html/dom/documents/dom-tree-accessors/document.title-09.html.ini b/tests/wpt/metadata/html/dom/documents/dom-tree-accessors/document.title-09.html.ini deleted file mode 100644 index 93d736c13e5..00000000000 --- a/tests/wpt/metadata/html/dom/documents/dom-tree-accessors/document.title-09.html.ini +++ /dev/null @@ -1,8 +0,0 @@ -[document.title-09.html] - type: testharness - [No title element in SVG document] - expected: FAIL - - [Title element not child of SVG root] - expected: FAIL -