Chromium Code Reviews| 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..692cb4e5cfe247b7689dad3296462536100f69e0 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 sizeOfMembers() const; |
|
tkent
2016/03/01 01:43:00
I'd like name it "size" simply.
je_julie(Not used)
2016/03/01 13:46:07
I'll change it at next patch.
|
| 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::sizeOfMembers() 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::sizeOfGroup(const HTMLInputElement* element) const |
| +{ |
| + if (!m_nameToGroupMap) |
| + return 0; |
| + |
| + RadioButtonGroup* group = m_nameToGroupMap->get(element->name()); |
| + if (!group) |
| + return 0; |
| + return group->sizeOfMembers(); |
| +} |
| + |
| void RadioButtonGroupScope::removeButton(HTMLInputElement* element) |
| { |
| ASSERT(element->type() == InputTypeNames::radio); |