User pfooti's comment referenced the specification[1]. You said that a browsers' implementation of the DOM API proves that it is illegal. I then linked to an issue with a detailed discussion of how the DOM API isn't consistent with itself, much less the HTML specification.
[1]:http://www.w3.org/TR/html-markup/syntax.html#syntax-attribut...