| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 | 186 |
| 187 void CheckedRadioButtons::addButton(HTMLInputElement* element) | 187 void CheckedRadioButtons::addButton(HTMLInputElement* element) |
| 188 { | 188 { |
| 189 ASSERT(element->isRadioButton()); | 189 ASSERT(element->isRadioButton()); |
| 190 if (element->name().isEmpty()) | 190 if (element->name().isEmpty()) |
| 191 return; | 191 return; |
| 192 | 192 |
| 193 if (!m_nameToGroupMap) | 193 if (!m_nameToGroupMap) |
| 194 m_nameToGroupMap = adoptPtr(new NameToGroupMap); | 194 m_nameToGroupMap = adoptPtr(new NameToGroupMap); |
| 195 | 195 |
| 196 OwnPtr<RadioButtonGroup>& group = m_nameToGroupMap->add(element->name(), Pas
sOwnPtr<RadioButtonGroup>()).iterator->value; | 196 OwnPtr<RadioButtonGroup>& group = m_nameToGroupMap->add(element->name(), Pas
sOwnPtr<RadioButtonGroup>()).storedValue->value; |
| 197 if (!group) | 197 if (!group) |
| 198 group = RadioButtonGroup::create(); | 198 group = RadioButtonGroup::create(); |
| 199 group->add(element); | 199 group->add(element); |
| 200 } | 200 } |
| 201 | 201 |
| 202 void CheckedRadioButtons::updateCheckedState(HTMLInputElement* element) | 202 void CheckedRadioButtons::updateCheckedState(HTMLInputElement* element) |
| 203 { | 203 { |
| 204 ASSERT(element->isRadioButton()); | 204 ASSERT(element->isRadioButton()); |
| 205 if (element->name().isEmpty()) | 205 if (element->name().isEmpty()) |
| 206 return; | 206 return; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 group->remove(element); | 258 group->remove(element); |
| 259 if (group->isEmpty()) { | 259 if (group->isEmpty()) { |
| 260 // We don't remove an empty RadioButtonGroup from m_nameToGroupMap for | 260 // We don't remove an empty RadioButtonGroup from m_nameToGroupMap for |
| 261 // better performance. | 261 // better performance. |
| 262 ASSERT(!group->isRequired()); | 262 ASSERT(!group->isRequired()); |
| 263 ASSERT_WITH_SECURITY_IMPLICATION(!group->checkedButton()); | 263 ASSERT_WITH_SECURITY_IMPLICATION(!group->checkedButton()); |
| 264 } | 264 } |
| 265 } | 265 } |
| 266 | 266 |
| 267 } // namespace | 267 } // namespace |
| OLD | NEW |