@kinti/a11y-toolkit 5.26.0 → 5.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +1 -1
  2. package/a11y_toolkit/a11y.py +27 -4
  3. package/a11y_toolkit/a11yact.py +9 -1
  4. package/a11y_toolkit/a11yannotate.py +185 -0
  5. package/a11y_toolkit/a11yaudit.py +853 -193
  6. package/a11y_toolkit/a11ybadge.py +24 -17
  7. package/a11y_toolkit/a11ybudget.py +145 -1
  8. package/a11y_toolkit/a11ycorpus.py +58 -24
  9. package/a11y_toolkit/a11ycrit.py +110 -53
  10. package/a11y_toolkit/a11ydiff.py +104 -34
  11. package/a11y_toolkit/a11ydisprove.py +15 -8
  12. package/a11y_toolkit/a11ydocx.py +8 -6
  13. package/a11y_toolkit/a11ydom.py +425 -95
  14. package/a11y_toolkit/a11yen301549.py +53 -1
  15. package/a11y_toolkit/a11yengines.py +157 -0
  16. package/a11y_toolkit/a11yevidence.py +81 -33
  17. package/a11y_toolkit/a11yfix.py +131 -52
  18. package/a11y_toolkit/a11yinit.py +30 -5
  19. package/a11y_toolkit/a11yjourney.py +110 -4
  20. package/a11y_toolkit/a11yledger.py +119 -12
  21. package/a11y_toolkit/a11ylocate.py +247 -0
  22. package/a11y_toolkit/a11yopenacr.py +10 -3
  23. package/a11y_toolkit/a11ypatches.py +154 -0
  24. package/a11y_toolkit/a11ypatterns.py +344 -0
  25. package/a11y_toolkit/a11ypdf.py +109 -53
  26. package/a11y_toolkit/a11yrgaa.py +60 -0
  27. package/a11y_toolkit/a11yroute.py +34 -12
  28. package/a11y_toolkit/a11ysarif.py +45 -18
  29. package/a11y_toolkit/a11yscope.py +67 -15
  30. package/a11y_toolkit/a11yscroll.py +7 -5
  31. package/a11y_toolkit/a11ystatement.py +30 -6
  32. package/a11y_toolkit/a11ytrace.py +293 -0
  33. package/a11y_toolkit/a11yvalidate.py +21 -15
  34. package/a11y_toolkit/a11yvpat.py +34 -7
  35. package/a11y_toolkit/a11yvtt.py +22 -6
  36. package/a11y_toolkit/a11ywiz.py +121 -0
  37. package/a11y_toolkit/contrast.py +62 -24
  38. package/a11y_toolkit/locales/en.json +177 -20
  39. package/a11y_toolkit/locales/es.json +178 -21
  40. package/a11y_toolkit/rgaa.json +2661 -0
  41. package/a11y_toolkit/server.py +149 -50
  42. package/package.json +2 -2
  43. package/a11y_toolkit/a11yplan.py +0 -214
  44. package/a11y_toolkit/a11ywcagem.py +0 -237
@@ -77,6 +77,23 @@ def _hsl_a_rgb(h, s, l):
77
77
  return f(0), f(8), f(4)
78
78
 
79
79
 
80
+ def _hue_deg(x):
81
+ """Ángulo CSS con unidades — deg (por defecto), turn, rad, grad → grados.
82
+ None si no es numérico (antes: rstrip('deg') tragaba '0.5turn' y cascaba)."""
83
+ x = x.strip().lower()
84
+ for suf, factor in (('turn', 360.0), ('grad', 0.9),
85
+ ('rad', 180.0 / math.pi), ('deg', 1.0)):
86
+ if x.endswith(suf):
87
+ try:
88
+ return float(x[:-len(suf)]) * factor
89
+ except ValueError:
90
+ return None
91
+ try:
92
+ return float(x)
93
+ except ValueError:
94
+ return None
95
+
96
+
80
97
  def parse_color(s):
81
98
  """'#rgb' | '#rrggbb' | '#rrggbbaa' | rgb()/rgba() | hsl()/hsla() | nombre CSS
82
99
  → dict r,g,b (y 'a' si hay alfa). Acepta comas o espacios como separadores.
@@ -104,30 +121,40 @@ def parse_color(s):
104
121
  body, alfa_ext = re.split(r'\s*/\s*', body, 1)
105
122
  parts = [p for p in (x.strip() for x in re.split(r'[\s,]+', body)) if p]
106
123
  kind, v = m.group(1), parts
107
- if kind.startswith('rgb'):
124
+ try:
125
+ if kind.startswith('rgb'):
126
+ if len(v) < 3:
127
+ return None
128
+ def _channel(x):
129
+ if x.endswith('%'):
130
+ return max(0, min(255, round(float(x[:-1]) * 2.55)))
131
+ return max(0, min(255, int(float(x))))
132
+ c = {'r': _channel(v[0]), 'g': _channel(v[1]), 'b': _channel(v[2])}
133
+ if len(v) >= 4:
134
+ c['a'] = max(0.0, min(1.0, float(v[3].rstrip('%')) / (100 if v[3].endswith('%') else 1)))
135
+ elif alfa_ext:
136
+ c['a'] = max(0.0, min(1.0, float(alfa_ext.strip().rstrip('%')) / (100 if alfa_ext.strip().endswith('%') else 1)))
137
+ return c
108
138
  if len(v) < 3:
109
139
  return None
110
- def _channel(x):
111
- if x.endswith('%'):
112
- return max(0, min(255, round(float(x[:-1]) * 2.55)))
113
- return max(0, min(255, int(float(x))))
114
- c = {'r': _channel(v[0]), 'g': _channel(v[1]), 'b': _channel(v[2])}
140
+ h_ = _hue_deg(v[0])
141
+ if h_ is None:
142
+ return None
143
+ s_ = max(0.0, min(1.0, float(v[1].rstrip('%')) / 100.0))
144
+ l_ = max(0.0, min(1.0, float(v[2].rstrip('%')) / 100.0))
145
+ r, g, b = _hsl_a_rgb(h_, s_, l_)
146
+ c = {'r': max(0, min(255, r)), 'g': max(0, min(255, g)),
147
+ 'b': max(0, min(255, b))}
115
148
  if len(v) >= 4:
116
149
  c['a'] = max(0.0, min(1.0, float(v[3].rstrip('%')) / (100 if v[3].endswith('%') else 1)))
117
150
  elif alfa_ext:
118
- c['a'] = max(0.0, min(1.0, float(alfa_ext.strip().rstrip('%')) / (100 if alfa_ext.strip().endswith('%') else 1)))
151
+ # hsl(0 0% 0% / 0.5) — sintaxis moderna con barra: MISMO trato
152
+ # que rgb() con barra (el canal existía solo para la rama rgb)
153
+ c['a'] = max(0.0, min(1.0, float(alfa_ext.strip().rstrip('%'))
154
+ / (100 if alfa_ext.strip().endswith('%') else 1)))
119
155
  return c
120
- if len(v) < 3:
121
- return None
122
- h_ = float(v[0].rstrip('deg')) % 360
123
- s_ = max(0.0, min(1.0, float(v[1].rstrip('%')) / 100.0))
124
- l_ = max(0.0, min(1.0, float(v[2].rstrip('%')) / 100.0))
125
- r, g, b = _hsl_a_rgb(h_, s_, l_)
126
- c = {'r': max(0, min(255, r)), 'g': max(0, min(255, g)),
127
- 'b': max(0, min(255, b))}
128
- if len(v) >= 4:
129
- c['a'] = max(0.0, min(1.0, float(v[3].rstrip('%')) / (100 if v[3].endswith('%') else 1)))
130
- return c
156
+ except (ValueError, TypeError, OverflowError):
157
+ return None # contrato: color inválido → None, nunca traceback
131
158
  if t in COLOR_NAMES:
132
159
  h = COLOR_NAMES[t]
133
160
  return {'r': int(h[0:2], 16), 'g': int(h[2:4], 16), 'b': int(h[4:6], 16)}
@@ -213,10 +240,12 @@ def pair(fg_s, bg_s, with_suggestion=True, lang='en'):
213
240
  if fg.get('a', 1) < 1:
214
241
  fg = composite(fg, bg)
215
242
  alpha_note = hexs(fg)
216
- r = ratio(fg, bg)
243
+ # se redondea ANTES de los veredictos: lo mostrado y el veredicto nunca
244
+ # discrepan (un ratio en [4.495,4.5) no puede imprimir "4.5" y fallar)
245
+ r = round(ratio(fg, bg), 2)
217
246
  out = {
218
247
  'text': hexs(fg), 'background': hexs(bg),
219
- 'ratio': round(r, 2),
248
+ 'ratio': r,
220
249
  'verdicts': verdicts(r, lang),
221
250
  }
222
251
  if alpha_note:
@@ -300,20 +329,23 @@ def _percentile(vals, p):
300
329
  def decode_png(data):
301
330
  """Bytes PNG → (ancho, alto, bytes RGB). Sin dependencias.
302
331
 
303
- Soporta color types 0 (gris), 2 (RGB), 3 (paleta) y 6 (RGBA) a 8 bits;
304
- el alfa se compone sobre blanco (las capturas de navegador son opacas).
305
- Lanza ValueError si el PNG está fuera de ese soporte (p. ej. 16 bits)."""
332
+ Soporta color types 0 (gris), 2 (RGB), 3 (paleta) y 6 (RGBA) a 8 bits,
333
+ SIN entrelazado (Adam7); el alfa se compone sobre blanco (las capturas
334
+ de navegador son opacas). Lanza ValueError si el PNG está fuera de ese
335
+ soporte (p. ej. 16 bits, gris+alfa, entrelazado)."""
306
336
  import struct
307
337
  import zlib
308
338
  if data[:8] != b'\x89PNG\r\n\x1a\n':
309
339
  raise ValueError('not a PNG file')
310
340
  pos, idat, w, h, bd, ct, plte = 8, b'', 0, 0, 0, 0, None
341
+ interlace = 0
311
342
  while pos < len(data):
312
343
  ln = struct.unpack('>I', data[pos:pos + 4])[0]
313
344
  kind = data[pos + 4:pos + 8]
314
345
  body = data[pos + 8:pos + 8 + ln]
315
346
  if kind == b'IHDR':
316
347
  w, h, bd, ct = struct.unpack('>IIBB', body[:10])
348
+ interlace = body[12] if len(body) >= 13 else 0
317
349
  elif kind == b'IDAT':
318
350
  idat += body
319
351
  elif kind == b'PLTE':
@@ -323,9 +355,15 @@ def decode_png(data):
323
355
  pos += 12 + ln
324
356
  if bd != 8:
325
357
  raise ValueError(f'PNG bit depth {bd} unsupported (8-bit only)')
326
- channels = {0: 1, 2: 3, 3: 1, 4: 2, 6: 4}.get(ct)
358
+ if ct == 4:
359
+ raise ValueError('PNG color type 4 (grayscale+alpha) unsupported '
360
+ '(convert to RGBA (6) or RGB (2))')
361
+ channels = {0: 1, 2: 3, 3: 1, 6: 4}.get(ct)
327
362
  if channels is None:
328
363
  raise ValueError(f'PNG color type {ct} unsupported')
364
+ if interlace:
365
+ raise ValueError('PNG interlaced (Adam7) unsupported '
366
+ '(export non-interlaced)')
329
367
  if ct == 3 and not plte:
330
368
  raise ValueError('PNG palette without PLTE chunk')
331
369
  raw = zlib.decompress(idat)
@@ -8,7 +8,10 @@
8
8
  "audit": {
9
9
  "accesskey_dup": "{n} duplicated accesskey values: {example}.",
10
10
  "accesskey_dup_rem": "Duplicated accesskeys trigger the wrong control and clash with browser shortcuts; remove or make unique.",
11
- "aria_hidden_focusable": "{n} interactive elements (<{tag}>) with aria-hidden=\"true\": hidden from the screen reader yet still focusable.",
11
+ "aria_hidden_focusable": {
12
+ "one": "1 interactive element (<{tag}>) with aria-hidden=\"true\": hidden from the screen reader yet still focusable.",
13
+ "other": "{n} interactive elements (<{tag}>) with aria-hidden=\"true\": hidden from the screen reader yet still focusable."
14
+ },
12
15
  "aria_hidden_focusable_rem": "Remove aria-hidden from the focusable element, or add tabindex=\"-1\" if it must stay out of interaction.",
13
16
  "aria_ref_missing": "{n} aria-labelledby/describedby references point to ids that do not exist: {example}.",
14
17
  "aria_ref_missing_rem": "Fix or remove the reference: a broken aria-labelledby leaves the control with no accessible name.",
@@ -16,7 +19,10 @@
16
19
  "aria_value_invalid_rem": "Boolean aria-* only accept true/false/undefined, position ones integers, token ones their closed list (4.1.2). Fix or drop the attribute.",
17
20
  "audio_desc_missing": "{n} <video> without audio-description track (1.2.3/1.2.5): pending human judgment.",
18
21
  "audio_desc_missing_rem": "If the video carries essential visual information not narrated, publish audio description (track kind=\"descriptions\" or alternative) — a person watching the video decides.",
19
- "autocomplete": "{n} fields collecting user information without an autocomplete attribute: {example}.",
22
+ "autocomplete": {
23
+ "one": "1 field collecting user information without an autocomplete attribute: {example}.",
24
+ "other": "{n} fields collecting user information without an autocomplete attribute: {example}."
25
+ },
20
26
  "autocomplete_invalid": "{n} invalid autocomplete token values: {example}. Tokens must come from the HTML autofill standard (§7.5) or assistive tech cannot identify the purpose (1.3.5).",
21
27
  "autocomplete_invalid_rem": "Use standard tokens: email, tel, name, postal-code, one-time-code… (full list in the tool).",
22
28
  "autocomplete_rem": "Add autocomplete with the right token (email, tel, name, postal-code…, 1.3.5): free accessibility and autofill at zero cost.",
@@ -26,11 +32,17 @@
26
32
  "captcha_rem": "Offer alternatives: magic links, OAuth, human support. A CAPTCHA without an alternative excludes (3.3.8, new in WCAG 2.2 AA).",
27
33
  "char_shortcut": "{n} single-character keyboard shortcuts detected: {example}. Review (2.1.4).",
28
34
  "char_shortcut_rem": "Single-key shortcuts must be disablable, remappable, or active only on focus (2.1.4): voice-dictation users trigger every letter.",
29
- "click_nonfocusable": "{n} non-interactive elements (<{tag}>) with onclick, no role, no tabindex and no keyboard handling.",
35
+ "click_nonfocusable": {
36
+ "one": "1 non-interactive element (<{tag}>) with onclick, no role, no tabindex and no keyboard handling.",
37
+ "other": "{n} non-interactive elements (<{tag}>) with onclick, no role, no tabindex and no keyboard handling."
38
+ },
30
39
  "click_nonfocusable_rem": "Use a real <button>; if impossible, add role=\"button\", tabindex=\"0\" and Enter/Space handling (2.1.1).",
31
40
  "color_only_link": "Links distinguishable only by color detected in the rendered pass (1.4.1).",
32
41
  "color_only_link_rem": "A link inside text needs underline or another cue, or ≥3:1 contrast against surrounding text (1.4.1).",
33
- "ctrl_name": "{n} <{tag}> with no accessible name (no text, aria-label or title).",
42
+ "ctrl_name": {
43
+ "one": "1 <{tag}> with no accessible name (no text, aria-label or title).",
44
+ "other": "{n} <{tag}> with no accessible name (no text, aria-label or title)."
45
+ },
34
46
  "ctrl_name_rem": "The accessible name comes from inner text, aria-label, title, or an inner image with alt. An empty control is invisible to screen readers.",
35
47
  "dom_visual_order": "DOM order differs from visual order in {n} text blocks: review with keyboard (1.3.2).",
36
48
  "dom_visual_order_rem": "Programmatic reading order must match visual order: check flex order, grid placement and position absolute (1.3.2).",
@@ -38,18 +50,33 @@
38
50
  "down_event_rem": "Activate on the UP event (onclick/onmouseup): dragging away can abort — that is rule 2.5.2.",
39
51
  "drag_no_alt": "{n} drag handlers with no visible click/button alternative: {example}. Review (2.5.7).",
40
52
  "drag_no_alt_rem": "Every drag action needs a non-dragging alternative: up/down buttons, context menu, arrows (2.5.7).",
41
- "dup_ids": "{n} duplicated ids; they can break label-for and aria-labelledby associations.",
53
+ "dup_ids": {
54
+ "one": "1 duplicated id; it can break label-for and aria-labelledby associations.",
55
+ "other": "{n} duplicated ids; they can break label-for and aria-labelledby associations."
56
+ },
42
57
  "dup_ids_rem": "Make ids unique: <label for> and aria-labelledby only point at the first match.",
43
58
  "element_lang_invalid": "{n} invalid lang attributes on elements (BCP-47): {example}.",
44
59
  "element_lang_invalid_rem": "Foreign-language fragments carry lang with a valid code (3.1.2): <blockquote lang=\"en\">…</blockquote>.",
45
- "empty_heading": "{n} empty headings (<h*> with no text).",
60
+ "empty_heading": {
61
+ "one": "1 empty heading (<h*> with no text).",
62
+ "other": "{n} empty headings (<h*> with no text)."
63
+ },
46
64
  "empty_heading_rem": "Remove empty headings or give them text: they show up as gaps in the reader's index.",
47
65
  "fetch_error": "could not download: {e}",
48
- "field_label": "{n} form fields with no associated <label> and no accessible name.",
66
+ "field_label": {
67
+ "one": "1 form field with no associated <label> and no accessible name.",
68
+ "other": "{n} form fields with no associated <label> and no accessible name."
69
+ },
49
70
  "field_label_rem": "Associate <label for=\"id\"> (or wrap the field), or use aria-label. Applies to input, select and textarea.",
50
- "fieldset_missing": "{n} radio/checkbox groups without <fieldset><legend>: screen readers do not announce the common question (1.3.1).",
71
+ "fieldset_missing": {
72
+ "one": "1 radio/checkbox group without <fieldset><legend>: screen readers do not announce the group.",
73
+ "other": "{n} radio/checkbox groups without <fieldset><legend>: screen readers do not announce the common question (1.3.1)."
74
+ },
51
75
  "fieldset_missing_rem": "Wrap groups in <fieldset><legend>Common question</legend>…</fieldset> (1.3.1): without it, each radio is announced without context.",
52
- "financial_no_confirm": "{n} financial/legal form(s) without a detectable confirmation step (3.3.4).",
76
+ "financial_no_confirm": {
77
+ "one": "1 financial/legal form without a detectable confirmation step (3.3.4).",
78
+ "other": "{n} financial/legal form(s) without a detectable confirmation step (3.3.4)."
79
+ },
53
80
  "financial_no_confirm_rem": "Submissions with legal/financial consequences must be reversible, checked, or confirmed (3.3.4): terms checkbox, \"Review and confirm\" button, or review step.",
54
81
  "forced_colors_svg": "{n} SVGs with hardcoded colored fill: under forced-colors (Windows High Contrast) the fill falls back to inherited and the icon can turn invisible.",
55
82
  "forced_colors_svg_rem": "Use fill=\"currentColor\" (inherits text color, which the system already adjusts) or the system keywords (CanvasText).",
@@ -65,12 +92,28 @@
65
92
  "help_inconsistent_rem": "When help appears on multiple pages, it must appear in the same relative order and consistently (3.2.6, new in 2.2): same menu, same place.",
66
93
  "iframe_title": "{n} <iframe> without an accessible title.",
67
94
  "iframe_title_rem": "Add a descriptive title to the iframe (screen readers announce it on arrival).",
68
- "images_of_text": "{n} images that appear to be rendered text (very long alt{ej2}). Review (1.4.5).",
95
+ "images_of_text": {
96
+ "one": "1 suspicious image of text (1.4.5): {ej2}",
97
+ "other": "{n} images that appear to be rendered text (very long alt{ej2}). Review (1.4.5)."
98
+ },
69
99
  "images_of_text_rem": "Except for logotypes, present text as real text (1.4.5): it rescales, reflows and translates; an image does not.",
70
100
  "overlay_widgets_note": "A third-party accessibility overlay widget was detected (see overlay_widgets). Overlays do not make a site accessible — see the community Overlay Fact Sheet (overlayfactsheet.com). Reported as information for procurement diligence, not as a WCAG finding.",
71
- "img_no_alt": "{n} <img> without an alt attribute (not even alt=\"\").",
101
+ "img_no_alt": {
102
+ "one": "1 <img> without an alt attribute (not even alt=\"\").",
103
+ "other": "{n} <img> without an alt attribute (not even alt=\"\")."
104
+ },
72
105
  "img_no_alt_rem": "Add alt to every <img>: descriptive text when it conveys information, alt=\"\" when decorative. Same requirement for <input type=\"image\"> and <area>.",
73
- "input_img_alt": "<input type=\"image\"> without alt (image button with no name).",
106
+ "canvas_no_accessible_layer": {
107
+ "one": "1 <canvas> with no static accessible layer (no aria-label/labelledby/title/role and no fallback text).",
108
+ "other": "{n} <canvas> with no static accessible layer (no aria-label/labelledby/title/role and no fallback text inside)."
109
+ },
110
+ "canvas_no_accessible_layer_rem": "Give each canvas an accessible layer: aria-label or role=\"img\" with a name, plus fallback text inside the tag; for charts, the data as a table or summary is the strong fix. Static filter: if a chart library injects the layer at runtime, the rendered pass is the judge.",
111
+ "chart_no_data_equivalent": "{n} named chart/graphic exposes no machine-visible data equivalent (no resolvable aria-details/aria-describedby, no table nearby).",
112
+ "chart_no_data_equivalent_rem": "A chart that carries data needs it in text: link the data table or long description with aria-details or aria-describedby, or place a real table next to the graphic. REVIEW finding: if the data lives in surrounding prose this can pass — judge the zone.",
113
+ "input_img_alt": {
114
+ "one": "1 <input type=\"image\"> without an alt attribute.",
115
+ "other": "<input type=\"image\"> without alt (image button with no name)."
116
+ },
74
117
  "input_img_alt_rem": "Add descriptive alt to the input type=\"image\" (it is its accessible name), or replace it with a <button> with text or <input type=\"submit\" value=\"…\">.",
75
118
  "label_in_name": "{n} controls whose aria-label does not contain the visible text («{example}»): voice-input users say what they see (2.5.3).",
76
119
  "label_in_name_rem": "The accessible name must CONTAIN the visible label: \"Summer offers (opens in new window)\", not \"More info\". Use visible text + suffix.",
@@ -95,9 +138,15 @@
95
138
  "motion_actuation_rem": "What motion activates must also be activatable via UI (button) and disablable (2.5.4).",
96
139
  "motion_moving": "{n} moving/looping contents with no visible pause control: {example}. Review (2.2.2).",
97
140
  "motion_moving_rem": "Content moving/blinking >5s needs a pause/stop mechanism (2.2.2): <marquee> has none; looping animations do not either by default.",
98
- "multi_h1": "{n} <h1> on the page (recommended maximum: 1).",
141
+ "multi_h1": {
142
+ "one": "1 <h1> on the page is fine; more than one is not recommended.",
143
+ "other": "{n} <h1> on the page (recommended maximum: 1)."
144
+ },
99
145
  "multi_h1_rem": "Keep a single h1 (page title) and demote the rest one level.",
100
- "multi_label": "{n} fields with more than one associated <label for>.",
146
+ "multi_label": {
147
+ "one": "1 field with multiple associated labels; assistive tech may read them concatenated or fight.",
148
+ "other": "{n} fields with more than one associated <label for>."
149
+ },
101
150
  "multi_label_rem": "One field, one label: screen readers announce concatenated labels. Merge the text into one.",
102
151
  "nav_inconsistent": "Repeated navigation changes across site pages ({example}) (3.2.3).",
103
152
  "nav_inconsistent_rem": "Repeated navigation mechanisms must appear in the same relative order on every page (3.2.3): shared template.",
@@ -113,7 +162,10 @@
113
162
  "no_status_regions_rem": "Add role=\"status\" or aria-live=\"polite\" for toasts, save confirmations, search results (4.1.3).",
114
163
  "orientation_lock": "Orientation lock detected: {example}. Review (1.3.4).",
115
164
  "orientation_lock_rem": "Content must not be locked to one orientation unless the exception demonstrably applies (1.3.4): remove screen.orientation.lock() and orientation-forcing media queries.",
116
- "placeholder_only": "{n} fields using placeholder as their only label (no <label>): {example}. The placeholder vanishes on input (3.3.2).",
165
+ "placeholder_only": {
166
+ "one": "1 field using placeholder as its only label (no <label>): {example}. The placeholder disappears on input.",
167
+ "other": "{n} fields using placeholder as their only label (no <label>): {example}. The placeholder vanishes on input (3.3.2)."
168
+ },
117
169
  "placeholder_only_rem": "Placeholder is NOT a label: add a visible <label for=\"id\">. The placeholder disappears when typing starts and screen readers do not always announce it (3.3.2).",
118
170
  "reduced_motion_ignored": "{n} looping animations still run with prefers-reduced-motion set (before {n}, after {nr}): the user's preference is ignored (2.2.2).",
119
171
  "reduced_motion_ignored_rem": "Wrap animations in @media (prefers-reduced-motion: reduce) { animation: none } — or pause via the Animation API. The user asked for less motion; honor it.",
@@ -124,7 +176,7 @@
124
176
  "role_unknown": "{n} unknown ARIA roles: {example}. Screen readers ignore them.",
125
177
  "role_unknown_rem": "Use roles from the ARIA specification (button, dialog, navigation…) or drop the attribute and rely on semantic HTML.",
126
178
  "same_name_links": {
127
- "one": "1 pair of links with identical text pointing to different destinations.",
179
+ "one": "1 link name resolves to different destinations — check that context disambiguates it.",
128
180
  "other": "{n} pairs of links with identical text pointing to different destinations."
129
181
  },
130
182
  "same_name_links_rem": "Differentiate the names (or unify the destination): \"Reports\" ×3 with three different URLs is a problem for anyone navigating by link list.",
@@ -133,7 +185,10 @@
133
185
  "sensory_text_rem": "Do not instruct by position/shape/color alone (\"the button on the right\"): name things (1.3.3).",
134
186
  "tabindex_pos": "{n} elements with a positive tabindex (overrides natural order).",
135
187
  "tabindex_pos_rem": "Use tabindex=\"0\" or drop the attribute: tab order must follow the DOM.",
136
- "table_no_th": "{n} <table> with no <th> cells.",
188
+ "table_no_th": {
189
+ "one": "1 <table> with no <th> cells.",
190
+ "other": "{n} <table> with no <th> cells."
191
+ },
137
192
  "table_no_th_rem": "Mark row/column headers with <th> (plus scope) so the reader can associate cells.",
138
193
  "text_spacing_clip": "{n} texts clipped when the 1.4.12 spacing overrides apply (line-height 1.5, letter 0.12em): review.",
139
194
  "text_spacing_clip_rem": "Content must survive text-spacing overrides without clipping: replace fixed heights with min-height (1.4.12).",
@@ -141,15 +196,32 @@
141
196
  "title_generic_rem": "One unique title per page: content + site (“Contact — MaisMedia”), never “Untitled”, “Home” or “Document”.",
142
197
  "title_missing": "The page has no <title> with content.",
143
198
  "title_missing_rem": "Write a unique, descriptive <title> per page (screen reader's first announcement, tab text).",
144
- "video_autoplay": "{n} media elements with autoplay (audio >3s with no way to stop it).",
199
+ "video_autoplay": {
200
+ "one": "1 media element with autoplay (audio >3s with no way to stop it).",
201
+ "other": "{n} media elements with autoplay (audio >3s with no way to stop it)."
202
+ },
145
203
  "video_autoplay_rem": "Remove autoplay or add muted + a visible pause/stop control (1.4.2): audio that starts on its own disrupts screen-reader users.",
146
- "video_captions": "{n} <video> without <track kind=\"captions\">.",
204
+ "video_captions": {
205
+ "one": "1 <video> without <track kind=\"captions\">.",
206
+ "other": "{n} <video> without <track kind=\"captions\">."
207
+ },
147
208
  "video_captions_rem": "Publish captions for the video audio track (1.2.2). If decorative and silent, mark it as such.",
148
209
  "zoom_max": "The viewport limits zoom (maximum-scale={v}; recommend no limit or ≥2).",
149
210
  "zoom_max_rem": "Remove maximum-scale from the viewport, or set it to 2 or higher, so text can be enlarged (1.4.4).",
150
211
  "zoom_no": "The viewport blocks user zoom (user-scalable=no/0).",
151
212
  "zoom_no_rem": "Remove user-scalable=no and maximum-scale: zooming is the user's right (1.4.4).",
152
- "rendered_reason": "requires the rendered audit (a11y_audit_dom / a11ytoolkit dom): computed styles, cascade, var(), real layout"
213
+ "rendered_reason": "requires the rendered audit (a11y_audit_dom / a11ytoolkit dom): computed styles, cascade, var(), real layout",
214
+ "err_unparseable": "unparseable HTML: {e}",
215
+ "err_too_big": "HTML larger than {mb} MB",
216
+ "err_not_html": "the URL does not return HTML (Content-Type: {ct})",
217
+ "role_no_tabindex": {
218
+ "one": "1 element with an interactive role (button/link) and no tabindex: not reachable by keyboard (JS could add it at runtime — the rendered pass confirms).",
219
+ "other": "{n} elements with an interactive role (button/link) and no tabindex: not reachable by keyboard (JS could add it at runtime — the rendered pass confirms)."
220
+ },
221
+ "role_no_tabindex_rem": "Add tabindex=\"0\" to every element that receives role=\"button\"/\"link\", plus Enter/Space key handling — or use the native <button>/<a href> element.",
222
+ "err_redirect_blocked": "redirect to a disallowed destination (private network): {url}",
223
+ "alt_quality": "{n} images with low-quality alt text (filenames, generic words or placeholders).",
224
+ "alt_quality_rem": "Alt like \"image\", \"foto\", \"img_123.jpg\" or a dash says nothing to a screen-reader user. Replace it with what the image conveys in its context; if the image is decorative, use alt=\"\" so assistive tech skips it."
153
225
  },
154
226
  "badge": {
155
227
  "name": "a11y-toolkit",
@@ -272,6 +344,12 @@
272
344
  "A dialog traps the keyboard and Escape does not close it.",
273
345
  "Close the dialog on Escape and return focus to the trigger."
274
346
  ],
347
+ "journey_drag_only": [
348
+ "2.5.7",
349
+ "high",
350
+ "The only way to complete the step is a drag gesture — no single-pointer alternative exists.",
351
+ "Provide a non-drag alternative (button, slider with arrow keys) that performs the same action."
352
+ ],
275
353
  "journey_duplicate_targets": [
276
354
  "4.1.2",
277
355
  "medium",
@@ -284,6 +362,12 @@
284
362
  "The tree changed after the action (content replaced) with no announcement — the agent’s map went stale.",
285
363
  "Announce dynamic region updates (role=status/aria-live) and keep focus stable."
286
364
  ],
365
+ "journey_error_no_suggestion": [
366
+ "3.3.3",
367
+ "medium",
368
+ "An error stopped the step but offers no fix the user can act on.",
369
+ "Add corrective text: what went wrong and the exact way to fix it."
370
+ ],
287
371
  "journey_error_silent": [
288
372
  "3.3.1",
289
373
  "high",
@@ -296,6 +380,12 @@
296
380
  "After an action, focus disappeared or jumped somewhere unexpected.",
297
381
  "Move focus programmatically to the logical destination after inserting or replacing content."
298
382
  ],
383
+ "journey_focus_not_visible": [
384
+ "2.4.7",
385
+ "high",
386
+ "The keyboard focus indicator is invisible or too faint to follow at a journey step.",
387
+ "Give the focused element a visible indicator (outline/ring) with 3:1 contrast against adjacent colors."
388
+ ],
299
389
  "journey_generic_link": [
300
390
  "2.4.4",
301
391
  "low",
@@ -314,6 +404,12 @@
314
404
  "Information essential to the task is missing from the accessibility tree.",
315
405
  "Express the relationship with real semantics (list, heading, table), not layout."
316
406
  ],
407
+ "journey_hover_only": [
408
+ "1.4.13",
409
+ "medium",
410
+ "Information needed to proceed appears only on hover and cannot be dismissed or reached by keyboard.",
411
+ "Make the content dismissible (Escape), hoverable and persistent — or expose it without hover."
412
+ ],
317
413
  "journey_landmark_missing": [
318
414
  "2.4.1",
319
415
  "medium",
@@ -338,6 +434,12 @@
338
434
  "A control needed for the task is not reachable or operable by keyboard.",
339
435
  "Make it focusable and keyboard-operable; pointer-only is never enough."
340
436
  ],
437
+ "journey_reflow_breaks": [
438
+ "1.4.10",
439
+ "medium",
440
+ "At 320px the step loses content or requires two-dimensional scrolling.",
441
+ "Use responsive layout so content reflows without horizontal scroll at 320px."
442
+ ],
341
443
  "journey_status_silent": [
342
444
  "4.1.3",
343
445
  "medium",
@@ -355,8 +457,38 @@
355
457
  "high",
356
458
  "A control needed for the task is announced without a name (\"button\", bare).",
357
459
  "Give the control an accessible name: visible text, aria-label or aria-labelledby."
460
+ ],
461
+ "journey_zoom_blocked": [
462
+ "1.4.4",
463
+ "high",
464
+ "The page blocks browser zoom, so the step cannot be magnified.",
465
+ "Remove zoom-blocking viewport directives; text must resize to 200% without loss of content."
358
466
  ]
359
467
  },
468
+ "patterns": {
469
+ "pattern_dialog_esc_no_close": "An open dialog does not close with Escape.",
470
+ "pattern_dialog_esc_no_close_rem": "Close the dialog on Escape (keydown handler or native <dialog>), then return focus to the trigger.",
471
+ "pattern_modal_focus_escapes": "Focus escaped a modal dialog (aria-modal=true) while tabbing.",
472
+ "pattern_modal_focus_escapes_rem": "Trap focus inside the modal (cycle the tab order or make background content inert) and return focus to the trigger on close.",
473
+ "pattern_tabs_arrows_dead": "A tablist with {n} tabs ignores ArrowRight: focus does not move between tabs (roving tabindex missing).",
474
+ "pattern_tabs_arrows_dead_rem": "Move focus across tabs with Left/Right arrows (roving tabindex); selection by focus or by Enter/Space (manual).",
475
+ "pattern_tabs_no_activation": "A tab received focus via arrows but never becomes selected (aria-selected never turns true).",
476
+ "pattern_tabs_no_activation_rem": "Make selection follow focus (automatic activation) or activate on Enter/Space (manual) — aria-selected must reflect the visible panel.",
477
+ "pattern_disclosure_state_frozen": "Activating “{name}” never flips aria-expanded: the exposed state contradicts the visual.",
478
+ "pattern_disclosure_state_frozen_rem": "Toggle aria-expanded (true/false) on every activation and point aria-controls at the region it reveals.",
479
+ "pattern_combobox_no_open": "A combobox never opens its popup with ArrowDown (no aria-expanded, no visible listbox).",
480
+ "pattern_combobox_no_open_rem": "Open the listbox on ArrowDown / Alt+ArrowDown and flip aria-expanded=true; keep focus on the input while filtering.",
481
+ "pattern_combobox_esc_no_close": "A combobox popup stays open after Escape.",
482
+ "pattern_combobox_esc_no_close_rem": "Close the popup on Escape, restore aria-expanded=false and return focus to the input.",
483
+ "pattern_menu_no_open": "A menu button never opens its menu on activation (no visible menu, no aria-expanded).",
484
+ "pattern_menu_no_open_rem": "Open the menu on click/Enter/Space, set aria-expanded=true and move focus to its first item.",
485
+ "pattern_menu_esc_no_close": "A menu stays open after Escape.",
486
+ "pattern_menu_esc_no_close_rem": "Close the menu on Escape, restore aria-expanded=false and return focus to the button.",
487
+ "pattern_slider_arrows_dead": "A slider ignores the arrow keys: aria-valuenow never changes.",
488
+ "pattern_slider_arrows_dead_rem": "Change the value with ArrowRight/Up and ArrowLeft/Down (Home/End for the limits) and keep aria-valuenow in sync.",
489
+ "pattern_slider_no_state": "A slider is missing its value trio (aria-valuenow / valuemin / valuemax).",
490
+ "pattern_slider_no_state_rem": "Expose aria-valuenow, aria-valuemin and aria-valuemax (plus aria-valuetext when the unit is not obvious)."
491
+ },
360
492
  "pdf": {
361
493
  "limits": "Zero-dep structural screening: full PDF/UA conformance needs a spec validator (veraPDF). This screening finds what makes full validation pointless.",
362
494
  "pdf_button_no_name": "{n} buttons without accessible name (/TU): a screen-reader user reaches them as just \"button\".",
@@ -562,5 +694,30 @@
562
694
  "note": "Applies to relay services and emergency-communication ICT."
563
695
  }
564
696
  }
697
+ },
698
+ "wiz": {
699
+ "wiz_q_target": "What are you building?\n 1 = web site/app\n 2 = documents (PDF/Office)\n 3 = non-web software\n 4 = several of those\nAnswer (1-4): ",
700
+ "wiz_q_multi": "Which ones? comma-separated (web,documents,software): ",
701
+ "wiz_q_std": "Which standard applies to your market or contract?\n 1 = WCAG 2.2 (global)\n 2 = EN 301 549 (EU / EAA / Ley 11/2023)\n 3 = RGAA 4.1 (France)",
702
+ "wiz_done": "Done. Scope: {scope}\nScore: {score} · in scope: {ins} · proposed out: {pro}\n(the tender annex and the 508 tree live in the private pro layer)",
703
+ "wiz_abort": "No input received — aborted. Everything the wizard does is also available as: a11ytoolkit scope --standard … / audit --standard … (a11ytoolkit scope --help)",
704
+ "wiz_need_url": "A URL (or HTML via --file) is needed to run the audit."
705
+ },
706
+ "locate": {
707
+ "loc_no_query": "Empty query: nothing to locate.",
708
+ "loc_no_match": "No named element matches \"{q}\". Only elements with an accessible name are indexed (controls, headings, images with alt, iframes with title, fields with an explicit name) — a match is never invented.",
709
+ "loc_ambiguous": "{n} elements share the name \"{q}\" — refusing to pick one. Inspect matches[] or pass multiple=true.",
710
+ "loc_multiple": "Several exact matches — all listed in matches[] (multiple=true).",
711
+ "loc_partial": "No exact accessible name \"{q}\"; the best partial match is returned — review it before acting.",
712
+ "loc_partial_ambiguous": "{n} partial matches, none exact for \"{q}\" — inspect matches[]."
713
+ },
714
+ "patches": {
715
+ "pat_bad_format": "Not an a11y-patches/1 artifact: verify refuses to judge it.",
716
+ "pat_stale": "This page is not the one the patch-set was built from (SHA-256 mismatch): the set invalidates itself and nothing is applied.",
717
+ "pat_mismatch": "The same page no longer produces the same fixes (engine drift or a tampered set): nothing is applied; compare reproduced[] and recorded[].",
718
+ "pat_reproduced": "Every recorded fix reproduced exactly on this page: the fixed html is returned for review."
719
+ },
720
+ "journeyrec": {
721
+ "bad_format": "Not an a11y-journey/1 record: verification refuses to judge it."
565
722
  }
566
723
  }