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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 { | 215 { |
216 if (element().isDisabledOrReadOnly()) | 216 if (element().isDisabledOrReadOnly()) |
217 return; | 217 return; |
218 const String& key = event->keyIdentifier(); | 218 const String& key = event->keyIdentifier(); |
219 if (key == "Up") | 219 if (key == "Up") |
220 spinButtonStepUp(); | 220 spinButtonStepUp(); |
221 else if (key == "Down") | 221 else if (key == "Down") |
222 spinButtonStepDown(); | 222 spinButtonStepDown(); |
223 else | 223 else |
224 return; | 224 return; |
225 element().dispatchFormControlChangeEvent(); | |
226 event->setDefaultHandled(); | 225 event->setDefaultHandled(); |
227 } | 226 } |
228 | 227 |
229 void TextFieldInputType::forwardEvent(Event* event) | 228 void TextFieldInputType::forwardEvent(Event* event) |
230 { | 229 { |
231 if (SpinButtonElement* spinButton = spinButtonElement()) { | 230 if (SpinButtonElement* spinButton = spinButtonElement()) { |
232 spinButton->forwardEvent(event); | 231 spinButton->forwardEvent(event); |
233 if (event->defaultHandled()) | 232 if (event->defaultHandled()) |
234 return; | 233 return; |
235 } | 234 } |
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 bool TextFieldInputType::shouldSpinButtonRespondToMouseEvents() | 568 bool TextFieldInputType::shouldSpinButtonRespondToMouseEvents() |
570 { | 569 { |
571 return !element().isDisabledOrReadOnly(); | 570 return !element().isDisabledOrReadOnly(); |
572 } | 571 } |
573 | 572 |
574 bool TextFieldInputType::shouldSpinButtonRespondToWheelEvents() | 573 bool TextFieldInputType::shouldSpinButtonRespondToWheelEvents() |
575 { | 574 { |
576 return shouldSpinButtonRespondToMouseEvents() && element().focused(); | 575 return shouldSpinButtonRespondToMouseEvents() && element().focused(); |
577 } | 576 } |
578 | 577 |
579 void TextFieldInputType::spinButtonDidReleaseMouseCapture() | |
580 { | |
581 element().dispatchFormControlChangeEvent(); | |
582 } | |
583 | |
584 } // namespace WebCore | 578 } // namespace WebCore |
OLD | NEW |