wpt icon indicating copy to clipboard operation
wpt copied to clipboard

Somehow lint for broken HTML in tests?

Open gsnedders opened this issue 5 months ago • 0 comments

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.

gsnedders avatar Jun 16 '25 17:06 gsnedders