mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Use an Atom for Event.type
This commit is contained in:
parent
601169c0e5
commit
0070adb71f
5 changed files with 27 additions and 21 deletions
|
@ -607,7 +607,7 @@ impl VirtualMethods for HTMLInputElement {
|
|||
s.handle_event(event);
|
||||
}
|
||||
|
||||
if &*event.Type() == "click" && !event.DefaultPrevented() {
|
||||
if event.type_() == atom!("click") && !event.DefaultPrevented() {
|
||||
match self.input_type.get() {
|
||||
InputType::InputRadio => self.update_checked_state(true, true),
|
||||
_ => {}
|
||||
|
@ -619,7 +619,7 @@ impl VirtualMethods for HTMLInputElement {
|
|||
//TODO: set the editing position for text inputs
|
||||
|
||||
document_from_node(self).request_focus(self.upcast());
|
||||
} else if &*event.Type() == "keydown" && !event.DefaultPrevented() &&
|
||||
} else if event.type_() == atom!("keydown") && !event.DefaultPrevented() &&
|
||||
(self.input_type.get() == InputType::InputText ||
|
||||
self.input_type.get() == InputType::InputPassword) {
|
||||
if let Some(keyevent) = event.downcast::<KeyboardEvent>() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue