mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Pass around event types as Atoms instead of Strings
`Event` internally stores the `type` as an `Atom`, and we're `String`s everywhere, which can cause unnecessary allocations to occur since they'll end up as `Atom`s anyways.
This commit is contained in:
parent
996c0a60b8
commit
4accaf50b2
25 changed files with 156 additions and 135 deletions
|
@ -162,7 +162,7 @@ impl HTMLFormElement {
|
|||
// TODO: Handle browsing contexts
|
||||
// TODO: Handle validation
|
||||
let event = Event::new(GlobalRef::Window(win.r()),
|
||||
DOMString::from("submit"),
|
||||
atom!("submit"),
|
||||
EventBubbles::Bubbles,
|
||||
EventCancelable::Cancelable);
|
||||
event.fire(self.upcast());
|
||||
|
@ -315,7 +315,7 @@ impl HTMLFormElement {
|
|||
|
||||
let win = window_from_node(self);
|
||||
let event = Event::new(GlobalRef::Window(win.r()),
|
||||
DOMString::from("reset"),
|
||||
atom!("reset"),
|
||||
EventBubbles::Bubbles,
|
||||
EventCancelable::Cancelable);
|
||||
event.fire(self.upcast());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue