Description
The spec for <button>
says:
Content model:Phrasing content, but there must be no interactive content descendant and no descendant with the tabindex attribute specified.
This issue is to ask: why the phrasing content limitation? (The interactive content limitation makes total sense.) I've asked around with some a11y folks, and as far as I've heard, this is unrelated to accessibility. It may be historical, from a time before CSS could be used change inline/block/etc. There would seem to be some very valid use cases for using a non-phrasing element like a <div>
inside a button, such as for layout reasons.
I searched for other related issues, and could only find this one in WHATWG, and these two (888, 1332) on the validator. None gave particularly satisfying rationale.
This content model rule, AFAIK, is just a validator issue, since all browsers properly and interoperably parse and render <button><div></div></button>
. And changing it would be a relaxation of the validator, which would seem to be backwards compatible.
Any reason not to relax the content model for <button>
?