(mapName: string, doc: Document)
| 204 | } |
| 205 | |
| 206 | function findImageUsingMap(mapName: string, doc: Document): Element | null { |
| 207 | // Use querySelector instead of a full-DOM scan; escape the map name so |
| 208 | // special characters in the CSS attribute value string are handled safely. |
| 209 | return doc.querySelector('[usemap="#' + mapName.replace(/\\/g, '\\\\').replace(/"/g, '\\"') + '"]'); |
| 210 | } |
| 211 | |
| 212 | function maybeFindImageMap(elem: Element): ImageMapResult | null { |
| 213 | var isMap = isElement(elem, 'MAP'); |