This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Specification: https://html.spec.whatwg.org/multipage/rendering.html Multipage: https://html.spec.whatwg.org/multipage/#the-textarea-element-2 Complete: https://html.spec.whatwg.org/#the-textarea-element-2 Referrer: https://html.spec.whatwg.org/multipage/ Comment: origin of the rule for textarea cols=0/rows=0 Posted from: 193.190.253.150 by ms2ger@gmail.com User agent: Mozilla/5.0 (X11; Linux x86_64; rv:34.0) Gecko/20100101 Firefox/34.0
Rendering says: > If the element has a cols attribute, and parsing that attribute's value using > the rules for parsing non-negative integers doesn't generate an error, then > the user agent is expected to use the attribute as a presentational hint for > the 'width' property on the element, with the value being the textarea > effective width (as defined below). Otherwise, the user agent is expected to > act as if it had a user-agent-level style sheet rule setting the 'width' > property on the element to the textarea effective width. So, cols=0 implies the element gets a preshint The definition of character width says: > If applying the rules for parsing non-negative integers to the [cols] > attribute's value results in a number greater than zero, then the element's > character width is that value; otherwise, it is 20. So cols=0 is effectively ignored. I'm not quite sure how to test this, but it seems like Rendering should ignore zero as well.
It's effectively ignored just like cols=20 is effectively ignored. This is black-box non-detectable as far as I can tell. The only way you could tell there was an effect is if you had something in your UA stylesheet that could influence textarea widths.
If it doesn't matter, I guess I don't care, but it feels kinda weird to have the requirement if so.