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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 DCHECK(!m_checkedButton); | 160 DCHECK(!m_checkedButton); |
161 } else if (wasValid != isValid()) { | 161 } else if (wasValid != isValid()) { |
162 setNeedsValidityCheckForAllButtons(); | 162 setNeedsValidityCheckForAllButtons(); |
163 } | 163 } |
164 if (!wasValid) { | 164 if (!wasValid) { |
165 // A radio button not in a group is always valid. We need to make it | 165 // A radio button not in a group is always valid. We need to make it |
166 // valid only if the group was invalid. | 166 // valid only if the group was invalid. |
167 button->setNeedsValidityCheck(); | 167 button->setNeedsValidityCheck(); |
168 } | 168 } |
169 | 169 |
170 // Send notification to update AX attributes for AXObjects which radiobutton g
roup has. | 170 // Send notification to update AX attributes for AXObjects which radiobutton |
| 171 // group has. |
171 if (!m_members.isEmpty()) { | 172 if (!m_members.isEmpty()) { |
172 HTMLInputElement* input = m_members.begin()->key; | 173 HTMLInputElement* input = m_members.begin()->key; |
173 if (AXObjectCache* cache = input->document().existingAXObjectCache()) | 174 if (AXObjectCache* cache = input->document().existingAXObjectCache()) |
174 cache->radiobuttonRemovedFromGroup(input); | 175 cache->radiobuttonRemovedFromGroup(input); |
175 } | 176 } |
176 } | 177 } |
177 | 178 |
178 void RadioButtonGroup::setNeedsValidityCheckForAllButtons() { | 179 void RadioButtonGroup::setNeedsValidityCheckForAllButtons() { |
179 for (auto& element : m_members) { | 180 for (auto& element : m_members) { |
180 HTMLInputElement* const button = element.key; | 181 HTMLInputElement* const button = element.key; |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 DCHECK(!group->isRequired()); | 302 DCHECK(!group->isRequired()); |
302 SECURITY_DCHECK(!group->checkedButton()); | 303 SECURITY_DCHECK(!group->checkedButton()); |
303 } | 304 } |
304 } | 305 } |
305 | 306 |
306 DEFINE_TRACE(RadioButtonGroupScope) { | 307 DEFINE_TRACE(RadioButtonGroupScope) { |
307 visitor->trace(m_nameToGroupMap); | 308 visitor->trace(m_nameToGroupMap); |
308 } | 309 } |
309 | 310 |
310 } // namespace blink | 311 } // namespace blink |
OLD | NEW |