Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Unified Diff: third_party/WebKit/Source/core/html/forms/RadioButtonGroupScope.cpp

Issue 1628283002: posinset and setsize for input type, radio, exposed in AX tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed isRadiobutton() Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698