| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 } | 63 } |
| 64 | 64 |
| 65 void BaseCheckableInputType::appendToFormData(FormData& formData) const | 65 void BaseCheckableInputType::appendToFormData(FormData& formData) const |
| 66 { | 66 { |
| 67 if (element().checked()) | 67 if (element().checked()) |
| 68 formData.append(element().name(), element().value()); | 68 formData.append(element().name(), element().value()); |
| 69 } | 69 } |
| 70 | 70 |
| 71 void BaseCheckableInputType::handleKeydownEvent(KeyboardEvent* event) | 71 void BaseCheckableInputType::handleKeydownEvent(KeyboardEvent* event) |
| 72 { | 72 { |
| 73 const String& key = event->keyIdentifier(); | 73 const String& key = event->key(); |
| 74 if (key == "U+0020") { | 74 if (key == " ") { |
| 75 element().setActive(true); | 75 element().setActive(true); |
| 76 // No setDefaultHandled(), because IE dispatches a keypress in this case | 76 // No setDefaultHandled(), because IE dispatches a keypress in this case |
| 77 // and the caller will only dispatch a keypress if we don't call setDefa
ultHandled(). | 77 // and the caller will only dispatch a keypress if we don't call setDefa
ultHandled(). |
| 78 } | 78 } |
| 79 } | 79 } |
| 80 | 80 |
| 81 void BaseCheckableInputType::handleKeypressEvent(KeyboardEvent* event) | 81 void BaseCheckableInputType::handleKeypressEvent(KeyboardEvent* event) |
| 82 { | 82 { |
| 83 if (event->charCode() == ' ') { | 83 if (event->charCode() == ' ') { |
| 84 // Prevent scrolling down the page. | 84 // Prevent scrolling down the page. |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 { | 130 { |
| 131 return true; | 131 return true; |
| 132 } | 132 } |
| 133 | 133 |
| 134 bool BaseCheckableInputType::shouldDispatchFormControlChangeEvent(String& oldVal
ue, String& newValue) | 134 bool BaseCheckableInputType::shouldDispatchFormControlChangeEvent(String& oldVal
ue, String& newValue) |
| 135 { | 135 { |
| 136 return oldValue != newValue; | 136 return oldValue != newValue; |
| 137 } | 137 } |
| 138 | 138 |
| 139 } // namespace blink | 139 } // namespace blink |
| OLD | NEW |