Bug 173585

Summary: Scrollbars of textarea elements are displayed when not required
Product: [Applications] konqueror Reporter: Ralph Moenchmeyer <rm>
Component: khtml formsAssignee: Konqueror Developers <konq-bugs>
Status: CONFIRMED ---    
Severity: wishlist CC: aiacovitti, frank78ac
Priority: NOR    
Version: 4.7.0   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:

Description Ralph Moenchmeyer 2008-10-26 12:46:13 UTC
Version:            (using KDE 4.1.2)
OS:                Linux
Installed from:    SuSE RPMs

Konqueror 4.1.2 shows scrollbars for textarea elements whether they are required or not. No other major browser does this - neither Firefox nor Opera nor MS IE 7. So I consider this a bug.  

The display of scrollbars is especially disturbing for textarea elements with a small height values. 

The necessity to display scrollbars should be calculated from the "rows" attribute and from the style definitions for "font-size" or "line-height" and "height". 
Only if more lines are written than are displayable within the area of the element, scrollbars should appear automatically.
Comment 1 Frank Reininghaus 2008-10-26 14:11:24 UTC
If it is agreed that this is a bug, the following patch seems to fix it:

Index: khtml/rendering/render_form.cpp
===================================================================
--- khtml/rendering/render_form.cpp     (revision 876068)
+++ khtml/rendering/render_form.cpp     (working copy)
@@ -1791,7 +1791,6 @@
     if(wrap != DOM::HTMLTextAreaElementImpl::ta_NoWrap) {
         setLineWrapMode(QTextEdit::WidgetWidth);
         setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
-        setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOn );
     }
     else {
         setLineWrapMode(QTextEdit::NoWrap);

Comment 2 Frank Reininghaus 2008-10-26 16:03:50 UTC
I just tried to find out since when a vertical scrollbar is shown by default. It seems that this was introduced in this commit:

http://websvn.kde.org/?view=rev&revision=131655

Maybe this helps to decide whether this behaviour is intended or not.

Considering the patch in comment 1, maybe it would be better to replace that line by
setVerticalScrollBarPolicy( Qt::ScrollBarAsNeeded );
But that seems to be Qt's default anyway.
Comment 3 Frank Reininghaus 2010-01-10 22:53:06 UTC
*** Bug 221830 has been marked as a duplicate of this bug. ***
Comment 4 Andrea Iacovitti 2010-02-14 13:12:33 UTC
SVN commit 1090000 by aiacovitti:

Do not display scroll bars on textarea elements when not necessary.
Match other browsers behaviour.
Approved by Germain.

BUG: 221830
CCBUG: 173585


 M  +7 -8      render_form.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1090000
Comment 5 Germain Garand 2010-02-20 02:13:05 UTC
SVN commit 1093037 by ggarand:

automatically merged revision 1090000:
Do not display scroll bars on textarea elements when not necessary.
Match other browsers behaviour.
Approved by Germain.

BUG: 221830
CCBUG: 173585

 M  +7 -8      render_form.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1093037
Comment 6 Andrea Iacovitti 2011-07-31 14:49:19 UTC
This commit http://websvn.kde.org/?revision=1097847&view=revision clarifies what's the intendend behavior about the wish reported here.
Therefore i think this bug can be closed as WONTFIX.
Comment 7 Ralph Moenchmeyer 2011-07-31 17:46:22 UTC
In my opinion the intention is quite clear: 

Textarea tags within form tags of any (X)HTML page should only show scrollbars when needed. I.e, when the actual text filled into the textarea field gets longer in vertical or horizontal direction than the area of the textarea-tag displayed in the browser. 

Konqueror displays vertical scrollbars all the time - independent of the row attribute and css height definitions.  

Just try with a textarea field defined as   

<textarea rows="2" cols="80" 
	    style="width:600px;  height:500px;">some text</textarea>

or even 

<textarea id="ka_utitel" name="ka_utitel"  rows="2" cols="80" 
	    >some text</textarea>

Vertical scrollbars will appear although they are completely unnecessary.

None of the other browsers (firefox, opera, ms ie, safari, ....) does this.
Comment 8 Andrea Iacovitti 2011-08-18 22:27:06 UTC
Tested MSIE8/9 and both display vertical scrollbars by default.
Changing severity to wishlist.
Comment 9 Ralph Moenchmeyer 2011-08-19 15:19:55 UTC
OK, I correct my statement from comment #7 as follows: 

None of the following browsers for Linux and Windows shows the vertical scrollbar when not needed : Firefox, Opera, Safari and Epiphany. 

Even Safari - which always was very close to Konqueror - does not.  

Therefore, the MS IEs are exceptions - but MS always does what it wants - whether it is reasonable, W3C compliant or not. 

What I find very interesting about "comment #8" and "http://websvn.kde.org/?revision=1097847&view=revision" is that the MS IE is used as a model browser regarding this bug .... 

Dear KDE developers, this is something I really do not understand ... Why should Konqueror behave as MS IE when all other major linux browsers do not ??????

Besides:  the additional scrollbar reduces the space for the text below the width of the style directive. 

But do as you like - I seldom use Konqueror for web browsing nowadays ...