FA-8441 / Assistive semantics / Open access
Accessible name precedence: An explicit empty native label falls back to content · case 01
An explicit empty native label falls back to content.
ROOT CAUSE
The native empty operation uses `if native_label:` where the contract requires `if native_label is not None:`.
VERIFIED REPAIR
Implement the native empty operation as `if native_label is not None:`.
Unsuccessful approach: Using the missing-label case ignores real labels.
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]
if referenced: return ' '.join(referenced)
if aria_label is not None: return aria_label
if native_label: 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 | body | | Failed |
| hidden | | | Passed |
| visible | visible | visible | Passed |
| empty reference | | | Passed |
| parameterized label content | label1 | label1 | Passed |
| repeat empty reference | | | Passed |
SHA-256 / cf93198b0ebbc1cd28f3cb797e22fe06f6ac2ea3fd8ba6161c7dfce9cb4de75f
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]
if referenced: return ' '.join(referenced)
if aria_label is not None: return aria_label
if native_label is 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 | body | | Failed |
| hidden | None | | Failed |
| visible | None | visible | Failed |
| empty reference | | | Passed |
| parameterized label content | label1 | label1 | Passed |
| repeat empty reference | | | Passed |
SHA-256 / 6f5f93f99a0495f7f648f9ae2db021fcb3001e775e219f24882787bf09935c0f
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.380849+00:00.
Case digest / e8e5f3b0496d84fddb8ec04dbc1c11ebb944e5eec869d8003f0c24eefa2ceef7