| 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 10 matching lines...) Expand all Loading... |
| 21 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 21 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 */ | 27 */ |
| 28 | 28 |
| 29 #include "modules/accessibility/AXImageMapLink.h" | 29 #include "modules/accessibility/AXImageMapLink.h" |
| 30 | 30 |
| 31 #include "SkMatrix44.h" |
| 31 #include "core/dom/ElementTraversal.h" | 32 #include "core/dom/ElementTraversal.h" |
| 32 #include "modules/accessibility/AXLayoutObject.h" | 33 #include "modules/accessibility/AXLayoutObject.h" |
| 33 #include "modules/accessibility/AXObjectCacheImpl.h" | 34 #include "modules/accessibility/AXObjectCacheImpl.h" |
| 35 #include "platform/graphics/Path.h" |
| 34 | 36 |
| 35 namespace blink { | 37 namespace blink { |
| 36 | 38 |
| 37 using namespace HTMLNames; | 39 using namespace HTMLNames; |
| 38 | 40 |
| 39 AXImageMapLink::AXImageMapLink(HTMLAreaElement* area, AXObjectCacheImpl& axObjec
tCache) | 41 AXImageMapLink::AXImageMapLink(HTMLAreaElement* area, AXObjectCacheImpl& axObjec
tCache) |
| 40 : AXNodeObject(area, axObjectCache) | 42 : AXNodeObject(area, axObjectCache) |
| 41 { | 43 { |
| 42 } | 44 } |
| 43 | 45 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 } | 97 } |
| 96 | 98 |
| 97 KURL AXImageMapLink::url() const | 99 KURL AXImageMapLink::url() const |
| 98 { | 100 { |
| 99 if (!areaElement()) | 101 if (!areaElement()) |
| 100 return KURL(); | 102 return KURL(); |
| 101 | 103 |
| 102 return areaElement()->href(); | 104 return areaElement()->href(); |
| 103 } | 105 } |
| 104 | 106 |
| 105 LayoutRect AXImageMapLink::elementRect() const | 107 void AXImageMapLink::getRelativeBounds(AXObject** outContainer, FloatRect& outBo
undsInContainer, SkMatrix44& outContainerTransform) const |
| 106 { | 108 { |
| 109 *outContainer = nullptr; |
| 110 outBoundsInContainer = FloatRect(); |
| 111 outContainerTransform.setIdentity(); |
| 112 |
| 107 HTMLAreaElement* area = areaElement(); | 113 HTMLAreaElement* area = areaElement(); |
| 108 HTMLMapElement* map = mapElement(); | 114 HTMLMapElement* map = mapElement(); |
| 109 if (!area || !map) | 115 if (!area || !map) |
| 110 return LayoutRect(); | 116 return; |
| 111 | 117 |
| 112 LayoutObject* layoutObject; | 118 LayoutObject* layoutObject; |
| 113 if (m_parent && m_parent->isAXLayoutObject()) | 119 if (m_parent && m_parent->isAXLayoutObject()) |
| 114 layoutObject = toAXLayoutObject(m_parent)->getLayoutObject(); | 120 layoutObject = toAXLayoutObject(m_parent)->getLayoutObject(); |
| 115 else | 121 else |
| 116 layoutObject = map->layoutObject(); | 122 layoutObject = map->layoutObject(); |
| 117 | 123 |
| 118 if (!layoutObject) | 124 if (!layoutObject) |
| 119 return LayoutRect(); | 125 return; |
| 120 | 126 |
| 121 return area->computeAbsoluteRect(layoutObject); | 127 outBoundsInContainer = area->getPath(layoutObject).boundingRect(); |
| 128 *outContainer = axObjectCache().getOrCreate(layoutObject); |
| 122 } | 129 } |
| 123 | 130 |
| 124 DEFINE_TRACE(AXImageMapLink) | 131 DEFINE_TRACE(AXImageMapLink) |
| 125 { | 132 { |
| 126 AXNodeObject::trace(visitor); | 133 AXNodeObject::trace(visitor); |
| 127 } | 134 } |
| 128 | 135 |
| 129 } // namespace blink | 136 } // namespace blink |
| OLD | NEW |