| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 void BaseCheckableInputType::appendToFormData(FormData& formData) const { | 62 void BaseCheckableInputType::appendToFormData(FormData& formData) const { |
| 63 if (element().checked()) | 63 if (element().checked()) |
| 64 formData.append(element().name(), element().value()); | 64 formData.append(element().name(), element().value()); |
| 65 } | 65 } |
| 66 | 66 |
| 67 void BaseCheckableInputType::handleKeydownEvent(KeyboardEvent* event) { | 67 void BaseCheckableInputType::handleKeydownEvent(KeyboardEvent* event) { |
| 68 const String& key = event->key(); | 68 const String& key = event->key(); |
| 69 if (key == " ") { | 69 if (key == " ") { |
| 70 element().setActive(true); | 70 element().setActive(true); |
| 71 // No setDefaultHandled(), because IE dispatches a keypress in this case | 71 // No setDefaultHandled(), because IE dispatches a keypress in this case |
| 72 // and the caller will only dispatch a keypress if we don't call setDefaultH
andled(). | 72 // and the caller will only dispatch a keypress if we don't call |
| 73 // setDefaultHandled(). |
| 73 } | 74 } |
| 74 } | 75 } |
| 75 | 76 |
| 76 void BaseCheckableInputType::handleKeypressEvent(KeyboardEvent* event) { | 77 void BaseCheckableInputType::handleKeypressEvent(KeyboardEvent* event) { |
| 77 if (event->charCode() == ' ') { | 78 if (event->charCode() == ' ') { |
| 78 // Prevent scrolling down the page. | 79 // Prevent scrolling down the page. |
| 79 event->setDefaultHandled(); | 80 event->setDefaultHandled(); |
| 80 } | 81 } |
| 81 } | 82 } |
| 82 | 83 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 return true; | 122 return true; |
| 122 } | 123 } |
| 123 | 124 |
| 124 bool BaseCheckableInputType::shouldDispatchFormControlChangeEvent( | 125 bool BaseCheckableInputType::shouldDispatchFormControlChangeEvent( |
| 125 String& oldValue, | 126 String& oldValue, |
| 126 String& newValue) { | 127 String& newValue) { |
| 127 return oldValue != newValue; | 128 return oldValue != newValue; |
| 128 } | 129 } |
| 129 | 130 |
| 130 } // namespace blink | 131 } // namespace blink |
| OLD | NEW |