Chromium Code Reviews| Index: Source/modules/accessibility/AXListBoxOption.cpp |
| diff --git a/Source/modules/accessibility/AXListBoxOption.cpp b/Source/modules/accessibility/AXListBoxOption.cpp |
| index 58a91d3a8961d74c081a87413373c69a193e9678..d25fca17a50235dd0d219912416e1c48ca988cc1 100644 |
| --- a/Source/modules/accessibility/AXListBoxOption.cpp |
| +++ b/Source/modules/accessibility/AXListBoxOption.cpp |
| @@ -58,9 +58,36 @@ AccessibilityRole AXListBoxOption::roleValue() const |
| AccessibilityRole ariaRole = ariaRoleAttribute(); |
| if (ariaRole != UnknownRole) |
| return ariaRole; |
| + |
| + // Generally, the presentation role is handled in computeAccessibilityIsIgnored(). |
| + // In case of ListBoxOption, if it just marked as ignored in computeAccessibilityIsIgnored(), |
| + // we can't see listboxoption on tree without any text. |
| + // http://www.w3.org/TR/wai-aria/complete#presentation |
| + // ARIA spec says that the presentation role causes a given element to be treated |
| + // as having no role or to be removed from the accessibility tree, but does not cause the |
| + // content contained within the element to be removed from the accessibility tree. |
| + if (isParentPresentationRole()) |
| + return StaticTextRole; |
| + |
| return ListBoxOptionRole; |
| } |
| +bool AXListBoxOption::isParentPresentationRole() const |
| +{ |
| + AXObject* parent = parentObject(); |
| + if (!parent) |
| + return false; |
| + |
| + LayoutObject* layoutObject = parent->layoutObject(); |
| + if (!layoutObject) |
| + return false; |
| + |
| + if (layoutObject->isListBox() && (parent->isPresentation() || parent->hasInheritedPresentationRole())) |
|
dmazzoni
2015/04/01 15:27:55
Do you need both isPresentation and hasInheritedPr
je_julie(Not used)
2015/04/02 05:51:28
Yes. you're right. Done.
|
| + return true; |
| + |
| + return false; |
| +} |
| + |
| bool AXListBoxOption::isEnabled() const |
| { |
| if (!node()) |