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) |