From be1a15db3b0786be139e569654d086421ee2bcde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20R=C3=B8ed?= Date: Wed, 22 Apr 2026 00:28:57 +0200 Subject: [PATCH 1/9] refactor: reconcile native-interactive-elements via shared util MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds `lib/utils/native-interactive-elements.js` exporting `isNativeInteractive(node, getTextAttrValue)` — the canonical "is this HTML tag natively interactive?" classifier. Migrates `template-no-invalid-interactive` and `template-no-nested-interactive` to use it. The set is hand-curated because axobject-query disagrees with browser reality on several rows (notably audio/video unconditional-widget; deprecated-but-still-listed). Each row is documented inline with spec/browser rationale. See the JSDoc in `lib/utils/native-interactive-elements.js` for the full table. Interactive set: - `button`, `select`, `textarea`, `iframe`, `embed`, `summary`, `details` — universally accepted widgets (iframe/details deviate from axobject-query's type classification but are focusable in practice). - `input` — except `type=hidden`. - `option`, `datalist` — axobject-query widget (ListBoxOptionRole / ListBoxRole). - `canvas` — axobject-query widget (CanvasRole); convention + no-false-positive bias. - `a[href]`, `area[href]` — HTML-AAM: anchor interactivity requires href. - `audio[controls]`, `video[controls]` — stricter than axobject-query (which marks bare audio/video as widget unconditionally); aligns with browser reality. Not in the interactive set: - `input[type=hidden]`, `menuitem`, `label` — documented per-row. - `` — excluded. Earlier revision included it based on a misattributed axobject-query EmbeddedObjectRole citation; verification showed that role maps only to ``, not ``. With no authoritative source backing inclusion, default to non-interactive. - `template-no-invalid-interactive` — replaces inline native-interactive set. - `template-no-nested-interactive` — same. Both rules' behavior is preserved for every case except `` (no longer classified as interactive). Tests updated accordingly — `