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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 return 0; | 75 return 0; |
76 | 76 |
77 return toAXMenuListOption(object); | 77 return toAXMenuListOption(object); |
78 } | 78 } |
79 | 79 |
80 int AXMenuListPopup::getSelectedIndex() const | 80 int AXMenuListPopup::getSelectedIndex() const |
81 { | 81 { |
82 if (!m_parent) | 82 if (!m_parent) |
83 return -1; | 83 return -1; |
84 | 84 |
85 Node* parentNode = m_parent->node(); | 85 Node* parentNode = m_parent->getNode(); |
86 if (!isHTMLSelectElement(parentNode)) | 86 if (!isHTMLSelectElement(parentNode)) |
87 return -1; | 87 return -1; |
88 | 88 |
89 HTMLSelectElement* htmlSelectElement = toHTMLSelectElement(parentNode); | 89 HTMLSelectElement* htmlSelectElement = toHTMLSelectElement(parentNode); |
90 return htmlSelectElement->selectedIndex(); | 90 return htmlSelectElement->selectedIndex(); |
91 } | 91 } |
92 | 92 |
93 bool AXMenuListPopup::press() const | 93 bool AXMenuListPopup::press() const |
94 { | 94 { |
95 if (!m_parent) | 95 if (!m_parent) |
96 return false; | 96 return false; |
97 | 97 |
98 m_parent->press(); | 98 m_parent->press(); |
99 return true; | 99 return true; |
100 } | 100 } |
101 | 101 |
102 void AXMenuListPopup::addChildren() | 102 void AXMenuListPopup::addChildren() |
103 { | 103 { |
104 ASSERT(!isDetached()); | 104 ASSERT(!isDetached()); |
105 if (!m_parent) | 105 if (!m_parent) |
106 return; | 106 return; |
107 | 107 |
108 Node* parentNode = m_parent->node(); | 108 Node* parentNode = m_parent->getNode(); |
109 if (!isHTMLSelectElement(parentNode)) | 109 if (!isHTMLSelectElement(parentNode)) |
110 return; | 110 return; |
111 | 111 |
112 HTMLSelectElement* htmlSelectElement = toHTMLSelectElement(parentNode); | 112 HTMLSelectElement* htmlSelectElement = toHTMLSelectElement(parentNode); |
113 m_haveChildren = true; | 113 m_haveChildren = true; |
114 | 114 |
115 if (m_activeIndex == -1) | 115 if (m_activeIndex == -1) |
116 m_activeIndex = getSelectedIndex(); | 116 m_activeIndex = getSelectedIndex(); |
117 | 117 |
118 const WillBeHeapVector<RawPtrWillBeMember<HTMLElement>>& listItems = htmlSel
ectElement->listItems(); | 118 const WillBeHeapVector<RawPtrWillBeMember<HTMLElement>>& listItems = htmlSel
ectElement->listItems(); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 | 178 |
179 AXObject* AXMenuListPopup::activeChild() | 179 AXObject* AXMenuListPopup::activeChild() |
180 { | 180 { |
181 if (m_activeIndex < 0 || m_activeIndex >= static_cast<int>(children().size()
)) | 181 if (m_activeIndex < 0 || m_activeIndex >= static_cast<int>(children().size()
)) |
182 return nullptr; | 182 return nullptr; |
183 | 183 |
184 return m_children[m_activeIndex].get(); | 184 return m_children[m_activeIndex].get(); |
185 } | 185 } |
186 | 186 |
187 } // namespace blink | 187 } // namespace blink |
OLD | NEW |