470,867 Members | 1,748 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,867 developers. It's quick & easy.

W3C Spec: Block level content within <map>? Style in <area>? Why?

I am implementing a comprehensive image-map generator utility, so have been
studying W3C HTML 4.01 Specification
(http://www.w3.org/TR/html4/struct/objects.html#h-13.6) on image maps (among
other things).

I note the document specifies that block level content can be included
within a <map>. Testing this in order to discover why one might wish to do
this, I find the block level content is rendered in page flow order anyway,
and not magically associated with (say) the image that uses the map.

Among elements which might be included within the <map> is specifically
mentioned the anchor (<a>) element. Testing this, I find the anchors are
rendered as normal anchors, again, in page flow order.

It is not clear to me how any advantage is gained by placing such content
within an image map. Indeed, such inclusion appears only to confuse the
organisation of the file. Does anybody know the intended use of this
facility?

Related to this, I note that anchor tags may include the 'shape' attribute,
presumably intended for use in the same way as this attribute in <area>
tags. Testing it, I find I cannot get <a> elements to express any shape but
that of their normal content.

Related to this also is the facility to provide both <map> and <area> tags
with style, either inline or with class attributes. Testing has yielded no
discernible effect with any style properties one might think to apply.

Does any W3C guru have answers for these mysteries? (Or is it just that my
testing has been conducted with IE? - even if that is the problem, block
content in maps still needs explanation).

Thanks in advance

Laurence
Jul 24 '05 #1
14 5373
laurence wrote:
I note the document specifies that block level content can be included
within a <map>. Testing this in order to discover why one might wish to do
this, I find the block level content is rendered in page flow order
anyway, and not magically associated with (say) the image that uses the
map.


"The MAP element may be used without an associated image for
general navigation mechanisms."
-- http://www.w3.org/TR/html4/struct/objects.html#edef-MAP
--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 24 '05 #2
laurence wrote:
I note the document specifies that block level content can be included
within a <map>. Testing this in order to discover why one might wish to do
this, I find the block level content is rendered in page flow order
anyway, and not magically associated with (say) the image that uses the
map.


"The MAP element may be used without an associated image for
general navigation mechanisms."

"Block-level content. This content should include A elements
that specify the geometric regions of the image map and the
link associated with each region. Note that the user agent
should render block-level content of a MAP element. Authors
should use this method to create more accessible documents."

-- http://www.w3.org/TR/html4/struct/objects.html#edef-MAP

i.e. Its the image map version of the alt attribute.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 24 '05 #3
in comp.infosystems.www.authoring.html, David Dorward wrote:
laurence wrote:
I note the document specifies that block level content can be included
within a <map>. Testing this in order to discover why one might wish to do
this, I find the block level content is rendered in page flow order
anyway, and not magically associated with (say) the image that uses the
map.


"The MAP element may be used without an associated image for
general navigation mechanisms."

"Block-level content. This content should include A elements
that specify the geometric regions of the image map and the
link associated with each region. Note that the user agent
should render block-level content of a MAP element. Authors
should use this method to create more accessible documents."

-- http://www.w3.org/TR/html4/struct/objects.html#edef-MAP

i.e. Its the image map version of the alt attribute.


Not in sence of alternative. Block level content is always displayed.
This usually makes sence on cases image map is supposed to be used... but
does not for the most common case, which is textual links in one image.
(inherited such site, orginal images long gone, everything in one
giant jpg...)
--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Utrecht, NL.
Support me, buy Opera:
https://secure.bmtmicro.com/opera/bu...tml?AID=882173
Jul 24 '05 #4
laurence wrote:

[question about the newer format for the contents of the MAP element]

It lets you provide a single set of navigation elements *as* a single
set in your content while presenting them in two alternative ways, each
preferred by a particular set of users. See

http://www.gavelcade.com/tests/imagemaps.html

The idea is that you present your navigational elements in an
accessible, text-based format, but that by wrapping them in a MAP
element, you are making them available for *reuse* as an image map for
those users who will benefit from one.

A thought occurred to me, that they ought to have done the same thing
with <map name="..."> that they did with <a name="...">, that is, make
it unnecessary. Instead of requiring

<img ... usemap="#mymap">
<!-- ... -->
<map name="mymap" ...>
<div ...>
<!-- ... content ... -->
</div>
</map>

they ought to have made it possible to write

<img ... usemap="#mymap">
<!-- ... -->
<div id="mymap" ...>
<!-- ... content ... -->
</div>

because the MAP tag serves no real purpose.
Jul 24 '05 #5
David wrote:
laurence wrote:
I note the document specifies that block level content can be included
within a <map>. Testing this in order to discover why one might wish to do
this, I find the block level content is rendered in page flow order
anyway, and not magically associated with (say) the image that uses the
map.


"The MAP element may be used without an associated image for
general navigation mechanisms."

"Block-level content. This content should include A elements
that specify the geometric regions of the image map and the
link associated with each region. Note that the user agent
should render block-level content of a MAP element. Authors
should use this method to create more accessible documents."

-- http://www.w3.org/TR/html4/struct/objects.html#edef-MAP

i.e. Its the image map version of the alt attribute.


Thanks David. Perhaps "the image map version of alternate object tags embedded within outer object tags", or "noscript embedded in script tags" are more analogous. Problem with this proposal is that the block level content is always rendered. It is not alternate to anything.

I already read these passages, and it is not clear to me how inclusion of block level stuff within a map allows one to create more accessible documents, at least any more accessible than putting the block level stuff outside the map. The means to provide accessibility for imagemaps is provided with alt attribute in areas, accesskey attributes etc.

Moreover, in fact, geometric regions are not successfully specified within A elements, even if they are actually specified in A attributes. This could simply be standards implementation shortfall, but one has to admit, just what the working group intended is completely unclear.

The first quote might lead us to think that included block level stuff can be the basis of the map instead of an image. In fact it does not render this way - bad standards conformance? Maybe, but I don't think that's it. Your supposed to be able to include block-level stuff in the map when you are using an image, not simply as an alternate to using an image. Why you would want to is the mystery.

Laurence
Jul 24 '05 #6
>> i.e. Its the image map version of the alt attribute.

Not in sence of alternative. Block level content is always displayed.
This usually makes sence on cases image map is supposed to be used... but


Thanks Lauri. Can you explain how it usually makes sense?

Laurence.
Jul 24 '05 #7
laurence wrote:
I already read these passages, and it is not clear to me how inclusion of
block level stuff within a map allows one to create more accessible
documents, at least any more accessible than putting the block level stuff
outside the map. The means to provide accessibility for imagemaps is
provided with alt attribute in areas, accesskey attributes etc.


http://www.cs.tut.fi/~jkorpela/html/mapalt.html might explain why alt isn't
sufficient.
--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 24 '05 #8
in comp.infosystems.www.authoring.html, laurence wrote:
David wrote:
-- http://www.w3.org/TR/html4/struct/objects.html#edef-MAP

I already read these passages, and it is not clear to me how inclusion
of block level stuff within a map allows one to create more accessible
documents, at least any more accessible than putting the block level
stuff outside the map.
Easy. Your imagemap should be map, or graph, or somethign like that. It
makes sence to alwas have alternative. Imagine map of Finland, with
hotspots in places some hotel chain has hotel. If you are not too
familiar with Finland, it might be hard to find right dot, if you know
which city you are going. If there is list of those same hotels, you can
find name of city easily. If, OTOH, you are coming from Russia, you find
your place easier using the map.

Now, if you are using text browser, if this is done with area elements
with alt attributes, and list with links, you get same stuff twice. With
block content in map element, you only get it once.

You think leaving out alt attributes in area elements would do this, ut
that is of course bad assumption, as nobody actually uses them and so
every text browser provides links to the links.

(No, I don't know if it goes like this, but I think is good enough
scenario to explain the spec)
The means to provide accessibility for imagemaps
is provided with alt attribute in areas, accesskey attributes etc.
Exept those don't work too well, which is problem.
Moreover, in fact, geometric regions are not successfully specified
within A elements, even if they are actually specified in A attributes.
What do you mean with this? The fact that IE don't understand coords
attribute for a element?
This could simply be standards implementation shortfall, but one has to
admit, just what the working group intended is completely unclear.
I think it is compromise.
The first quote might lead us to think that included block level stuff
can be the basis of the map instead of an image. In fact it does not
render this way - bad standards conformance?
What you mean with this? I don't get it. Opera 7-8 at least supports
these things as they should be, If I have understood spec correctly.
Unsurprisingly, IE won't.
Maybe, but I don't think
that's it. Your supposed to be able to include block-level stuff in the
map when you are using an image, not simply as an alternate to using an
image. Why you would want to is the mystery.


Why you wouldn't want it? I can't think anything, exept that image map is
used for some stylistic thing (for which you shold use CSS), instead of
something sensible.
--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Utrecht, NL.
Support me, buy Opera:
https://secure.bmtmicro.com/opera/bu...tml?AID=882173
Jul 24 '05 #9
in comp.infosystems.www.authoring.html, Harlan Messinger wrote:
laurence wrote: they ought to have made it possible to write

<img ... usemap="#mymap">
<!-- ... -->
<div id="mymap" ...>
<!-- ... content ... -->
</div>

because the MAP tag serves no real purpose.


But then you couldn't have to map elements with same name? Wouldn't that
be shame? (no, I have no idea why it is allowed in HTML4...)

Anyway, I assume reason is of course backwards compatibility. And I think
that the map element is maybe worst defined in whole spec...

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Utrecht, NL.
Support me, buy Opera:
https://secure.bmtmicro.com/opera/bu...tml?AID=882173
Jul 24 '05 #10

"Harlan Messinger" <hm*******************@comcast.net> wrote in message
news:3g************@individual.net...
laurence wrote:

[question about the newer format for the contents of the MAP element]

It lets you provide a single set of navigation elements *as* a single set
in your content while presenting them in two alternative ways, each
preferred by a particular set of users. See

http://www.gavelcade.com/tests/imagemaps.html

The idea is that you present your navigational elements in an accessible,
text-based format, but that by wrapping them in a MAP element, you are
making them available for *reuse* as an image map for those users who will
benefit from one.
That's great Harlan, thanks. This dual use of the links is apparently not
supported in MSIE, but works a treat in Firefox. Good info, and great
example.
A thought occurred to me, that they ought to have done the same thing with
<map name="..."> that they did with <a name="...">, that is, make it
unnecessary. Instead of requiring

<img ... usemap="#mymap">
<!-- ... -->
<map name="mymap" ...>
<div ...>
<!-- ... content ... -->
</div>
</map>

they ought to have made it possible to write

<img ... usemap="#mymap">
<!-- ... -->
<div id="mymap" ...>
<!-- ... content ... -->
</div>

because the MAP tag serves no real purpose.


Could it be that maps will not always contain renderable content (apart from
hotspots on image/object), and so should not then make their presence felt
on a page in the form of a div?
Also, maps can be used by more than one image; their location in a div, at
some particular page location doesn't make much sense.

In experimenting with your code, I found that adding <area> elements to the
map (for it is decreed you can mix these elements within a map) appear to
cancel out the A regions in Firefox. Only the AREA regions work as
hot-spots. Interesting.
Thanks for the explanation Harlan,
and thanks to other contributors too.

Now, if only someone would enlighten me as to style being applied to map &
area tags...
Laurence.
Jul 24 '05 #11
On Thu, 9 Jun 2005, laurence wrote:
I am implementing a comprehensive image-map generator utility, so have been
studying W3C HTML 4.01 Specification
(http://www.w3.org/TR/html4/struct/objects.html#h-13.6) on image maps (among
other things).
Just for a bit of background, the client-side imagemap was originally
introduced by RFC1980. Typical browsers never quite implemented
everything that was in the original spec. Over the years this has
shifted a bit one way and a bit the other, and now the W3C have a
specification in HTML4, but there's always been a bit of a gap between
what the spec hopes for and what browsers actually implement.
I note the document specifies that block level content can be
included within a <map>. Testing this in order to discover why one
might wish to do this, I find the block level content is rendered in
page flow order anyway, and not magically associated with (say) the
image that uses the map.
That sounds about right, yes. You can put the MAP wherever it's
convenient, and refer to it from elsewhere with USEMAP=

The HTML spec emphasises the use of OBJECT here, which is a fine idea
in principle, but like so many attempts to move forward, has got
tripped up by poor browser implementations, meaning author reluctance
to use it instead of the now-traditional IMG - for all its faults.
Does any W3C guru have answers for these mysteries?
(don't look at me...)
(Or is it just that my testing has been conducted with IE? - even if
that is the problem, block content in maps still needs explanation).


You definitely need to consider at least one www-compatible browser
before worrying about IE.

Whether or not you agree with him, Hixie has some excellent
discussions of implementation issues for Mozilla that can help in
understanding and illustrating possible usage of HTML4 constructs.
When I have questions of this kind I'd look at those discussions as an
early part of any investigation. No guarantees on this particular
topic but I'd start at http://www.hixie.ch/ and look for his test
suites and rationales.

Sorry if this seems over cryptic, but like so many things that have a
past history, there are some rough edges and it looks as if you've
spotted some of them.

And yes, even if one knows how it's *supposed* to work it would still
be necessary to do a reality check with IE. My point is that IE
is best not used as a starting point.

hope this is of some use.
Jul 24 '05 #12
David wrote:

http://www.cs.tut.fi/~jkorpela/html/mapalt.html might explain why alt
isn't
sufficient.

Thanks David. An excellent link.
Laurence
Jul 24 '05 #13
Lauri Raittila wrote:
in comp.infosystems.www.authoring.html, Harlan Messinger wrote:
laurence wrote:
they ought to have made it possible to write

<img ... usemap="#mymap">
<!-- ... -->
<div id="mymap" ...>
<!-- ... content ... -->
</div>

because the MAP tag serves no real purpose.

But then you couldn't have to map elements with same name? Wouldn't that
be shame?


:) Right, if you had two MAP elements with the same name, the browser
wouldn't know which one to use. It would be like having two A tags with
the same name on the same page,

<a name="myanchor">

To which of these would a hyperlink tagged

<a href=#myanchor">

go? And yet it's not a spec violation.

Oh, wait: the spec *does* say that the NAME attribute for an A tag needs
to be unique. It doesn't say that for the MAP tag, though. It should.
(no, I have no idea why it is allowed in HTML4...)

Anyway, I assume reason is of course backwards compatibility. And I think
that the map element is maybe worst defined in whole spec...

Jul 24 '05 #14
laurence wrote:

Could it be that maps will not always contain renderable content (apart from
hotspots on image/object), and so should not then make their presence felt
on a page in the form of a div?
You have to have the DIV, or some other block-level element, and its
contents inside the MAP anyway, and it will display anyway, if you're
following the approach that uses A tags instead of AREA tags. I'm saying
that in that case, the MAP tag itself is serving no purpose except as a
place to hang the identifier, but the block itself can be used for that.
Also, maps can be used by more than one image; their location in a div, at
some particular page location doesn't make much sense.
Eh? You're making the same set of shapes and coordinates available, to
as many images as you want, via the A tags, whether or not you wrap the
DIV inside a MAP.

In experimenting with your code, I found that adding <area> elements to the
map (for it is decreed you can mix these elements within a map) appear to
cancel out the A regions in Firefox. Only the AREA regions work as
hot-spots. Interesting.


Interesting, that's not what's supposed to happen. The spec says that
when a block and a set of AREA tags are both present, the AREA tags are
meant for use by older UAs that won't know what to do with the A tags
that have SHAPE and COORDS attributes. Compliant UAs that understand
what to do with the A tag's image-map attributes are supposed to use the
block and ignore the AREA tags.
Jul 24 '05 #15

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

54 posts views Thread by Brandon J. Van Every | last post: by
2 posts views Thread by Gabe Moothart | last post: by
1 post views Thread by Brad | last post: by
16 posts views Thread by Gufus | last post: by
27 posts views Thread by VK | last post: by
5 posts views Thread by shawn.ready | last post: by
8 posts views Thread by Dan Rumney | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.