Auto merge of #8296 - notriddle:svg_title_prepend, r=nox

Prepend, rather than append, SVG title elements.

Fixes #8164

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8296)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-11-07 14:13:42 +05:30
commit 3c794d0076
2 changed files with 4 additions and 10 deletions

View file

@ -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::<Node>()
.AppendChild(elem.upcast())
let parent = root.upcast::<Node>();
let child = elem.upcast::<Node>();
parent
.InsertBefore(child, parent.GetFirstChild().r())
.unwrap()
}
}