Mozilla's textarea has MSIE5W's bogus box model

RESOLVED WORKSFORME

Status

()

Core
Layout: Form Controls
P2
normal
RESOLVED WORKSFORME
16 years ago
15 years ago

People

(Reporter: Robert Munyer, Assigned: rods (gone))

Tracking

({testcase})

Trunk
Future
PowerPC
Mac System 9.x
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

16 years ago
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).
(Reporter)

Comment 1

16 years ago
Created attachment 53015 [details]
A simple box model test
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

Comment 3

16 years ago
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
(Reporter)

Comment 4

16 years ago
> 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.
(Assignee)

Comment 6

16 years ago
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
(Reporter)

Comment 7

16 years ago
> 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.
(Assignee)

Comment 9

16 years ago
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.
(Assignee)

Updated

16 years ago
Target Milestone: --- → mozilla1.2
Keywords: testcase
(Assignee)

Updated

16 years ago
Priority: -- → P2
Target Milestone: mozilla1.2 → Future

Updated

16 years ago
QA Contact: madhur → tpreston

Comment 10

15 years ago
Moz 20030312 OSX displays the testcase correctly.
Status: ASSIGNED → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.