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

Unified Diff: Source/modules/accessibility/AXObjectCacheImpl.cpp

Issue 1034493005: Fire AX notifications on list box options. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@menu_list_more
Patch Set: Update expectations for other test that failed Created 5 years, 9 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
« no previous file with comments | « Source/modules/accessibility/AXObjectCacheImpl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/accessibility/AXObjectCacheImpl.cpp
diff --git a/Source/modules/accessibility/AXObjectCacheImpl.cpp b/Source/modules/accessibility/AXObjectCacheImpl.cpp
index 247178f6970e17caf1fdd28e88f3335e0d7d28a7..a70a16ea3b0420532e71bb8a1c3df47f56d8772b 100644
--- a/Source/modules/accessibility/AXObjectCacheImpl.cpp
+++ b/Source/modules/accessibility/AXObjectCacheImpl.cpp
@@ -39,6 +39,8 @@
#include "core/html/HTMLImageElement.h"
#include "core/html/HTMLInputElement.h"
#include "core/html/HTMLLabelElement.h"
+#include "core/html/HTMLOptionElement.h"
+#include "core/html/HTMLSelectElement.h"
#include "core/layout/LayoutListBox.h"
#include "core/layout/LayoutMenuList.h"
#include "core/layout/LayoutProgress.h"
@@ -747,21 +749,23 @@ void AXObjectCacheImpl::checkedStateChanged(Node* node)
postNotification(node, AXObjectCacheImpl::AXCheckedStateChanged);
}
-void AXObjectCacheImpl::selectedChildrenChanged(Node* node)
+void AXObjectCacheImpl::listboxOptionStateChanged(HTMLOptionElement* option)
{
- selectedChildrenChanged(get(node));
+ postNotification(option, AXCheckedStateChanged);
}
-void AXObjectCacheImpl::selectedChildrenChanged(LayoutObject* layoutObject)
+void AXObjectCacheImpl::listboxSelectedChildrenChanged(HTMLSelectElement* select)
{
- selectedChildrenChanged(get(layoutObject));
+ postNotification(select, AXSelectedChildrenChanged);
}
-void AXObjectCacheImpl::selectedChildrenChanged(AXObject* obj)
+void AXObjectCacheImpl::listboxActiveIndexChanged(HTMLSelectElement* select)
{
- while (obj && obj->roleValue() != ListBoxRole)
- obj = obj->parentObject();
- postNotification(obj, AXSelectedChildrenChanged);
+ AXObject* obj = get(select);
+ if (!obj || !obj->isAXListBox())
+ return;
+
+ static_cast<AXListBox*>(obj)->activeIndexChanged();
}
void AXObjectCacheImpl::handleScrollbarUpdate(FrameView* view)
@@ -796,6 +800,19 @@ void AXObjectCacheImpl::handleAriaExpandedChange(Node* node)
obj->handleAriaExpandedChanged();
}
+void AXObjectCacheImpl::handleAriaSelectedChanged(Node* node)
+{
+ AXObject* obj = get(node);
+ if (!obj)
+ return;
+
+ postNotification(obj, AXCheckedStateChanged);
+
+ AXObject* listbox = obj->parentObjectUnignored();
+ if (listbox->roleValue() == ListBoxRole)
+ postNotification(listbox, AXSelectedChildrenChanged);
+}
+
void AXObjectCacheImpl::handleActiveDescendantChanged(Node* node)
{
if (AXObject* obj = getOrCreate(node))
@@ -832,7 +849,7 @@ void AXObjectCacheImpl::handleAttributeChanged(const QualifiedName& attrName, El
else if (attrName == aria_checkedAttr)
checkedStateChanged(element);
else if (attrName == aria_selectedAttr)
- selectedChildrenChanged(element);
+ handleAriaSelectedChanged(element);
else if (attrName == aria_expandedAttr)
handleAriaExpandedChange(element);
else if (attrName == aria_hiddenAttr)
« no previous file with comments | « Source/modules/accessibility/AXObjectCacheImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698