Bug 97204 - HTML map does not work using id attribute in xhtml 1.1
Summary: HTML map does not work using id attribute in xhtml 1.1
Status: RESOLVED DUPLICATE of bug 91228
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2012-09-20 06:06 PDT by vabr
Modified: 2012-09-20 10:15 PDT (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description vabr 2012-09-20 06:06:39 PDT
[This is derived from http://crbug.com/108489 ]

== Summary ==
It looks like for XHTML 1.1, WebKit ignores "id" attribute for the "map" HTML tag, and does not ignore the "name" attribute.
The norm, on the other hand, prescribes "id" and forbids "name" for the "map" tag.
http://www.w3.org/TR/xhtml-modularization/dtd_module_defs.html#a_module_Client-side_Image_Map (search for "'usemap' points to the 'id' attribute of a <map> element")

== Reproduction ==
1. Go to http://xkcd.com/
2. Click on any of the five thumbnails of the old issues of the comics at the bottom of the page.

* The browser should navigate to the old comics.

* Nothing happens.

This was observed on GNU/Linux running:
 * Chromium 24.0.1272.0 (Developer Build 157719) + WebKit 537.11 (trunk@128849)
 * Google Chrome 22.0.1229.56 (Official Build 156464) beta + WebKit 537.4 (@128207)
and also on other configurations (see http://crbug.com/108489).

== Pointer to source ==
I looks like the culprit is the conditional

if (document()->isHTMLDocument())

in HTMLMapElement::parseAttribute() in WebCore/html/HTMLMapElement.cpp

If that is removed, the id works OK.
Comment 1 Alexey Proskuryakov 2012-09-20 10:15:27 PDT
XKCD is not XHTML, so the bug title is misleading. Anyway, a duplicate.

*** This bug has been marked as a duplicate of bug 91228 ***