Replace many uses of to_ascii_lowercase() by make_ascii_lowercase()

This commit is contained in:
Anthony Ramine 2015-08-28 00:51:15 +02:00
parent 67cbda4be3
commit 105d990845
7 changed files with 32 additions and 23 deletions

View file

@ -1243,7 +1243,7 @@ impl DocumentMethods for Document {
return Err(InvalidCharacter);
}
if self.is_html_document {
local_name = local_name.to_ascii_lowercase()
local_name.make_ascii_lowercase();
}
let name = QualName::new(ns!(HTML), Atom::from_slice(&local_name));
Ok(Element::create(name, None, self, ElementCreator::ScriptCreated))
@ -1350,10 +1350,11 @@ impl DocumentMethods for Document {
}
// https://dom.spec.whatwg.org/#dom-document-createevent
fn CreateEvent(&self, interface: DOMString) -> Fallible<Root<Event>> {
fn CreateEvent(&self, mut interface: DOMString) -> Fallible<Root<Event>> {
let window = self.window.root();
match &*interface.to_ascii_lowercase() {
interface.make_ascii_lowercase();
match &*interface {
"uievents" | "uievent" => Ok(EventCast::from_root(
UIEvent::new_uninitialized(window.r()))),
"mouseevents" | "mouseevent" => Ok(EventCast::from_root(