[whatwg] Outline style to use for drawSystemFocusRing
cabanier at gmail.com
Mon Sep 30 10:15:25 PDT 2013
On Thu, Sep 12, 2013 at 9:32 AM, Dominic Mazzoni <dmazzoni at google.com>wrote:
> On Wed, Sep 11, 2013 at 5:54 PM, Ian Hickson <ian at hixie.ch> wrote:
> > On Tue, 10 Sep 2013, Dominic Mazzoni wrote:
> > >
> > > We've finished implementing drawSystemFocusRing and drawCustomFocusRing
> > > in Chrome. Try it in Chrome 31 or higher (either canary or dev channel
> > > should work today). You'll need to go to chrome://flags and enable
> > > *experimental canvas features*, then restart the browser.
> > >
> > > Here's a demo I built that uses drawSystemFocusRing:
> > > http://dmazzoni-google.github.io/canvas-focus-ring-demo/
> > Looks good. Was your conclusion that the spec was ok as is, or did you
> > deviate from the spec in some way that needs a spec change
> I think drawSystemFocusRing is good to go. If you want, you can update the
> spec to reflect that an implementation is available (behind a flag).
> Only one minor issue for clarification: if the current path is a line or
> unclosed polygon, should it be closed (or otherwise outlined) when drawing
> the focus ring? Currently we're not doing so in Chrome, but it might help
> to clarify. For example, if the path is a line, what's drawn is just an
> additional stroke on that line, not a "ring".
> I'm not as sure about drawCustomFocusRing. The spec says "If the user has
> requested the use of particular focus rings", but I'm not aware of any
> platform API we could use to query that. To the best of my knowledge,
> assistive technology that draws its own focus rings, like ZoomText,
> normally draws an additional focus ring with extra padding, rather than
> replacing the system one. (Example:
> So, I'm not sure how I'd implement that part of the spec. Chrome definitely
> has no plans to give users an additional preference for focus rings as a
> browser setting.
> So, what we implemented in Chrome for drawCustomFocusRing is basically just
> a function that notifies assistive technology of the bounding rect of the
> focused region within the canvas. It's still useful, but if that's all it
> does, then drawCustomFocusRing is a poor name. Perhaps it should be called
> something like notifyFocusLocation or something like that.
'drawCustomFocusRing' returns a boolean that signals the author that he is
supposed to draw the focus ring.
If you want to rename it, then maybe 'needsFocusRing' is better.
'drawSystemFocusRing' could then be simplified to 'drawFocusRing'
More information about the whatwg