| 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 22 matching lines...) Expand all Loading... |
| 33 static PassOwnPtrWillBeRawPtr<RadioButtonGroup> create(); | 33 static PassOwnPtrWillBeRawPtr<RadioButtonGroup> create(); |
| 34 bool isEmpty() const { return m_members.isEmpty(); } | 34 bool isEmpty() const { return m_members.isEmpty(); } |
| 35 bool isRequired() const { return m_requiredCount; } | 35 bool isRequired() const { return m_requiredCount; } |
| 36 HTMLInputElement* checkedButton() const { return m_checkedButton; } | 36 HTMLInputElement* checkedButton() const { return m_checkedButton; } |
| 37 void add(HTMLInputElement*); | 37 void add(HTMLInputElement*); |
| 38 void updateCheckedState(HTMLInputElement*); | 38 void updateCheckedState(HTMLInputElement*); |
| 39 void requiredAttributeChanged(HTMLInputElement*); | 39 void requiredAttributeChanged(HTMLInputElement*); |
| 40 void remove(HTMLInputElement*); | 40 void remove(HTMLInputElement*); |
| 41 bool contains(HTMLInputElement*) const; | 41 bool contains(HTMLInputElement*) const; |
| 42 | 42 |
| 43 void trace(Visitor*); | 43 DECLARE_TRACE(); |
| 44 | 44 |
| 45 private: | 45 private: |
| 46 RadioButtonGroup(); | 46 RadioButtonGroup(); |
| 47 void setNeedsValidityCheckForAllButtons(); | 47 void setNeedsValidityCheckForAllButtons(); |
| 48 bool isValid() const; | 48 bool isValid() const; |
| 49 void setCheckedButton(HTMLInputElement*); | 49 void setCheckedButton(HTMLInputElement*); |
| 50 | 50 |
| 51 WillBeHeapHashSet<RawPtrWillBeMember<HTMLInputElement>> m_members; | 51 WillBeHeapHashSet<RawPtrWillBeMember<HTMLInputElement>> m_members; |
| 52 RawPtrWillBeMember<HTMLInputElement> m_checkedButton; | 52 RawPtrWillBeMember<HTMLInputElement> m_checkedButton; |
| 53 size_t m_requiredCount; | 53 size_t m_requiredCount; |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 ASSERT(button->type() == InputTypeNames::radio); | 167 ASSERT(button->type() == InputTypeNames::radio); |
| 168 button->setNeedsValidityCheck(); | 168 button->setNeedsValidityCheck(); |
| 169 } | 169 } |
| 170 } | 170 } |
| 171 | 171 |
| 172 bool RadioButtonGroup::contains(HTMLInputElement* button) const | 172 bool RadioButtonGroup::contains(HTMLInputElement* button) const |
| 173 { | 173 { |
| 174 return m_members.contains(button); | 174 return m_members.contains(button); |
| 175 } | 175 } |
| 176 | 176 |
| 177 void RadioButtonGroup::trace(Visitor* visitor) | 177 DEFINE_TRACE(RadioButtonGroup) |
| 178 { | 178 { |
| 179 #if ENABLE(OILPAN) | 179 #if ENABLE(OILPAN) |
| 180 visitor->trace(m_members); | 180 visitor->trace(m_members); |
| 181 visitor->trace(m_checkedButton); | 181 visitor->trace(m_checkedButton); |
| 182 #endif | 182 #endif |
| 183 } | 183 } |
| 184 | 184 |
| 185 // ---------------------------------------------------------------- | 185 // ---------------------------------------------------------------- |
| 186 | 186 |
| 187 // Explicity define empty constructor and destructor in order to prevent the | 187 // Explicity define empty constructor and destructor in order to prevent the |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 return; | 268 return; |
| 269 group->remove(element); | 269 group->remove(element); |
| 270 if (group->isEmpty()) { | 270 if (group->isEmpty()) { |
| 271 // We don't remove an empty RadioButtonGroup from m_nameToGroupMap for | 271 // We don't remove an empty RadioButtonGroup from m_nameToGroupMap for |
| 272 // better performance. | 272 // better performance. |
| 273 ASSERT(!group->isRequired()); | 273 ASSERT(!group->isRequired()); |
| 274 ASSERT_WITH_SECURITY_IMPLICATION(!group->checkedButton()); | 274 ASSERT_WITH_SECURITY_IMPLICATION(!group->checkedButton()); |
| 275 } | 275 } |
| 276 } | 276 } |
| 277 | 277 |
| 278 void RadioButtonGroupScope::trace(Visitor* visitor) | 278 DEFINE_TRACE(RadioButtonGroupScope) |
| 279 { | 279 { |
| 280 #if ENABLE(OILPAN) | 280 #if ENABLE(OILPAN) |
| 281 visitor->trace(m_nameToGroupMap); | 281 visitor->trace(m_nameToGroupMap); |
| 282 #endif | 282 #endif |
| 283 } | 283 } |
| 284 | 284 |
| 285 } // namespace | 285 } // namespace |
| OLD | NEW |