mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
Use atom's for matching to gain performance benefits
This commit is contained in:
parent
618c1070cc
commit
603d0a54ea
1 changed files with 8 additions and 8 deletions
|
@ -570,14 +570,14 @@ impl VirtualMethods for HTMLInputElement {
|
|||
&atom!("type") => {
|
||||
match mutation {
|
||||
AttributeMutation::Set(_) => {
|
||||
let value = match &**attr.value() {
|
||||
"button" => InputType::InputButton,
|
||||
"submit" => InputType::InputSubmit,
|
||||
"reset" => InputType::InputReset,
|
||||
"file" => InputType::InputFile,
|
||||
"radio" => InputType::InputRadio,
|
||||
"checkbox" => InputType::InputCheckbox,
|
||||
"password" => InputType::InputPassword,
|
||||
let value = match attr.value().as_atom() {
|
||||
&atom!("button") => InputType::InputButton,
|
||||
&atom!("submit") => InputType::InputSubmit,
|
||||
&atom!("reset") => InputType::InputReset,
|
||||
&atom!("file") => InputType::InputFile,
|
||||
&atom!("radio") => InputType::InputRadio,
|
||||
&atom!("checkbox") => InputType::InputCheckbox,
|
||||
&atom!("password") => InputType::InputPassword,
|
||||
_ => InputType::InputText,
|
||||
};
|
||||
self.input_type.set(value);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue