W3C home > Mailing lists > Public > public-canvas-api@w3.org > July to September 2013

Re: drawSystemFocusRing implementation details

From: Charles Pritchard <chuck@jumis.com>
Date: Fri, 16 Aug 2013 16:40:22 -0700
Message-Id: <846BF2B6-6361-4B2A-9894-FFF3D2A78665@jumis.com>
Cc: "public-canvas-api@w3.org" <public-canvas-api@w3.org>
To: Rik Cabanier <cabanier@gmail.com>
On Aug 16, 2013, at 4:11 PM, Rik Cabanier <cabanier@gmail.com> wrote:

> Yes, the spec says that the focus ring is drawn directly into the canvas bitmap.
> I'm unsure how it could work differently (unless it's completely redesigned).

A temporary bitmap would be created and the browser would draw on it, above the current bitmap. Basically, the same thing that happens with HTML/SVG elements (the focus ring is rendered above their backing bitmap).


> 
> element.onfocus = function(e) { ctx.drawSystemFocusRing(e.target); };
> How would this work? The canvas object doesn't know what area of the canvas correspond to an element.

That example is from some old code where the current canvas path corresponds to the element, as it's just got one element as a child.

The hope is to avoid doing a clearRect and redraw step on blur; and as such, avoid the onblur hook when using drawSystemFocusRing.
Received on Friday, 16 August 2013 23:40:53 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:31:55 UTC