Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2011 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2010 Google Inc. All rights reserved. | 3 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 120 document.setFocusedElement(inputElement, FocusParams(SelectionBehaviorOn Focus::None, WebFocusTypeNone, nullptr)); | 120 document.setFocusedElement(inputElement, FocusParams(SelectionBehaviorOn Focus::None, WebFocusTypeNone, nullptr)); |
| 121 inputElement->dispatchSimulatedClick(event, SendNoEvents); | 121 inputElement->dispatchSimulatedClick(event, SendNoEvents); |
| 122 event->setDefaultHandled(); | 122 event->setDefaultHandled(); |
| 123 return; | 123 return; |
| 124 } | 124 } |
| 125 } | 125 } |
| 126 | 126 |
| 127 void RadioInputType::handleKeyupEvent(KeyboardEvent* event) | 127 void RadioInputType::handleKeyupEvent(KeyboardEvent* event) |
| 128 { | 128 { |
| 129 const String& key = event->keyIdentifier(); | 129 const String& key = event->keyIdentifier(); |
| 130 if (key != "U+0020") | 130 if (key != "U+0020" && key != "Enter") |
|
aelias_OOO_until_Jul13
2016/02/10 07:09:21
For some reason, you're changing behavior globally
| |
| 131 return; | 131 return; |
| 132 // If an unselected radio is tabbed into (because the entire group has nothi ng | 132 // If an unselected radio is tabbed into (because the entire group has nothi ng |
| 133 // checked, or because of some explicit .focus() call), then allow space to check it. | 133 // checked, or because of some explicit .focus() call), then allow space to check it. |
| 134 if (element().checked()) | 134 if (element().checked()) |
| 135 return; | 135 return; |
| 136 dispatchSimulatedClickIfActive(event); | 136 dispatchSimulatedClickIfActive(event); |
| 137 } | 137 } |
| 138 | 138 |
| 139 bool RadioInputType::isKeyboardFocusable() const | 139 bool RadioInputType::isKeyboardFocusable() const |
| 140 { | 140 { |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 202 // The work we did in willDispatchClick was default handling. | 202 // The work we did in willDispatchClick was default handling. |
| 203 event->setDefaultHandled(); | 203 event->setDefaultHandled(); |
| 204 } | 204 } |
| 205 | 205 |
| 206 bool RadioInputType::shouldAppearIndeterminate() const | 206 bool RadioInputType::shouldAppearIndeterminate() const |
| 207 { | 207 { |
| 208 return !element().checkedRadioButtonForGroup(); | 208 return !element().checkedRadioButtonForGroup(); |
| 209 } | 209 } |
| 210 | 210 |
| 211 } // namespace blink | 211 } // namespace blink |
| OLD | NEW |