| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |