[whatwg] <map id="">

On 8/9/07, Simon Pieters <zcorpan at gmail.com> wrote:
> On Wed, 08 Aug 2007 20:21:00 +0200, Michael A. Puls II
> <shadow2531 at gmail.com> wrote:
>
> > Just wan to be sure:
> >
> > Even though id is required, name is allowed on <map>. Correct?
>
> No. name is currently not allowed (but I have suggested we change to name
> instead of id [1]).
> [1]
> http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2007-April/010975.html

Thanks.

I agree with that. (with minor concerns though)

For authoring conformance, if *only* name is supported
(case-insensitive) in both HTML5 and XHTML5, that would be cool and
much simpler. The only thing that would have to be tweaked is FF and
Safari XHTML usemap matching to allow name to also match in XHTML.

That would mean that you could do:
<map name="foo"> + usemap="#foo" in both XHTML5 and HTML5 and be done with it.
However, the XHTML5 page would only work in FF and Safari versions
that have the tweak, but this might not be too much of a concern.

The alternative is to get rid of name in HTML5 and use just id like
the spec currently says. This requires Safari and FF tweaking to also
match on id in HTML.

That would mean that you could do:
<map id="foo"> + usemap="#foo" in both XHTML5 and HTML5 and be done with it.
However, the HTML5 page would only work in FF and Safari versions that
have the tweak.

By the time everyone's really into authoring HTML5/XHTML5, supporting
FF and Safari versions without the mentioned tweaks might not be a
concern.  Then again, if it is a concern then, the author would just
break conformance and use both name and id, or go with XHTML 1.0 or
something.

The ugly happy medium for authoring conformance in both HTML5 and XHTML5 is:
Both name and id are allowed.
If you specify name, you must specify id.
If both are present, they must have the same value.
(or always require both if you're going to provie one. It'd be annoying, but...)

Either way, UA conformance should probably be something like this:

usemap can be matched to name or id regardless of mime type.
Matching of usemap to id is case-insensitve regardless of mime type.
Matching of usemap to name is case-insensitive regardless of mime type.
If both name and id are present, if name isn't a match, try to see if
id is and vice versa.
The first map element that has a matching name or id is considered a match.

For example, in XHTML5 and HTML5, each of the usemaps would match each
of the maps in an HTML5/XHTML5 UA.
<map name="bam" id="foo">
<map name="foo" id="bam">
<map name="foo" id="foo">
<map name="FoO" id="FoO">
<map id="foo">
<map name="foo">

usemap="#foo"
usemap="#FoO"
usenap="#FOO"

So, whether we go with just name or just id, FF and Safari will need
some tweaking and conforming HTML5/XHTML5 pages will break in current
versions. If we go with just id, that means HTML5 page breakage. If we
go with just name, that means XHTML5 page breakage.

So, there's a tiny bit of advantage of just allowing name instead of
just allowing id.

As for making matching case-insensitive in XHTML, an author would
avoid relying on that if planning to support FF and Safari versions
without the mentioned ua conformance tweaks.

Those are my thoughts at least.

-- 
Michael

Received on Friday, 10 August 2007 03:13:10 UTC