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

Unified Diff: third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.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/elements/StylesSidebarPane.js
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js b/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js
index 3104c01653305aefc7c5a61a58189d34ebc16a43..a2f9a351584786e5a17aacf3c2a3b950061aaa08 100644
--- a/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js
+++ b/third_party/WebKit/Source/devtools/front_end/elements/StylesSidebarPane.js
@@ -631,8 +631,7 @@ WebInspector.StylesSidebarPane.createPropertyFilterElement = function(placeholde
*/
function keydownHandler(event)
{
- var Esc = "U+001B";
- if (event.keyIdentifier !== Esc || !input.value)
+ if (event.key !== "Escape" || !input.value)
return;
event.consume(true);
input.value = "";
@@ -2473,7 +2472,7 @@ WebInspector.StylePropertyTreeElement.prototype = {
if (isEnterKey(event)) {
event.preventDefault();
result = "forward";
- } else if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Esc.code || event.keyIdentifier === "U+001B")
+ } else if (event.keyCode === WebInspector.KeyboardShortcut.Keys.Esc.code || event.key === "Escape")
result = "cancel";
else if (!context.isEditingName && this._newProperty && event.keyCode === WebInspector.KeyboardShortcut.Keys.Backspace.code) {
// For a new property, when Backspace is pressed at the beginning of new property value, move back to the property name.
@@ -2482,7 +2481,7 @@ WebInspector.StylePropertyTreeElement.prototype = {
event.preventDefault();
result = "backward";
}
- } else if (event.keyIdentifier === "U+0009") { // Tab key.
+ } else if (event.key === "Tab") {
result = event.shiftKey ? "backward" : "forward";
event.preventDefault();
}
@@ -2887,9 +2886,9 @@ WebInspector.StylesSidebarPane.CSSPropertyPrompt.prototype = {
*/
onKeyDown: function(event)
{
- switch (event.keyIdentifier) {
- case "Up":
- case "Down":
+ switch (event.key) {
+ case "ArrowUp":
+ case "ArrowDown":
case "PageUp":
case "PageDown":
if (this._handleNameOrValueUpDown(event)) {

Powered by Google App Engine
This is Rietveld 408576698