Re: Canvas positioning issue - possible solution (feedback requested).

Dominic Mazzoni <> wrote on 03/08/2011 03:45:48 PM:

> From: Dominic Mazzoni <>
> To: Richard Schwerdtfeger/Austin/IBM@IBMUS
> Cc:,, Maciej Stachowiak
> <>,, Charles Pritchard
> <>,,
> Date: 03/08/2011 03:47 PM
> Subject: Re: Canvas positioning issue - possible solution (feedback
> requested).
> On Tue, Mar 8, 2011 at 11:59 AM, Richard Schwerdtfeger
> <> wrote:
> > One of the challenges we still have with Canvas accessibility is
computing a
> > bounding rectangle for the accessibility API mapped to each object in
> > fallback content. We have looked at:
> >
> > - Use CSS positioning. This is inadequate as it only provides us with a
> > point and not the full rectangle,
> What's wrong with the width and height attributes in CSS?
Thanks for the feedback Dominic.

Yes, that is an advantage but I have yet to see people really create
fallback for the purposes of fallback. Here are some drawbacks we saw:

- When you are authoring canvas you can't really see what you are styling
all that well to see that things line up.
- If you use CSS you have to do all the coordinate transformations
- If you use width and height the author needs to calculate these. Clipping
regions may not be rectangular and the browser could do the computation for
you to make it easier.

With the clippingregion approach the author could make use of the existing
drawing transformations, provide a developer with the ability to create a
clickable region and do hit testing that is processed back in the fallback,
while at the same time producing an accessible solution.

> One advantage I can see to this approach is that authors could simple
> comment out the surrounding <canvas> tag to see what the fallback
> content looks like and how it lays out.
> Also, it looks like for WebKit at least, we might be laying out the
> fallback content offscreen, so those coordinates will already be
> available. Not sure if other user agents have chosen to implement it
> the same way.
> > We have had a number of discussions on this and we think the rightway
to do
> > this is to bind the element to a clipping region in canvas. This is
> > consistent with how Windows and UNIX graphics subsystems started. You
> > get a handle to a device context and apply a number of properties to it
> > including the bounding rectangle or clipping region. When assistive
> > technology first came out this device context was bound to an
> > object and that is where the bounding rectangle would come from. It
> > allowed the graphic subsystem to maintain the rectangle as things were
> > on the desktop. This same clipping rectangle was used in hit testing
for the
> > mouse.
> I'm totally open to this too, will be easier to understand if I could
> see a complete code sample of how it'd be used.

we can work on some code. ... as I said nothing is executable yet of
course :-)
> - Dominic

Rich Schwerdtfeger

Received on Tuesday, 8 March 2011 23:11:10 UTC