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 2170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2181 | 2181 |
2182 // The element we find may not be accessible, so find the first accessible o bject. | 2182 // The element we find may not be accessible, so find the first accessible o bject. |
2183 return firstAccessibleObjectFromNode(linkedNode); | 2183 return firstAccessibleObjectFromNode(linkedNode); |
2184 } | 2184 } |
2185 | 2185 |
2186 AccessibilityObject* AccessibilityRenderObject::accessibilityImageMapHitTest(HTM LAreaElement* area, const IntPoint& point) const | 2186 AccessibilityObject* AccessibilityRenderObject::accessibilityImageMapHitTest(HTM LAreaElement* area, const IntPoint& point) const |
2187 { | 2187 { |
2188 if (!area) | 2188 if (!area) |
2189 return 0; | 2189 return 0; |
2190 | 2190 |
2191 HTMLMapElement* map = static_cast<HTMLMapElement*>(area->parentNode()); | 2191 Element* mapParent = area->parentElement(); |
inferno
2013/06/08 22:44:39
Why should we traverse the parent chain ? Is this
| |
2192 while (mapParent && !mapParent->hasTagName(mapTag)) | |
2193 mapParent = mapParent->parentElement(); | |
2194 if (!mapParent) | |
2195 return 0; | |
2196 HTMLMapElement* map = static_cast<HTMLMapElement*>(mapParent); | |
2192 AccessibilityObject* parent = accessibilityParentForImageMap(map); | 2197 AccessibilityObject* parent = accessibilityParentForImageMap(map); |
2193 if (!parent) | 2198 if (!parent) |
2194 return 0; | 2199 return 0; |
2195 | 2200 |
2196 AccessibilityObject::AccessibilityChildrenVector children = parent->children (); | 2201 AccessibilityObject::AccessibilityChildrenVector children = parent->children (); |
2197 | 2202 |
2198 unsigned count = children.size(); | 2203 unsigned count = children.size(); |
2199 for (unsigned k = 0; k < count; ++k) { | 2204 for (unsigned k = 0; k < count; ++k) { |
2200 if (children[k]->elementRect().contains(point)) | 2205 if (children[k]->elementRect().contains(point)) |
2201 return children[k].get(); | 2206 return children[k].get(); |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2604 if (label && label->renderer()) { | 2609 if (label && label->renderer()) { |
2605 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR ect(); | 2610 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR ect(); |
2606 result.unite(labelRect); | 2611 result.unite(labelRect); |
2607 } | 2612 } |
2608 } | 2613 } |
2609 | 2614 |
2610 return result; | 2615 return result; |
2611 } | 2616 } |
2612 | 2617 |
2613 } // namespace WebCore | 2618 } // namespace WebCore |
OLD | NEW |