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