[Webkit-unassigned] [Bug 91228] imagemap without a "name" attribute doesn't work (affects xkcd.com)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jul 11 02:17:15 PDT 2013


https://bugs.webkit.org/show_bug.cgi?id=91228





--- Comment #28 from Chen Zhixiang <chenzx at cn.fujitsu.com>  2013-07-11 02:19:15 PST ---
http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#the-map-element

The name attribute gives the map a name so that it can be referenced. The attribute must be present and must have a non-empty value with no space characters. The value of the name attribute must not be a compatibility-caseless match for the value of the name attribute of another map element in the same document. If the id attribute is also specified, both attributes must have the same value.

>From the draft spec, we can say it's too strict. This does not fit the spirit of HTML5 -- improve error compatibility.

If you say HTML5 allows more error-compatible parsing, then it should allows more loose name-id attribute matching, by the same principle?

So my thought:
(1)<img>'s usemap first matches <map>'s name, if there are multiple <map>'s with the same name, match the first;
(2)Then if no <img> with the matched name, match against id. if there are multiple <map>'s with the same id, match the first;
This would be more consistent and shows the clarity.

The first modification in patch will violate the above rule:
  <img usemap="#b" .../> 
  <map name="a" id="b" .../> 
  <map name="b" id="c" .../> 
The `keyMatchesMapNameOrId` will cause the first <map> matched, while it may be better the second <map>.

Or just modifier the parse? It'll be more simple: if <map> has no name but id, just add a name according to id.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list