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

Unified Diff: Source/core/accessibility/AXRenderObject.cpp

Issue 679623002: Check whether aria-expanded attribute is defined (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update expanded API for AXMenuList Created 6 years, 2 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: Source/core/accessibility/AXRenderObject.cpp
diff --git a/Source/core/accessibility/AXRenderObject.cpp b/Source/core/accessibility/AXRenderObject.cpp
index b66468d79180da9832394543b082c7a59fa4e3bb..1a553c8c07a4db9854734eee3c963af20276f5e2 100644
--- a/Source/core/accessibility/AXRenderObject.cpp
+++ b/Source/core/accessibility/AXRenderObject.cpp
@@ -1737,8 +1737,17 @@ void AXRenderObject::handleAriaExpandedChanged()
axObjectCache()->postNotification(containerParent, document(), AXObjectCacheImpl::AXRowCountChanged, true);
// Post that the specific row either collapsed or expanded.
- if (roleValue() == RowRole || roleValue() == TreeItemRole)
- axObjectCache()->postNotification(this, document(), isExpanded() ? AXObjectCacheImpl::AXRowExpanded : AXObjectCacheImpl::AXRowCollapsed, true);
+ AccessibilityExpanded expanded = isExpanded();
+ if (!expanded)
+ return;
+
+ if (roleValue() == RowRole || roleValue() == TreeItemRole) {
+ AXObjectCacheImpl::AXNotification notification = AXObjectCacheImpl::AXRowExpanded;
+ if (expanded == ExpandedCollapsed)
+ notification = AXObjectCacheImpl::AXRowCollapsed;
+
+ axObjectCache()->postNotification(this, document(), notification, true);
+ }
}
void AXRenderObject::textChanged()

Powered by Google App Engine
This is Rietveld 408576698