FA-8451 / Assistive semantics / Open access
Accessible name precedence: Empty referenced labels are dropped and precedence changes · case 01
Empty referenced labels are dropped and precedence changes.
ROOT CAUSE
The missing reference operation uses `if x in nodes and nodes[x]` where the contract requires `if x in nodes`.
VERIFIED REPAIR
Implement the missing reference operation as `if x in nodes`.
Unsuccessful approach: Keeping only the first ID ignores other label references.
Case contract
Resolve existing labelledby references in order, including explicit empty labels; then aria-label, native label, and visible content; explicit labels take precedence over fallback content.
Why this case matters
A deterministic model of accessible name precedence; this isolates one interface invariant without requiring a browser.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(labelledby, nodes, aria_label, native_label, content, hidden):
referenced = [nodes[x] for x in labelledby if x in nodes and nodes[x]]
if referenced: return ' '.join(referenced)
if aria_label is not None: return aria_label
if native_label is not None: return native_label
if hidden: return ''
return content
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('reference order', solve(['z','a'], {'z':'Zulu','a':'Alpha'}, 'fallback', 'native', 'body', False), 'Zulu Alpha')
check('aria empty', solve([], {}, '', 'native', 'body', False), '')
check('native empty', solve([], {}, None, '', 'body', False), '')
check('hidden', solve([], {}, None, None, 'secret', True), '')
check('visible', solve([], {}, None, None, 'visible', False), 'visible')
check('empty reference', solve(['missing','empty'], {'empty':''}, 'fallback', None, 'body', False), '')
check('parameterized label content', solve([], {}, 'label'+str(N), None, 'body', False), 'label'+str(N))
for repetition in range(N):
check('repeat empty reference', solve(['missing','empty'], {'empty':''}, 'fallback', None, 'body', False), '')
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| reference order | Zulu Alpha | Zulu Alpha | Passed |
| aria empty | | | Passed |
| native empty | | | Passed |
| hidden | | | Passed |
| visible | visible | visible | Passed |
| empty reference | fallback | | Failed |
| parameterized label content | label1 | label1 | Passed |
| repeat empty reference | fallback | | Failed |
SHA-256 / ff41db31bd51ca44445b12c8f2faa92d74d8c16b7692c6f02f82d456f9be4907
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(labelledby, nodes, aria_label, native_label, content, hidden):
referenced = [nodes[x] for x in labelledby if x in nodes and x == labelledby[0]]
if referenced: return ' '.join(referenced)
if aria_label is not None: return aria_label
if native_label is not None: return native_label
if hidden: return ''
return content
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('reference order', solve(['z','a'], {'z':'Zulu','a':'Alpha'}, 'fallback', 'native', 'body', False), 'Zulu Alpha')
check('aria empty', solve([], {}, '', 'native', 'body', False), '')
check('native empty', solve([], {}, None, '', 'body', False), '')
check('hidden', solve([], {}, None, None, 'secret', True), '')
check('visible', solve([], {}, None, None, 'visible', False), 'visible')
check('empty reference', solve(['missing','empty'], {'empty':''}, 'fallback', None, 'body', False), '')
check('parameterized label content', solve([], {}, 'label'+str(N), None, 'body', False), 'label'+str(N))
for repetition in range(N):
check('repeat empty reference', solve(['missing','empty'], {'empty':''}, 'fallback', None, 'body', False), '')
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| reference order | Zulu | Zulu Alpha | Failed |
| aria empty | | | Passed |
| native empty | | | Passed |
| hidden | | | Passed |
| visible | visible | visible | Passed |
| empty reference | fallback | | Failed |
| parameterized label content | label1 | label1 | Passed |
| repeat empty reference | fallback | | Failed |
SHA-256 / d02bbc29d77e31b35bf42cc11a77bb5423f2d2c8cdf22b80973207f5fad9026a
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(labelledby, nodes, aria_label, native_label, content, hidden):
referenced = [nodes[x] for x in labelledby if x in nodes]
if referenced: return ' '.join(referenced)
if aria_label is not None: return aria_label
if native_label is not None: return native_label
if hidden: return ''
return content
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('reference order', solve(['z','a'], {'z':'Zulu','a':'Alpha'}, 'fallback', 'native', 'body', False), 'Zulu Alpha')
check('aria empty', solve([], {}, '', 'native', 'body', False), '')
check('native empty', solve([], {}, None, '', 'body', False), '')
check('hidden', solve([], {}, None, None, 'secret', True), '')
check('visible', solve([], {}, None, None, 'visible', False), 'visible')
check('empty reference', solve(['missing','empty'], {'empty':''}, 'fallback', None, 'body', False), '')
check('parameterized label content', solve([], {}, 'label'+str(N), None, 'body', False), 'label'+str(N))
for repetition in range(N):
check('repeat empty reference', solve(['missing','empty'], {'empty':''}, 'fallback', None, 'body', False), '')
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| reference order | Zulu Alpha | Zulu Alpha | Passed |
| aria empty | | | Passed |
| native empty | | | Passed |
| hidden | | | Passed |
| visible | visible | visible | Passed |
| empty reference | | | Passed |
| parameterized label content | label1 | label1 | Passed |
| repeat empty reference | | | Passed |
SHA-256 / 4a8117238ad2ac80817d300f0e91664c1ddb47df852ab045ba134c325fc2746f
Verification & scope
This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:38:21.422309+00:00.
Case digest / 8ca0f41060e2bb2e710bfeaaeee1d2e6c1950ad845cfffdd01b12f8145161355