This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 23980 - drawSystemFocusRing and drawCustomFocusRing is poorly named
Summary: drawSystemFocusRing and drawCustomFocusRing is poorly named
Status: CLOSED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: CR HTML Canvas 2D Context (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 major
Target Milestone: ---
Assignee: Jay Munro
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords: a11y_canvas
Depends on:
Blocks:
 
Reported: 2013-12-03 16:50 UTC by Philippe Le Hegaret
Modified: 2014-01-20 23:26 UTC (History)
6 users (show)

See Also:


Attachments

Description Philippe Le Hegaret 2013-12-03 16:50:16 UTC
A.  drawSystemFocusRing and drawCustomFocusRing don't necessarily draw a ring. This may be just terminology. How does one call the drawing to indicate a focus location?

 B. If the element isn't in focus, they don't draw anything at all. If the element is in focus, it won't be drawn if the user hasn't requested a particular focus ring (and the element doesn't usually have a focus ring for drawSystemFocusRing). In other words, it's user and platform dependent whether a focus ring is drawn or not. Those functions are request to the user agent that may be fulfilled or not.

See also
[[
What would you call it if it never draws, but just notifies the UI? I think
we could call it notifyFocusRingPath or something like that.
]]
http://lists.w3.org/Archives/Public/public-whatwg-archive/2013Oct/0203.html
Comment 1 Jay Munro 2013-12-03 21:32:36 UTC
Reassigning to Canvas 2D Context Level 2 since drawSystemFocusRing and drawCustomFocusRing are at risk for CR.
Comment 2 Rich Schwerdtfeger 2013-12-04 14:42:41 UTC
Like any error condition, if someone tries to draw focus ring on something that does not have focus then it should not draw the ring. I don't see the issue. That is how it should operate.


This statement makes no sense: 

"If the element is in focus, it won't be drawn if the user hasn't requested a particular focus ring (and the element doesn't usually have a focus ring for drawSystemFocusRing)" 

All the platforms I have used have a default focus ring style. It is also a WCAG requirement that the user draw visual focus. WCAG2 is also being applied to software in the new 508 refresh so if the OS does not provide for this then the OS platform will have problems.
Comment 3 Rich Schwerdtfeger 2013-12-04 14:48:12 UTC
I think the name is fine as it is consistent with platform accessibility APIs. A name change is also not justification for pushing low vision access to L2.
Comment 4 Philippe Le Hegaret 2013-12-04 17:53:46 UTC
The spec says "or if the element would have a focus ring drawn around it", which implies that not all elements have a default focus ring.

My point related to the naming is that, at best, it is a quest to draw a focus ring but the specification doesn't guarantee that a focus ring will be drawn even if the element is in focus and a descendant of the context. At least, that's how I read the spec.

Given that, some are questioning the naming of the method.
Comment 5 Rich Schwerdtfeger 2013-12-04 19:13:17 UTC
I don't interpret it that way. At best we are talking about an editorial change.
Comment 6 Philippe Le Hegaret 2013-12-04 19:33:53 UTC
You may not interpret that way but,as far as I can tell, my interpretation of the specification reflects what was implemented.

If you focus on a p element and then call drawSystemFocusRing on it, you won't get a focus ring:
 http://w3c-test.org/web-platform-tests/submissions/457/2dcontext/drawing-paths-to-the-canvas/drawSystemFocusRing_005.html
(this test fails on Firefox Nightly and Chrome Canary)
Comment 7 Jay Munro 2013-12-04 19:46:43 UTC
I jumped the gun on moving to L2, there are still ongoing discussions on the focus ring methods. Moving back to CR.
Comment 8 Rich Schwerdtfeger 2013-12-05 15:08:46 UTC
The focus ring is a hold over from platform accessibility apis that is something that people who work in accessibility are familiar with on Windows. This is why Microsoft and others who wrote the original proposal chose this name. I don't think the name should be something that holds us up. Perhaps simply calling the API drawSystemFocus() and drawCustomFocus()? This gets us away with being tied down to any particular path appearance.

I should note that Microsoft wanted to convert the path to a rectangle as it was consistent with how focus "rings" were drawn in Windows.
Comment 9 Philippe Le Hegaret 2013-12-05 16:35:21 UTC
As a side comment, 
http://w3c-test.org/web-platform-tests/submissions/457/2dcontext/drawing-paths-to-the-canvas/drawSystemFocusRing_005.html
was incorrect since it didn't have a tabindex. It's now fixed and works properly.
Comment 10 Jay Munro 2014-01-06 23:53:24 UTC
Initial title: 
drawSystemFocusRing and drawCustomFocusRing are poorly named

Per A11y/Canvas group, we'll keep drawSystemFocusRing name the same. drawCustomFocusRing will be worked on in Canvas Context 2D Level 2. 

Changing title to:
drawCustomFocusRing is poorly named
Comment 11 Philippe Le Hegaret 2014-01-08 18:35:27 UTC
I'm fine with the resolution btw and having this bug closed or moved to L2.
Comment 12 Jatinder Mann [MSFT] 2014-01-09 16:58:35 UTC
I would like to talk about this bug some more in next Monday's Canvas Accessibility Sub Group meeting. I think we should consider updating the name of drawSystemFocusRing in the L1 spec to make the feature more clear to web developers. I personally don't think fixing the name should mean that we need to push this API out to the L2 spec; its quite reasonable to update the name in the L1 spec, especially if we will likely be going to Last Call anyway. Just because some old Win32 API is using this sort of name doesn't mean we should confuse web developers and impact the adoption of this API.

I don't like the use of "System" because it sounds like we are using the OS focus, whereas we really mean User Agent focus. E.g., On Windows Chrome uses a orange focus which is different from the system dotted focus. I rather we just remove the word "System" for this method. The "Custom" version should keep the word "Custom" because it is a custom focus that the web developer draws.

I don't like the use of "Ring". You can use the Canvas API to draw any path, not just a ring. We can drop "Ring" and go with "Region", "Path", or nothing at all.  

I don't particularly like the use of "draw" as we only draw if the area is focused. Other draw calls like "drawImage" always draw once the call is made. I can see that "set" may be confusing as it may appear that we are setting the focus, not the user. Since it may be the least confusing, I think we should leave "draw" in.

How does "drawFocus" instead of "drawSystemFocusRing" and "drawCustomFocus" instead of "drawCustomFocusRing" sound? I know naming may sound like a minor thing, but if we are spending the time to fix the defects in this API, we might as well get the name right.
Comment 13 Jatinder Mann [MSFT] 2014-01-13 22:11:22 UTC
Bringing the bug back to HTML5 CR as there is an ongoing discussion on fixing this issue.
Comment 14 Philippe Le Hegaret 2014-01-13 23:46:10 UTC
Proposed resolution is to change drawSystemFocusRing to drawFocusIfNeeded
Comment 15 Jay Munro 2014-01-16 23:11:47 UTC
drawSystemFocusRing has been renamed to drawFocusIfNeeded.
Comment 16 Jatinder Mann [MSFT] 2014-01-20 23:26:31 UTC
As per Canvas SubGroup discussion, we have agreed upon the drawFocusIfNeeded name, http://www.w3.org/2014/01/20-html-a11y-minutes.html. The spec has been updated to reflect that change.