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

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: 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/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 18cb7f157e6a1fb4740a695867431d2b414ee637..24e8dfb4fafb045a431d840db4e3c8fd2b6962bf 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp
@@ -29,6 +29,7 @@
#include "modules/accessibility/AXObjectCacheImpl.h"
#include "core/HTMLNames.h"
+#include "core/InputTypeNames.h"
#include "core/dom/Document.h"
#include "core/frame/FrameView.h"
#include "core/frame/LocalFrame.h"
@@ -65,6 +66,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 +307,9 @@ AXObject* AXObjectCacheImpl::createFromRenderer(LayoutObject* layoutObject)
if (isHTMLOptionElement(node))
return AXListBoxOption::create(layoutObject, *this);
+ if (isHTMLInputElement(node) && toHTMLInputElement(node)->type() == InputTypeNames::radio)
+ return AXRadioInput::create(layoutObject, *this);
+
if (layoutObject->isSVGRoot())
return AXSVGRoot::create(layoutObject, *this);
@@ -932,6 +937,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)->findFirstRadioButtonInGroup(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