#include "config.h"
#include "core/html/forms/RadioButtonGroupScope.h"
+#include "core/InputTypeNames.h"
#include "core/html/HTMLInputElement.h"
#include "wtf/HashSet.h"
void RadioButtonGroup::add(HTMLInputElement* button)
{
- ASSERT(button->isRadioButton());
+ ASSERT(button->type() == InputTypeNames::radio);
if (!m_members.add(button).isNewEntry)
return;
bool groupWasValid = isValid();
void RadioButtonGroup::updateCheckedState(HTMLInputElement* button)
{
- ASSERT(button->isRadioButton());
+ ASSERT(button->type() == InputTypeNames::radio);
ASSERT(m_members.contains(button));
bool wasValid = isValid();
if (button->checked()) {
}
if (wasValid != isValid())
setNeedsValidityCheckForAllButtons();
+ typedef WillBeHeapHashSet<RawPtrWillBeMember<HTMLInputElement> >::const_iterator Iterator;
+ Iterator end = m_members.end();
+ for (Iterator it = m_members.begin(); it != end; ++it) {
+ (*it)->pseudoStateChanged(CSSSelector::PseudoIndeterminate);
+ }
}
void RadioButtonGroup::requiredAttributeChanged(HTMLInputElement* button)
{
- ASSERT(button->isRadioButton());
+ ASSERT(button->type() == InputTypeNames::radio);
ASSERT(m_members.contains(button));
bool wasValid = isValid();
if (button->isRequired()) {
void RadioButtonGroup::remove(HTMLInputElement* button)
{
- ASSERT(button->isRadioButton());
+ ASSERT(button->type() == InputTypeNames::radio);
WillBeHeapHashSet<RawPtrWillBeMember<HTMLInputElement> >::iterator it = m_members.find(button);
if (it == m_members.end())
return;
Iterator end = m_members.end();
for (Iterator it = m_members.begin(); it != end; ++it) {
HTMLInputElement* button = *it;
- ASSERT(button->isRadioButton());
+ ASSERT(button->type() == InputTypeNames::radio);
button->setNeedsValidityCheck();
}
}
void RadioButtonGroupScope::addButton(HTMLInputElement* element)
{
- ASSERT(element->isRadioButton());
+ ASSERT(element->type() == InputTypeNames::radio);
if (element->name().isEmpty())
return;
void RadioButtonGroupScope::updateCheckedState(HTMLInputElement* element)
{
- ASSERT(element->isRadioButton());
+ ASSERT(element->type() == InputTypeNames::radio);
if (element->name().isEmpty())
return;
ASSERT(m_nameToGroupMap);
void RadioButtonGroupScope::requiredAttributeChanged(HTMLInputElement* element)
{
- ASSERT(element->isRadioButton());
+ ASSERT(element->type() == InputTypeNames::radio);
if (element->name().isEmpty())
return;
ASSERT(m_nameToGroupMap);
bool RadioButtonGroupScope::isInRequiredGroup(HTMLInputElement* element) const
{
- ASSERT(element->isRadioButton());
+ ASSERT(element->type() == InputTypeNames::radio);
if (element->name().isEmpty())
return false;
if (!m_nameToGroupMap)
void RadioButtonGroupScope::removeButton(HTMLInputElement* element)
{
- ASSERT(element->isRadioButton());
+ ASSERT(element->type() == InputTypeNames::radio);
if (element->name().isEmpty())
return;
if (!m_nameToGroupMap)