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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 setNode(renderer->node()); | 210 setNode(renderer->node()); |
211 } | 211 } |
212 | 212 |
213 RenderBoxModelObject* AXRenderObject::renderBoxModelObject() const | 213 RenderBoxModelObject* AXRenderObject::renderBoxModelObject() const |
214 { | 214 { |
215 if (!m_renderer || !m_renderer->isBoxModelObject()) | 215 if (!m_renderer || !m_renderer->isBoxModelObject()) |
216 return 0; | 216 return 0; |
217 return toRenderBoxModelObject(m_renderer); | 217 return toRenderBoxModelObject(m_renderer); |
218 } | 218 } |
219 | 219 |
220 RenderView* AXRenderObject::topRenderer() const | |
221 { | |
222 Document* topDoc = topDocument(); | |
223 if (!topDoc) | |
224 return 0; | |
225 | |
226 return topDoc->renderView(); | |
227 } | |
228 | |
229 Document* AXRenderObject::topDocument() const | 220 Document* AXRenderObject::topDocument() const |
230 { | 221 { |
231 if (!document()) | 222 if (!document()) |
232 return 0; | 223 return 0; |
233 return &document()->topDocument(); | 224 return &document()->topDocument(); |
234 } | 225 } |
235 | 226 |
236 bool AXRenderObject::shouldNotifyActiveDescendant() const | 227 bool AXRenderObject::shouldNotifyActiveDescendant() const |
237 { | 228 { |
238 // We want to notify that the combo box has changed its active descendant, | 229 // We want to notify that the combo box has changed its active descendant, |
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
853 return queryString(WebLocalizedString::AXRadioButtonActionVerb); | 844 return queryString(WebLocalizedString::AXRadioButtonActionVerb); |
854 case CheckBoxRole: | 845 case CheckBoxRole: |
855 return queryString(isChecked() ? WebLocalizedString::AXCheckedCheckBoxAc
tionVerb : WebLocalizedString::AXUncheckedCheckBoxActionVerb); | 846 return queryString(isChecked() ? WebLocalizedString::AXCheckedCheckBoxAc
tionVerb : WebLocalizedString::AXUncheckedCheckBoxActionVerb); |
856 case LinkRole: | 847 case LinkRole: |
857 return queryString(WebLocalizedString::AXLinkActionVerb); | 848 return queryString(WebLocalizedString::AXLinkActionVerb); |
858 default: | 849 default: |
859 return emptyString(); | 850 return emptyString(); |
860 } | 851 } |
861 } | 852 } |
862 | 853 |
863 void AXRenderObject::selectedChildren(AccessibilityChildrenVector& result) | |
864 { | |
865 ASSERT(result.isEmpty()); | |
866 | |
867 // only listboxes should be asked for their selected children. | |
868 AccessibilityRole role = roleValue(); | |
869 if (role == ListBoxRole) // native list boxes would be AXListBoxes, so only
check for aria list boxes | |
870 ariaListboxSelectedChildren(result); | |
871 else if (role == TreeRole || role == TreeGridRole || role == TableRole) | |
872 ariaSelectedRows(result); | |
873 } | |
874 | |
875 String AXRenderObject::stringValue() const | 854 String AXRenderObject::stringValue() const |
876 { | 855 { |
877 if (!m_renderer) | 856 if (!m_renderer) |
878 return String(); | 857 return String(); |
879 | 858 |
880 if (isPasswordField()) | 859 if (isPasswordField()) |
881 return String(); | 860 return String(); |
882 | 861 |
883 RenderBoxModelObject* cssBox = renderBoxModelObject(); | 862 RenderBoxModelObject* cssBox = renderBoxModelObject(); |
884 | 863 |
(...skipping 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1921 while (checkFocusElement) { | 1900 while (checkFocusElement) { |
1922 if (tabPanel == checkFocusElement) | 1901 if (tabPanel == checkFocusElement) |
1923 return true; | 1902 return true; |
1924 checkFocusElement = checkFocusElement->parentObject(); | 1903 checkFocusElement = checkFocusElement->parentObject(); |
1925 } | 1904 } |
1926 } | 1905 } |
1927 | 1906 |
1928 return false; | 1907 return false; |
1929 } | 1908 } |
1930 | 1909 |
1931 AXObject* AXRenderObject::internalLinkElement() const | |
1932 { | |
1933 Element* element = anchorElement(); | |
1934 // Right now, we do not support ARIA links as internal link elements | |
1935 if (!isHTMLAnchorElement(element)) | |
1936 return 0; | |
1937 HTMLAnchorElement& anchor = toHTMLAnchorElement(*element); | |
1938 | |
1939 KURL linkURL = anchor.href(); | |
1940 String fragmentIdentifier = linkURL.fragmentIdentifier(); | |
1941 if (fragmentIdentifier.isEmpty()) | |
1942 return 0; | |
1943 | |
1944 // check if URL is the same as current URL | |
1945 KURL documentURL = m_renderer->document().url(); | |
1946 if (!equalIgnoringFragmentIdentifier(documentURL, linkURL)) | |
1947 return 0; | |
1948 | |
1949 Node* linkedNode = m_renderer->document().findAnchor(fragmentIdentifier); | |
1950 if (!linkedNode) | |
1951 return 0; | |
1952 | |
1953 // The element we find may not be accessible, so find the first accessible o
bject. | |
1954 return firstAccessibleObjectFromNode(linkedNode); | |
1955 } | |
1956 | |
1957 AXObject* AXRenderObject::accessibilityImageMapHitTest(HTMLAreaElement* area, co
nst IntPoint& point) const | 1910 AXObject* AXRenderObject::accessibilityImageMapHitTest(HTMLAreaElement* area, co
nst IntPoint& point) const |
1958 { | 1911 { |
1959 if (!area) | 1912 if (!area) |
1960 return 0; | 1913 return 0; |
1961 | 1914 |
1962 AXObject* parent = axObjectCache()->getOrCreate(area->imageElement()); | 1915 AXObject* parent = axObjectCache()->getOrCreate(area->imageElement()); |
1963 if (!parent) | 1916 if (!parent) |
1964 return 0; | 1917 return 0; |
1965 | 1918 |
1966 AXObject::AccessibilityChildrenVector children = parent->children(); | 1919 AXObject::AccessibilityChildrenVector children = parent->children(); |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2354 if (label && label->renderer()) { | 2307 if (label && label->renderer()) { |
2355 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR
ect(); | 2308 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR
ect(); |
2356 result.unite(labelRect); | 2309 result.unite(labelRect); |
2357 } | 2310 } |
2358 } | 2311 } |
2359 | 2312 |
2360 return result; | 2313 return result; |
2361 } | 2314 } |
2362 | 2315 |
2363 } // namespace WebCore | 2316 } // namespace WebCore |
OLD | NEW |