pub fn audit(node: &Node) -> Vec<A11yIssue>Expand description
Finds accessibility problems in a subtree.
The rules are the ones Winged-Swift’s ROADMAP.md lists under “Quality”:
<img>without analtattribute<button>with neither text nor anaria-label<iframe>without atitle<a>with no accessible name<input>with neither anaria-labelnor anida<label>could point at
This is a linter, not a guarantee: it cannot tell whether an alt is useful, only
whether it exists.
§Examples
use winged_rust::prelude::*;
use winged_rust::accessibility::audit;
let good = image("/a.png", "A cat");
assert!(audit(&good.clone().into()).is_empty());
let bad = Node::from(img().attr("src", "/a.png"));
assert_eq!(audit(&bad).len(), 1);