From 71c5d1764a5b4a4c547bc156a496f7677db71f96 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Sat, 31 Oct 2015 14:38:16 -0700 Subject: [PATCH] Prepend, rather than append, SVG title elements. Fixes #8164 --- components/script/dom/document.rs | 6 ++++-- .../dom-tree-accessors/document.title-09.html.ini | 8 -------- 2 files changed, 4 insertions(+), 10 deletions(-) delete mode 100644 tests/wpt/metadata/html/dom/documents/dom-tree-accessors/document.title-09.html.ini diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index 90e5697dd33..54fc5afd9f9 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 -