Closed Bug 255038 Opened 20 years ago Closed 18 years ago

"textarea" attribute "rows" creates one row too many

Categories

(Core :: Layout: Form Controls, defect)

x86
Windows XP
defect
Not set
minor

Tracking

()

RESOLVED DUPLICATE of bug 33654

People

(Reporter: trevor, Unassigned)

Details

Attachments

(3 files, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040626 Firefox/0.9.1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040626 Firefox/0.9.1

When displaying select multiple form fields (specifically where the specified
size of the select multiple field is greater than the number of option elements)
the field draws at least 1 line smaller than specified in the html.  To observe
this behavior create a table with two columns and make a textarea element of
size 10 in one field, and create a select multiple field with <9 options of size
10.  The two fields should render the same size, but the select multiple field
will be smaller.

Reproducible: Always
Steps to Reproduce:
1. create a website with a table that has two columns
2. create a textarea element of size 10 in the left column
3. create a select multiple field with <9 elements of size 10 in the right column
4. observer result in firefox

Actual Results:  
the select multiple field is smaller than the textarea field

Expected Results:  
the two fields should be the same size

It appears that in some cases the select multiple field will draw even more than
1 line smaller than it should for some of my users.  I have not been able to
duplicate this behaviour by reconfiguring my client.
If you use proper CSS the problem should be gone.
<textarea style="width:200px;height:200px"></textarea>
This is an automated message, with ID "auto-resolve01".

This bug has had no comments for a long time. Statistically, we have found that
bug reports that have not been confirmed by a second user after three months are
highly unlikely to be the source of a fix to the code.

While your input is very important to us, our resources are limited and so we
are asking for your help in focussing our efforts. If you can still reproduce
this problem in the latest version of the product (see below for how to obtain a
copy) or, for feature requests, if it's not present in the latest version and
you still believe we should implement it, please visit the URL of this bug
(given at the top of this mail) and add a comment to that effect, giving more
reproduction information if you have it.

If it is not a problem any longer, you need take no action. If this bug is not
changed in any way in the next two weeks, it will be automatically resolved.
Thank you for your help in this matter.

The latest beta releases can be obtained from:
Firefox:     http://www.mozilla.org/projects/firefox/
Thunderbird: http://www.mozilla.org/products/thunderbird/releases/1.5beta1.html
Seamonkey:   http://www.mozilla.org/projects/seamonkey/
This is still a problem. It is not a huge deal since it's only cosmetic, but it
is frustrating since I have many applications where textarea and select multiple
boxes go side by side, and are supposed to render the same size.  Some of my
users use IE where this renders properly, and some use firefox where it does
not.  So I can't solve the problem by increasing the size alone.
Can we have a testcase page please - just a bare-bones demo of the problem. 
Without one, this bug is likely to be closed.
Trevor - please be so kind as to reply to comment #3 !

Furthermore, your reported Firefox versions are too old a build to analyze bugs against now. The problem you are reporting may well have been fixed already. 

Could you please download a recent version or nightly build from <http://www.mozilla.org/releases/nightly.html>, and then let us know if you still see this problem?

Many thanks, Cigno
Attached file Example (obsolete) —
I have attached a barebones demo of this problem to the bug ticket.  You'll see that both elements are the same height in IE, but not in Firefox.  According to the W3C specs for SELECT, "size" is supposed to be the number of rows in the select box, but in Firefox it renders with one less row than specified.  I could use CSS to determine the box sizes, but I prefer to vary the element size by rows in some cases, and firefox should conform to this standard as well.
Assignee: firefox → nobody
Component: General → Layout: Form Controls
Product: Firefox → Core
QA Contact: general → layout.form-controls
Version: unspecified → Trunk
Towards comment 7: The problem seems to be in the wrong display of the textarea not the select element. As shown in the attachment, 10 rows can be inserted / are visible.

(Note: Example's html is not valid - select is not child of form.)
Attached image Example as seen for IE6
For comparison here how this would look like in IE6. 9 rows are genereated as specified in the source:

<textarea name=change cols="50" rows="9"></textarea>
<select multiple name="select" size="9"></select>
Attachment #211267 - Attachment is obsolete: true
Severity: trivial → minor
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Select Multiple menus render smaller than the size specified in source → "textarea" attribute "rows" creates one row too many
Is anyone working one this ? 

This is still happening with todays cvs 

% /usr/lib/mozilla/mozilla --version
SeaMonkey 1.5a, Copyright (c) 2003-2006 mozilla.org, build 2006080523

With this minimal html fragment.

<html>
<form>
<textarea rows=2 cols=20>foo
bar
</textarea>
</form>
</html>
Seeing it here too (FF 1.5.0.8).  It's not a huge deal, but it seems like it should be easy to fix.  Is it maybe a result of leaving a line for a horizontal scrollbar?
Hi Brian Salomaki,

You are right, those additional space actually allocated for scollbar.
Can be fix by editing mozilla/forms/nsTextControlFrame.cpp

Just comment out this aIntrinsicSize.height += scrollbarHeight; as follow:-
//aIntrinsicSize.height += scrollbarHeight;

This only remove the additional space appear as one extra rows.

The sample may appear not equal height due to default font size differ for TextArea and Select element.
> Is anyone working one this ? 

This bug is a DUPLICATE of bug 33654: see bug 33654 comment #63. Resolving as such
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → DUPLICATE
Hi Guys, 
No need o change any browser based code, since just by adding following style in css resolve this issue

textarea{
   overflow-x: hidden
}

Note: it is only applicable when there is no horizontal scroll bar required for respective Textarea
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: