auto merge of #4029 : znewman01/servo/issue4009, r=Ms2ger

Fixes #4009.

Only lower-case the argument to Document#createElement if it's a HTML document.
This commit is contained in:
bors-servo 2014-11-18 07:15:34 -07:00
commit 929671f945
2 changed files with 5 additions and 4 deletions

View file

@ -568,7 +568,11 @@ impl<'a> DocumentMethods for JSRef<'a, Document> {
debug!("Not a valid element name");
return Err(InvalidCharacter);
}
let local_name = local_name.as_slice().to_ascii_lower();
let local_name = if self.is_html_document {
local_name.as_slice().to_ascii_lower()
} else {
local_name
};
let name = QualName::new(ns!(HTML), Atom::from_slice(local_name.as_slice()));
Ok(Element::create(name, None, self, ScriptCreated))
}