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 2458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2469 LayoutBoxModelObject* cssBox = layoutBoxModelObject(); | 2469 LayoutBoxModelObject* cssBox = layoutBoxModelObject(); |
2470 if (!cssBox || !cssBox->isLayoutImage()) | 2470 if (!cssBox || !cssBox->isLayoutImage()) |
2471 return; | 2471 return; |
2472 | 2472 |
2473 HTMLMapElement* map = toLayoutImage(cssBox)->imageMap(); | 2473 HTMLMapElement* map = toLayoutImage(cssBox)->imageMap(); |
2474 if (!map) | 2474 if (!map) |
2475 return; | 2475 return; |
2476 | 2476 |
2477 for (HTMLAreaElement& area : Traversal<HTMLAreaElement>::descendantsOf(*map)
) { | 2477 for (HTMLAreaElement& area : Traversal<HTMLAreaElement>::descendantsOf(*map)
) { |
2478 // add an <area> element for this child if it has a link | 2478 // add an <area> element for this child if it has a link |
2479 if (area.isLink()) { | 2479 AXObject* obj = axObjectCache().getOrCreate(&area); |
2480 AXImageMapLink* areaObject = toAXImageMapLink(axObjectCache().getOrC
reate(ImageMapLinkRole)); | 2480 if (obj) { |
2481 areaObject->setHTMLAreaElement(&area); | 2481 AXImageMapLink* areaObject = toAXImageMapLink(obj); |
2482 areaObject->setHTMLMapElement(map); | |
2483 areaObject->setParent(this); | 2482 areaObject->setParent(this); |
2484 ASSERT(areaObject->axObjectID() != 0); | 2483 ASSERT(areaObject->axObjectID() != 0); |
2485 if (!areaObject->accessibilityIsIgnored()) | 2484 if (!areaObject->accessibilityIsIgnored()) |
2486 m_children.append(areaObject); | 2485 m_children.append(areaObject); |
2487 else | 2486 else |
2488 axObjectCache().remove(areaObject->axObjectID()); | 2487 axObjectCache().remove(areaObject->axObjectID()); |
2489 } | 2488 } |
2490 } | 2489 } |
2491 } | 2490 } |
2492 | 2491 |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2593 if (label && label->layoutObject()) { | 2592 if (label && label->layoutObject()) { |
2594 LayoutRect labelRect = axObjectCache().getOrCreate(label)->elementRe
ct(); | 2593 LayoutRect labelRect = axObjectCache().getOrCreate(label)->elementRe
ct(); |
2595 result.unite(labelRect); | 2594 result.unite(labelRect); |
2596 } | 2595 } |
2597 } | 2596 } |
2598 | 2597 |
2599 return result; | 2598 return result; |
2600 } | 2599 } |
2601 | 2600 |
2602 } // namespace blink | 2601 } // namespace blink |
OLD | NEW |