Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1586)

Unified Diff: Source/devtools/front_end/ui/ShortcutRegistry.js

Issue 659403006: DevTools: do not consider ? a shortcut while editing. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/ui/ShortcutRegistry.js
diff --git a/Source/devtools/front_end/ui/ShortcutRegistry.js b/Source/devtools/front_end/ui/ShortcutRegistry.js
index 0c2be000ce11f93c8f083e77bf68407f710dedca..94c580ff5fee900628ae979cf9e21063f929b76e 100644
--- a/Source/devtools/front_end/ui/ShortcutRegistry.js
+++ b/Source/devtools/front_end/ui/ShortcutRegistry.js
@@ -91,16 +91,20 @@ WebInspector.ShortcutRegistry.prototype = {
{
var keyModifiers = key >> 8;
var actionIds = this.applicableActions(key);
+ if (!actionIds.length)
+ return;
if (WebInspector.GlassPane.DefaultFocusedViewStack.length > 1) {
- if (event && actionIds.length && !isPossiblyInputKey())
+ if (event && !isPossiblyInputKey())
event.consume(true);
return;
}
- if (!isPossiblyInputKey())
+ if (!isPossiblyInputKey()) {
+ event.consume(true);
processActionIdsSequentially.call(this);
- else
+ } else {
this._pendingActionTimer = setTimeout(processActionIdsSequentially.bind(this), 0);
+ }
/**
* @this {WebInspector.ShortcutRegistry}
@@ -119,13 +123,8 @@ WebInspector.ShortcutRegistry.prototype = {
*/
function continueIfNecessary(result)
{
- // Note that this is a best effort solution - lazily loaded modules won't have a chance to
- // consume platform event.
- if (result) {
- if (event)
- event.consume(true);
+ if (result)
return;
- }
processActionIdsSequentially.call(this);
}
}
@@ -135,7 +134,7 @@ WebInspector.ShortcutRegistry.prototype = {
*/
function isPossiblyInputKey()
{
- if (!event || !WebInspector.isBeingEdited(/** @type {!Node} */ (event.target)) || /^F\d+|Control|Shift|Alt|Meta|Win|U\+001B$/.test(keyIdentifier))
+ if (!event || !WebInspector.isEditing() || /^F\d+|Control|Shift|Alt|Meta|Win|U\+001B$/.test(keyIdentifier))
return false;
if (!keyModifiers)

Powered by Google App Engine
This is Rietveld 408576698