| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 AXListBoxOption::~AXListBoxOption() | 47 AXListBoxOption::~AXListBoxOption() |
| 48 { | 48 { |
| 49 } | 49 } |
| 50 | 50 |
| 51 PassRefPtr<AXListBoxOption> AXListBoxOption::create(LayoutObject* layoutObject,
AXObjectCacheImpl* axObjectCache) | 51 PassRefPtr<AXListBoxOption> AXListBoxOption::create(LayoutObject* layoutObject,
AXObjectCacheImpl* axObjectCache) |
| 52 { | 52 { |
| 53 return adoptRef(new AXListBoxOption(layoutObject, axObjectCache)); | 53 return adoptRef(new AXListBoxOption(layoutObject, axObjectCache)); |
| 54 } | 54 } |
| 55 | 55 |
| 56 AccessibilityRole AXListBoxOption::roleValue() const | 56 AccessibilityRole AXListBoxOption::determineAccessibilityRole() |
| 57 { | 57 { |
| 58 AccessibilityRole ariaRole = ariaRoleAttribute(); | 58 if ((m_ariaRole = determineAriaRoleAttribute()) != UnknownRole) |
| 59 if (ariaRole != UnknownRole) | 59 return m_ariaRole; |
| 60 return ariaRole; | |
| 61 | 60 |
| 62 // http://www.w3.org/TR/wai-aria/complete#presentation | 61 // http://www.w3.org/TR/wai-aria/complete#presentation |
| 63 // ARIA spec says that the presentation role causes a given element to be tr
eated | 62 // ARIA spec says that the presentation role causes a given element to be tr
eated |
| 64 // as having no role or to be removed from the accessibility tree, but does
not cause the | 63 // as having no role or to be removed from the accessibility tree, but does
not cause the |
| 65 // content contained within the element to be removed from the accessibility
tree. | 64 // content contained within the element to be removed from the accessibility
tree. |
| 66 if (isParentPresentationalRole()) | 65 if (isParentPresentationalRole()) |
| 67 return StaticTextRole; | 66 return StaticTextRole; |
| 68 | 67 |
| 69 return ListBoxOptionRole; | 68 return ListBoxOptionRole; |
| 70 } | 69 } |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 unsigned length = listItems.size(); | 192 unsigned length = listItems.size(); |
| 194 for (unsigned i = 0; i < length; i++) { | 193 for (unsigned i = 0; i < length; i++) { |
| 195 if (listItems[i] == node()) | 194 if (listItems[i] == node()) |
| 196 return i; | 195 return i; |
| 197 } | 196 } |
| 198 | 197 |
| 199 return -1; | 198 return -1; |
| 200 } | 199 } |
| 201 | 200 |
| 202 } // namespace blink | 201 } // namespace blink |
| OLD | NEW |