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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 HTMLSelectElement* htmlSelectElement = toHTMLSelectElement(parentNode); | 104 HTMLSelectElement* htmlSelectElement = toHTMLSelectElement(parentNode); |
105 m_haveChildren = true; | 105 m_haveChildren = true; |
106 | 106 |
107 if (m_activeIndex == -1) | 107 if (m_activeIndex == -1) |
108 m_activeIndex = getSelectedIndex(); | 108 m_activeIndex = getSelectedIndex(); |
109 | 109 |
110 for (const auto& optionElement : htmlSelectElement->optionList()) { | 110 for (const auto& optionElement : htmlSelectElement->optionList()) { |
111 AXMenuListOption* option = menuListOptionAXObject(optionElement); | 111 AXMenuListOption* option = menuListOptionAXObject(optionElement); |
112 if (option) { | 112 if (option) { |
113 option->setParent(this); | 113 option->setParent(this); |
114 m_children.append(option); | 114 m_children.push_back(option); |
115 } | 115 } |
116 } | 116 } |
117 } | 117 } |
118 | 118 |
119 void AXMenuListPopup::updateChildrenIfNecessary() { | 119 void AXMenuListPopup::updateChildrenIfNecessary() { |
120 if (m_haveChildren && m_parent && m_parent->needsToUpdateChildren()) | 120 if (m_haveChildren && m_parent && m_parent->needsToUpdateChildren()) |
121 clearChildren(); | 121 clearChildren(); |
122 | 122 |
123 if (!m_haveChildren) | 123 if (!m_haveChildren) |
124 addChildren(); | 124 addChildren(); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 } | 167 } |
168 | 168 |
169 AXObject* AXMenuListPopup::activeDescendant() { | 169 AXObject* AXMenuListPopup::activeDescendant() { |
170 if (m_activeIndex < 0 || m_activeIndex >= static_cast<int>(children().size())) | 170 if (m_activeIndex < 0 || m_activeIndex >= static_cast<int>(children().size())) |
171 return nullptr; | 171 return nullptr; |
172 | 172 |
173 return m_children[m_activeIndex].get(); | 173 return m_children[m_activeIndex].get(); |
174 } | 174 } |
175 | 175 |
176 } // namespace blink | 176 } // namespace blink |
OLD | NEW |