[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/khtml
From:       Germain Garand <germain () ebooksfrance ! org>
Date:       2010-03-02 9:28:09
Message-ID: 1267522089.564918.32199.nullmailer () svn ! kde ! org
[Download RAW message or body]

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<TextAreaWidget*>(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()
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic