| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 PassRefPtr<AccessibilityImageMapLink> AccessibilityImageMapLink::create() | 52 PassRefPtr<AccessibilityImageMapLink> AccessibilityImageMapLink::create() |
| 53 { | 53 { |
| 54 return adoptRef(new AccessibilityImageMapLink()); | 54 return adoptRef(new AccessibilityImageMapLink()); |
| 55 } | 55 } |
| 56 | 56 |
| 57 AccessibilityObject* AccessibilityImageMapLink::parentObject() const | 57 AccessibilityObject* AccessibilityImageMapLink::parentObject() const |
| 58 { | 58 { |
| 59 if (m_parent) | 59 if (m_parent) |
| 60 return m_parent; | 60 return m_parent; |
| 61 | 61 |
| 62 if (!m_mapElement || !m_mapElement->renderer()) | 62 if (!m_mapElement.get() || !m_mapElement->renderer()) |
| 63 return 0; | 63 return 0; |
| 64 | 64 |
| 65 return m_mapElement->document()->axObjectCache()->getOrCreate(m_mapElement->
renderer()); | 65 return m_mapElement->document()->axObjectCache()->getOrCreate(m_mapElement->
renderer()); |
| 66 } | 66 } |
| 67 | 67 |
| 68 AccessibilityRole AccessibilityImageMapLink::roleValue() const | 68 AccessibilityRole AccessibilityImageMapLink::roleValue() const |
| 69 { | 69 { |
| 70 if (!m_areaElement) | 70 if (!m_areaElement) |
| 71 return WebCoreLinkRole; | 71 return WebCoreLinkRole; |
| 72 | 72 |
| 73 const AtomicString& ariaRole = getAttribute(roleAttr); | 73 const AtomicString& ariaRole = getAttribute(roleAttr); |
| 74 if (!ariaRole.isEmpty()) | 74 if (!ariaRole.isEmpty()) |
| 75 return AccessibilityObject::ariaRoleToWebCoreRole(ariaRole); | 75 return AccessibilityObject::ariaRoleToWebCoreRole(ariaRole); |
| 76 | 76 |
| 77 return WebCoreLinkRole; | 77 return WebCoreLinkRole; |
| 78 } | 78 } |
| 79 | 79 |
| 80 Element* AccessibilityImageMapLink::actionElement() const | 80 Element* AccessibilityImageMapLink::actionElement() const |
| 81 { | 81 { |
| 82 return anchorElement(); | 82 return anchorElement(); |
| 83 } | 83 } |
| 84 | 84 |
| 85 Element* AccessibilityImageMapLink::anchorElement() const | 85 Element* AccessibilityImageMapLink::anchorElement() const |
| 86 { | 86 { |
| 87 return m_areaElement; | 87 return m_areaElement.get(); |
| 88 } | 88 } |
| 89 | 89 |
| 90 KURL AccessibilityImageMapLink::url() const | 90 KURL AccessibilityImageMapLink::url() const |
| 91 { | 91 { |
| 92 if (!m_areaElement) | 92 if (!m_areaElement.get()) |
| 93 return KURL(); | 93 return KURL(); |
| 94 | 94 |
| 95 return m_areaElement->href(); | 95 return m_areaElement->href(); |
| 96 } | 96 } |
| 97 | 97 |
| 98 String AccessibilityImageMapLink::accessibilityDescription() const | 98 String AccessibilityImageMapLink::accessibilityDescription() const |
| 99 { | 99 { |
| 100 const AtomicString& ariaLabel = getAttribute(aria_labelAttr); | 100 const AtomicString& ariaLabel = getAttribute(aria_labelAttr); |
| 101 if (!ariaLabel.isEmpty()) | 101 if (!ariaLabel.isEmpty()) |
| 102 return ariaLabel; | 102 return ariaLabel; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 114 return title; | 114 return title; |
| 115 const AtomicString& summary = getAttribute(summaryAttr); | 115 const AtomicString& summary = getAttribute(summaryAttr); |
| 116 if (!summary.isEmpty()) | 116 if (!summary.isEmpty()) |
| 117 return summary; | 117 return summary; |
| 118 | 118 |
| 119 return String(); | 119 return String(); |
| 120 } | 120 } |
| 121 | 121 |
| 122 IntRect AccessibilityImageMapLink::elementRect() const | 122 IntRect AccessibilityImageMapLink::elementRect() const |
| 123 { | 123 { |
| 124 if (!m_mapElement || !m_areaElement) | 124 if (!m_mapElement.get() || !m_areaElement.get()) |
| 125 return IntRect(); | 125 return IntRect(); |
| 126 | 126 |
| 127 RenderObject* renderer; | 127 RenderObject* renderer; |
| 128 if (m_parent && m_parent->isAccessibilityRenderObject()) | 128 if (m_parent && m_parent->isAccessibilityRenderObject()) |
| 129 renderer = static_cast<AccessibilityRenderObject*>(m_parent)->renderer()
; | 129 renderer = static_cast<AccessibilityRenderObject*>(m_parent)->renderer()
; |
| 130 else | 130 else |
| 131 renderer = m_mapElement->renderer(); | 131 renderer = m_mapElement->renderer(); |
| 132 | 132 |
| 133 if (!renderer) | 133 if (!renderer) |
| 134 return IntRect(); | 134 return IntRect(); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 145 { | 145 { |
| 146 return url(); | 146 return url(); |
| 147 } | 147 } |
| 148 | 148 |
| 149 String AccessibilityImageMapLink::nameForMSAA() const | 149 String AccessibilityImageMapLink::nameForMSAA() const |
| 150 { | 150 { |
| 151 return accessibilityDescription(); | 151 return accessibilityDescription(); |
| 152 } | 152 } |
| 153 | 153 |
| 154 } // namespace WebCore | 154 } // namespace WebCore |
| OLD | NEW |