| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 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 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 AccessibilityRole AXListBox::determineAccessibilityRole() | 57 AccessibilityRole AXListBox::determineAccessibilityRole() |
| 58 { | 58 { |
| 59 if ((m_ariaRole = determineAriaRoleAttribute()) != UnknownRole) | 59 if ((m_ariaRole = determineAriaRoleAttribute()) != UnknownRole) |
| 60 return m_ariaRole; | 60 return m_ariaRole; |
| 61 | 61 |
| 62 return ListBoxRole; | 62 return ListBoxRole; |
| 63 } | 63 } |
| 64 | 64 |
| 65 AXObject* AXListBox::activeDescendant() const | 65 AXObject* AXListBox::activeDescendant() const |
| 66 { | 66 { |
| 67 if (!isHTMLSelectElement(node())) | 67 if (!isHTMLSelectElement(getNode())) |
| 68 return nullptr; | 68 return nullptr; |
| 69 | 69 |
| 70 HTMLSelectElement* select = toHTMLSelectElement(node()); | 70 HTMLSelectElement* select = toHTMLSelectElement(getNode()); |
| 71 int activeIndex = select->activeSelectionEndListIndex(); | 71 int activeIndex = select->activeSelectionEndListIndex(); |
| 72 if (activeIndex >= 0 && activeIndex < static_cast<int>(select->length())) { | 72 if (activeIndex >= 0 && activeIndex < static_cast<int>(select->length())) { |
| 73 HTMLOptionElement* option = select->item(m_activeIndex); | 73 HTMLOptionElement* option = select->item(m_activeIndex); |
| 74 return axObjectCache().get(option); | 74 return axObjectCache().get(option); |
| 75 } | 75 } |
| 76 | 76 |
| 77 return nullptr; | 77 return nullptr; |
| 78 } | 78 } |
| 79 | 79 |
| 80 void AXListBox::activeIndexChanged() | 80 void AXListBox::activeIndexChanged() |
| 81 { | 81 { |
| 82 if (!isHTMLSelectElement(node())) | 82 if (!isHTMLSelectElement(getNode())) |
| 83 return; | 83 return; |
| 84 | 84 |
| 85 HTMLSelectElement* select = toHTMLSelectElement(node()); | 85 HTMLSelectElement* select = toHTMLSelectElement(getNode()); |
| 86 int activeIndex = select->activeSelectionEndListIndex(); | 86 int activeIndex = select->activeSelectionEndListIndex(); |
| 87 if (activeIndex == m_activeIndex) | 87 if (activeIndex == m_activeIndex) |
| 88 return; | 88 return; |
| 89 | 89 |
| 90 m_activeIndex = activeIndex; | 90 m_activeIndex = activeIndex; |
| 91 if (!select->focused()) | 91 if (!select->focused()) |
| 92 return; | 92 return; |
| 93 | 93 |
| 94 if (m_activeIndex >= 0 && m_activeIndex < static_cast<int>(select->length())
) { | 94 if (m_activeIndex >= 0 && m_activeIndex < static_cast<int>(select->length())
) { |
| 95 HTMLOptionElement* option = select->item(m_activeIndex); | 95 HTMLOptionElement* option = select->item(m_activeIndex); |
| 96 axObjectCache().postNotification(option, AXObjectCacheImpl::AXFocusedUIE
lementChanged); | 96 axObjectCache().postNotification(option, AXObjectCacheImpl::AXFocusedUIE
lementChanged); |
| 97 } else { | 97 } else { |
| 98 axObjectCache().postNotification(this, AXObjectCacheImpl::AXFocusedUIEle
mentChanged); | 98 axObjectCache().postNotification(this, AXObjectCacheImpl::AXFocusedUIEle
mentChanged); |
| 99 } | 99 } |
| 100 } | 100 } |
| 101 | 101 |
| 102 } // namespace blink | 102 } // namespace blink |
| OLD | NEW |