| 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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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") |
| 212 spinButtonStepDown(); | 212 spinButtonStepDown(); |
| 213 else | 213 else |
| 214 return; | 214 return; |
| 215 element().dispatchFormControlChangeEvent(); | |
| 216 event->setDefaultHandled(); | 215 event->setDefaultHandled(); |
| 217 } | 216 } |
| 218 | 217 |
| 219 void TextFieldInputType::forwardEvent(Event* event) | 218 void TextFieldInputType::forwardEvent(Event* event) |
| 220 { | 219 { |
| 221 if (SpinButtonElement* spinButton = spinButtonElement()) { | 220 if (SpinButtonElement* spinButton = spinButtonElement()) { |
| 222 spinButton->forwardEvent(event); | 221 spinButton->forwardEvent(event); |
| 223 if (event->defaultHandled()) | 222 if (event->defaultHandled()) |
| 224 return; | 223 return; |
| 225 } | 224 } |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 bool TextFieldInputType::shouldSpinButtonRespondToMouseEvents() | 558 bool TextFieldInputType::shouldSpinButtonRespondToMouseEvents() |
| 560 { | 559 { |
| 561 return !element().isDisabledOrReadOnly(); | 560 return !element().isDisabledOrReadOnly(); |
| 562 } | 561 } |
| 563 | 562 |
| 564 bool TextFieldInputType::shouldSpinButtonRespondToWheelEvents() | 563 bool TextFieldInputType::shouldSpinButtonRespondToWheelEvents() |
| 565 { | 564 { |
| 566 return shouldSpinButtonRespondToMouseEvents() && element().focused(); | 565 return shouldSpinButtonRespondToMouseEvents() && element().focused(); |
| 567 } | 566 } |
| 568 | 567 |
| 569 void TextFieldInputType::spinButtonDidReleaseMouseCapture() | |
| 570 { | |
| 571 element().dispatchFormControlChangeEvent(); | |
| 572 } | |
| 573 | |
| 574 } // namespace WebCore | 568 } // namespace WebCore |
| OLD | NEW |