OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "webkit/glue/webaccessibility.h" | 5 #include "webkit/glue/webaccessibility.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
806 int_attributes[ATTR_TITLE_UI_ELEMENT] = src.titleUIElement().axID(); | 806 int_attributes[ATTR_TITLE_UI_ELEMENT] = src.titleUIElement().axID(); |
807 if (!src.url().isEmpty()) | 807 if (!src.url().isEmpty()) |
808 string_attributes[ATTR_URL] = src.url().spec().utf16(); | 808 string_attributes[ATTR_URL] = src.url().spec().utf16(); |
809 | 809 |
810 if (role == ROLE_TREE_ITEM) | 810 if (role == ROLE_TREE_ITEM) |
811 int_attributes[ATTR_HIERARCHICAL_LEVEL] = src.hierarchicalLevel(); | 811 int_attributes[ATTR_HIERARCHICAL_LEVEL] = src.hierarchicalLevel(); |
812 | 812 |
813 if (role == ROLE_SLIDER) | 813 if (role == ROLE_SLIDER) |
814 include_children = false; | 814 include_children = false; |
815 | 815 |
| 816 // Treat the active list box item as focused. |
| 817 if (role == ROLE_LISTBOX_OPTION && src.isSelectedOptionActive()) |
| 818 state |= (1 << WebAccessibility::STATE_FOCUSED); |
| 819 |
816 WebKit::WebNode node = src.node(); | 820 WebKit::WebNode node = src.node(); |
817 bool is_iframe = false; | 821 bool is_iframe = false; |
818 | 822 |
819 if (!node.isNull() && node.isElementNode()) { | 823 if (!node.isNull() && node.isElementNode()) { |
820 WebKit::WebElement element = node.to<WebKit::WebElement>(); | 824 WebKit::WebElement element = node.to<WebKit::WebElement>(); |
821 is_iframe = (element.tagName() == ASCIIToUTF16("IFRAME")); | 825 is_iframe = (element.tagName() == ASCIIToUTF16("IFRAME")); |
822 | 826 |
823 // TODO(ctguil): The tagName in WebKit is lower cased but | 827 // TODO(ctguil): The tagName in WebKit is lower cased but |
824 // HTMLElement::nodeName calls localNameUpper. Consider adding | 828 // HTMLElement::nodeName calls localNameUpper. Consider adding |
825 // a WebElement method that returns the original lower cased tagName. | 829 // a WebElement method that returns the original lower cased tagName. |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1022 bool WebAccessibility::IsParentUnignoredOf( | 1026 bool WebAccessibility::IsParentUnignoredOf( |
1023 const WebKit::WebAccessibilityObject& ancestor, | 1027 const WebKit::WebAccessibilityObject& ancestor, |
1024 const WebKit::WebAccessibilityObject& child) { | 1028 const WebKit::WebAccessibilityObject& child) { |
1025 WebKit::WebAccessibilityObject parent = child.parentObject(); | 1029 WebKit::WebAccessibilityObject parent = child.parentObject(); |
1026 while (!parent.isNull() && parent.accessibilityIsIgnored()) | 1030 while (!parent.isNull() && parent.accessibilityIsIgnored()) |
1027 parent = parent.parentObject(); | 1031 parent = parent.parentObject(); |
1028 return parent.equals(ancestor); | 1032 return parent.equals(ancestor); |
1029 } | 1033 } |
1030 | 1034 |
1031 } // namespace webkit_glue | 1035 } // namespace webkit_glue |
OLD | NEW |