OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2010 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 ASSERT(m_children.size() == 1); | 81 ASSERT(m_children.size() == 1); |
82 m_children[0]->childrenChanged(); | 82 m_children[0]->childrenChanged(); |
83 } | 83 } |
84 | 84 |
85 bool AXMenuList::isCollapsed() const | 85 bool AXMenuList::isCollapsed() const |
86 { | 86 { |
87 return !toRenderMenuList(m_renderer)->popupIsVisible(); | 87 return !toRenderMenuList(m_renderer)->popupIsVisible(); |
88 } | 88 } |
89 | 89 |
| 90 AccessibilityExpanded AXMenuList::isExpanded() const |
| 91 { |
| 92 if (isCollapsed()) |
| 93 return ExpandedCollapsed; |
| 94 |
| 95 return ExpandedExpanded; |
| 96 } |
| 97 |
90 bool AXMenuList::canSetFocusAttribute() const | 98 bool AXMenuList::canSetFocusAttribute() const |
91 { | 99 { |
92 if (!node()) | 100 if (!node()) |
93 return false; | 101 return false; |
94 | 102 |
95 return !toElement(node())->isDisabledFormControl(); | 103 return !toElement(node())->isDisabledFormControl(); |
96 } | 104 } |
97 | 105 |
98 void AXMenuList::didUpdateActiveOption(int optionIndex) | 106 void AXMenuList::didUpdateActiveOption(int optionIndex) |
99 { | 107 { |
100 RefPtrWillBeRawPtr<Document> document(m_renderer->document()); | 108 RefPtrWillBeRawPtr<Document> document(m_renderer->document()); |
101 AXObjectCacheImpl* cache = toAXObjectCacheImpl(document->axObjectCache()); | 109 AXObjectCacheImpl* cache = toAXObjectCacheImpl(document->axObjectCache()); |
102 | 110 |
103 const AccessibilityChildrenVector& childObjects = children(); | 111 const AccessibilityChildrenVector& childObjects = children(); |
104 if (!childObjects.isEmpty()) { | 112 if (!childObjects.isEmpty()) { |
105 ASSERT(childObjects.size() == 1); | 113 ASSERT(childObjects.size() == 1); |
106 ASSERT(childObjects[0]->isMenuListPopup()); | 114 ASSERT(childObjects[0]->isMenuListPopup()); |
107 | 115 |
108 if (childObjects[0]->isMenuListPopup()) { | 116 if (childObjects[0]->isMenuListPopup()) { |
109 if (AXMenuListPopup* popup = toAXMenuListPopup(childObjects[0].get()
)) | 117 if (AXMenuListPopup* popup = toAXMenuListPopup(childObjects[0].get()
)) |
110 popup->didUpdateActiveOption(optionIndex); | 118 popup->didUpdateActiveOption(optionIndex); |
111 } | 119 } |
112 } | 120 } |
113 | 121 |
114 cache->postNotification(this, document.get(), AXObjectCacheImpl::AXMenuListV
alueChanged, true); | 122 cache->postNotification(this, document.get(), AXObjectCacheImpl::AXMenuListV
alueChanged, true); |
115 } | 123 } |
116 | 124 |
117 } // namespace blink | 125 } // namespace blink |
OLD | NEW |