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

Side by Side Diff: third_party/WebKit/Source/core/html/forms/TextFieldInputType.cpp

Issue 2045603002: Handle the "key" field as opposed to keyIdentifier field. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove initialization of the view 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * Copyright (C) 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2011 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 chromeClient->handleKeyboardEventOnTextField(element(), *event); 203 chromeClient->handleKeyboardEventOnTextField(element(), *event);
204 return; 204 return;
205 } 205 }
206 event->setDefaultHandled(); 206 event->setDefaultHandled();
207 } 207 }
208 208
209 void TextFieldInputType::handleKeydownEventForSpinButton(KeyboardEvent* event) 209 void TextFieldInputType::handleKeydownEventForSpinButton(KeyboardEvent* event)
210 { 210 {
211 if (element().isDisabledOrReadOnly()) 211 if (element().isDisabledOrReadOnly())
212 return; 212 return;
213 const String& key = event->keyIdentifier(); 213 const String& key = event->key();
214 if (key == "Up") 214 if (key == "ArrowUp")
215 spinButtonStepUp(); 215 spinButtonStepUp();
216 else if (key == "Down" && !event->altKey()) 216 else if (key == "ArrowDown" && !event->altKey())
217 spinButtonStepDown(); 217 spinButtonStepDown();
218 else 218 else
219 return; 219 return;
220 element().dispatchFormControlChangeEvent(); 220 element().dispatchFormControlChangeEvent();
221 event->setDefaultHandled(); 221 event->setDefaultHandled();
222 } 222 }
223 223
224 void TextFieldInputType::forwardEvent(Event* event) 224 void TextFieldInputType::forwardEvent(Event* event)
225 { 225 {
226 if (SpinButtonElement* spinButton = spinButtonElement()) { 226 if (SpinButtonElement* spinButton = spinButtonElement()) {
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 return shouldSpinButtonRespondToMouseEvents() && element().focused(); 551 return shouldSpinButtonRespondToMouseEvents() && element().focused();
552 } 552 }
553 553
554 void TextFieldInputType::spinButtonDidReleaseMouseCapture(SpinButtonElement::Eve ntDispatch eventDispatch) 554 void TextFieldInputType::spinButtonDidReleaseMouseCapture(SpinButtonElement::Eve ntDispatch eventDispatch)
555 { 555 {
556 if (eventDispatch == SpinButtonElement::EventDispatchAllowed) 556 if (eventDispatch == SpinButtonElement::EventDispatchAllowed)
557 element().dispatchFormControlChangeEvent(); 557 element().dispatchFormControlChangeEvent();
558 } 558 }
559 559
560 } // namespace blink 560 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698