| 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 895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 906 } | 906 } |
| 907 | 907 |
| 908 if (m_renderer->isText()) | 908 if (m_renderer->isText()) |
| 909 return textUnderElement(); | 909 return textUnderElement(); |
| 910 | 910 |
| 911 if (cssBox && cssBox->isMenuList()) { | 911 if (cssBox && cssBox->isMenuList()) { |
| 912 // RenderMenuList will go straight to the text() of its selected item. | 912 // RenderMenuList will go straight to the text() of its selected item. |
| 913 // This has to be overridden in the case where the selected item has an
ARIA label. | 913 // This has to be overridden in the case where the selected item has an
ARIA label. |
| 914 HTMLSelectElement* selectElement = toHTMLSelectElement(m_renderer->node(
)); | 914 HTMLSelectElement* selectElement = toHTMLSelectElement(m_renderer->node(
)); |
| 915 int selectedIndex = selectElement->selectedIndex(); | 915 int selectedIndex = selectElement->selectedIndex(); |
| 916 const WillBeHeapVector<RawPtrWillBeMember<HTMLElement> >& listItems = se
lectElement->listItems(); | 916 const WillBeHeapVector<RawPtrWillBeMember<HTMLElement>>& listItems = sel
ectElement->listItems(); |
| 917 if (selectedIndex >= 0 && static_cast<size_t>(selectedIndex) < listItems
.size()) { | 917 if (selectedIndex >= 0 && static_cast<size_t>(selectedIndex) < listItems
.size()) { |
| 918 const AtomicString& overriddenDescription = listItems[selectedIndex]
->fastGetAttribute(aria_labelAttr); | 918 const AtomicString& overriddenDescription = listItems[selectedIndex]
->fastGetAttribute(aria_labelAttr); |
| 919 if (!overriddenDescription.isNull()) | 919 if (!overriddenDescription.isNull()) |
| 920 return overriddenDescription; | 920 return overriddenDescription; |
| 921 } | 921 } |
| 922 return toRenderMenuList(m_renderer)->text(); | 922 return toRenderMenuList(m_renderer)->text(); |
| 923 } | 923 } |
| 924 | 924 |
| 925 if (m_renderer->isListMarker()) | 925 if (m_renderer->isListMarker()) |
| 926 return toRenderListMarker(m_renderer)->text(); | 926 return toRenderListMarker(m_renderer)->text(); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 983 | 983 |
| 984 // An activedescendant is only useful if it has a renderer, because that's w
hat's needed to post the notification. | 984 // An activedescendant is only useful if it has a renderer, because that's w
hat's needed to post the notification. |
| 985 if (obj && obj->isAXRenderObject()) | 985 if (obj && obj->isAXRenderObject()) |
| 986 return obj; | 986 return obj; |
| 987 | 987 |
| 988 return 0; | 988 return 0; |
| 989 } | 989 } |
| 990 | 990 |
| 991 void AXRenderObject::accessibilityChildrenFromAttribute(QualifiedName attr, Acce
ssibilityChildrenVector& children) const | 991 void AXRenderObject::accessibilityChildrenFromAttribute(QualifiedName attr, Acce
ssibilityChildrenVector& children) const |
| 992 { | 992 { |
| 993 WillBeHeapVector<RawPtrWillBeMember<Element> > elements; | 993 WillBeHeapVector<RawPtrWillBeMember<Element>> elements; |
| 994 elementsFromAttribute(elements, attr); | 994 elementsFromAttribute(elements, attr); |
| 995 | 995 |
| 996 AXObjectCacheImpl* cache = axObjectCache(); | 996 AXObjectCacheImpl* cache = axObjectCache(); |
| 997 unsigned count = elements.size(); | 997 unsigned count = elements.size(); |
| 998 for (unsigned k = 0; k < count; ++k) { | 998 for (unsigned k = 0; k < count; ++k) { |
| 999 Element* element = elements[k]; | 999 Element* element = elements[k]; |
| 1000 AXObject* child = cache->getOrCreate(element); | 1000 AXObject* child = cache->getOrCreate(element); |
| 1001 if (child) | 1001 if (child) |
| 1002 children.append(child); | 1002 children.append(child); |
| 1003 } | 1003 } |
| (...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1965 if (!node || !node->isElementNode()) | 1965 if (!node || !node->isElementNode()) |
| 1966 return false; | 1966 return false; |
| 1967 | 1967 |
| 1968 // The ARIA spec says a tab item can also be selected if it is aria-labeled
by a tabpanel | 1968 // The ARIA spec says a tab item can also be selected if it is aria-labeled
by a tabpanel |
| 1969 // that has keyboard focus inside of it, or if a tabpanel in its aria-contro
ls list has KB | 1969 // that has keyboard focus inside of it, or if a tabpanel in its aria-contro
ls list has KB |
| 1970 // focus inside of it. | 1970 // focus inside of it. |
| 1971 AXObject* focusedElement = focusedUIElement(); | 1971 AXObject* focusedElement = focusedUIElement(); |
| 1972 if (!focusedElement) | 1972 if (!focusedElement) |
| 1973 return false; | 1973 return false; |
| 1974 | 1974 |
| 1975 WillBeHeapVector<RawPtrWillBeMember<Element> > elements; | 1975 WillBeHeapVector<RawPtrWillBeMember<Element>> elements; |
| 1976 elementsFromAttribute(elements, aria_controlsAttr); | 1976 elementsFromAttribute(elements, aria_controlsAttr); |
| 1977 | 1977 |
| 1978 unsigned count = elements.size(); | 1978 unsigned count = elements.size(); |
| 1979 for (unsigned k = 0; k < count; ++k) { | 1979 for (unsigned k = 0; k < count; ++k) { |
| 1980 Element* element = elements[k]; | 1980 Element* element = elements[k]; |
| 1981 AXObject* tabPanel = axObjectCache()->getOrCreate(element); | 1981 AXObject* tabPanel = axObjectCache()->getOrCreate(element); |
| 1982 | 1982 |
| 1983 // A tab item should only control tab panels. | 1983 // A tab item should only control tab panels. |
| 1984 if (!tabPanel || tabPanel->roleValue() != TabPanelRole) | 1984 if (!tabPanel || tabPanel->roleValue() != TabPanelRole) |
| 1985 continue; | 1985 continue; |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2420 if (label && label->renderer()) { | 2420 if (label && label->renderer()) { |
| 2421 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR
ect(); | 2421 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR
ect(); |
| 2422 result.unite(labelRect); | 2422 result.unite(labelRect); |
| 2423 } | 2423 } |
| 2424 } | 2424 } |
| 2425 | 2425 |
| 2426 return result; | 2426 return result; |
| 2427 } | 2427 } |
| 2428 | 2428 |
| 2429 } // namespace blink | 2429 } // namespace blink |
| OLD | NEW |