| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 return m_parent->isEnabled(); | 59 return m_parent->isEnabled(); |
| 60 } | 60 } |
| 61 | 61 |
| 62 bool AccessibilityMenuListPopup::computeAccessibilityIsIgnored() const | 62 bool AccessibilityMenuListPopup::computeAccessibilityIsIgnored() const |
| 63 { | 63 { |
| 64 return accessibilityIsIgnoredByDefault(); | 64 return accessibilityIsIgnoredByDefault(); |
| 65 } | 65 } |
| 66 | 66 |
| 67 AccessibilityMenuListOption* AccessibilityMenuListPopup::menuListOptionAccessibi
lityObject(HTMLElement* element) const | 67 AccessibilityMenuListOption* AccessibilityMenuListPopup::menuListOptionAccessibi
lityObject(HTMLElement* element) const |
| 68 { | 68 { |
| 69 if (!element || !element->hasTagName(optionTag) || !element->attached()) | 69 if (!element || !element->hasTagName(optionTag) || !element->confusingAndOft
enMisusedAttached()) |
| 70 return 0; | 70 return 0; |
| 71 | 71 |
| 72 AccessibilityObject* object = document()->axObjectCache()->getOrCreate(MenuL
istOptionRole); | 72 AccessibilityObject* object = document()->axObjectCache()->getOrCreate(MenuL
istOptionRole); |
| 73 ASSERT_WITH_SECURITY_IMPLICATION(object->isMenuListOption()); | 73 ASSERT_WITH_SECURITY_IMPLICATION(object->isMenuListOption()); |
| 74 | 74 |
| 75 AccessibilityMenuListOption* option = static_cast<AccessibilityMenuListOptio
n*>(object); | 75 AccessibilityMenuListOption* option = static_cast<AccessibilityMenuListOptio
n*>(object); |
| 76 option->setElement(element); | 76 option->setElement(element); |
| 77 | 77 |
| 78 return option; | 78 return option; |
| 79 } | 79 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 107 m_children.append(option); | 107 m_children.append(option); |
| 108 } | 108 } |
| 109 } | 109 } |
| 110 } | 110 } |
| 111 | 111 |
| 112 void AccessibilityMenuListPopup::childrenChanged() | 112 void AccessibilityMenuListPopup::childrenChanged() |
| 113 { | 113 { |
| 114 AXObjectCache* cache = axObjectCache(); | 114 AXObjectCache* cache = axObjectCache(); |
| 115 for (size_t i = m_children.size(); i > 0 ; --i) { | 115 for (size_t i = m_children.size(); i > 0 ; --i) { |
| 116 AccessibilityObject* child = m_children[i - 1].get(); | 116 AccessibilityObject* child = m_children[i - 1].get(); |
| 117 if (child->actionElement() && !child->actionElement()->attached()) { | 117 if (child->actionElement() && !child->actionElement()->confusingAndOften
MisusedAttached()) { |
| 118 child->detachFromParent(); | 118 child->detachFromParent(); |
| 119 cache->remove(child->axObjectID()); | 119 cache->remove(child->axObjectID()); |
| 120 } | 120 } |
| 121 } | 121 } |
| 122 | 122 |
| 123 m_children.clear(); | 123 m_children.clear(); |
| 124 m_haveChildren = false; | 124 m_haveChildren = false; |
| 125 addChildren(); | 125 addChildren(); |
| 126 } | 126 } |
| 127 | 127 |
| 128 void AccessibilityMenuListPopup::didUpdateActiveOption(int optionIndex) | 128 void AccessibilityMenuListPopup::didUpdateActiveOption(int optionIndex) |
| 129 { | 129 { |
| 130 ASSERT_ARG(optionIndex, optionIndex >= 0); | 130 ASSERT_ARG(optionIndex, optionIndex >= 0); |
| 131 ASSERT_ARG(optionIndex, optionIndex < static_cast<int>(m_children.size())); | 131 ASSERT_ARG(optionIndex, optionIndex < static_cast<int>(m_children.size())); |
| 132 | 132 |
| 133 AXObjectCache* cache = axObjectCache(); | 133 AXObjectCache* cache = axObjectCache(); |
| 134 RefPtr<AccessibilityObject> child = m_children[optionIndex].get(); | 134 RefPtr<AccessibilityObject> child = m_children[optionIndex].get(); |
| 135 | 135 |
| 136 cache->postNotification(child.get(), document(), AXObjectCache::AXFocusedUIE
lementChanged, true, PostSynchronously); | 136 cache->postNotification(child.get(), document(), AXObjectCache::AXFocusedUIE
lementChanged, true, PostSynchronously); |
| 137 cache->postNotification(child.get(), document(), AXObjectCache::AXMenuListIt
emSelected, true, PostSynchronously); | 137 cache->postNotification(child.get(), document(), AXObjectCache::AXMenuListIt
emSelected, true, PostSynchronously); |
| 138 } | 138 } |
| 139 | 139 |
| 140 } // namespace WebCore | 140 } // namespace WebCore |
| OLD | NEW |