OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008, 2009, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008, 2009, 2011 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 1751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1762 case kRadioButtonRole: | 1762 case kRadioButtonRole: |
1763 case kRowHeaderRole: | 1763 case kRowHeaderRole: |
1764 case kStaticTextRole: | 1764 case kStaticTextRole: |
1765 case kStatusRole: | 1765 case kStatusRole: |
1766 case kSwitchRole: | 1766 case kSwitchRole: |
1767 case kTabRole: | 1767 case kTabRole: |
1768 case kToggleButtonRole: | 1768 case kToggleButtonRole: |
1769 case kTreeItemRole: | 1769 case kTreeItemRole: |
1770 case kUserInterfaceTooltipRole: | 1770 case kUserInterfaceTooltipRole: |
1771 return true; | 1771 return true; |
| 1772 case kRowRole: { |
| 1773 // Spec says we should always expose the name on rows, |
| 1774 // but for performance reasons we only do it |
| 1775 // if the row might receive focus |
| 1776 if (AncestorExposesActiveDescendant()) { |
| 1777 return true; |
| 1778 } |
| 1779 const Node* node = this->GetNode(); |
| 1780 return node && node->IsElementNode() && ToElement(node)->IsFocusable(); |
| 1781 } |
1772 default: | 1782 default: |
1773 return false; | 1783 return false; |
1774 } | 1784 } |
1775 } | 1785 } |
1776 | 1786 |
1777 AccessibilityRole AXObject::ButtonRoleType() const { | 1787 AccessibilityRole AXObject::ButtonRoleType() const { |
1778 // If aria-pressed is present, then it should be exposed as a toggle button. | 1788 // If aria-pressed is present, then it should be exposed as a toggle button. |
1779 // http://www.w3.org/TR/wai-aria/states_and_properties#aria-pressed | 1789 // http://www.w3.org/TR/wai-aria/states_and_properties#aria-pressed |
1780 if (AriaPressedIsPresent()) | 1790 if (AriaPressedIsPresent()) |
1781 return kToggleButtonRole; | 1791 return kToggleButtonRole; |
(...skipping 19 matching lines...) Expand all Loading... |
1801 } | 1811 } |
1802 | 1812 |
1803 DEFINE_TRACE(AXObject) { | 1813 DEFINE_TRACE(AXObject) { |
1804 visitor->Trace(children_); | 1814 visitor->Trace(children_); |
1805 visitor->Trace(parent_); | 1815 visitor->Trace(parent_); |
1806 visitor->Trace(cached_live_region_root_); | 1816 visitor->Trace(cached_live_region_root_); |
1807 visitor->Trace(ax_object_cache_); | 1817 visitor->Trace(ax_object_cache_); |
1808 } | 1818 } |
1809 | 1819 |
1810 } // namespace blink | 1820 } // namespace blink |
OLD | NEW |