[Webkit-unassigned] [Bug 270377] New: AX: CSS content unexpectedly becomes name for input type=checkbox switch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Mar 1 14:06:05 PST 2024


            Bug ID: 270377
           Summary: AX: CSS content unexpectedly becomes name for input
                    type=checkbox switch
           Product: WebKit
           Version: Safari Technology Preview
          Hardware: All
                OS: All
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Accessibility
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: scottaohara at yahoo.com
                CC: andresg_22 at apple.com,
                    webkit-bug-importer at group.apple.com

Reviewing https://webkit.org/blog/15054/an-html-switch-control/

For the instances of the switch demonstrations which use CSS pseudo content to display visible "on" and "off" text states, Webkit is exposing this pseudo content as the accessible name of the switch control.  So, per the demos if one were to use VoiceOver they would hear them announced as "on off, switch, [actual state of switch announced here]"

If these are properly labelled, then the label element text, or the aria-label(ledby) attribute, would provide the name.  Unfortunately, the current implementation gives this pseudo content priority over the title attribute, so that can't be relied on to name the switch if there is pseudo content.

To resolve this, I would generally expect this pseudo content to not be used as a candidate for the switch's accessible name. The most common use of such pseudo content is to communicate the current state in text, anyway. So, using it as a potential name source is redundant at best, and confusing at worst. Using another one of the examples, consider the day/night switch using pseudo text to convey the current state as well as the graphical change.  Where right now, this would result in the switch being exposed as "day night, switch, [on\off]".  Even if someone were to build this in a way where only one pseudo content text string was displayed at a time, it'd result in a name change when the state changed.  So what does "day, switch, off" mean? Does it mean day is "off" so it's night?  Or that because the switch is in the off state, it _is_ daytime?

But, if there is any desire to make sure users have access to this pseudo text, potentially as a way to overwrite the implicit on/off announcements.  So for instance, a user could hear "Choose theme, switch, light" or "choose theme, switch, dark" - then this is what the ARIA working group has been discussing both as a potential new ARIA feature, but ideally, this should be possible in the HTML implementation without need for ARIA - https://github.com/w3c/aria/issues/2085#issuecomment-1973438719

an additional test case to show how the psuedo text isn't available when labelled, and is as a confusing name when unlabelled:

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20240301/0df3ed07/attachment.htm>

More information about the webkit-unassigned mailing list