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 1240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1251 return AXNodeObject::TextAlternative(recursive, in_aria_labelled_by_traversal, | 1251 return AXNodeObject::TextAlternative(recursive, in_aria_labelled_by_traversal, |
1252 visited, name_from, related_objects, | 1252 visited, name_from, related_objects, |
1253 name_sources); | 1253 name_sources); |
1254 } | 1254 } |
1255 | 1255 |
1256 // | 1256 // |
1257 // ARIA attributes. | 1257 // ARIA attributes. |
1258 // | 1258 // |
1259 | 1259 |
1260 void AXLayoutObject::AriaOwnsElements(AXObjectVector& owns) const { | 1260 void AXLayoutObject::AriaOwnsElements(AXObjectVector& owns) const { |
1261 AccessibilityChildrenFromAttribute(aria_ownsAttr, owns); | 1261 AccessibilityChildrenFromAOMProperty(AOMRelationListProperty::kOwns, owns); |
1262 } | 1262 } |
1263 | 1263 |
1264 void AXLayoutObject::AriaDescribedbyElements( | 1264 void AXLayoutObject::AriaDescribedbyElements( |
1265 AXObjectVector& describedby) const { | 1265 AXObjectVector& describedby) const { |
1266 AccessibilityChildrenFromAttribute(aria_describedbyAttr, describedby); | 1266 AccessibilityChildrenFromAOMProperty(AOMRelationListProperty::kDescribedBy, |
| 1267 describedby); |
1267 } | 1268 } |
1268 | 1269 |
1269 void AXLayoutObject::AriaLabelledbyElements(AXObjectVector& labelledby) const { | 1270 void AXLayoutObject::AriaLabelledbyElements(AXObjectVector& labelledby) const { |
1270 AccessibilityChildrenFromAttribute(aria_labelledbyAttr, labelledby); | 1271 AccessibilityChildrenFromAOMProperty(AOMRelationListProperty::kLabeledBy, |
| 1272 labelledby); |
1271 } | 1273 } |
1272 | 1274 |
1273 bool AXLayoutObject::AriaHasPopup() const { | 1275 bool AXLayoutObject::AriaHasPopup() const { |
1274 return ElementAttributeValue(aria_haspopupAttr); | 1276 return ElementAttributeValue(aria_haspopupAttr); |
1275 } | 1277 } |
1276 | 1278 |
1277 bool AXLayoutObject::AriaRoleHasPresentationalChildren() const { | 1279 bool AXLayoutObject::AriaRoleHasPresentationalChildren() const { |
1278 switch (aria_role_) { | 1280 switch (aria_role_) { |
1279 case kButtonRole: | 1281 case kButtonRole: |
1280 case kSliderRole: | 1282 case kSliderRole: |
(...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2244 return false; | 2246 return false; |
2245 | 2247 |
2246 // The ARIA spec says a tab item can also be selected if it is aria-labeled by | 2248 // The ARIA spec says a tab item can also be selected if it is aria-labeled by |
2247 // a tabpanel that has keyboard focus inside of it, or if a tabpanel in its | 2249 // a tabpanel that has keyboard focus inside of it, or if a tabpanel in its |
2248 // aria-controls list has KB focus inside of it. | 2250 // aria-controls list has KB focus inside of it. |
2249 AXObject* focused_element = AxObjectCache().FocusedObject(); | 2251 AXObject* focused_element = AxObjectCache().FocusedObject(); |
2250 if (!focused_element) | 2252 if (!focused_element) |
2251 return false; | 2253 return false; |
2252 | 2254 |
2253 HeapVector<Member<Element>> elements; | 2255 HeapVector<Member<Element>> elements; |
2254 ElementsFromAttribute(elements, aria_controlsAttr); | 2256 if (!HasAOMPropertyOrARIAAttribute(AOMRelationListProperty::kControls, |
| 2257 elements)) |
| 2258 return false; |
2255 | 2259 |
2256 for (const auto& element : elements) { | 2260 for (const auto& element : elements) { |
2257 AXObject* tab_panel = AxObjectCache().GetOrCreate(element); | 2261 AXObject* tab_panel = AxObjectCache().GetOrCreate(element); |
2258 | 2262 |
2259 // A tab item should only control tab panels. | 2263 // A tab item should only control tab panels. |
2260 if (!tab_panel || tab_panel->RoleValue() != kTabPanelRole) | 2264 if (!tab_panel || tab_panel->RoleValue() != kTabPanelRole) |
2261 continue; | 2265 continue; |
2262 | 2266 |
2263 AXObject* check_focus_element = focused_element; | 2267 AXObject* check_focus_element = focused_element; |
2264 // Check if the focused element is a descendant of the element controlled by | 2268 // Check if the focused element is a descendant of the element controlled by |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2515 | 2519 |
2516 bool AXLayoutObject::ElementAttributeValue( | 2520 bool AXLayoutObject::ElementAttributeValue( |
2517 const QualifiedName& attribute_name) const { | 2521 const QualifiedName& attribute_name) const { |
2518 if (!layout_object_) | 2522 if (!layout_object_) |
2519 return false; | 2523 return false; |
2520 | 2524 |
2521 return EqualIgnoringASCIICase(GetAttribute(attribute_name), "true"); | 2525 return EqualIgnoringASCIICase(GetAttribute(attribute_name), "true"); |
2522 } | 2526 } |
2523 | 2527 |
2524 } // namespace blink | 2528 } // namespace blink |
OLD | NEW |