validator / validator

Nu Html Checker – Helps you catch problems in your HTML/CSS/SVG
https://validator.github.io/validator/
MIT License
1.71k stars 275 forks source link

referrerpolicy on <script> elements #817

Closed gregbaker closed 5 years ago

gregbaker commented 5 years ago

The validator doesn't accept the referrerpolicy attribute on <script> elements, but my reading of the spec of the script element says it should be allowed (except for data block script elements).

This page fails validation but passes when the referrerpolicy is removed.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Page Title</title>
<script src="code.js" referrerpolicy="origin"></script>
</head>
<body>
</body>
</html>
sideshowbarker commented 5 years ago

Yep, I see it’s been in the HTML spec now for almost a year —

https://github.com/whatwg/html/commit/0d28f8fc3a7c272f6d148f647ead29965a56ab60

Dunno how I didn’t get it added to the checker at that time — so thanks very much for catching it and taking time to report it. I’ll get it added to the checker today or tomorrow.

sideshowbarker commented 5 years ago

Thanks for reporting this — fix pushed to https://validator.w3.org/nu/