Chromium Code Reviews| Index: third_party/WebKit/Source/core/input/EventHandler.cpp |
| diff --git a/third_party/WebKit/Source/core/input/EventHandler.cpp b/third_party/WebKit/Source/core/input/EventHandler.cpp |
| index bad5b0dc36e3628c3abf728963fe111b80484d2d..464019b1f711dee05382aa43cc93b4cf0fb7677a 100644 |
| --- a/third_party/WebKit/Source/core/input/EventHandler.cpp |
| +++ b/third_party/WebKit/Source/core/input/EventHandler.cpp |
| @@ -2684,22 +2684,17 @@ WebInputEventResult EventHandler::keyEvent(const PlatformKeyboardEvent& initialK |
| return toWebInputEventResult(node->dispatchEvent(keypress)); |
| } |
| -static WebFocusType focusDirectionForKey(const AtomicString& keyIdentifier) |
| +static WebFocusType focusDirectionForKey(const String& key) |
| { |
| - DEFINE_STATIC_LOCAL(AtomicString, Down, ("Down")); |
| - DEFINE_STATIC_LOCAL(AtomicString, Up, ("Up")); |
| - DEFINE_STATIC_LOCAL(AtomicString, Left, ("Left")); |
| - DEFINE_STATIC_LOCAL(AtomicString, Right, ("Right")); |
| - |
| WebFocusType retVal = WebFocusTypeNone; |
| - if (keyIdentifier == Down) |
| + if (key == "ArrowDown") |
|
bokan
2016/06/09 15:51:56
Perhaps these kind of "ArrowDown", "Backspace" typ
dtapuska
2016/06/09 18:20:33
sgtm; I can create a bug for that.
|
| retVal = WebFocusTypeDown; |
| - else if (keyIdentifier == Up) |
| + else if (key == "ArrowUp") |
| retVal = WebFocusTypeUp; |
| - else if (keyIdentifier == Left) |
| + else if (key == "ArrowLeft") |
| retVal = WebFocusTypeLeft; |
| - else if (keyIdentifier == Right) |
| + else if (key == "ArrowRight") |
| retVal = WebFocusTypeRight; |
| return retVal; |
| @@ -2716,14 +2711,14 @@ void EventHandler::defaultKeyboardEventHandler(KeyboardEvent* event) |
| m_frame->editor().handleKeyboardEvent(event); |
| if (event->defaultHandled()) |
| return; |
| - if (event->keyIdentifier() == "U+0009") { |
| + if (event->key() == "Tab") { |
| defaultTabEventHandler(event); |
| - } else if (event->keyIdentifier() == "U+0008") { |
| + } else if (event->key() == "Backspace") { |
| defaultBackspaceEventHandler(event); |
| - } else if (event->keyIdentifier() == "U+001B") { |
| + } else if (event->key() == "Escape") { |
| defaultEscapeEventHandler(event); |
| } else { |
| - WebFocusType type = focusDirectionForKey(AtomicString(event->keyIdentifier())); |
| + WebFocusType type = focusDirectionForKey(event->key()); |
| if (type != WebFocusTypeNone) |
| defaultArrowEventHandler(type, event); |
| } |