| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 } | 95 } |
| 96 | 96 |
| 97 KURL AXImageMapLink::url() const | 97 KURL AXImageMapLink::url() const |
| 98 { | 98 { |
| 99 if (!areaElement()) | 99 if (!areaElement()) |
| 100 return KURL(); | 100 return KURL(); |
| 101 | 101 |
| 102 return areaElement()->href(); | 102 return areaElement()->href(); |
| 103 } | 103 } |
| 104 | 104 |
| 105 String AXImageMapLink::deprecatedAccessibilityDescription() const | |
| 106 { | |
| 107 const AtomicString& ariaLabel = getAttribute(aria_labelAttr); | |
| 108 if (!ariaLabel.isEmpty()) | |
| 109 return ariaLabel; | |
| 110 const AtomicString& alt = getAttribute(altAttr); | |
| 111 if (!alt.isEmpty()) | |
| 112 return alt; | |
| 113 | |
| 114 return String(); | |
| 115 } | |
| 116 | |
| 117 String AXImageMapLink::deprecatedTitle(TextUnderElementMode mode) const | |
| 118 { | |
| 119 const AtomicString& title = getAttribute(titleAttr); | |
| 120 if (!title.isEmpty()) | |
| 121 return title; | |
| 122 const AtomicString& summary = getAttribute(summaryAttr); | |
| 123 if (!summary.isEmpty()) | |
| 124 return summary; | |
| 125 | |
| 126 return String(); | |
| 127 } | |
| 128 | |
| 129 LayoutRect AXImageMapLink::elementRect() const | 105 LayoutRect AXImageMapLink::elementRect() const |
| 130 { | 106 { |
| 131 HTMLAreaElement* area = areaElement(); | 107 HTMLAreaElement* area = areaElement(); |
| 132 HTMLMapElement* map = mapElement(); | 108 HTMLMapElement* map = mapElement(); |
| 133 if (!area || !map) | 109 if (!area || !map) |
| 134 return LayoutRect(); | 110 return LayoutRect(); |
| 135 | 111 |
| 136 LayoutObject* layoutObject; | 112 LayoutObject* layoutObject; |
| 137 if (m_parent && m_parent->isAXLayoutObject()) | 113 if (m_parent && m_parent->isAXLayoutObject()) |
| 138 layoutObject = toAXLayoutObject(m_parent)->layoutObject(); | 114 layoutObject = toAXLayoutObject(m_parent)->layoutObject(); |
| 139 else | 115 else |
| 140 layoutObject = map->layoutObject(); | 116 layoutObject = map->layoutObject(); |
| 141 | 117 |
| 142 if (!layoutObject) | 118 if (!layoutObject) |
| 143 return LayoutRect(); | 119 return LayoutRect(); |
| 144 | 120 |
| 145 return area->computeRect(layoutObject); | 121 return area->computeRect(layoutObject); |
| 146 } | 122 } |
| 147 | 123 |
| 148 DEFINE_TRACE(AXImageMapLink) | 124 DEFINE_TRACE(AXImageMapLink) |
| 149 { | 125 { |
| 150 AXNodeObject::trace(visitor); | 126 AXNodeObject::trace(visitor); |
| 151 } | 127 } |
| 152 | 128 |
| 153 } // namespace blink | 129 } // namespace blink |
| OLD | NEW |