[whatwg] Usemap and ismap for canvas tag

Charles McCathieNevile chaals at opera.com
Mon Mar 3 21:26:41 PST 2008


On Tue, 04 Mar 2008 13:40:52 +0900, Greg Houston  
<gregory.houston at gmail.com> wrote:

>> Wouldn't it make more sense just to use SVG?
...
> So canvas is tuned more for creating dynamic charts and graphs whereas
> SVG is better apt for static sprites and interface elements with the
> bonus that it "can automatically detect interaction".
>
> WHATWG SVG and Canvas Comparison:
> http://wiki.whatwg.org/wiki/SVG_and_canvas
>
> My second idea of being able to add canvas shapes directly to the DOM
> may be too much. Though since canvas "renders onto a fixed-resolution
> bitmap" and is basically a flat image, giving the canvas element the
> usemap and ismap properties doesn't seem like it would be a big issue.

This seems to make sense to me.

> Browser agents could probably use pretty much the exact same code for
> both the img and canvas tag where image maps are concerned. The
> benefit would be being able to add hot spots for links and tooltips to
> canvas drawings. It seems silly that something as dynamic as the
> canvas element would have less interactivity than the img element.

Right. On the other hand, loading it with a DOM would slow it down to the  
point that it loses its major benefit over SVG (at least as I see it) -  
the fact that it is relatively lightweight, ergo faster.

cheers

Chaals

-- 
Charles McCathieNevile  Opera Software, Standards Group
     je parle français -- hablo español -- jeg lærer norsk
http://my.opera.com/chaals   Try Opera 9.5: http://snapshot.opera.com



More information about the whatwg mailing list