Closed Bug 335884 Opened 20 years ago Closed 20 years ago

Textarea and input[type="text"] elements render different widths when requested to be the same.

Categories

(Core :: Layout: Form Controls, defect)

1.8 Branch
x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: vldi, Unassigned)

Details

(Keywords: testcase)

Attachments

(2 files)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.2) Gecko/20060308 Firefox/1.5.0.2 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.2) Gecko/20060308 Firefox/1.5.0.2 When specifying style="width :50em;" for both, the input element is wider, than the textarea element. Reproducible: Always Steps to Reproduce: <html><head><title>Width Test</title></head><body> <p><input type="text" style="width: 50em;" /></p> <p><textarea style="width: 50em;"> </textarea></p> </body></html> Actual Results: Visually the input element is wider, than the textarea. DOM Inspector's Computed Style view gives 662.667px for the input element, and 646px for the textarea. Expected Results: Expect calculated widths to be the same for proper visual alignment in forms.
Attached file An example html page —
Just tested it out on the MAC OS X 10.4, FFX 1.5.0.2 mozilla/5.0 rv 1.8.0.2 Gecko/20060328, and textare was rendered wider (796px) than the input (646px). There is no visible width difference on IE on Windows or on Camino 2004082512 (0.8.1) on Mac OS X, while Camino 2006021400 (1.0Int) had input a two-three pixels wider, than textarea.
Version: unspecified → 1.5.0.x Branch
Component: General → Layout: Form Controls
Product: Firefox → Core
Version: 1.5.0.x Branch → 1.8 Branch
Keywords: testcase
It turns out, that input and textarea has different font-families by default, which causes misaligned widths. When enforced to the same font family (see the second attachement) widths are the same. I am not sure if using different font families by default is a bug or not.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: