Input with pattern not working

Most likely because widgets are saved via AJAX, and, as far as I’m aware, the submit handler will bypass any HTML5 input rules unless they are explicitly checked with JavaScript.

Your best bet is to validate/sanitize the data server-side, and pass back any messages if there is an input error.

Chrome adding ="" is just a nuance of the console – it’s not your actual markup, but the interpreted DOM.