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 783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
794 int_attributes[ATTR_TITLE_UI_ELEMENT] = src.titleUIElement().axID(); | 794 int_attributes[ATTR_TITLE_UI_ELEMENT] = src.titleUIElement().axID(); |
795 if (!src.url().isEmpty()) | 795 if (!src.url().isEmpty()) |
796 string_attributes[ATTR_URL] = src.url().spec().utf16(); | 796 string_attributes[ATTR_URL] = src.url().spec().utf16(); |
797 | 797 |
798 if (role == ROLE_TREE_ITEM) | 798 if (role == ROLE_TREE_ITEM) |
799 int_attributes[ATTR_HIERARCHICAL_LEVEL] = src.hierarchicalLevel(); | 799 int_attributes[ATTR_HIERARCHICAL_LEVEL] = src.hierarchicalLevel(); |
800 | 800 |
801 if (role == ROLE_SLIDER) | 801 if (role == ROLE_SLIDER) |
802 include_children = false; | 802 include_children = false; |
803 | 803 |
| 804 // Treat the active list box item as focused. |
| 805 if (role == ROLE_LISTBOX_OPTION && src.isSelectedOptionActive()) |
| 806 state |= (1 << WebAccessibility::STATE_FOCUSED); |
| 807 |
804 WebKit::WebNode node = src.node(); | 808 WebKit::WebNode node = src.node(); |
805 bool is_iframe = false; | 809 bool is_iframe = false; |
806 | 810 |
807 if (!node.isNull() && node.isElementNode()) { | 811 if (!node.isNull() && node.isElementNode()) { |
808 WebKit::WebElement element = node.to<WebKit::WebElement>(); | 812 WebKit::WebElement element = node.to<WebKit::WebElement>(); |
809 is_iframe = (element.tagName() == ASCIIToUTF16("IFRAME")); | 813 is_iframe = (element.tagName() == ASCIIToUTF16("IFRAME")); |
810 | 814 |
811 // TODO(ctguil): The tagName in WebKit is lower cased but | 815 // TODO(ctguil): The tagName in WebKit is lower cased but |
812 // HTMLElement::nodeName calls localNameUpper. Consider adding | 816 // HTMLElement::nodeName calls localNameUpper. Consider adding |
813 // a WebElement method that returns the original lower cased tagName. | 817 // a WebElement method that returns the original lower cased tagName. |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1002 bool WebAccessibility::IsParentUnignoredOf( | 1006 bool WebAccessibility::IsParentUnignoredOf( |
1003 const WebKit::WebAccessibilityObject& ancestor, | 1007 const WebKit::WebAccessibilityObject& ancestor, |
1004 const WebKit::WebAccessibilityObject& child) { | 1008 const WebKit::WebAccessibilityObject& child) { |
1005 WebKit::WebAccessibilityObject parent = child.parentObject(); | 1009 WebKit::WebAccessibilityObject parent = child.parentObject(); |
1006 while (!parent.isNull() && parent.accessibilityIsIgnored()) | 1010 while (!parent.isNull() && parent.accessibilityIsIgnored()) |
1007 parent = parent.parentObject(); | 1011 parent = parent.parentObject(); |
1008 return parent.equals(ancestor); | 1012 return parent.equals(ancestor); |
1009 } | 1013 } |
1010 | 1014 |
1011 } // namespace webkit_glue | 1015 } // namespace webkit_glue |
OLD | NEW |