Mozilla obeys invalid maxwidth attribute on text form controls

VERIFIED FIXED in mozilla6

Status

()

Core
Layout: Form Controls
P4
normal
VERIFIED FIXED
16 years ago
6 years ago

People

(Reporter: Stephen Moehle, Assigned: dbaron)

Tracking

(Depends on: 1 bug, {dev-doc-complete, testcase})

Trunk
mozilla6
dev-doc-complete, testcase
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite ?

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(3 attachments)

(Reporter)

Description

16 years ago
The above url has a form with an text input that has a maxwidth attribute:

<INPUT TYPE="TEXT" NAME="email" SIZE="30" maxwidth="40">

As far as I can tell, there is no version of HTML that has a maxwidth attribute
for text input controls.  I think the author of the page probably meant
maxlength, but I really am not sure.

Mozilla, however, obeys this maxwidth attribute rendering the text control 40
pixels wide.  In fact it takes it over the size attribute which has a reasonable
value.  As a result, the form is unusable in Mozilla as the text input control
is far too narrow to actually type in.

Both NN4 and Opera ignore the maxwidth attribute and render the text control 30
characters wide which is what I think Mozilla should do as well.

Tested with Mozilla trunk build 2001092906 on Linux.
(Reporter)

Comment 1

16 years ago
Created attachment 51462 [details]
Simplified test case
confirming.  <div> elements do not seem to do maxwidth..

now, we have maxwidth in XUL, but I don't see how this would affect HTML
elements....
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: testcase

Comment 3

16 years ago
The problem is the GfxText uses the nsBox for part of it's sizing and the 
method:
nsIBox::AddCSSMaxSize(nsBoxLayoutState& aState, nsIBox* aBox, nsSize& aSize)

Checks for a XULATom:maxwidth and name space none and it should really only be 
looking at the XUL namespace.

Or somehow the nsBox needs to NOT do this when sizing an HTML control.

Over to evaughan
Assignee: rods → evaughan
Reassigning to Alex.
Assignee: eric → alexsavulov
Target Milestone: --- → mozilla1.1
*** Bug 131597 has been marked as a duplicate of this bug. ***

Comment 6

15 years ago
I also see this on Win2k using RC1 (build id: 2002041711). 

This html:
<input type="text" name="foo" maxwidth="3" size="5">
displays on mozilla as a VERY thin line.
In IE 5.5 and netscape 4.7 it displays as a text box.

Comment 7

14 years ago
*** Bug 207373 has been marked as a duplicate of this bug. ***

Comment 8

14 years ago
OS->all based on last 2 comments
OS: Linux → All

Comment 9

14 years ago
retargeting
Target Milestone: mozilla1.1alpha → Future
We should just move the maxwidth XUL stuff into the XUL attribute-mapping code
(which we should create).
Depends on: 216838
Assignee: alexsavulov → nobody
QA Contact: madhur → layout.form-controls
Duplicate of this bug: 645137
Created attachment 521915 [details]
Another testcase showing the problems this causes

Comment 13

6 years ago
(In reply to comment #11)
> *** Bug 645137 has been marked as a duplicate of this bug. ***

Thanks, Boris.  I just needed to use a different name, other than maxWidth, for my custom attribute name.
Depends on: 644514
(Assignee)

Comment 14

6 years ago
Created attachment 527168 [details] [diff] [review]
patch

This started off as bug 644514 patch 2, but it really doesn't have anything to do with that bug, and a lot to do with this one, so let's put it here.
Assignee: nobody → dbaron
Status: NEW → ASSIGNED
Attachment #527168 - Flags: review?(bzbarsky)
(Assignee)

Updated

6 years ago
Flags: in-testsuite?
Comment on attachment 527168 [details] [diff] [review]
patch

r=me, but add some tests, please?
Attachment #527168 - Flags: review?(bzbarsky) → review+
Comment on attachment 527168 [details] [diff] [review]
patch

>           <html:input anonid="input"
>                       class="autocomplete-textbox urlbar-input textbox-input uri-element-right-align"
>-                      flex="1" allowevents="true"
>+                      style="-moz-box-flex: 1" allowevents="true"
Instead of inline style please put this in toolkit/content/textbox.css
Keywords: dev-doc-needed
(Assignee)

Comment 17

6 years ago
ok... I also had to put it in menulist.css, since menulist.xml doesn't use the textbox-input class.
(Assignee)

Comment 18

6 years ago
https://hg.mozilla.org/mozilla-central/rev/5b0b236704da
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Priority: -- → P4
Hardware: x86 → All
Resolution: --- → FIXED
Target Milestone: Future → mozilla6
(In reply to comment #17)
> ok... I also had to put it in menulist.css, since menulist.xml doesn't use the
> textbox-input class.

That might be a bug, or it might be a limitation of XBL1. I'll look into it.
Updated documentation by adding a note to Firefox 6 for developers; this was never documented as supported, so it's more of a relnote type issue.
Keywords: dev-doc-needed → dev-doc-complete

Updated

6 years ago
Blocks: 659982
Mozilla/5.0 (Windows NT 5.1; rv:6.0) Gecko/20100101 Firefox/6.0

Verified issue on Windows XP, Windows 7, Mac OS X 10.6 and Ubuntu, using the test case from Comment 12. 

Setting resolution to VERIFIED FIXED.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.