mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Auto merge of #8193 - dzbarsky:event_type, r=nox
Use an Atom for Event.type Depends on https://github.com/servo/string-cache/pull/113 <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8193) <!-- Reviewable:end -->
This commit is contained in:
commit
35b452660b
5 changed files with 27 additions and 21 deletions
|
@ -618,7 +618,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),
|
||||
_ => {}
|
||||
|
@ -630,7 +630,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