@kinti/a11y-toolkit 5.30.0 → 5.32.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.
- package/a11y_toolkit/a11yannotate.py +39 -42
- package/a11y_toolkit/a11yaudit.py +277 -163
- package/a11y_toolkit/a11ycorpus.py +7 -1
- package/a11y_toolkit/a11ycrit.py +6 -0
- package/a11y_toolkit/a11ydom.py +85 -19
- package/a11y_toolkit/a11ylocate.py +4 -4
- package/a11y_toolkit/a11ypatterns.py +8 -2
- package/a11y_toolkit/a11ypdf.py +41 -5
- package/a11y_toolkit/a11ytrace.py +173 -24
- package/a11y_toolkit/locales/en.json +12 -0
- package/a11y_toolkit/locales/es.json +12 -0
- package/a11y_toolkit/server.py +5 -1
- package/package.json +1 -1
|
@@ -20,7 +20,7 @@ must not mutate the page it measures.
|
|
|
20
20
|
CLI (infrastructure, not a tool — D17, like corpus/mutants/engines):
|
|
21
21
|
a11ytrace.py https://web [--steps 25] [-o trace.json] # needs Playwright
|
|
22
22
|
a11ytrace.py https://web --script journey.json -o t.json # scripted real journey
|
|
23
|
-
a11ytrace.py diff before.json after.json # exit 0 ok / 2
|
|
23
|
+
a11ytrace.py diff before.json after.json # exit 0 ok / 1 invalid / 2 regression
|
|
24
24
|
|
|
25
25
|
Script file: a JSON list of actions — {"kind":"click","selector":"#pay"},
|
|
26
26
|
{"kind":"fill","selector":"#email","value":"…"}, {"kind":"select",…},
|
|
@@ -82,6 +82,33 @@ _COLLECTOR = r'''() => {
|
|
|
82
82
|
# aún no existe — el paso se graba, simplemente sin anuncios de ese instante.
|
|
83
83
|
_DRAIN = '() => window.__a11yTraceDrain ? window.__a11yTraceDrain() : []'
|
|
84
84
|
|
|
85
|
+
# (issue #16) estado de diálogo TRAS cada acción — mínimo y no sensible: el
|
|
86
|
+
# CONTEO de modales abiertos (role=dialog/alertdialog con aria-modal, o
|
|
87
|
+
# dialog[open]) y si el foco está dentro de uno. Nada de contenido, ids ni
|
|
88
|
+
# texto: dos builds con el mismo viaje deben poder comparar este estado sin
|
|
89
|
+
# que nada de la página viaje al JSON
|
|
90
|
+
_DIALOG_STATE_JS = '''() => {
|
|
91
|
+
const modals = [...document.querySelectorAll(
|
|
92
|
+
'[role="dialog"][aria-modal="true"], [role="alertdialog"][aria-modal="true"], dialog[open]')]
|
|
93
|
+
.filter(el => el.getClientRects().length > 0); // display:none (hidden) no cuenta,
|
|
94
|
+
// aunque el CSS fije position (getClientRects mide lo real)
|
|
95
|
+
const a = document.activeElement;
|
|
96
|
+
return {open: modals.length, focus_inside: modals.some(m => m === a || m.contains(a))};
|
|
97
|
+
}'''
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
class _TraceHttpError(Exception):
|
|
101
|
+
def __init__(self, status, url):
|
|
102
|
+
super().__init__(f'HTTP {status}: could not capture the requested page')
|
|
103
|
+
self.status = status
|
|
104
|
+
self.url = url
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
def _goto(page, url, timeout):
|
|
108
|
+
response = page.goto(url, wait_until='load', timeout=timeout)
|
|
109
|
+
if response is not None and response.status >= 400:
|
|
110
|
+
raise _TraceHttpError(response.status, page.url)
|
|
111
|
+
|
|
85
112
|
|
|
86
113
|
def _run_script_action(page, act):
|
|
87
114
|
"""One scripted action → (label, ok). Selector-valued actions target CSS."""
|
|
@@ -104,7 +131,7 @@ def _run_script_action(page, act):
|
|
|
104
131
|
page.wait_for_timeout(int(act.get('ms', 300)))
|
|
105
132
|
return f'wait:{act.get("ms", 300)}', True
|
|
106
133
|
if kind == 'goto':
|
|
107
|
-
page
|
|
134
|
+
_goto(page, act.get('url', ''), timeout=30000)
|
|
108
135
|
# la navegación destruye el recolector (contexto nuevo): re-inyectarlo
|
|
109
136
|
# o el drain de ESTE paso y de los siguientes tronaría/volvería vacío
|
|
110
137
|
page.evaluate(_COLLECTOR)
|
|
@@ -112,7 +139,7 @@ def _run_script_action(page, act):
|
|
|
112
139
|
return f'unknown:{kind or sel}', False
|
|
113
140
|
|
|
114
141
|
|
|
115
|
-
def _run_script(page, script):
|
|
142
|
+
def _run_script(page, script, dialog_state=False):
|
|
116
143
|
"""Scripted actions → (walk, navigations). Factored out of trace() so the
|
|
117
144
|
loop is testable against a fake page (no Playwright needed)."""
|
|
118
145
|
walk = []
|
|
@@ -123,6 +150,8 @@ def _run_script(page, script):
|
|
|
123
150
|
continue
|
|
124
151
|
try:
|
|
125
152
|
label, _ok = _run_script_action(page, act)
|
|
153
|
+
except _TraceHttpError:
|
|
154
|
+
raise
|
|
126
155
|
except Exception as e: # noqa: BLE001 — a failed action is a recorded step too
|
|
127
156
|
label = f'{act.get("kind", "?")}:{act.get("selector") or act.get("key") or ""}'
|
|
128
157
|
label += f' (failed: {str(e)[:60]})'
|
|
@@ -132,25 +161,40 @@ def _run_script(page, script):
|
|
|
132
161
|
if page.url != url_now:
|
|
133
162
|
navigations += 1
|
|
134
163
|
url_now = page.url
|
|
135
|
-
|
|
136
|
-
|
|
164
|
+
step = {'step': i + 1, 'action': label, 'focus': info,
|
|
165
|
+
'announcements': anns, 'url': page.url}
|
|
166
|
+
if dialog_state:
|
|
167
|
+
try:
|
|
168
|
+
step['dialog'] = page.evaluate(_DIALOG_STATE_JS)
|
|
169
|
+
except Exception: # noqa: BLE001 — contexto destruido: sin dato
|
|
170
|
+
step['dialog'] = None
|
|
171
|
+
walk.append(step)
|
|
137
172
|
return walk, navigations
|
|
138
173
|
|
|
139
174
|
|
|
140
|
-
def trace(url, steps=25, output=None, auth_state=None, timeout=45, script=None, browser='auto'
|
|
175
|
+
def trace(url, steps=25, output=None, auth_state=None, timeout=45, script=None, browser='auto',
|
|
176
|
+
capture_dialog_state=False):
|
|
141
177
|
"""One url → the behavioral trace (replayable JSON).
|
|
142
178
|
|
|
143
179
|
script: optional list of scripted actions (click/fill/select/press/wait/
|
|
144
180
|
goto, each with a CSS selector where applicable) — a REAL journey instead
|
|
145
181
|
of the keyboard walk. Each action becomes a recorded step; the announcement
|
|
146
182
|
collector and the focus signature stay identical, so trace diff works the
|
|
147
|
-
same over scripted traces.
|
|
183
|
+
same over scripted traces.
|
|
184
|
+
|
|
185
|
+
capture_dialog_state (issue #16): graba tras cada paso el estado mínimo
|
|
186
|
+
de diálogo (cuántos modales abiertos + foco dentro de uno) — nada de
|
|
187
|
+
contenido. Para trace diff --gate-dialog-state: un Escape que devuelve
|
|
188
|
+
el foco al opener pero DEJA el modal abierto es una divergencia de
|
|
189
|
+
estado que el foco solo no ve."""
|
|
148
190
|
from .a11ydom import _get_browser, _pooled_page
|
|
149
191
|
nav = _get_browser(preferred=browser)
|
|
150
192
|
page, close_page = _pooled_page(nav, auth_state)
|
|
151
193
|
try:
|
|
152
194
|
try:
|
|
153
|
-
page
|
|
195
|
+
_goto(page, url, timeout=timeout * 1000)
|
|
196
|
+
except _TraceHttpError:
|
|
197
|
+
raise
|
|
154
198
|
except Exception as e: # noqa: BLE001
|
|
155
199
|
return {'error': f'could not load: {e}'}
|
|
156
200
|
page.wait_for_timeout(400)
|
|
@@ -161,7 +205,7 @@ def trace(url, steps=25, output=None, auth_state=None, timeout=45, script=None,
|
|
|
161
205
|
url_now = page.url
|
|
162
206
|
if script:
|
|
163
207
|
ended_by = 'script_done'
|
|
164
|
-
walk, navigations = _run_script(page, script)
|
|
208
|
+
walk, navigations = _run_script(page, script, dialog_state=capture_dialog_state)
|
|
165
209
|
else:
|
|
166
210
|
ended_by = 'step_cap'
|
|
167
211
|
for i in range(steps):
|
|
@@ -175,8 +219,14 @@ def trace(url, steps=25, output=None, auth_state=None, timeout=45, script=None,
|
|
|
175
219
|
if page.url != url_now:
|
|
176
220
|
navigations += 1
|
|
177
221
|
url_now = page.url
|
|
178
|
-
|
|
179
|
-
|
|
222
|
+
step = {'step': i + 1, 'focus': info,
|
|
223
|
+
'announcements': anns, 'url': page.url}
|
|
224
|
+
if capture_dialog_state:
|
|
225
|
+
try:
|
|
226
|
+
step['dialog'] = page.evaluate(_DIALOG_STATE_JS)
|
|
227
|
+
except Exception: # noqa: BLE001
|
|
228
|
+
step['dialog'] = None
|
|
229
|
+
walk.append(step)
|
|
180
230
|
|
|
181
231
|
tree = None
|
|
182
232
|
try:
|
|
@@ -185,11 +235,14 @@ def trace(url, steps=25, output=None, auth_state=None, timeout=45, script=None,
|
|
|
185
235
|
tree = tree[:60_000] + '\n… (truncated)'
|
|
186
236
|
except Exception: # noqa: BLE001
|
|
187
237
|
tree = None
|
|
238
|
+
except _TraceHttpError as e:
|
|
239
|
+
return {'error': str(e), 'url': e.url, 'http_status': e.status}
|
|
188
240
|
finally:
|
|
189
241
|
close_page()
|
|
190
242
|
|
|
191
243
|
data = {'mode': 'trace', 'url': url,
|
|
192
244
|
'ts': datetime.now(timezone.utc).isoformat(),
|
|
245
|
+
**({'dialog_state_captured': True} if capture_dialog_state else {}),
|
|
193
246
|
'steps': walk,
|
|
194
247
|
'summary': {'steps_taken': len(walk),
|
|
195
248
|
'announcements': sum(len(s.get('announcements') or [])
|
|
@@ -204,10 +257,84 @@ def trace(url, steps=25, output=None, auth_state=None, timeout=45, script=None,
|
|
|
204
257
|
return data
|
|
205
258
|
|
|
206
259
|
|
|
207
|
-
def
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
260
|
+
def _has_dialog_state(state):
|
|
261
|
+
return (isinstance(state, dict)
|
|
262
|
+
and type(state.get('open')) is int and state['open'] >= 0
|
|
263
|
+
and isinstance(state.get('focus_inside'), bool))
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
def _dialog_gate(a, b):
|
|
267
|
+
"""(issue #16) comparación OPT-IN del estado de diálogo por paso.
|
|
268
|
+
|
|
269
|
+
Devuelve {'status': 'off'|'inconclusive'|'pass'|'regression', ...}:
|
|
270
|
+
- off: no se pidió el gate
|
|
271
|
+
- inconclusive: falta estado (alguna traza sin dialog_state_captured,
|
|
272
|
+
un paso sin 'dialog') o las SECUENCIAS DE ACCIÓN divergen (el estado
|
|
273
|
+
solo es comparable paso a paso cuando el viaje es el mismo) — JAMÁS
|
|
274
|
+
un falso PASS
|
|
275
|
+
- regression: mismas acciones y foco, pero el estado de diálogo difiere
|
|
276
|
+
en algún paso (p. ej. el Escape dejó el modal abierto en el candidato)
|
|
277
|
+
- pass: estado idéntico en todos los pasos
|
|
278
|
+
"""
|
|
279
|
+
sa = a.get('steps', [])
|
|
280
|
+
sb = b.get('steps', [])
|
|
281
|
+
if not (a.get('dialog_state_captured') and b.get('dialog_state_captured')):
|
|
282
|
+
return {'status': 'inconclusive',
|
|
283
|
+
'reason': 'dialog state not captured in both traces — re-run '
|
|
284
|
+
'trace --capture-dialog-state'}
|
|
285
|
+
acts_a = [s.get('action') for s in sa]
|
|
286
|
+
acts_b = [s.get('action') for s in sb]
|
|
287
|
+
if acts_a != acts_b or len(sa) != len(sb):
|
|
288
|
+
return {'status': 'inconclusive',
|
|
289
|
+
'reason': 'action sequences diverge — dialog state is only '
|
|
290
|
+
'comparable step-by-step on the same journey'}
|
|
291
|
+
if not sa:
|
|
292
|
+
return {'status': 'inconclusive', 'reason': 'no steps with dialog evidence'}
|
|
293
|
+
state_divergences = []
|
|
294
|
+
for i, (x, y) in enumerate(zip(sa, sb)):
|
|
295
|
+
if not (_has_dialog_state(x.get('dialog')) and _has_dialog_state(y.get('dialog'))):
|
|
296
|
+
return {'status': 'inconclusive',
|
|
297
|
+
'reason': f'step {i + 1} lacks dialog state (destroyed '
|
|
298
|
+
'context?) — evidence missing'}
|
|
299
|
+
if x['dialog'] != y['dialog']:
|
|
300
|
+
state_divergences.append({'step': i + 1, 'before': x['dialog'],
|
|
301
|
+
'after': y['dialog']})
|
|
302
|
+
if state_divergences:
|
|
303
|
+
return {'status': 'regression', 'divergences': state_divergences}
|
|
304
|
+
return {'status': 'pass', 'steps_compared': len(sa)}
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
def _trace_error(trace):
|
|
308
|
+
if not isinstance(trace, dict):
|
|
309
|
+
return 'expected a trace object'
|
|
310
|
+
if 'error' in trace or (
|
|
311
|
+
type(trace.get('http_status')) is int and trace['http_status'] >= 400):
|
|
312
|
+
return 'capture failed'
|
|
313
|
+
if not isinstance(trace.get('steps'), list):
|
|
314
|
+
return 'expected a steps list'
|
|
315
|
+
for index, step in enumerate(trace['steps'], 1):
|
|
316
|
+
if (not isinstance(step, dict) or 'focus' not in step
|
|
317
|
+
or (step['focus'] is not None and not isinstance(step['focus'], str))
|
|
318
|
+
or (step.get('announcements') is not None
|
|
319
|
+
and not isinstance(step['announcements'], list))):
|
|
320
|
+
return f'invalid step {index}'
|
|
321
|
+
return None
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
def trace_diff(a, b, gate_dialog_state=False):
|
|
325
|
+
"""Two traces → verdict. Focus behavior gates; announcements inform.
|
|
326
|
+
|
|
327
|
+
gate_dialog_state (issue #16): OPT-IN — compara también el estado de
|
|
328
|
+
diálogo capturado (trace --capture-dialog-state). Sin foco perdido ni
|
|
329
|
+
reordenado pero con el modal ABIERTO donde antes cerraba: regresión.
|
|
330
|
+
Evidencia faltante o acciones distintas → INCONCLUSIVE, nunca un falso
|
|
331
|
+
PASS. El foco sigue siendo el único gate por defecto."""
|
|
332
|
+
for label, capture in (('reference', a), ('candidate', b)):
|
|
333
|
+
error = _trace_error(capture)
|
|
334
|
+
if error:
|
|
335
|
+
return {'ok': False, 'error': f'{label} trace: {error}'}
|
|
336
|
+
fa = [s['focus'] for s in a['steps']]
|
|
337
|
+
fb = [s['focus'] for s in b['steps']]
|
|
211
338
|
set_a, set_b = set(fa), set(fb)
|
|
212
339
|
common_a = [x for x in fa if x in set_b]
|
|
213
340
|
common_b = [x for x in fb if x in set_a]
|
|
@@ -216,24 +343,33 @@ def trace_diff(a, b):
|
|
|
216
343
|
reordered = common_a != common_b
|
|
217
344
|
first_divergence = next((i for i, (x, y) in enumerate(zip(common_a, common_b))
|
|
218
345
|
if x != y), None)
|
|
219
|
-
ann_a = sum(len(s.get('announcements'
|
|
220
|
-
ann_b = sum(len(s.get('announcements'
|
|
346
|
+
ann_a = sum(len(s.get('announcements') or []) for s in a['steps'])
|
|
347
|
+
ann_b = sum(len(s.get('announcements') or []) for s in b['steps'])
|
|
221
348
|
collapsed = ann_a > 0 and ann_b == 0
|
|
349
|
+
gate = _dialog_gate(a, b) if gate_dialog_state else {'status': 'off'}
|
|
222
350
|
ok = not (lost or reordered)
|
|
351
|
+
if gate['status'] == 'regression':
|
|
352
|
+
ok = False # el estado diverge con las mismas acciones: bloquea
|
|
223
353
|
return {
|
|
224
354
|
'ok': ok,
|
|
225
355
|
'summary': {'steps': {'before': len(fa), 'after': len(fb)},
|
|
226
356
|
'focus_lost': len(lost), 'focus_gained': len(gained),
|
|
227
357
|
'reordered': reordered,
|
|
358
|
+
'dialog_gate': gate['status'],
|
|
228
359
|
'announcements': {'before': ann_a, 'after': ann_b,
|
|
229
360
|
'collapsed': collapsed}},
|
|
230
361
|
'focus': {'before': fa, 'after': fb, 'lost': lost, 'gained': gained,
|
|
231
362
|
'first_divergence': first_divergence},
|
|
363
|
+
**({'dialog_gate': gate} if gate_dialog_state else {}),
|
|
232
364
|
'note': ('focus behavior is the gate: a lost or forked tab sequence '
|
|
233
365
|
'blocks (exit 2). Announcement counts are reported, not '
|
|
234
366
|
'gated — content changes legitimately between builds; a '
|
|
235
367
|
'collapsed layer (had announcements, now zero) is flagged '
|
|
236
|
-
'informationally'
|
|
368
|
+
'informationally'
|
|
369
|
+
+ (' — dialog gate ON (opt-in): same actions + same focus '
|
|
370
|
+
'but diverging modal state blocks; missing evidence or '
|
|
371
|
+
'diverging actions read INCONCLUSIVE, never a pass'
|
|
372
|
+
if gate_dialog_state else '')),
|
|
237
373
|
}
|
|
238
374
|
|
|
239
375
|
|
|
@@ -250,10 +386,16 @@ def main(argv):
|
|
|
250
386
|
s1.add_argument('--script', help='JSON file: scripted journey (click/fill/select/press/wait/goto)')
|
|
251
387
|
s1.add_argument('--auth-state', help='Playwright storage_state JSON (session)')
|
|
252
388
|
s1.add_argument('--timeout', type=int, default=45)
|
|
389
|
+
s1.add_argument('--capture-dialog-state', action='store_true',
|
|
390
|
+
help='record minimal dialog state per step (open modal '
|
|
391
|
+
'count + focus inside) for diff --gate-dialog-state')
|
|
253
392
|
s1.add_argument('-o', '--out', default='trace.json')
|
|
254
393
|
s2 = sub.add_parser('diff')
|
|
255
394
|
s2.add_argument('a')
|
|
256
395
|
s2.add_argument('b')
|
|
396
|
+
s2.add_argument('--gate-dialog-state', action='store_true',
|
|
397
|
+
help='opt-in: compare captured dialog state (focus stays '
|
|
398
|
+
'the only default gate; missing evidence = INCONCLUSIVE)')
|
|
257
399
|
a = p.parse_args(argv)
|
|
258
400
|
|
|
259
401
|
if a.cmd == 'trace':
|
|
@@ -267,7 +409,8 @@ def main(argv):
|
|
|
267
409
|
return 1
|
|
268
410
|
try:
|
|
269
411
|
d = trace(a.url, steps=a.steps, output=a.out, auth_state=a.auth_state,
|
|
270
|
-
timeout=a.timeout, script=script
|
|
412
|
+
timeout=a.timeout, script=script,
|
|
413
|
+
capture_dialog_state=a.capture_dialog_state)
|
|
271
414
|
except ImportError:
|
|
272
415
|
print(json.dumps({'error': 'Playwright not installed: pip install '
|
|
273
416
|
'playwright && playwright install chromium'}))
|
|
@@ -278,12 +421,18 @@ def main(argv):
|
|
|
278
421
|
print(json.dumps({'url': d['url'], 'summary': d['summary'],
|
|
279
422
|
'out': a.out}, ensure_ascii=False, indent=1))
|
|
280
423
|
return 0
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
424
|
+
try:
|
|
425
|
+
with open(a.a, encoding='utf-8') as f:
|
|
426
|
+
ja = json.load(f)
|
|
427
|
+
with open(a.b, encoding='utf-8') as f:
|
|
428
|
+
jb = json.load(f)
|
|
429
|
+
except (OSError, ValueError) as e:
|
|
430
|
+
print(json.dumps({'ok': False, 'error': f'could not read trace: {e}'}))
|
|
431
|
+
return 1
|
|
432
|
+
verdict = trace_diff(ja, jb, gate_dialog_state=a.gate_dialog_state)
|
|
286
433
|
print(json.dumps(verdict, ensure_ascii=False, indent=1))
|
|
434
|
+
if 'error' in verdict:
|
|
435
|
+
return 1
|
|
287
436
|
return 0 if verdict['ok'] else 2
|
|
288
437
|
|
|
289
438
|
|
|
@@ -31,6 +31,18 @@
|
|
|
31
31
|
"heading_role_removed_rem": "The correct pattern for an interactive heading is the control INSIDE: <h2><button>…</button></h2> keeps both heading and button; on the element itself, only use role=heading if that is its real function.",
|
|
32
32
|
"text_spacing_important": "{n} inline styles with letter/line/word-spacing set to !important: {example}. The user cannot re-space the text with their own stylesheet (1.4.12, ACT rules 24afc2/78fd32/9e45ec).",
|
|
33
33
|
"text_spacing_important_rem": "Drop the !important from inline spacing (normal specificity is enough): 1.4.12 requires users be able to raise line height to 1.5x and letter/word spacing without losing content.",
|
|
34
|
+
"a_no_href": "{n} <a> links without href acting as controls: {example}. Without href it is not a link: screen readers will not announce it as one even though it takes focus and clicks (2.1.1).",
|
|
35
|
+
"a_no_href_rem": "If it opens or navigates, give it the correct href (or make it a <button>); if it is only a target anchor, drop the tabindex and click handler.",
|
|
36
|
+
"nested_main": "{n} mains nested inside sectioning elements: {example}. main is top-level: inside section/aside/nav/article it stops being a valid landmark (1.3.1).",
|
|
37
|
+
"nested_main_rem": "Move main to the root of body (one per page); inside sections use headings, not another main.",
|
|
38
|
+
"fake_list": "{n} fake lists built with typographic bullets and <br> breaks: {example}. Screen readers do not announce them as lists nor count their items (1.3.1).",
|
|
39
|
+
"fake_list_rem": "Turn them into real <ul><li> lists: navigable structure and item counts come for free.",
|
|
40
|
+
"alert_polite": "{n} role=alert with aria-live=polite: {example}. The alert role is ALREADY assertive; polite contradicts it and the announcement is left undefined (4.1.2).",
|
|
41
|
+
"alert_polite_rem": "Leave the role alone (role=alert is assertive) or use role=status for a gentler notice; never mix the two scales.",
|
|
42
|
+
"lang_xml_mismatch": "{n} elements whose lang and xml:lang disagree: {example}. The screen reader cannot tell which language to apply (3.1.2, ACT 5b7ae0).",
|
|
43
|
+
"lang_xml_mismatch_rem": "Make lang and xml:lang identical on the element (same subtag, any casing).",
|
|
44
|
+
"headers_attr_bad": "{n} headers= attributes pointing outside their table or to non-header cells: {example}. The cell-header relationship breaks (1.3.1, ACT d0f69e/a25f45).",
|
|
45
|
+
"headers_attr_bad_rem": "Every headers= id must exist, be a th (or a cell with columnheader/rowheader role) and live in THE SAME table; for simple tables scope is enough.",
|
|
34
46
|
"autocomplete_rem": "Add autocomplete with the right token (email, tel, name, postal-code…, 1.3.5): free accessibility and autofill at zero cost.",
|
|
35
47
|
"blank_no_warning": "{n} links with target=\"_blank\" that do not warn they open a new window.",
|
|
36
48
|
"blank_no_warning_rem": "Add a text hint (or title/aria-label): \"(opens in a new window)\", or let the user decide.",
|
|
@@ -31,6 +31,18 @@
|
|
|
31
31
|
"heading_role_removed_rem": "El patrón correcto para un encabezado interactivo es el control DENTRO: <h2><button>…</button></h2> conserva encabezado y botón; sobre el elemento, usa role=heading solo si es su función real.",
|
|
32
32
|
"text_spacing_important": "{n} estilos inline con letter/line/word-spacing en !important: {example}. El usuario no puede re-espaciar el texto con su hoja de estilos (1.4.12, reglas ACT 24afc2/78fd32/9e45ec).",
|
|
33
33
|
"text_spacing_important_rem": "Quita el !important de los spacing inline (la especificidad normal basta): 1.4.12 exige que el usuario pueda aumentar el interlineado a 1,5 veces y los espaciados sin perder contenido.",
|
|
34
|
+
"a_no_href": "{n} enlaces <a> sin href con vida de control: {example}. Sin href no es enlace: el lector no lo anuncia como tal aunque reciba foco y click (2.1.1).",
|
|
35
|
+
"a_no_href_rem": "Si abre o navega, dale el href correcto (o conviértelo en <button>); si es solo un ancla de destino, quítale tabindex y el click handler.",
|
|
36
|
+
"nested_main": "{n} main anidados dentro de seccionantes: {example}. El main es top-level: dentro de section/aside/nav/article deja de ser landmark válido (1.3.1).",
|
|
37
|
+
"nested_main_rem": "Saca el main a la raíz del body (uno solo por página); dentro de secciones usan encabezados, no otro main.",
|
|
38
|
+
"fake_list": "{n} listas falsas con viñetas tipográficas y saltos <br>: {example}. El lector no las anuncia como lista ni cuenta sus elementos (1.3.1).",
|
|
39
|
+
"fake_list_rem": "Conviértelas en <ul><li> reales: la estructura navegable y el conteo de elementos llegan gratis.",
|
|
40
|
+
"alert_polite": "{n} role=alert con aria-live=polite: {example}. El rol alert YA es asertivo; polite lo contradice y el anuncio queda indefinido (4.1.2).",
|
|
41
|
+
"alert_polite_rem": "Deja el rol solo (role=alert es asertivo) o usa role=status si querías un aviso amable; nunca mezcles las dos escalas.",
|
|
42
|
+
"lang_xml_mismatch": "{n} elementos con lang y xml:lang discrepando: {example}. El lector no sabe qué lengua aplicar (3.1.2, ACT 5b7ae0).",
|
|
43
|
+
"lang_xml_mismatch_rem": "Iguala lang y xml:lang en el mismo elemento (mismo subtag, da igual la caja).",
|
|
44
|
+
"headers_attr_bad": "{n} atributos headers= apuntando fuera de tabla o a celdas que no son cabecera: {example}. La relación celda-cabecera se rompe (1.3.1, ACT d0f69e/a25f45).",
|
|
45
|
+
"headers_attr_bad_rem": "Cada id de headers= debe existir, ser un th (o celda con rol columnheader/rowheader) y estar EN LA MISMA tabla; si la tabla es simple, scope basta.",
|
|
34
46
|
"autocomplete_rem": "Añade autocomplete con el token correcto (email, tel, name, postal-code…, 1.3.5): relleno automático y voz de accesibilidad con sobrecoste cero.",
|
|
35
47
|
"blank_no_warning": "{n} enlaces con target=\"_blank\" sin avisar de que abren ventana nueva.",
|
|
36
48
|
"blank_no_warning_rem": "Añade aviso en texto (o title/aria-label): «(abre en ventana nueva)», o deja que la persona usuaria decida.",
|
package/a11y_toolkit/server.py
CHANGED
|
@@ -97,7 +97,7 @@ try:
|
|
|
97
97
|
except ImportError:
|
|
98
98
|
ARIALIVE_JS = None # repo checkout: read the file
|
|
99
99
|
|
|
100
|
-
VERSION = '5.
|
|
100
|
+
VERSION = '5.32.0'
|
|
101
101
|
|
|
102
102
|
# Params renombrados a inglés en 5.11.0; se aceptan los nombres previos.
|
|
103
103
|
PARAM_ALIASES = {
|
|
@@ -209,6 +209,10 @@ TOOLS = [
|
|
|
209
209
|
'focus indicator heuristic (2.4.7), plus rendered versions of the '
|
|
210
210
|
'static checks (alt, accessible names, labels, headings, lang/title, '
|
|
211
211
|
'tabindex, aria-hidden, captions, tables). Findings include remediation. '
|
|
212
|
+
'HTTP contract: the report carries http_status, its url is the FINAL '
|
|
213
|
+
'page after redirects (requested_url keeps the original), and a 4xx/5xx '
|
|
214
|
+
'response is returned as an error — the audited content still rides '
|
|
215
|
+
'along, but no CI gate can pass on an error response. '
|
|
212
216
|
'Requires playwright: pip install playwright && playwright install '
|
|
213
217
|
'chromium.'),
|
|
214
218
|
'inputSchema': {'type': 'object', 'properties': {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kinti/a11y-toolkit",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.32.0",
|
|
4
4
|
"mcpName": "io.github.kinti/a11y-toolkit",
|
|
5
5
|
"description": "Zero-dependency WCAG 2.2 accessibility engine (37 MCP tools + CLI): audits, contrast fixing, SHA-256-sealed evidence packs, SARIF, EARL/ACT, CI ratchet. Self-contained: the pure-stdlib Python engine ships inside and runs via python3 \u2014 no downloads, no installs.",
|
|
6
6
|
"license": "MIT",
|