Bug 259977

Summary: AX: Associated labels not read when one is hidden
Product: WebKit Reporter: Andrew <theandy500>
Component: AccessibilityAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: andresg_22, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 16   
Hardware: All   
OS: All   

Description Andrew 2023-08-09 08:34:28 PDT
If you have multiple labels with the same "for" property, but the first one is hidden, VoiceOver on Mac with Safari does not read the visible label (or any label at all). Chrome with VoiceOver works fine.

The below code will read "edit text, blank" in Safari on Ventura 13.5  instead of "Test Two, edit text" as Chrome does. 

<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Test</title>
</head>
<body>
    <label style="display:none" for="test1">Test One</label>
    <label for="test1">Test Two</label>
    <input id="test1" name="test1">
</body>
</html>
Comment 1 Radar WebKit Bug Importer 2023-08-09 08:34:36 PDT
<rdar://problem/113631557>