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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 { | 153 { |
154 // the internal HTMLSelectElement methods for returning a listbox option at
a point | 154 // the internal HTMLSelectElement methods for returning a listbox option at
a point |
155 // ignore optgroup elements. | 155 // ignore optgroup elements. |
156 if (!m_renderer) | 156 if (!m_renderer) |
157 return 0; | 157 return 0; |
158 | 158 |
159 Node* node = m_renderer->node(); | 159 Node* node = m_renderer->node(); |
160 if (!node) | 160 if (!node) |
161 return 0; | 161 return 0; |
162 | 162 |
163 LayoutRect parentRect = boundingBoxRect(); | 163 LayoutRect parentRect = elementRect(); |
164 | 164 |
165 AccessibilityObject* listBoxOption = 0; | 165 AccessibilityObject* listBoxOption = 0; |
166 unsigned length = m_children.size(); | 166 unsigned length = m_children.size(); |
167 for (unsigned i = 0; i < length; i++) { | 167 for (unsigned i = 0; i < length; i++) { |
168 LayoutRect rect = toRenderListBox(m_renderer)->itemBoundingBoxRect(paren
tRect.location(), i); | 168 LayoutRect rect = toRenderListBox(m_renderer)->itemBoundingBoxRect(paren
tRect.location(), i); |
169 // The cast to HTMLElement below is safe because the only other possible
listItem type | 169 // The cast to HTMLElement below is safe because the only other possible
listItem type |
170 // would be a WMLElement, but WML builds don't use accessibility feature
s at all. | 170 // would be a WMLElement, but WML builds don't use accessibility feature
s at all. |
171 if (rect.contains(point)) { | 171 if (rect.contains(point)) { |
172 listBoxOption = m_children[i].get(); | 172 listBoxOption = m_children[i].get(); |
173 break; | 173 break; |
174 } | 174 } |
175 } | 175 } |
176 | 176 |
177 if (listBoxOption && !listBoxOption->accessibilityIsIgnored()) | 177 if (listBoxOption && !listBoxOption->accessibilityIsIgnored()) |
178 return listBoxOption; | 178 return listBoxOption; |
179 | 179 |
180 return axObjectCache()->getOrCreate(m_renderer); | 180 return axObjectCache()->getOrCreate(m_renderer); |
181 } | 181 } |
182 | 182 |
183 } // namespace WebCore | 183 } // namespace WebCore |
OLD | NEW |