Dan Rumney wrote:
Quote:
Robin wrote:
Quote:
>Dan Rumney wrote:
Quote:
>>On Jun 5, 10:00 am, "Thomas 'PointedEars' Lahn" <PointedE...@web.de>
>>wrote:
>>>However, you should post the URL of a test case instead of this many
>>>lines of uncommented code.
>>
http://www.danrumney.co.uk/clj/csUsageSample.html
>>>
>>This is slightly different to the original code sample, however, the
>>problem remains the same.
>Isn't the 'usemap' attribute meant to refer to a URL not name attribute
>value.
Yes, it is. Good catch.
javascript
:window.alert(document.images[0].useMap="#"+document.images[0].useMap);
renders the first image map working.
Quote:
Quote:
>i.e.
>useMap="iog0Mapall"
>should be
>useMap="#iog0Mapall"
Correct. See also
<http://www.w3.org/TR/REC-html40/struct/objects.html#adef-usemap>
Quote:
I'll look into that. That's the first time I've ever heard of that being
suggested, but that's not to say that it's without merit. I'll post back
what I find
FWIW, this is what I had drafted elsewhere on Google Groups *before*
I read Robin's posting with Thunderbird here now:
----
When you Tab through this document in IE 7, you will observe that the image
map areas are never focused, in contrast to image maps on other Web sites,
e.g. <http://de.selfhtml.org/html/grafiken/anzeige/img_usemap.htm>. This
would indicate that something is wrong with your image map already. So it
is entirely possible that it is not a script problem. (However, have you
tried disabling the script includes as recommended?)
This might be wrong:
| <map name="iog0Mapall">
| <area class="clickable" shape="rect" coords="0,0,31.25,30"
^^^^^^^^^^^^
| onclick="zoomGraph(0,'rc');" title="Zoom to RC Usage"
| alt="Zoom to RC Usage">
| <area shape="rect" coords="31.25,0,768.75,30"
| title="Unallocated Memory" alt="Unallocated Memory">
| <area class="clickable" shape="rect" coords="768.75,0,800,30"
^^^^^^^^^^^^^^^
| onclick="zoomGraph(0,'fc');"
| title="Zoom to FC Usage" alt="Zoom to FC Usage">
| </map>
Because the HTML 4.01 DTDs says:
| <!ATTLIST AREA
| %attrs; -- %coreattrs, %i18n, %events --
| shape %Shape; rect -- controls interpretation of coords --
| coords %Coords; #IMPLIED -- comma-separated list of lengths --
and
| <!ENTITY % Coords "CDATA" -- comma-separated list of lengths -->
But the HTML 4.01 Specification's prose says:
,-<http://www.w3.org/TR/REC-html40/types.html#h-6.6>
|
| 6.6 Lengths
|
| HTML specifies three types of length values for attributes:
|
| 1. Pixels: The value (%Pixels; in the DTD) is an integer that
| represents the number of pixels of the canvas (screen, paper).
| Thus, the value "50" means fifty pixels. For normative
| information about the definition of a pixel, please consult [CSS1].
| 2. Length: The value (%Length; in the DTD) may be either a %Pixel;
| or a percentage of the available horizontal or vertical space.
| Thus, the value "50%" means half of the available space.
| 3. MultiLength: The value ( %MultiLength; in the DTD) may be a
| %Length; or a relative length. A relative length has the form
| "i*", where "i" is an integer. When allotting space among elements
| competing for that space, user agents allot pixel and percentage
| lengths first, then divide up remaining available space among
| relative lengths. Each relative length receives a portion of
| the available space that is proportional to the integer preceding
| the "*". The value "*" is equivalent to "1*". Thus, if 60 pixels
| of space are available after the user agent allots pixel and
| percentage space, and the competing relative lengths are 1*, 2*,
| and 3*, the 1* will be alloted 10 pixels, the 2* will be alloted
| 20 pixels, and the 3* will be alloted 30 pixels.
|
| Length values are case-neutral.
31.25 is obviously no integer. The W3C Validator cannot recognize this
error because it validates against the DTD which says CDATA (arbitrary
character data).[1] However, the Specification's prose is normative, too
(unless explicitly stated otherwise for a section). And as I have never
seen fixed-point values in image map coordinates since they were introduced
in HTML 3.2 (and it makes little sense to divide a pixel), I would assume
the comment means `%Length' when it says `length' (CMIIW).
It might be that Gecko is more forgiving here.[2] However, my attempts to
assign .coords = "0,0,31,30" via scripting in IE instead have unfortunately
not resulted in appropriate display. So the error might be elsewhere.[3]
I noted that document.compatMode yields "BackCompat" there, i.e. _not_
rendering in Standards Mode ("CSS1Compat") as you stated. This is because of
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
I suggest you try using
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
instead. (The system identifier [URI of the DTD] is necessary to escape
Quirks/Compatibility Mode, see <http://quirksmode.org/>.)
See also
<http://validator.w3.org/check?uri=http://www.danrumney.co.uk/clj/csUsageSample.html>
which shows some errors that might contribute to the problem.
You can try <http://getfirebug.com/lite.htmlfor tracking the problem.
----
[1] Obviously now, the W3C Validator also cannot recognize that "#foo"
is required when "foo" was written, because both match %URI:
| <!ENTITY % URI "CDATA"
| -- a Uniform Resource Identifier,
| see [URI]
| -->
[2] And, in fact, it is more forgiving about the `usemap' attribute value.
[3] Which is obvious now, however the other things should be fixed as well.
Quote:
Quote:
>Also, there seem to be a large number of attributes without any quotes
>around their values. e.g. <MAP name=iog0Mapall>
>
Not sure why you're seeing that. The source that I've uploaded and the
source that is viewable via firefox shows no such thing. I'd be
interested to know how you're viewing the source.
Probably using the .innerHTML property.
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f806at$ail$1$8300dec7@news.demon.co.uk>