[whatwg] Clickable regions as a necessary step for canvas

Charles Pritchard chuck at jumis.com
Sat Aug 27 00:20:00 PDT 2011

Though discussion continues on a11y issues on the public-canvas-api 
mailing list at the w3c, I'd like to continue some of the discussion here.

Currently, Canvas 2d has a drawFocusRing API, enabling authors (at least 
in IE9, currently) to create elements inside of the Canvas subtree, set 
onfocus handlers, and let the OS know that a path/rectangle within the 
canvas image currently has focus (and that focus event, is of course, on 
the selected element).

The API only works for tracking a single element at one time. We need a 
more broad method for notifying the OS about multiple regions within an 
image, as cycling through drawFocusRing is both inefficient and not 
quite the appropriate use of the method semantics.

Something like: setClickableElement(elementInSubtree), which would use 
the current path, and the element passed as the first argument, and 
share that information with the OS (more specifically, the UAs 
accessibility tree).

This is needed for Canvas 2d to inter-operate with software such as 
Apple's VoiceOver on Mobile Safari.
Image maps are not flexible enough for use with Canvas, and using SVG 
and/or CSS overlays is rather inefficient and impractical (it's 
difficult anyway), for many of the same reasons that Image maps are not 
practical for Canvas regions.

Though Google's NaCl has not gained acceptance with other vendors, NaCl 
name spaces would also benefit from the same semantic as Canvas 2d, as 
they operate within a boxed region.

For other vendors, such as Mozilla, which are operating on translation, 
the method would also be quite helpful/appropriate, as they often use 
the Canvas api for rendering legacy applications.
See emscripten for an example of translation of C++ apps into web apps:

Can we make some progress on this?

Several proposals have been posted to the public-canvas-api mailing 
list. They all are designed to fill-in this missing component of mapping 
non-visible elements to 2d regions.

Keep in mind that 2d regions are spatial -- they are not, primarily, visual.


More information about the whatwg mailing list