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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
52 } | 52 } |
53 | 53 |
54 void BaseCheckableInputType::appendToFormData(FormData& formData) const | 54 void BaseCheckableInputType::appendToFormData(FormData& formData) const |
55 { | 55 { |
56 if (element().checked()) | 56 if (element().checked()) |
57 formData.append(element().name(), element().value()); | 57 formData.append(element().name(), element().value()); |
58 } | 58 } |
59 | 59 |
60 void BaseCheckableInputType::handleKeydownEvent(KeyboardEvent* event) | 60 void BaseCheckableInputType::handleKeydownEvent(KeyboardEvent* event) |
61 { | 61 { |
62 const String& key = event->keyIdentifier(); | 62 const String& key = event->keyIdentifier(); |
dtapuska
2016/02/09 14:29:03
As per the similar comment before; keyIdentifier w
| |
63 if (key == "U+0020") { | 63 if (key == "U+0020" || key == "Enter") { |
64 element().setActive(true); | 64 element().setActive(true); |
65 // No setDefaultHandled(), because IE dispatches a keypress in this case | 65 // No setDefaultHandled(), because IE dispatches a keypress in this case |
66 // and the caller will only dispatch a keypress if we don't call setDefa ultHandled(). | 66 // and the caller will only dispatch a keypress if we don't call setDefa ultHandled(). |
67 } | 67 } |
68 } | 68 } |
69 | 69 |
70 void BaseCheckableInputType::handleKeypressEvent(KeyboardEvent* event) | 70 void BaseCheckableInputType::handleKeypressEvent(KeyboardEvent* event) |
71 { | 71 { |
72 if (event->charCode() == ' ') { | 72 if (event->charCode() == ' ') { |
73 // Prevent scrolling down the page. | 73 // Prevent scrolling down the page. |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
113 { | 113 { |
114 return true; | 114 return true; |
115 } | 115 } |
116 | 116 |
117 bool BaseCheckableInputType::shouldDispatchFormControlChangeEvent(String& oldVal ue, String& newValue) | 117 bool BaseCheckableInputType::shouldDispatchFormControlChangeEvent(String& oldVal ue, String& newValue) |
118 { | 118 { |
119 return oldValue != newValue; | 119 return oldValue != newValue; |
120 } | 120 } |
121 | 121 |
122 } // namespace blink | 122 } // namespace blink |
OLD | NEW |