Hi everyone,
Following Dutch Web Guidelines Validation Status, where we agreed to keep the DWG tests until we’d reviewed what they check beyond WCAG, I’ve now done that rule-by-rule review. Since then, our official commitment is WCAG 2.2 AA (not AAA), and it’s validated by axe-core in the Docker functional tests. So IMO the question is no longer “are the DWG rules good?” but “which DWG rules do we need for WCAG 2.2 AA that axe-core or the HTML5 (Nu) validator don’t already check?”.
Context: I’ve just converted the webstandards tests (HTML5, XWiki, DWG and RSS validation of all the flavor pages) from JUnit 3 to JUnit 5, in [Misc] Convert the flavor web standards functional tests to JUnit 5 by vmassol · Pull Request #7279 · xwiki/xwiki-platform · GitHub, as part of removing the JUnit 3/4 leftovers. That made me look at the DWG part again.
I’ve reviewed HTML5DutchWebGuidelinesValidator:
- It has 125
validateRpdXsY()methods, but only 31 checks actually do something. The other 94 are empty (“cannot be automatically tested”, “checked by XHTMLValidator”, “No DOCTYPE in HTML5”…). - 6 of the 31 are warnings, which never fail the build (they’re only printed).
- 29 are either not WCAG requirements at all, AAA-only, obsolete (e.g.
<q>because of Internet Explorer,target“deprecated” which is false in HTML5), code style (<br><br>,<b>/<i>, inlinestyle), or already checked by axe-core and/or Nu:
| Rule | Check | Why it’s not needed |
|---|---|---|
| 1s3, 13s4 | no javascript: href, no href="#" + onclick, every form has a submit button, no select[onchange] |
no SC requires it (3.2.2 only forbids an actual change of context on input) |
| 3s1, 3s5 | no <b>/<i> |
valid HTML5, no SC |
| 3s2 | page has an h1 | not required by WCAG (axe best-practice rule only) |
| 3s3 | no skipped heading levels | not a WCAG failure, and Nu now checks it (our implementation is also buggy) |
| 3s4, 3s9, 3s11 | no <br><br>, no <sub>/<sup>, no <q> |
code style / obsolete |
| 6s1, 16s1, 16s2, 16s4 | doctype, charset meta | not accessibility, checked by Nu (16s1 even rejects HTML5’s <meta charset>) |
| 7s1, 7s4, 7s5 | alt on images, image links, image maps | 1.1.1/2.4.4, checked by axe (image-alt, link-name, area-alt, input-image-alt) and Nu |
| 8s1 | no “click here” link text | 2.4.4 (A) allows context, link-only is 2.4.9 (AAA) |
| 8s11 | accesskeys must be numbers | no SC |
| 8s14 | no target attribute |
3.2.5 is AAA, and target isn’t deprecated |
| 8s16, 8s17 | mailto address visible / no ?subject= |
no SC |
| 9s1 | no style attribute, no <style> |
no SC (the 1.4.12 part is axe avoid-inline-spacing, Nu flags <style> in body) |
| 11s4, 11s5 | scope or headers/id on all tables |
only needed for complex tables (H63/H43), axe checks td-headers-attr/th-has-data-cells |
| 12s1 | iframe title + role | title checked by axe frame-title, role not required |
| 13s3, 13s5, 13s18 | fieldset, onsubmit/onchange, no reset button | no SC |
The 2 remaining ones are WCAG A requirements that axe doesn’t fail on today:
- 11s2 (data tables must have
th, 1.3.1): axe hastd-has-header, which is experimental and thus not run by default. It’s also more accurate than DWG (data cells of tables larger than 3x3, layout tables ignored). - 13s1 (inputs must have a label, 1.3.1/3.3.2/4.1.2): axe’s
labelrule is configured as warning-only inWCAGContext.
Proposal
Remove the DWG validation completely: the DWG tests in the webstandards module, CustomDutchWebGuidelinesValidator with its exceptions, the hidden pages skip + class whitelist, and HTML5DutchWebGuidelinesValidator. The HTML5 (Nu) and XWiki validations of all the pages stay. I’d do it right after #7279 is merged, and update the DWG doc page to say it’s been removed and why.
Follow-ups, nice to have but not blocking the removal:
- Enable axe’s
td-has-headerrule, as a warning first, and make it fail the build once we’ve checked it doesn’t report false positives. - Fix the remaining
labelviolations reported by axe and make thelabelrule fail the build. - Validate more screens with axe: today it only validates pages modelled as
BasePagepage objects, so screens modelled asBaseElements (e.g. the page creation form, the comments/history/attachments tabs) are never checked even though our functional tests open them.
What we lose: the DWG tests currently report no error on any page, so we don’t lose the detection of any existing problem. We only lose the detection of future regressions of the 2 rules above on pages that our functional tests don’t open (the DWG tests check all the non-hidden flavor pages and ~74 admin URLs, while axe checks the pages our Docker functional tests open). That gap shrinks as we add functional tests, since axe validates every page they visit, and Nu keeps covering alt, lang, doctype and headings on all pages.
Side note: we don’t pass the wcag22aa tag to axe, so target-size (the only WCAG 2.2 AA rule in axe) isn’t actually executed right now. I’ll fix that separately.
Here’s my +1. WDYT?
Thanks