Bugzilla – Bug 1006
input@accept
Last modified: 2015-06-28 14:03:43 CEST
This is an old bug, already notified and ignored. While the "accept" attribute on input type "file" accepts single and listed MIME types, it flags as an error when extensions are present in the list. More specifically, the validator considers it an error when no slash is present in the token. And as authors are encouraged to provide both extension and MIME types in the list of allowed files, it is quite a serious problem.
(In reply to Andy R from comment #0) > This is an old bug, already notified and ignored. It's not been ignored. It's just not been fixed yet. > While the "accept" > attribute on input type "file" accepts single and listed MIME types, it > flags as an error when extensions are present in the list. More > specifically, the validator considers it an error when no slash is present > in the token. And as authors are encouraged to provide both extension and > MIME types in the list of allowed files, it is quite a serious problem. I'm sorry it's not been fixed yet but I think it's not a particularly serious problem, and we'll get around to fixing it at some point. In the mean time please keep in mind that the purpose of the checker isn't to give you a pass/fail certification of the correctness of your document. The purpose is to help you find unintentional mistakes. If we wanted to do the easy thing, we'd just accept any arbitrary string in the "accept" value, and any document with a file extension in the value would then pass. Doing the more-helpful thing of having it actually check that you have, e.g., ".png" in there instead of ",png" takes a little more work to code. And it will get fixed when we can make time to do it.
(In reply to Michael[tm] Smith from comment #1) I do understand the purpose of the validator, and probably now i understand it even more. But while I know that accept=".png" is a valid attribute+value, I also think that authors wishing to understand what errors they made would achieve a headache seeing the false positive with extension, and therefore they would try to fix the (false) issue by, e.g., removing the dot or so on. What is just a bug for who reports it, can become a matter of confusion for people in real need of help. Anyway, as said, no problem if time is needed. Just a standby reply is welcome.
See https://github.com/validator/validator/commit/3ea40b2f79c025bd5b7444f1c6c3dee4853269f6