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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
199 return; | 199 return; |
200 } | 200 } |
201 event->setDefaultHandled(); | 201 event->setDefaultHandled(); |
202 } | 202 } |
203 | 203 |
204 void TextFieldInputType::handleKeydownEventForSpinButton(KeyboardEvent* event) | 204 void TextFieldInputType::handleKeydownEventForSpinButton(KeyboardEvent* event) |
205 { | 205 { |
206 if (element().isDisabledOrReadOnly()) | 206 if (element().isDisabledOrReadOnly()) |
207 return; | 207 return; |
208 const String& key = event->keyIdentifier(); | 208 const String& key = event->keyIdentifier(); |
209 if (key == "Up") | 209 if (key == "Up") { |
210 spinButtonStepUp(); | 210 spinButtonStepUp(); |
211 else if (key == "Down") | 211 } else if (key == "Down" && !event->altKey()) { |
212 spinButtonStepDown(); | 212 spinButtonStepDown(); |
213 else | 213 } else if (key == "Down" && event->altKey()) { |
214 if (Chrome* chrome = this->chrome()) { | |
215 chrome->client().handleKeyboardEventOnTextField(element(), *event); | |
keishi
2014/04/02 08:38:01
I think if we return early without calling event->
| |
216 return; | |
217 } | |
218 } else | |
214 return; | 219 return; |
215 event->setDefaultHandled(); | 220 event->setDefaultHandled(); |
216 } | 221 } |
217 | 222 |
218 void TextFieldInputType::forwardEvent(Event* event) | 223 void TextFieldInputType::forwardEvent(Event* event) |
219 { | 224 { |
220 if (SpinButtonElement* spinButton = spinButtonElement()) { | 225 if (SpinButtonElement* spinButton = spinButtonElement()) { |
221 spinButton->forwardEvent(event); | 226 spinButton->forwardEvent(event); |
222 if (event->defaultHandled()) | 227 if (event->defaultHandled()) |
223 return; | 228 return; |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
552 { | 557 { |
553 return !element().isDisabledOrReadOnly(); | 558 return !element().isDisabledOrReadOnly(); |
554 } | 559 } |
555 | 560 |
556 bool TextFieldInputType::shouldSpinButtonRespondToWheelEvents() | 561 bool TextFieldInputType::shouldSpinButtonRespondToWheelEvents() |
557 { | 562 { |
558 return shouldSpinButtonRespondToMouseEvents() && element().focused(); | 563 return shouldSpinButtonRespondToMouseEvents() && element().focused(); |
559 } | 564 } |
560 | 565 |
561 } // namespace WebCore | 566 } // namespace WebCore |
OLD | NEW |