Closed
Bug 34573
Opened 24 years ago
Closed 24 years ago
Setting TEXTAREA.rows/cols and input.size doesn't resize the control
Categories
(Core :: DOM: Core & HTML, defect, P3)
Core
DOM: Core & HTML
Tracking
()
M16
People
(Reporter: martin.honnen, Assigned: rods)
Details
(Keywords: regression)
Attachments
(1 file)
349 bytes,
text/html
|
Details |
I am trying to increase the size of a textarea by setting
textareaElement.rows
The property is increased but the display doesn't change:
<TEXTAREA NAME="aTextArea" ROWS="1" COLS="20"
ONKEYUP="if (this.rows)
if (event.keyCode == 13)
this.rows = parseInt(this.rows) + 1;
alert(this.rows)"
></TEXTAREA>
Reporter | ||
Comment 1•24 years ago
|
||
Comment 2•24 years ago
|
||
Rods, I think this is due to a bug in the nsGfxTextControlFrame, it checks if an attribute named "size" has changed, but AFAIK there's no "size" attribute on <textarea> elements, in stead there's a "rows" attribute. This patch fixes this bug. Rods, does this look good to you, is it safe to remove the check for the size attribute (is that used in XUL?) or should I add a check for rows in stead of replacing the "size" check? Index: nsGfxTextControlFrame.cpp =================================================================== RCS file: /cvsroot/mozilla/layout/html/forms/src/nsGfxTextControlFrame.cpp,v retrieving revision 3.161 diff -u -r3.161 nsGfxTextControlFrame.cpp --- nsGfxTextControlFrame.cpp 2000/04/01 23:39:53 3.161 +++ nsGfxTextControlFrame.cpp 2000/04/05 16:07:45 @@ -915,7 +915,7 @@ } mEditor->SetFlags(flags); } - else if (nsHTMLAtoms::size == aAttribute && aHint != NS_STYLE_HINT_REFLOW) { + else if (nsHTMLAtoms::rows == aAttribute && aHint != NS_STYLE_HINT_REFLOW) { nsFormFrame::StyleChangeReflow(aPresContext, this); } // Allow the base class to handle common attributes supported
Status: NEW → ASSIGNED
Assignee | ||
Comment 3•24 years ago
|
||
This frame takes care of both the input text and the textarea. So you will need to leave in the check for "size" and add in the new line checking for "rows".
Comment 4•24 years ago
|
||
Ok, thanks rods, patch updated, unless someone objects I'll check in the below for M16. Index: nsGfxTextControlFrame.cpp =================================================================== RCS file: /cvsroot/mozilla/layout/html/forms/src/nsGfxTextControlFrame.cpp,v retrieving revision 3.161 diff -u -r3.161 nsGfxTextControlFrame.cpp --- nsGfxTextControlFrame.cpp 2000/04/01 23:39:53 3.161 +++ nsGfxTextControlFrame.cpp 2000/04/05 17:50:18 @@ -915,7 +915,8 @@ } mEditor->SetFlags(flags); } - else if (nsHTMLAtoms::size == aAttribute && aHint != NS_STYLE_HINT_REFLOW) { + else if ((nsHTMLAtoms::size == aAttribute || + nsHTMLAtoms::rows == aAttribute) && aHint != NS_STYLE_HINT_REFLOW) { nsFormFrame::StyleChangeReflow(aPresContext, this); } // Allow the base class to handle common attributes supported
Whiteboard: [HAVEFIX]
Target Milestone: --- → M16
Comment 5•24 years ago
|
||
I just checked in the above patch. Marking FIXED.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Comment 6•24 years ago
|
||
this bug was fixed in M16, but it's back in M17. Note also that the same bug applies to TEXTAREA.cols, and this was not even fixed in M16.
Comment 8•24 years ago
|
||
Rods, could you have a look at this, `this is probably related to bug 50280.
Assignee | ||
Comment 9•24 years ago
|
||
This is really exactly the same problem as 50280. *** This bug has been marked as a duplicate of 50280 ***
Status: NEW → RESOLVED
Closed: 24 years ago → 24 years ago
Resolution: --- → DUPLICATE
Summary: Setting TEXTAREA.rows doesn't resize the TEXTAREA → Setting TEXTAREA.rows/cols and input.size doesn't resize the control
Whiteboard: [HAVEFIX]
Comment 11•24 years ago
|
||
Verified dupe of bug 50280: "setting size of input field via Javascript doesn't work" (The issue related to this bug is marked future)
Status: RESOLVED → VERIFIED
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•