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

Unified Diff: third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.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: Moved position handling to AXRadioInput 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/modules/accessibility/AXObjectCacheImpl.cpp
diff --git a/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp b/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp
index 73d29f6a1ae820776412366a50188bc00b0e5d26..23535a15b4bcc3bbbe72f77c99e9c8d01cd29d63 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp
@@ -65,6 +65,7 @@
#include "modules/accessibility/AXMenuListOption.h"
#include "modules/accessibility/AXMenuListPopup.h"
#include "modules/accessibility/AXProgressIndicator.h"
+#include "modules/accessibility/AXRadioInput.h"
#include "modules/accessibility/AXSVGRoot.h"
#include "modules/accessibility/AXSlider.h"
#include "modules/accessibility/AXSpinButton.h"
@@ -305,6 +306,9 @@ AXObject* AXObjectCacheImpl::createFromRenderer(LayoutObject* layoutObject)
if (isHTMLOptionElement(node))
return AXListBoxOption::create(layoutObject, *this);
+ if (isHTMLInputElement(node) && toHTMLInputElement(node)->isRadioButton())
+ return AXRadioInput::create(layoutObject, *this);
+
if (layoutObject->isSVGRoot())
return AXSVGRoot::create(layoutObject, *this);
@@ -922,6 +926,24 @@ void AXObjectCacheImpl::listboxActiveIndexChanged(HTMLSelectElement* select)
toAXListBox(obj)->activeIndexChanged();
}
+void AXObjectCacheImpl::radiobuttonRemovedFromGroup(HTMLInputElement* groupMember)
+{
+ AXObject* obj = get(groupMember);
+ if (!obj || !obj->isAXRadioInput())
+ return;
+
+ // The 'posInSet' and 'setSize' attributes should be updated from the first node,
+ // as the removed node is already detached from tree.
+ HTMLInputElement* firstRadio = toAXRadioInput(obj)->findFristFocusableRadioButtonInGroup(groupMember);
+ AXObject* firstObj = get(firstRadio);
+ if (!firstObj || !firstObj->isAXRadioInput())
+ return;
+
+ toAXRadioInput(firstObj)->updatePosAndSetSize(1);
+ postNotification(firstObj, AXAriaAttributeChanged);
+ toAXRadioInput(firstObj)->requestUpdateToNextNode(true);
+}
+
void AXObjectCacheImpl::handleLayoutComplete(LayoutObject* layoutObject)
{
if (!layoutObject)

Powered by Google App Engine
This is Rietveld 408576698