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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
144 | 144 |
145 Node* node = m_renderer->node(); | 145 Node* node = m_renderer->node(); |
146 if (!node) | 146 if (!node) |
147 return 0; | 147 return 0; |
148 | 148 |
149 LayoutRect parentRect = elementRect(); | 149 LayoutRect parentRect = elementRect(); |
150 | 150 |
151 AXObject* listBoxOption = 0; | 151 AXObject* listBoxOption = 0; |
152 unsigned length = m_children.size(); | 152 unsigned length = m_children.size(); |
153 for (unsigned i = 0; i < length; i++) { | 153 for (unsigned i = 0; i < length; i++) { |
154 LayoutRect rect = toRenderListBox(m_renderer)->itemBoundingBoxRect(paren tRect.location(), i); | 154 RenderListBox* listBox = toRenderListBox(m_renderer); |
155 LayoutRect rect = listBox->itemBoundingBoxRect(parentRect.location(), li stBox->toRenderListBoxIndex(i)); | |
keishi
2014/04/11 06:40:13
Ditto. toRenderListBoxIndex should be done inside
| |
155 // The cast to HTMLElement below is safe because the only other possible listItem type | 156 // The cast to HTMLElement below is safe because the only other possible listItem type |
156 // would be a WMLElement, but WML builds don't use accessibility feature s at all. | 157 // would be a WMLElement, but WML builds don't use accessibility feature s at all. |
157 if (rect.contains(point)) { | 158 if (rect.contains(point)) { |
158 listBoxOption = m_children[i].get(); | 159 listBoxOption = m_children[i].get(); |
159 break; | 160 break; |
160 } | 161 } |
161 } | 162 } |
162 | 163 |
163 if (listBoxOption && !listBoxOption->accessibilityIsIgnored()) | 164 if (listBoxOption && !listBoxOption->accessibilityIsIgnored()) |
164 return listBoxOption; | 165 return listBoxOption; |
165 | 166 |
166 return axObjectCache()->getOrCreate(m_renderer); | 167 return axObjectCache()->getOrCreate(m_renderer); |
167 } | 168 } |
168 | 169 |
169 } // namespace WebCore | 170 } // namespace WebCore |
OLD | NEW |