mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +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
|
@ -329,11 +329,11 @@ impl VirtualMethods for HTMLTextAreaElement {
|
|||
s.handle_event(event);
|
||||
}
|
||||
|
||||
if &*event.Type() == "click" && !event.DefaultPrevented() {
|
||||
if event.type_() == atom!("click") && !event.DefaultPrevented() {
|
||||
//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() {
|
||||
if let Some(kevent) = event.downcast::<KeyboardEvent>() {
|
||||
match self.textinput.borrow_mut().handle_keydown(kevent) {
|
||||
KeyReaction::TriggerDefaultAction => (),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue