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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 if (event->defaultPrevented() || event->defaultHandled()) { | 189 if (event->defaultPrevented() || event->defaultHandled()) { |
190 // Restore the original selected radio button if possible. | 190 // Restore the original selected radio button if possible. |
191 // Make sure it is still a radio button and only do the restoration if i
t still belongs to our group. | 191 // Make sure it is still a radio button and only do the restoration if i
t still belongs to our group. |
192 HTMLInputElement* checkedRadioButton = state.checkedRadioButton.get(); | 192 HTMLInputElement* checkedRadioButton = state.checkedRadioButton.get(); |
193 if (!checkedRadioButton) | 193 if (!checkedRadioButton) |
194 element().setChecked(false); | 194 element().setChecked(false); |
195 else if (checkedRadioButton->type() == InputTypeNames::radio | 195 else if (checkedRadioButton->type() == InputTypeNames::radio |
196 && checkedRadioButton->form() == element().form() | 196 && checkedRadioButton->form() == element().form() |
197 && checkedRadioButton->name() == element().name()) | 197 && checkedRadioButton->name() == element().name()) |
198 checkedRadioButton->setChecked(true); | 198 checkedRadioButton->setChecked(true); |
| 199 } else { |
| 200 element().dispatchChangeEventIfNeeded(); |
199 } | 201 } |
200 | 202 |
201 // The work we did in willDispatchClick was default handling. | 203 // The work we did in willDispatchClick was default handling. |
202 event->setDefaultHandled(); | 204 event->setDefaultHandled(); |
203 } | 205 } |
204 | 206 |
205 bool RadioInputType::shouldAppearIndeterminate() const | 207 bool RadioInputType::shouldAppearIndeterminate() const |
206 { | 208 { |
207 return !element().checkedRadioButtonForGroup(); | 209 return !element().checkedRadioButtonForGroup(); |
208 } | 210 } |
209 | 211 |
210 } // namespace blink | 212 } // namespace blink |
OLD | NEW |