Auto merge of #24546 - garasubo:refactor-submission, r=paulrouget

Re-add missing commit in PR #24489

Fix #22782

I'm sorry, but I failed to add one of commits during the squash phase in #24489.
Could you review and merge this?

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
This commit is contained in:
bors-servo 2019-10-28 01:31:07 -04:00 committed by GitHub
commit 0c20fba2ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1469,8 +1469,8 @@ impl Document {
// however *when* we do it is up to us.
// Here, we're dispatching it after the key event so the script has a chance to cancel it
// https://www.w3.org/Bugs/Public/show_bug.cgi?id=27337
if (keyboard_event.key == Key::Enter && keyboard_event.state == KeyState::Up) ||
(keyboard_event.code == Code::Space && keyboard_event.state == KeyState::Down)
if (keyboard_event.key == Key::Enter || keyboard_event.code == Code::Space) &&
keyboard_event.state == KeyState::Up
{
let maybe_elem = target.downcast::<Element>();
if let Some(el) = maybe_elem {