Closed Bug 104143 Opened 23 years ago Closed 21 years ago

Mozilla's textarea has MSIE5W's bogus box model

Categories

(Core :: Layout: Form Controls, defect, P2)

PowerPC
Mac System 9.x
defect

Tracking

()

RESOLVED WORKSFORME
Future

People

(Reporter: munyer, Assigned: rods)

Details

(Keywords: testcase)

Attachments

(1 file)

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Macintosh; U; PPC; en-US; rv:0.9.5+) Gecko/20011010
BuildID:    2001101008

The infamous bogus box model of WinMSIE5, killed by Microsoft in
WinMSIE6, is reincarnated in Mozilla's implementation of TEXTAREA.

Reproducible: Always
Steps to Reproduce:
1.  View the attached HTML page.

Actual Results:  The TEXTAREA box is much narrower than the DIV box.

Expected Results:  The two boxes should be the same width.

A simple box model test is attached.  Various browsers' results:

Mac MSIE 5 passes with flying colors.

Mozilla build #2001101008 gets the div right but the textarea wrong.

Win MSIE 6 gets the widths right, but loses the textarea contents!

Win MSIE 5 gets the widths wrong and loses the textarea contents.

Win MSIE 5 & 6 get the textarea's vertical margin wrong (by 1 pixel).
IMO, we shouldn't apply style to textareas at all, since the CSS box model can't
fully describe them, or certainly not until we come up with a consistent, well
thought-out, implementation.  Also, some users expect that they act more like
replaced elements, which would imply that this behavior is expected.
Assignee: dbaron → rods
Component: Style System → HTML Form Controls
QA Contact: ian → madhur
I confirm that the test case seems to exhibit CSS problems with respect to the TEXTAREA, 
such as width, using Mac/2001101117 (0.9.5).

This could use a better, more specific and to-the-point summary, Reporter.
Status: UNCONFIRMED → NEW
Ever confirmed: true
> some users expect that they act more like replaced elements,
> which would imply that this behavior is expected.

Replaced, like an image?  Consider a JPEG image with style
"height: 32px; width: 32px; padding: 5px; border: 5px".  Are
there many people who would expect the photographic content to
occupy only 12 by 12 pixels?

> This could use a better, more specific and to-the-point summary

It could be less indirect, but then it would also be less concise.
How about: "TEXTAREA narrower than specified width, if padding
and/or border != 0"?
No, as if the textarea, including its border, is the image.  After all, that's
basically the way native widgets work.
My understanding was that textarea was a replaced element and was suppose to
obey the CSS2 box model. We since changed our box implementation to to be more
of a "moz" box impl as illustrated by teh textarea's CSS:

  -moz-box-sizing: border-box;

Given the above assumptions it appears that the textarea is being correctly. THe
style for textarea in the example is as follow:

.boxtest {background: #ffc; border: 20px solid black;
  color: black; margin: 0; padding: 30px; width: 300px}

It sets the width to 300px and the textarea is 300px so I would say it works. To
get it to size to 400px, the textarea should have the -moz-box-sizing set to
content-box Which when I do that the texrea ends up being 400px wide.

You may argue (or change) in the bug that the -moz-box-sizing should be
content-box instead of border-box. But otherwise, this bug is invalid.
Status: NEW → ASSIGNED
> My understanding was that textarea was a replaced
> element and was suppose to obey the CSS2 box model.

Are you sure you read the CSS2 spec correctly?  To me it looks
like the CSS2 spec agrees completely with the CSS1 spec: both of
them say the total width should be 400px, as in MSIE5m and MSIE6w.

Where did you find this "CSS2 box model" saying MSIE5w is correct?

> You may argue (or change) in the bug that the -moz-box-sizing
> should be content-box instead of border-box. But otherwise, this
> bug is invalid.

This border-box sounds like something that should only happen in
quirks mode, because it violates both CSS standards (CSS1 & CSS2).

The CSS box model DOES NOT FULLY APPLY to form controls since the form controls
cannot be described by that box model.  Therefore any styling of form controls
is outside the scope of the CSS2 spec.
Peter L. had indicated that it was covered (about 2 1/2 years ago or so) but
that is neither here nor there. I guess the fix is to change it to "content-box"
but I will have to do some testing and then I will attach a patch.
Target Milestone: --- → mozilla1.2
Keywords: testcase
Priority: -- → P2
Target Milestone: mozilla1.2 → Future
QA Contact: madhur → tpreston
Moz 20030312 OSX displays the testcase correctly.
Status: ASSIGNED → RESOLVED
Closed: 21 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: