Closed Bug 188324 Opened 23 years ago Closed 23 years ago

The height of <Input Type=Text> is larger than specified

Categories

(Core :: Layout: Form Controls, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: Maniac, Unassigned)

Details

Attachments

(3 files, 1 obsolete file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3b) Gecko/20030107 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3b) Gecko/20030107 The height of text inputs is larger than the one set in style by 5 pixels. The following testcase shows difference between a text input and a button side by side. Reproducible: Always Steps to Reproduce: 1. Look at the test case 2. Note the difference in height between the input field and the button 3. Actual Results: The text input is higher than the button by 5px Expected Results: Elements' height sholud be equal
Attached file testcase (obsolete) —
Ah... things are a bit worse :-). The difference is actually 4 pixels. But the button is _positioned_ 1 pixel higher then the text input.
Hmm strange. Work for me on WinXP Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3b) Gecko/20030104. Is it a regression?
Then it looks like an issue with OS drawing on Win 2000. I'll attach a screenshot.
This is on XP also, both classic and xp style. Build 2003010805.
This is a "regression" in that we now, in standards mode, use content-box sizing for text inputs (so "height" is height of content") while using border-box sizing for buttons (so "height" is height of content + padding + border). We used to use border-box sizing for both, but IE6 has started approaching the CSS standard on the issue and we're tracking the changes they made (pending a reevaluation of all the form sizing stuff). The only issue I see here is the issue of 1px mispositioning.... does that happen if you do not set the heights?
oh, see bug 184478 for more information
> This is a "regression" in that we now, in standards mode, use content-box sizing > for text inputs (so "height" is height of content") while using border-box > sizing for buttons (so "height" is height of content + padding + border). But... Uhm... Doesn't it break standard compliance than? I believe CSS spec says 'height' should be used only for content without padding, borders, margins without exceptions. Am I missing somehting? And as you've touched the issue... What is now the politics in standard compliance in strict mode? Are we copying IE's behaviour in some things or adhere the specs everywhere? > We used to use border-box sizing for both, but IE6 has started approaching the CSS > standard on the issue and we're tracking the changes they made (pending a > reevaluation of all the form sizing stuff). In fact IE renders the testcase differently: it aligns input and button by bottom. (I'll attach another screenshot for convinience) > The only issue I see here is the issue of 1px mispositioning.... does that happen if you do not set the heights? They are aligned and sized correctly without 'size' AND without 'padding' set. With 'padding:0' and without 'size' button's top is 1px higher and bottom is 1px lower :-) Extended testcase follows.
Attached file Extended testcase
Testcase with different 'height' and 'padding' options
Attachment #111040 - Attachment is obsolete: true
> Am I missing somehting? Yes. You're missing the fact that form controls are replaced content which is not really specifiable via CSS (how do you style the file control usefully?). You're also missing the use of a proposed CSS3 property that controls this (the border-box/content-box is not hardcoded; it can be changed by the -moz-box-sizing property). > In fact IE renders the testcase differently: Yes, I know. We baseline-align the controls instead of bottom-aligning, since it looks better. > With 'padding:0' all bets are off. Again, we align the baselines of the text in the controls, as much as possible (once you assign a height, this breaks since buttons center vertically while text inputs do not; this does not affect the baseline locations, however). The outer edge is determined then by how much padding and border the controls have. See http://lxr.mozilla.org/seamonkey/source/layout/html/document/src/forms.css#77 So we come back to the fact that the internals of form controls (like the border and padding) should simply not be stylable... we keep trying to make that so, but people are insisting that they be given the chance to shoot themselves in the foot.
> You're missing the fact that form controls are replaced content Oops.. Thank you for pointing this. >> With 'padding:0' > > all bets are off. Again, we align the baselines of the text in the controls, > as much as possible (once you assign a height, this breaks since buttons > center vertically while text inputs do not; this does not affect the baseline > locations, however). The outer edge is determined then by how much padding > and border the controls have. > See http://lxr.mozilla.org/seamonkey/source/layout/html/document/src/forms.css#77 Understood. > So we come back to the fact that the internals of form controls > (like the border and padding) should simply not be stylable... > we keep trying to make that so, but people are insisting that they > be given the chance to shoot themselves in the foot. Ah... I remember this discussion in the bug 134927 :-). But this is another story. Clearly, the ability of styling some controls are widely required and used and usually web developers don't care about styling file upload or radio controls. Perhaps they don't know what to expect from certain user agent given 'width:200px; height:10px;' on radio button, so they just don't use it. But styling of text inputs, buttons, select's options is much clearer. That's why this issues are raised continuously. Anyway, thank you again for clearing things up. Since <Input Type=Text> is a replaced element one can not require any strictly defined behavior when using dimension style settings. I believe this is WONTFIX then?
One related question: Using <Input Type=Text Style="Border-Width:1px;"> doesn't actually affect the border's width but shrinks the input vertically instead. Is this the same issue as in bug 184359 or it's another one?
Yep. That's bug 184359
Resolving this INVALID based on Boris Zbarsky's explanation.
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago
Resolution: --- → INVALID
BTW, I need a clarification about who should verify/close the bug? Reporter or QA contact may be?
QA contact, typically.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: