Page MenuHomePhabricator

imagemap creates duplicate names
Open, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • on a new page, create 2 identical <imagemap> tags with identical content (including size)
  • note that the maps generated, have identical names. (e.g. <map name="ImageMap_d4cc6d14751f9bd4">)
  • also note that this is illegal, as noted here: basically, ids and names share the same namespace, and it's illegal to have 2 identical ids, 2 identcal names, or an id and name which are identical

this seems like a small and insignificant violation, but it breaks some scripts, and confuses the DOM.

What happens?:
imagemap extension creates non-unique names

What should have happened instead?:
imagemap extension should create unique names

Software version (skip for WMF-hosted wikis like Wikipedia):
up to and including 1.40.0-wmf.20 (212529a)

Other information (browser name/version, screenshots, etc.):

specific scripts affected: "imagemapHighLight, used on hewiki, ruwiki, and elsewhere.

Event Timeline

Just an idea for a possible solution: add the number

$('body').find('*').index(<current map or image dom element>)

to the hash function input.