Index: includes/form.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/form.inc,v
retrieving revision 1.511
diff -u -p -r1.511 form.inc
--- includes/form.inc	17 Nov 2010 04:10:51 -0000	1.511
+++ includes/form.inc	17 Nov 2010 08:05:34 -0000
@@ -3167,6 +3167,58 @@ function form_process_tableselect($eleme
 }
 
 /**
+ * Processes the size of a form element.
+ *
+ * When vertical tabs are used within a theme that is width-constrained (when
+ * there are two sidebars, for example), the default value for #size and
+ * #cols is too large. This causes textfield, textarea, file, password, and
+ * password_confirm elements to overflow the vertical tab container.
+ *
+ * This function checks to see if the element exists within a group and if
+ * its #size (or, in the case of textarea, #cols) is larger than the maximum
+ * value before an overflow occurs (set by vertical_tabs_max_field_size). If it
+ * is, it resets #size down to the maximum safe value.
+ *
+ * @param $element
+ *   The form element to process. Properties used:
+ *   - #type: The type of form element. Used to determine if #size or #cols
+ *     should be checked.
+ *   - #array_parents: The array of names of the element's parents. Used to
+ *     determine if the element is a member of a group.
+ *   - #size: Width of the element in characters.
+ *   - #cols: Width of the textarea in columns.
+ * @param &$form_state
+ *   The current state of the form. Properties used:
+ *   - groups: An associative array containing the groups within the form.
+ *     Each group is an associative array containing #group_exists, a boolean
+ *     value that will be set to true if the group-holding element exists.
+ *
+ * @return
+ *   The processed element.
+ */
+function form_process_size($element, &$form_state) {
+  // Multiselect boxes use #size to determine how many lines to use and do not
+  // need to be adjusted.
+  if ($element['#type'] == 'select') {
+    return $element;
+  }
+  // Determine if the element is a member of a group that will be rendered.
+  // If so, adjust any #size or #cols value over the maximum safe value.
+  $group = $element['#array_parents'][0];
+  if (isset($form_state['groups'][$group]['#group_exists'])) {
+    $max_size = variable_get('vertical_tabs_max_field_size', 30);
+    if (isset($element['#size']) && $element['#size'] > $max_size) {
+      $element['#size'] = $max_size;
+    }
+    else if (isset($element['#cols']) && $element['#cols'] > $max_size) {
+      $element['#cols'] = $max_size;
+    }
+  }
+
+  return $element;
+}
+
+/**
  * Processes a machine-readable name form element.
  *
  * @param $element
Index: misc/vertical-tabs.css
===================================================================
RCS file: /cvs/drupal/drupal/misc/vertical-tabs.css,v
retrieving revision 1.8
diff -u -p -r1.8 vertical-tabs.css
--- misc/vertical-tabs.css	7 Oct 2010 15:54:13 -0000	1.8
+++ misc/vertical-tabs.css	17 Nov 2010 08:05:34 -0000
@@ -1,18 +1,18 @@
 /* $Id: vertical-tabs.css,v 1.8 2010/10/07 15:54:13 webchick Exp $ */
 
 div.vertical-tabs {
-  margin: 1em 0 1em 15em; /* LTR */
+  margin: 1em 0 1em 13em; /* LTR */
   border: 1px solid #ccc;
   position: relative; /* IE6/7 */
 }
 .vertical-tabs ul.vertical-tabs-list {
-  width: 15em;
+  width: 13em;
   list-style: none;
   list-style-image: none; /* IE6 */
   border-top: 1px solid #ccc;
   padding: 0;
   position: relative; /* IE6 */
-  margin: -1px 0 -1px -15em; /* LTR */
+  margin: -1px 0 -1px -13em; /* LTR */
   float: left; /* LTR */
 }
 .vertical-tabs fieldset.vertical-tabs-pane {
@@ -23,6 +23,9 @@ div.vertical-tabs {
 .vertical-tabs legend {
   display: none;
 }
+.vertical-tabs .fieldset-wrapper {
+  padding: 0;
+}
 
 /* Layout of each tab */
 .vertical-tabs ul.vertical-tabs-list li {
@@ -62,17 +65,8 @@ div.vertical-tabs {
 }
 
 /**
- * Prevent text inputs from overflowing when container is too narrow. "width" is
- * applied to override hardcoded cols or size attributes and used in conjunction
- * with "box-sizing" to prevent box model issues from occurring in most browsers.
-*/
-.vertical-tabs .form-type-textfield input {
-  width: 100%;
-  -moz-box-sizing: border-box;
-  -webkit-box-sizing: border-box;
-  box-sizing: border-box;
-}
-* html .vertical-tabs .form-type-textfield,
-* html .vertical-tabs .form-textarea-wrapper {
+ * Prevent textareas from overflowing when the container is too narrow.
+ */
+* html .vertical-tabs .form-type-textarea {
   width: 95%; /* IE6 */
 }
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.989
diff -u -p -r1.989 system.module
--- modules/system/system.module	15 Nov 2010 17:47:50 -0000	1.989
+++ modules/system/system.module	17 Nov 2010 08:05:34 -0000
@@ -347,7 +347,7 @@ function system_element_info() {
     '#size' => 60,
     '#maxlength' => 128,
     '#autocomplete_path' => FALSE,
-    '#process' => array('ajax_process_form'),
+    '#process' => array('form_process_size', 'ajax_process_form'),
     '#theme' => 'textfield',
     '#theme_wrappers' => array('form_element'),
   );
@@ -367,13 +367,13 @@ function system_element_info() {
     '#input' => TRUE,
     '#size' => 60,
     '#maxlength' => 128,
-    '#process' => array('ajax_process_form'),
+    '#process' => array('form_process_size', 'ajax_process_form'),
     '#theme' => 'password',
     '#theme_wrappers' => array('form_element'),
   );
   $types['password_confirm'] = array(
     '#input' => TRUE,
-    '#process' => array('form_process_password_confirm', 'user_form_process_password_confirm'),
+    '#process' => array('form_process_size', 'form_process_password_confirm', 'user_form_process_password_confirm'),
     '#theme_wrappers' => array('form_element'),
   );
   $types['textarea'] = array(
@@ -381,7 +381,7 @@ function system_element_info() {
     '#cols' => 60,
     '#rows' => 5,
     '#resizable' => TRUE,
-    '#process' => array('ajax_process_form'),
+    '#process' => array('form_process_size', 'ajax_process_form'),
     '#theme' => 'textarea',
     '#theme_wrappers' => array('form_element'),
   );
@@ -438,6 +438,7 @@ function system_element_info() {
     '#size' => 60,
     '#theme' => 'file',
     '#theme_wrappers' => array('form_element'),
+    '#process' => array('form_process_size'),
   );
   $types['tableselect'] = array(
     '#input' => TRUE,
Index: themes/bartik/css/style.css
===================================================================
RCS file: /cvs/drupal/drupal/themes/bartik/css/style.css,v
retrieving revision 1.35
diff -u -p -r1.35 style.css
--- themes/bartik/css/style.css	16 Nov 2010 18:54:23 -0000	1.35
+++ themes/bartik/css/style.css	17 Nov 2010 08:05:34 -0000
@@ -1235,8 +1235,17 @@ div.password-suggestions {
   background: #222222;
   opacity: 0.7;
 }
-div.vertical-tabs .vertical-tabs-panes fieldset.vertical-tabs-pane {
-  padding: 1em;
+div.vertical-tabs {
+  word-wrap: normal;
+  font-size: 0.929em;
+}
+fieldset.vertical-tabs-pane {
+  font-size: 1em;
+  top: auto;
+  -khtml-border-radius: 0;
+  -moz-border-radious: 0;
+  -webkit-border-radius: 0;
+  border-radius: 0;
 }
 #forum tr td.forum {
   padding-left: 35px;
