Index: third_party/WebKit/Source/core/html/forms/RadioButtonGroupScope.cpp |
diff --git a/third_party/WebKit/Source/core/html/forms/RadioButtonGroupScope.cpp b/third_party/WebKit/Source/core/html/forms/RadioButtonGroupScope.cpp |
index a09c6707046e34edadc476c3c5790a4a56f06f03..c60402ae16ec7684cbee795cec2d332b544be582 100644 |
--- a/third_party/WebKit/Source/core/html/forms/RadioButtonGroupScope.cpp |
+++ b/third_party/WebKit/Source/core/html/forms/RadioButtonGroupScope.cpp |
@@ -38,6 +38,7 @@ public: |
void requiredAttributeChanged(HTMLInputElement*); |
void remove(HTMLInputElement*); |
bool contains(HTMLInputElement*) const; |
+ unsigned size() const; |
DECLARE_TRACE(); |
@@ -180,6 +181,13 @@ void RadioButtonGroup::remove(HTMLInputElement* button) |
// valid only if the group was invalid. |
button->setNeedsValidityCheck(); |
} |
+ |
+ // Send notification to update AX attributes for AXObjects which radiobutton group has. |
+ if (!m_members.isEmpty()) { |
+ HTMLInputElement* input = m_members.begin()->key; |
+ if (AXObjectCache* cache = input->document().existingAXObjectCache()) |
+ cache->radiobuttonRemovedFromGroup(input); |
+ } |
} |
void RadioButtonGroup::setNeedsValidityCheckForAllButtons() |
@@ -196,6 +204,11 @@ bool RadioButtonGroup::contains(HTMLInputElement* button) const |
return m_members.contains(button); |
} |
+unsigned RadioButtonGroup::size() const |
+{ |
+ return m_members.size(); |
+} |
+ |
DEFINE_TRACE(RadioButtonGroup) |
{ |
#if ENABLE(OILPAN) |
@@ -277,6 +290,17 @@ bool RadioButtonGroupScope::isInRequiredGroup(HTMLInputElement* element) const |
return group && group->isRequired() && group->contains(element); |
} |
+unsigned RadioButtonGroupScope::groupSizeFor(const HTMLInputElement* element) const |
+{ |
+ if (!m_nameToGroupMap) |
+ return 0; |
+ |
+ RadioButtonGroup* group = m_nameToGroupMap->get(element->name()); |
+ if (!group) |
+ return 0; |
+ return group->size(); |
+} |
+ |
void RadioButtonGroupScope::removeButton(HTMLInputElement* element) |
{ |
ASSERT(element->type() == InputTypeNames::radio); |