Skip to content

Commit 3ac3d02

Browse files
spec(native): a container label does not merge its children; targets measure in their environment (#8135)
* spec(native): a container label does not merge its children; targets measure in their environment X5 states the outcome, one element per thing a person reads, without the mechanism that produces it. A text child inside a labelled ancestor keeps its own element and publishes the ancestor's label instead of its own words, so the same name is reachable twice and the child's words are never read. X5 now says a component that reads as one thing merges its children explicitly, and the acceptance checks assert it rather than leaving it to the audit. A control's rendered size follows the environment its ancestor establishes, so X7 measures a hit target in the environment the component ships in, at the largest text size. * spec(native): measure targets at both text sizes; merge modifiers are examples X7 and its acceptance row measure the 44-point target at the default and the largest text sizes, not only the largest, where text-scaled controls are biggest. X5 gives the merge modifiers as examples and admits any equivalent that exposes one element named with the component's own words.
1 parent 63592ed commit 3ac3d02

1 file changed

Lines changed: 16 additions & 4 deletions

File tree

‎packages/native/specs/swift/library/accessibility.md‎

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,17 @@ Differentiate Without Color get components that honor each setting.
4040
hidden from VoiceOver unless it carries a label. An icon-only control
4141
requires a label.
4242
- **X5 — One element per thing a person reads.** A component that reads as one
43-
thing, such as a banner or a list row, is one accessibility element. Every
44-
action reachable only by a gesture (swipe, long press, drag) is also an
43+
thing, such as a banner or a list row, is one accessibility element. A label
44+
on a container does not merge what the container holds: a text child inside a
45+
labelled ancestor keeps its own element and its static-text role, and that
46+
element publishes the ancestor's label in place of the child's own words, so
47+
the same name is reachable twice and the words the child draws are never
48+
read. A component that reads as one thing merges its children explicitly
49+
rather than resting on a container label:
50+
`accessibilityElement(children: .combine)`, `.ignore` with a label of its
51+
own, and `accessibilityRepresentation` each do this, as does any equivalent
52+
that exposes one element named with the component's own words. Every action
53+
reachable only by a gesture (swipe, long press, drag) is also an
4554
`accessibilityAction`.
4655
- **X6 — Settings are honored.**
4756
- Reduce Motion: movement becomes a cross-fade or no animation.
@@ -52,7 +61,9 @@ Differentiate Without Color get components that honor each setting.
5261
an icon, or a word.
5362
- Button Shapes: controls drawn without a visible edge show one.
5463
- **X7 — Targets are at least 44 by 44 points,** even when the drawn control is
55-
smaller.
64+
smaller. A control's rendered size follows the environment its ancestor
65+
establishes, so a target is measured in the environment the component ships
66+
in, at the default and the largest text sizes, and not in isolation.
5667

5768
## Acceptance checks
5869

@@ -62,8 +73,9 @@ Differentiate Without Color get components that honor each setting.
6273
| X2 | A test disables a focused control and finds it still focused, read as dimmed, with its reason as the hint. |
6374
| X3 | A test shows a covered component's message after load and observes exactly one announcement, at high priority for an error; a time-critical failure is also high priority; a second render announces nothing; the same message present at load announces nothing; a Banner shown after load announces nothing. A message VoiceOver can reach only through its announcement, present at load, announces once. |
6475
| X4, X5 | A UI test runs `performAccessibilityAudit()` on a screen of every component at the default and largest text sizes, with no failures. |
76+
| X5 | A test places a text child inside a container that carries a label and finds exactly one element, reachable once, whose name is the words the component reads as. The audit does not establish this on its own, so the test asserts it. |
6577
| X6 | Captures under Reduce Motion show no movement; under Reduce Transparency, opaque surfaces; under Bold Text, heavier text in every component; under Differentiate Without Color, every state shown by color also shows a shape, an icon, or a word; under Button Shapes, every control drawn without a visible edge shows one. |
66-
| X7 | The audit's hit-region check passes for every control. |
78+
| X7 | The audit's hit-region check passes for every control, measured in the environment the component ships in and at the default and largest text sizes. |
6779

6880
## Current state
6981

0 commit comments

Comments
 (0)