Index: includes/form.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/form.inc,v
retrieving revision 1.509
diff -u -p -r1.509 form.inc
--- includes/form.inc	13 Nov 2010 14:04:08 -0000	1.509
+++ includes/form.inc	14 Nov 2010 09:13:47 -0000
@@ -3165,6 +3165,57 @@ function form_process_tableselect($eleme
 }
 
 /**
+ * Processes the size of a form element.
+ *
+ * When vertical tabs are used within a theme that is width-constrained (like,
+ * for example, when there are two sidebars), 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 (30 characters). 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'])) {
+    if (isset($element['#size']) && $element['#size'] > 30) {
+      $element['#size'] = 30;
+    }
+    else if (isset($element['#cols']) && $element['#cols'] > 30) {
+      $element['#cols'] = 30;
+    }
+  }
+
+  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	14 Nov 2010 09:13:47 -0000
@@ -60,19 +60,3 @@ div.vertical-tabs {
   line-height: normal;
   margin-bottom: 0;
 }
-
-/**
- * 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 {
-  width: 95%; /* IE6 */
-}
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.988
diff -u -p -r1.988 system.module
--- modules/system/system.module	12 Nov 2010 01:36:08 -0000	1.988
+++ modules/system/system.module	14 Nov 2010 09:13:47 -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'),
   );
@@ -437,7 +437,7 @@ function system_element_info() {
     '#input' => TRUE,
     '#size' => 60,
     '#theme' => 'file',
-    '#theme_wrappers' => array('form_element'),
+    '#theme_wrappers' => array('form_process_size', 'form_element'),
   );
   $types['tableselect'] = array(
     '#input' => TRUE,
