Textarea cols should default to 20 rather than 1 for non-positive values.

RESOLVED FIXED in Firefox 40

Status

()

Core
DOM: Core & HTML
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: Ms2ger, Assigned: bz)

Tracking

Trunk
mozilla40
Points:
---

Firefox Tracking Flags

(firefox40 fixed)

Details

Attachments

(1 attachment)

(Reporter)

Description

3 years ago
The spec <https://html.spec.whatwg.org/multipage/#attr-textarea-cols-value> says

> If applying the rules for parsing non-negative integers to the
> attribute's value results in a number greater than zero, then the
> element's character width is that value; otherwise, it is 20.

This matches at least IE and Chrome.

See also <http://software.hixie.ch/utilities/js/live-dom-viewer/saved/3503>.

This corresponds to the comment "XXX why a default of 1 char, why hide it" (initially added 1999-02-22 by Chris Karnaze; <http://bonsai.mozilla.org/cvsview2.cgi?diff_mode=context&whitespace_mode=show&root=/cvsroot&subdir=mozilla/layout/html/forms/src/Attic&command=DIFF_FRAMESET&file=nsFormControlHelper.cpp&rev2=1.13&rev1=1.12>).
Created attachment 8594822 [details] [diff] [review]
Just use the return value of the cols DOM property for determining the default number of rendered columns for a textarea
Attachment #8594822 - Flags: review?(Ms2ger)
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
(Reporter)

Updated

3 years ago
Attachment #8594822 - Flags: superreview+
(Reporter)

Comment 2

3 years ago
Comment on attachment 8594822 [details] [diff] [review]
Just use the return value of the cols DOM property for determining the default number of rendered columns for a textarea

Wrong button.
Attachment #8594822 - Flags: superreview+
Attachment #8594822 - Flags: review?(Ms2ger)
Attachment #8594822 - Flags: review+
https://hg.mozilla.org/mozilla-central/rev/1e5d6c99630e
Status: ASSIGNED → RESOLVED
Last Resolved: 3 years ago
status-firefox40: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
You need to log in before you can comment on or make changes to this bug.