| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 menuList->hidePopup(); | 49 menuList->hidePopup(); |
| 50 else | 50 else |
| 51 menuList->showPopup(); | 51 menuList->showPopup(); |
| 52 return true; | 52 return true; |
| 53 } | 53 } |
| 54 | 54 |
| 55 void AccessibilityMenuList::addChildren() | 55 void AccessibilityMenuList::addChildren() |
| 56 { | 56 { |
| 57 m_haveChildren = true; | 57 m_haveChildren = true; |
| 58 | 58 |
| 59 AXObjectCache* cache = m_renderer->document()->axObjectCache(); | 59 AXObjectCache* cache = m_renderer->document().axObjectCache(); |
| 60 | 60 |
| 61 AccessibilityObject* list = cache->getOrCreate(MenuListPopupRole); | 61 AccessibilityObject* list = cache->getOrCreate(MenuListPopupRole); |
| 62 if (!list) | 62 if (!list) |
| 63 return; | 63 return; |
| 64 | 64 |
| 65 static_cast<AccessibilityMockObject*>(list)->setParent(this); | 65 static_cast<AccessibilityMockObject*>(list)->setParent(this); |
| 66 if (list->accessibilityIsIgnored()) { | 66 if (list->accessibilityIsIgnored()) { |
| 67 cache->remove(list->axObjectID()); | 67 cache->remove(list->axObjectID()); |
| 68 return; | 68 return; |
| 69 } | 69 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 90 bool AccessibilityMenuList::canSetFocusAttribute() const | 90 bool AccessibilityMenuList::canSetFocusAttribute() const |
| 91 { | 91 { |
| 92 if (!node()) | 92 if (!node()) |
| 93 return false; | 93 return false; |
| 94 | 94 |
| 95 return !toElement(node())->isDisabledFormControl(); | 95 return !toElement(node())->isDisabledFormControl(); |
| 96 } | 96 } |
| 97 | 97 |
| 98 void AccessibilityMenuList::didUpdateActiveOption(int optionIndex) | 98 void AccessibilityMenuList::didUpdateActiveOption(int optionIndex) |
| 99 { | 99 { |
| 100 RefPtr<Document> document = m_renderer->document(); | 100 RefPtr<Document> document = &m_renderer->document(); |
| 101 AXObjectCache* cache = document->axObjectCache(); | 101 AXObjectCache* cache = document->axObjectCache(); |
| 102 | 102 |
| 103 const AccessibilityChildrenVector& childObjects = children(); | 103 const AccessibilityChildrenVector& childObjects = children(); |
| 104 if (!childObjects.isEmpty()) { | 104 if (!childObjects.isEmpty()) { |
| 105 ASSERT(childObjects.size() == 1); | 105 ASSERT(childObjects.size() == 1); |
| 106 ASSERT(childObjects[0]->isMenuListPopup()); | 106 ASSERT(childObjects[0]->isMenuListPopup()); |
| 107 | 107 |
| 108 if (childObjects[0]->isMenuListPopup()) { | 108 if (childObjects[0]->isMenuListPopup()) { |
| 109 if (AccessibilityMenuListPopup* popup = static_cast<AccessibilityMen
uListPopup*>(childObjects[0].get())) | 109 if (AccessibilityMenuListPopup* popup = static_cast<AccessibilityMen
uListPopup*>(childObjects[0].get())) |
| 110 popup->didUpdateActiveOption(optionIndex); | 110 popup->didUpdateActiveOption(optionIndex); |
| 111 } | 111 } |
| 112 } | 112 } |
| 113 | 113 |
| 114 cache->postNotification(this, document.get(), AXObjectCache::AXMenuListValue
Changed, true, PostSynchronously); | 114 cache->postNotification(this, document.get(), AXObjectCache::AXMenuListValue
Changed, true, PostSynchronously); |
| 115 } | 115 } |
| 116 | 116 |
| 117 } // namespace WebCore | 117 } // namespace WebCore |
| OLD | NEW |