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

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js

Issue 2033403005: Eradicate keyIndentifier from devtools/* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Call KeyCodeToKeyIdentifier for unhandle key events Created 4 years, 6 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: third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js b/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
index 231d4de44ed8d2905b3569ca9fa89933cd22d38c..98583532de7d7c53461e5b70ffc52dcf972537ba 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
@@ -376,9 +376,9 @@ WebInspector._valueModificationDirection = function(event)
else if (event.wheelDeltaY < 0 || event.wheelDeltaX < 0)
direction = "Down";
} else {
- if (event.keyIdentifier === "Up" || event.keyIdentifier === "PageUp")
+ if (event.key === "ArrowUp" || event.key === "PageUp")
direction = "Up";
- else if (event.keyIdentifier === "Down" || event.keyIdentifier === "PageDown")
+ else if (event.key === "ArrowDown" || event.key === "PageDown")
direction = "Down";
}
return direction;
@@ -527,8 +527,8 @@ WebInspector.handleElementValueModifications = function(event, element, finishHa
return document.createRange();
}
- var arrowKeyOrMouseWheelEvent = (event.keyIdentifier === "Up" || event.keyIdentifier === "Down" || event.type === "mousewheel");
- var pageKeyPressed = (event.keyIdentifier === "PageUp" || event.keyIdentifier === "PageDown");
+ var arrowKeyOrMouseWheelEvent = (event.key === "ArrowUp" || event.key === "ArrowDown" || event.type === "mousewheel");
+ var pageKeyPressed = (event.key === "PageUp" || event.key === "PageDown");
if (!arrowKeyOrMouseWheelEvent && !pageKeyPressed)
return false;
@@ -1594,7 +1594,7 @@ WebInspector.bindInput = function(input, apply, validate, numeric)
if (!numeric)
return;
- var increment = event.keyIdentifier === "Up" ? 1 : event.keyIdentifier === "Down" ? -1 : 0;
+ var increment = event.key === "ArrowUp" ? 1 : event.key === "ArrowDown" ? -1 : 0;
if (!increment)
return;
if (event.shiftKey)

Powered by Google App Engine
This is Rietveld 408576698