Bug 64263

Summary: JavaScript changing text area sizes does not work
Product: [Applications] konqueror Reporter: Colin Ogilvie <bugs.kde.org>
Component: khtml ecmaAssignee: Konqueror Developers <konq-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: maksim
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Mandrake RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Simple Testcase
Another simple test case

Description Colin Ogilvie 2003-09-14 15:24:17 UTC
Version:            (using KDE KDE 3.1)
Installed from:    Mandrake RPMs

I have a simple JavaScript function which resizes a Textarea in a form which sets x.cols to a value calculated (where x is a reference to the text area).

The code correctly sets x.cols to the new value, future calls to the function use the new cols value but the text box does not redraw on the screen.

I have a sample test case which demonstrates this problem which I will attach shortly.
Comment 1 Colin Ogilvie 2003-09-14 15:25:15 UTC
Created attachment 2454 [details]
Simple Testcase

This is a simple demonstration of the problem.
Comment 2 Frank 2005-06-11 08:29:48 UTC
Created attachment 11398 [details]
Another simple test case

Interactive test case to show that one can change a TEXTBOX's style.height and
style.width, but not COLS and ROWS.
Comment 3 Maksim Orlovich 2005-06-16 17:30:12 UTC
That 2nd testcase wouldn't work right because it relies on getDocumentById grabbing things by name -- but that's a separate quirk. 
Comment 4 Maksim Orlovich 2005-06-16 19:53:42 UTC
Actually, that testcase is broken entirely, since the CSS-specified width, height, override the instrincs one, of course..
Comment 5 Maksim Orlovich 2005-06-16 20:02:13 UTC
SVN commit 426213 by orlovich:

Honor changes of cols/rows via the DOM/ECMA bindings.
Based on apple html/html_formimpl.cpp, but not touching wordwrap,
since that would have to be done different anyway, and I am
not touching that with a br. 

BUG:64263


 M  +4 -0      html_formimpl.cpp  


--- trunk/KDE/kdelibs/khtml/html/html_formimpl.cpp #426212:426213
@@ -2454,9 +2454,13 @@
     {
     case ATTR_ROWS:
         m_rows = attr->val() ? attr->val()->toInt() : 3;
+        if (renderer())
+            renderer()->setNeedsLayoutAndMinMaxRecalc();
         break;
     case ATTR_COLS:
         m_cols = attr->val() ? attr->val()->toInt() : 60;
+        if (renderer())
+            renderer()->setNeedsLayoutAndMinMaxRecalc();
         break;
     case ATTR_WRAP:
         // virtual / physical is Netscape extension of HTML 3.0, now deprecated