[webkit-dev] Proposal: Add support for focus rings in Canvas 2d

Rik Cabanier cabanier at gmail.com
Mon Oct 14 14:58:02 PDT 2013


On Mon, Oct 14, 2013 at 2:46 PM, Chris Fleizach <cfleizach at apple.com> wrote:

>
> On Oct 14, 2013, at 2:28 PM, Rik Cabanier <cabanier at gmail.com> wrote:
>
>
>
>
> On Mon, Oct 14, 2013 at 1:31 PM, Timothy Hatcher <timothy at apple.com>wrote:
>
>> On Oct 14, 2013, at 12:43 PM, Rik Cabanier <cabanier at gmail.com> wrote:
>>
>> Also, how would your suggestion tell the UA about what areas are
>> associated with the elements? What happens if an element is no longer
>> focused? The ring is drawn into the canvas bitmap so those pixels have to
>> be regenerated.
>>
>>
>> Focus rings are usually larger than the control they surround. How is the
>> developer suppose to know the pixel padding needed for each platform's
>> focus ring? Guess and hope for the best?
>>
>
> Why would he need to know this? Is it for the path that describes the ring?
>
>
>> Would drawing the system focus ring taint the canvas pixels? (Drawing
>> form controls into canvas via SVG images and <foreignObject> has been
>> considered taint worthy because it could leak the user's UI theme.)
>>
>
> I'm unsure if it should taint the canvas. How much information would be
> leaked that isn't already available through other means?
>
>
> Hi,
>
> I think it would be likely that the OS would draw their focus ring on top
> in a different context and the canvas wouldn't have to be responsible to
> repaint.
>

Doesn't that require another buffer that has the same memory size as the
canvas? Or did you mean that it draws the focus ring on top right after the
canvas backing store is composited?
drawSystemFocusRing would be dropped with this proposal, right?


>
> Which leaves the case where the canvas sees drawCursor fails and then
> tries to draw its own, which seems somewhat strange to me. How would the
> web page know what the user wanted.
>

I'm unsure what you mean. could you rephrase?


> There could be a variety of high contrast cursors that the user might want
> to use
>

My patch looks like this:

GraphicsContext* c = drawingContext();
if (c)
  c->drawFocusRing(m_path, 1, 1, RenderTheme::focusRingColor());

 Should that use the focus ring color and style that the user picked?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20131014/c310250d/attachment.html>


More information about the webkit-dev mailing list