From kde-commits Tue Mar 02 09:28:09 2010 From: Germain Garand Date: Tue, 02 Mar 2010 09:28:09 +0000 To: kde-commits Subject: KDE/kdelibs/khtml Message-Id: <1267522089.564918.32199.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=126752209807230 SVN commit 1097847 by ggarand: got a better idea here: instead of letting the textarea be always ScrollBarAsNeeded, we may mirror the overflow-x/y property and default to overflow-y:scroll This matches MSIE7 so should be perfectly compatible with sites that want to turn the scrollbars to auto for cosmetic reasons (with overflow:auto), while retaining as default the very nice "this is a form widget" accessibility hint that the vertical scrollbar naturally provides. CCBUG: 221830 M +1 -0 css/html4.css M +13 -0 rendering/render_form.cpp --- trunk/KDE/kdelibs/khtml/css/html4.css #1097846:1097847 @@ -460,6 +460,7 @@ font-family: monospace; border: 2px -khtml-native; cursor: text; + overflow-y: scroll; } /* --- trunk/KDE/kdelibs/khtml/rendering/render_form.cpp #1097846:1097847 @@ -2205,6 +2205,19 @@ scrollbarsStyled = false; element()->m_unsubmittedFormChange = unsubmittedFormChange; + TextAreaWidget* w = static_cast(m_widget); + if (style()->overflowX() == OSCROLL) + w->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOn ); + else if (style()->overflowX() == OHIDDEN) + w->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); + else + w->setHorizontalScrollBarPolicy( Qt::ScrollBarAsNeeded ); + if (style()->overflowY() == OSCROLL) + w->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOn ); + else if(style()->overflowY() == OHIDDEN) + w->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); + else + w->setVerticalScrollBarPolicy( Qt::ScrollBarAsNeeded ); } void RenderTextArea::layout()