Use atom's for matching to gain performance benefits

This commit is contained in:
Iszak Bryan 2016-01-03 00:13:52 +00:00
parent 618c1070cc
commit 603d0a54ea

View file

@ -570,14 +570,14 @@ impl VirtualMethods for HTMLInputElement {
&atom!("type") => { &atom!("type") => {
match mutation { match mutation {
AttributeMutation::Set(_) => { AttributeMutation::Set(_) => {
let value = match &**attr.value() { let value = match attr.value().as_atom() {
"button" => InputType::InputButton, &atom!("button") => InputType::InputButton,
"submit" => InputType::InputSubmit, &atom!("submit") => InputType::InputSubmit,
"reset" => InputType::InputReset, &atom!("reset") => InputType::InputReset,
"file" => InputType::InputFile, &atom!("file") => InputType::InputFile,
"radio" => InputType::InputRadio, &atom!("radio") => InputType::InputRadio,
"checkbox" => InputType::InputCheckbox, &atom!("checkbox") => InputType::InputCheckbox,
"password" => InputType::InputPassword, &atom!("password") => InputType::InputPassword,
_ => InputType::InputText, _ => InputType::InputText,
}; };
self.input_type.set(value); self.input_type.set(value);