? fieldset_fix.patch
Index: misc/collapse.js
===================================================================
RCS file: /cvs/drupal/drupal/misc/collapse.js,v
retrieving revision 1.8
diff -u -p -r1.8 collapse.js
--- misc/collapse.js	17 Nov 2006 20:36:46 -0000	1.8
+++ misc/collapse.js	9 Dec 2006 19:21:29 -0000
@@ -52,22 +52,16 @@ Drupal.collapseAutoAttach = function () 
       .append(a);
 
     // Wrap fieldsets contents (except for the legend) into wrapper divs for animating.
-    // div1 is used to avoid margin problems inside fieldsets,
-    // div2 is the one that is actually animated.
-    var div1 = document.createElement('div');
-    var div2 = document.createElement('div');
-    this.parentNode.contentWrapper = div2;
-    $(this).after(div1);
-    $(div1).append(div2);
-    var el = div1.nextSibling;
+    // div is used for animation.
+    var div = document.createElement('div');
+    this.parentNode.contentWrapper = div;
+    $(this).after(div);
+    var el = div.nextSibling;
     while (el != null) {
       var next = el.nextSibling;
-      $(el).remove();
-      $(div2).append(el);
+      $(div).append(el);
       el = next;
     }
-    // Avoid jumping around due to margins collapsing into fieldset border
-    $(div1).css('overflow', 'hidden');
 
     // Expand if there are errors inside
     if ($('input.error, textarea.error, select.error', this.parentNode).size() > 0) {
Index: modules/system/system.css
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.css,v
retrieving revision 1.18
diff -u -p -r1.18 system.css
--- modules/system/system.css	7 Dec 2006 19:50:31 -0000	1.18
+++ modules/system/system.css	9 Dec 2006 19:21:29 -0000
@@ -329,6 +329,16 @@ html.js fieldset.collapsed legend a {
 html.js fieldset.collapsible legend a {
   display: block;
 }
+/* Padding and Margin cancle each other out. Vertical scroll bar shows without them. */
+html.js fieldset.collapsible div {
+  overflow: auto;
+  padding: .4em 0;
+  margin: -.4em 0;
+}
+/* Make sure overflow behavior does not affect .form-item */
+html.js fieldset.collapsible .form-item {
+  overflow: visible;
+}
 
 /*
 ** Resizable text areas
