This Wiki page is edited by participants of the HTML Accessibility Task Force. It does not necessarily represent consensus and it may have incorrect information or information that is not supported by other Task Force participants, WAI, or W3C. It may also have some very useful information.
Summary of focusRing method naming
Contents
Resources
- Bug 23980
- Discussion Thread started on 01/09 by Jatinder Mann
Summary
drawSystemFocusRing() (dSFR) and drawCustomFocusRing() (dCFR) do more than draw a focus ring. Their naming is likely to cause confusion to developers who consider using the method which is likely to lead to incorrect usage, or worse, no usage.
Jatinder M
- It's not clear to web developers.
- Thinks it can happen in L1 (If going back to LC)
- Not using OS focus, but UA focus.
- There is no "ring" (prefer Region or Path or nothing at all)
- not always drawing, so "draw" is inappropriate but may be best we have
Propose: drawFocus, drawCustomFocus
Dominic M
- OK with drawFocus
Propose: drawFocus or notifyFocus, notifyFocusRegion
OR
- setFocusPath that never draws anything but notifies the system what path is highlighted when an element has focus, to complement it.
OR
- Create a single API called setElementFocusPath that only needs to be called once (if the path doesn't change), and the browser then takes over drawing the focused path around that element ever time that element gets focus, and clearing it when it loses focus. It would have to do that in a separate overlay.
Alexander S
- OK with drawFocus
Robert O
- "draw" is inappropriate because it doesn't always draw
- force authors to provide Path parameter
- add spec text for purpose of Path parameter
- Dominic's Idea 2 can't work (canvas draw timing)
Propose:
- drawFocusIfNeeded for the method that draws
- needToDrawFocus for accessibility
Rik C
- needToDrawFocus to L2
- not sure Applicable is any more clear than IfNeeded
- Split the function up
- Likes Dominic's idea 2: Create a single API called setElementFocusPath
Propose: drawSystemFocusRing to drawFocusIfNeeded
OR
Propose:
- setAccessibilityRegion -> associates the current path and the element for a11y
- drawFocus -> draws a focus ring around the current path. It's trivial to check if the element is focused.
Rich S
- ifNeeded implies that it may not be needed.
- method sets the location and draws if has focus
- OK with notifyFocus, notifyFocusRegion
Propose: drawFocusIfNeeded should be drawApplicableFocus or applyVisibleFocusLocation