From 3af931004f7c021ab9c02b2059c0afd9c2ffb0fc Mon Sep 17 00:00:00 2001 From: takumi Date: Fri, 25 Oct 2019 16:14:16 +0900 Subject: [PATCH] Fix the condition to keep original logic Address this PR comment: https://github.com/servo/servo/pull/24489/files#diff-30a18e04d7e0b66aafdf192e416cad44R1472 This commit was failed to add in PR #24489. Issue: #22782 --- components/script/dom/document.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index f790f52cc5f..fd5994925c1 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -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::(); if let Some(el) = maybe_elem {