Bug 64263 - JavaScript changing text area sizes does not work
Summary: JavaScript changing text area sizes does not work
Status: RESOLVED FIXED
Alias: None
Product: konqueror
Classification: Applications
Component: khtml ecma (show other bugs)
Version: unspecified
Platform: Mandrake RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Konqueror Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-14 15:24 UTC by Colin Ogilvie
Modified: 2005-06-16 20:02 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Simple Testcase (640 bytes, text/html)
2003-09-14 15:25 UTC, Colin Ogilvie
Details
Another simple test case (1.08 KB, text/html)
2005-06-11 08:29 UTC, Frank
Details

Note You need to log in before you can comment on or make changes to this bug.
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