This repository was archived by the owner on Sep 24, 2026. It is now read-only.
Report img without alt and interactive content in a; document parser gaps - #2
Merged
Merged
Conversation
…gaps Two of four reported missing findings were missing Schematron rules: - elements-img-missing-alt: vnu's general missing-alt branch (outside figure, with its aria-label/aria-labelledby/title exemptions). Only the figure-without-figcaption case existed before. - elements-interactive-in-a: vnu's interactive-descendant-of-a list (button, select, textarea, label, details, dialog, embed, iframe, a, non-hidden input, controls media, usemap img/object, tabindex, interactive roles). The other two (stray </div>, misnested <b><i>...</b></i>) are parse errors html5-parser 0.3.0 does not record: it only reports a stray end tag on the "any other end tag" path and none from the adoption agency algorithm. The tokens leave no trace in the tree, so the fix belongs in html5-parser. Documented as a gap in README and docs, with ignored regression tests. Differential test unchanged: TP 3745, TN 909, FP 0, FN 1.
html5-parser 0.4.0 records the tree-construction parse errors 0.3.0 dropped silently: stray end tags with no matching element in scope (</div>, </li>, </h2>, ...), start tags the parser ignores, and misnested formatting elements repaired by the adoption agency algorithm. They surface as parser.html5 findings through the existing mapping; no rule-ID changes needed. Un-ignore the two known-gap regression tests. README, vnu comparison and rule-ID docs now list only the parse errors 0.4.0 still misses (e.g. <div><span></div>, content after </html>). Differential corpus unchanged: TP 3745, TN 909, FP 0, FN 1. Cargo.lock is intentionally not updated: html5-parser 0.4.0 is not on crates.io yet. Run `cargo update -p html5-parser` after publishing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Four constructs that vnu flags produced no finding when placed alone in an otherwise valid document. What each one turned out to be:
<img>withoutaltfigure-without-figcaptioncase existedassertion.elements.img-missing-alt, following vnu's general missing-altbranch and its exemptions (aria-label,aria-labelledby, non-emptytitle;role/otheraria-*keep their existing, more specific rules)<button>inside<a>ahad no counterpart (only a fewbutton-ancestor rules existed)elements-interactive-in-apattern, vnu's full list (button,select,textarea,label,details,dialog,embed,iframe,a, non-hiddeninput,video/audio[controls],img/object[usemap],[tabindex], interactive roles), one finding per element in vnu's else-if order</div>html5-parser0.3.0:StrayEndTagis only emitted on the "any other end tag" path (</span>,</b>), not in the block,li,dd/dtor heading end-tag branches<b><i>…</b></i>html5-parser0.3.0: the adoption agency algorithm repairs the tree without recording an errorThe two parser cases can't be fixed in this crate. The dropped tokens leave no trace in the tree, the same reason the stray-
<!DOCTYPE>gap is already documented insrc/parse.rs. The fix is inhtml5-parser: record the parse error at the remaining §13.2.6.4.7 "in body" end-tag branches and adoption agency steps, release it, then bump the=0.3.0pin here. Two#[ignore]d regression tests insrc/lib.rsreproduce both cases.Docs
docs/guides/vnu-comparison.mdanddocs/guides/rule-ids.mddescribe the parser gap. The differential test does not show it: the corpus fixtures vnu flags for a stray</header>or</td>still count as true positives, through unrelated heading and table findings.content-model.htmlnow includes both new findings. The JSON was regenerated withcargo run --example findings, and the description insite/src/showcase.tswas updated.Unreleasedentry.Validation
cargo fmt --check,cargo clippy --all-targets -- -D warnings,cargo test(417 passed, 2 known-gap tests ignored)cargo test --release --test differential -- --ignored:true_positive=3745 true_negative=909 false_positive=0 false_negative=1 not_comparable=0. This is unchanged, because the corpus has no fixtures for these two new rules in either direction. No baseline update.The
msrvjob was already failing onmasterbefore this change: locked dependencies need a newer Rust than the declared 1.85. Not addressed here.