wpt
wpt copied to clipboard
Somehow lint for broken HTML in tests?
https://github.com/web-platform-tests/wpt/pull/53180 is a case of a test case having:
<link rel="help" href="https://drafts.csswg.org/css-fonts/#font-variant-caps-prop"
<link rel="match" href="font-variant-caps-invalidation-container-sizing-ref.html">
Which leads to a DOM containing:
LINK rel="help" href="https://drafts.csswg.org/css-fonts/#font-variant-caps-prop" <link=""
And thus the file isn't found as a test.
While I'm somewhat skeptical of whether we can reasonably parse all the HTML to look for parse errors (which I vaguely remember some discussion about before — but the only reference I can find is in https://github.com/web-platform-tests/wpt/issues/7204).
A more minimal approach of just linting for rel\s*=\s*["']?(mis)?match but not finding any such nodes might be enough? We could clearly also lint for testharness.js references but no such nodes, too.