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