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

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

Issue 806823002: Ignore text elements for menu item related roles. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Make sure parent object is always a valid object Created 6 years 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 | « LayoutTests/accessibility/ignore-text-elements-for-menu-item-related-roles-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/accessibility/AXRenderObject.cpp
diff --git a/Source/modules/accessibility/AXRenderObject.cpp b/Source/modules/accessibility/AXRenderObject.cpp
index 66d3e6796b5184777fd2cff57bb695dddfc471fc..4aa37ae856edac34c5f749696f425b4fa77fee58 100644
--- a/Source/modules/accessibility/AXRenderObject.cpp
+++ b/Source/modules/accessibility/AXRenderObject.cpp
@@ -587,9 +587,11 @@ bool AXRenderObject::computeAccessibilityIsIgnored() const
// NOTE: BRs always have text boxes now, so the text box check here can be removed
if (m_renderer->isText()) {
// static text beneath MenuItems and MenuButtons are just reported along with the menu item, so it's ignored on an individual level
- AXObject* parent = parentObjectUnignored();
- if (parent && (parent->ariaRoleAttribute() == MenuItemRole || parent->ariaRoleAttribute() == MenuButtonRole))
- return true;
+ if (AXObject* parent = parentObjectUnignored()) {
+ AccessibilityRole role = parent->ariaRoleAttribute();
+ if (role == MenuItemRole || role == MenuItemRadioRole || role == MenuItemCheckBoxRole || role == MenuButtonRole)
+ return true;
+ }
RenderText* renderText = toRenderText(m_renderer);
if (m_renderer->isBR() || !renderText->firstTextBox())
return true;
« no previous file with comments | « LayoutTests/accessibility/ignore-text-elements-for-menu-item-related-roles-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698