Re: drawSystemFocusRing and drawCustomFocusRing names are confusing.

On Mon, Jan 13, 2014 at 4:58 PM, Charles Pritchard <chuck@jumis.com> wrote:

>  On 1/13/2014 2:48 PM, Richard Schwerdtfeger wrote:
>
> <to>
>
> "Sets the location, based on the *current default path,*<http://www.w3.org/TR/2012/CR-2dcontext-20121217/#current-default-path> for
> the associated fallback element and if the given element is focused,
> draws a ring along the same path using the style the browser uses for
> drawing its standard focus ring."
> </to>
>
>
> Apologies if this has already been covered: did the group settle on the
> issue of what "drawing" means in this context?
>
> When I was participating on this topic, let's say a few years ago, I
> thought draw just meant "show".
>
> As in, show focus using the style the browser would use for the particular
> element in focus.
> In the early Chrome implementation however, the implementer (hi Dominic)
> chose to draw directly onto the canvas bitmap.
>

Yes, this is the behavior that we settled on.
The focus is drawn like a stroke using the current path into the canvas
pixels.


> On this bikeshedding issue, I believe we had considered using a simple
> flag.
>
> // HTML+early canvas:
> <style>a{ -webkit-focus: outline: none|<outline>;}</style>
> <canvas></canvas><a href="#" style="position: absolute">text</a>
>

> // HTML with live descendents:
> <canvas><a onfocus="this.parent.getContext('2d').showFocus(this,
> {transparent: true|false})" href="#">text</a></canvas>
>
>
> I've not had much luck with code snippets on these discussions, but I hope
> that shows where things were and where I thought they were going.
> Now we'd just used a boolean instead of an object, and a different name,
> but it was intended (at least on my part), to be about "showFocus".
>
> The boolean was there for the same reason -webkit-focus exists. Note that
> in these, the author only needs to call showFocus, they do not need to
> repaint the bitmap.
>

We had a discussion about that behavior last week on this mailing list, but
people preferred the current behavior.
So, the only time the focus is drawn, is when the author calls
drawFocusIfNeeded. It's not drawn and clear automatically.

Received on Tuesday, 14 January 2014 01:10:35 UTC