This works around browser specific issues where legend cannot safely be overriden by CSS.
Most notable problem is that Firefox ignores setting the width and border.

By adding a <span> inside of the legend, this allows for using CSS to override legend.span without breaking normal behavior

When this was done, the collapsed javascript code had issues and so the system.css had to be modified accordingly

diff -Nurp ../drupal-6.15.orig/includes/form.inc ./includes/form.inc
--- ../drupal-6.15.orig/includes/form.inc	2010-03-01 15:16:11.000000000 -0600
+++ ./includes/form.inc	2010-03-01 15:16:29.000000000 -0600
@@ -1524,7 +1524,7 @@ function theme_fieldset($element) {
     }
   }
 
-  return '<fieldset'. drupal_attributes($element['#attributes']) .'>'. ($element['#title'] ? '<legend>'. $element['#title'] .'</legend>' : '') . (isset($element['#description']) && $element['#description'] ? '<div class="description">'. $element['#description'] .'</div>' : '') . (!empty($element['#children']) ? $element['#children'] : '') . (isset($element['#value']) ? $element['#value'] : '') ."</fieldset>\n";
+  return '<fieldset'. drupal_attributes($element['#attributes']) .'>'. ($element['#title'] ? '<legend><span>'. $element['#title'] .'</span></legend>' : '') . (isset($element['#description']) && $element['#description'] ? '<div class="description">'. $element['#description'] .'</div>' : '') . (!empty($element['#children']) ? $element['#children'] : '') . (isset($element['#value']) ? $element['#value'] : '') ."</fieldset>\n";
 }
 
 /**
diff -Nurp ../drupal-6.15.orig/modules/system/system.css ./modules/system/system.css
--- ../drupal-6.15.orig/modules/system/system.css	2010-03-01 15:16:11.000000000 -0600
+++ ./modules/system/system.css	2010-03-03 13:05:42.000000000 -0600
@@ -322,6 +322,10 @@ html.js fieldset.collapsed legend a {
   background-image: url(../../misc/menu-collapsed.png); /* LTR */
   background-position: 5px 50%; /* LTR */
 }
+/* Span was added as a work-around on legend css theming; this is added to prevent the legend from dissapearing when collapse.js is called. */
+html.js fieldset.collapsed legend a span {
+  display: inline
+}
 /* Note: IE-only fix due to '* html' (breaks Konqueror otherwise). */
 * html.js fieldset.collapsed legend,
 * html.js fieldset.collapsed legend *,
