mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +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") => {
|
&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);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue