mirror of
https://github.com/servo/servo
synced 2026-05-09 08:32:31 +02:00
Accepting the name of the event as a `DOMString` means that when events are constructed from within Servo (for instance via input event handling), the static strings are converted to an owned `String` wrapped in a `DOMString` and then finally converted to an `Atom` in `Event`. This makes it so that all non-generated `Event` constructors accept `Atom`, which can avoid a conversion entirely when the atom already exists on the Stylo atoms list and eliminate one in-memory copy in the case that it isn't on the atom list. Eventually, all event names can be on the atom list and we can eliminate all copies. This is a tiny optimization, but also makes the code much friendlier everywhere. Testing: This should not change behavior so should be covered by existing test. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
9.9 KiB
9.9 KiB