This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 28517 - origin of the rule for textarea cols=0/rows=0
Summary: origin of the rule for textarea cols=0/rows=0
Status: RESOLVED WORKSFORME
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: https://html.spec.whatwg.org/#the-tex...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-20 08:27 UTC by contributor
Modified: 2015-08-13 06:47 UTC (History)
4 users (show)

See Also:


Attachments

Description contributor 2015-04-20 08:27:18 UTC
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
Comment 1 Ms2ger 2015-04-20 08:30:27 UTC
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.
Comment 2 Ian 'Hixie' Hickson 2015-04-21 21:15:47 UTC
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.
Comment 3 Ms2ger 2015-04-21 21:19:57 UTC
If it doesn't matter, I guess I don't care, but it feels kinda weird to have the requirement if so.