Index: includes/form.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/form.inc,v
retrieving revision 1.432
diff -u -p -r1.432 form.inc
--- includes/form.inc	12 Feb 2010 15:11:29 -0000	1.432
+++ includes/form.inc	1 Mar 2010 22:11:36 -0000
@@ -1950,8 +1950,10 @@ function theme_fieldset($variables) {
 
   $output = '<fieldset' . drupal_attributes($element['#attributes']) . '>';
   if (!empty($element['#title'])) {
-    $output .= '<legend>' . $element['#title'] . '</legend>';
+    // Always wrap fieldset legends in a SPAN for CSS positioning.
+    $output .= '<legend><span>' . $element['#title'] . '</span></legend>';
   }
+  $output .= '<div class="fieldset-wrapper">';
   if (!empty($element['#description'])) {
     $output .= '<div class="fieldset-description">' . $element['#description'] . '</div>';
   }
@@ -1959,6 +1961,7 @@ function theme_fieldset($variables) {
   if (isset($element['#value'])) {
     $output .= $element['#value'];
   }
+  $output .= '</div>';
   $output .= "</fieldset>\n";
   return $output;
 }
Index: misc/collapse.js
===================================================================
RCS file: /cvs/drupal/drupal/misc/collapse.js,v
retrieving revision 1.27
diff -u -p -r1.27 collapse.js
--- misc/collapse.js	8 Nov 2009 11:46:22 -0000	1.27
+++ misc/collapse.js	1 Mar 2010 22:11:36 -0000
@@ -5,40 +5,37 @@
  * Toggle the visibility of a fieldset using smooth animations.
  */
 Drupal.toggleFieldset = function (fieldset) {
-  if ($(fieldset).is('.collapsed')) {
+  var $fieldset = $(fieldset);
+  if ($fieldset.is('.collapsed')) {
     // Action div containers are processed separately because of a IE bug
     // that alters the default submit button behavior.
-    var content = $('> div:not(.action)', fieldset);
-    $(fieldset)
+    var content = $('> .fieldset-wrapper', fieldset);
+    $fieldset
       .removeClass('collapsed')
       .trigger({ type: 'collapsed', value: false })
-      .find('> legend > a > span.element-invisible')
-        .empty()
-        .append(Drupal.t('Hide'));
+      .find('> legend > a > span.element-invisible').html(Drupal.t('Hide'));
     content.hide();
     content.slideDown({
       duration: 'fast',
       easing: 'linear',
       complete: function () {
-        Drupal.collapseScrollIntoView(this.parentNode);
-        this.parentNode.animating = false;
-        $('div.action', fieldset).show();
+        Drupal.collapseScrollIntoView(fieldset);
+        fieldset.animating = false;
+        $('.form-actions', fieldset).show();
       },
       step: function () {
         // Scroll the fieldset into view.
-        Drupal.collapseScrollIntoView(this.parentNode);
+        Drupal.collapseScrollIntoView(fieldset);
       }
     });
   }
   else {
-    $('div.action', fieldset).hide();
-    $(fieldset).trigger({ type: 'collapsed', value: true });
-    var content = $('> div:not(.action)', fieldset).slideUp('fast', function () {
-      $(this.parentNode).addClass('collapsed')
-        .find('> legend > a > span.element-invisible')
-          .empty()
-          .append(Drupal.t('Show'));
-      this.parentNode.animating = false;
+    $('.form-actions', fieldset).hide();
+    $fieldset.trigger({ type: 'collapsed', value: true });
+    var content = $('> .fieldset-wrapper', fieldset).slideUp('fast', function () {
+      $fieldset.addClass('collapsed')
+        .find('> legend > a > span.element-invisible').html(Drupal.t('Show'));
+      fieldset.animating = false;
     });
   }
 };
@@ -64,16 +61,16 @@ Drupal.collapseScrollIntoView = function
 Drupal.behaviors.collapse = {
   attach: function (context, settings) {
     $('fieldset.collapsible > legend', context).once('collapse', function () {
-      var fieldset = $(this.parentNode);
+      var $fieldset = $(this).closest('fieldset');
       // Expand if there are errors inside.
-      if ($('input.error, textarea.error, select.error', fieldset).size() > 0) {
-        fieldset.removeClass('collapsed');
+      if ($('input.error, textarea.error, select.error', $fieldset).size() > 0) {
+        $fieldset.removeClass('collapsed');
       }
 
       var summary = $('<span class="summary"></span>');
-      fieldset.
+      $fieldset.
         bind('summaryUpdated', function () {
-          var text = $.trim(fieldset.getSummary());
+          var text = $.trim($fieldset.getSummary());
           summary.html(text ? ' (' + text + ')' : '');
         })
         .trigger('summaryUpdated');
@@ -84,24 +81,19 @@ Drupal.behaviors.collapse = {
       $(this).empty()
         .append($('<a href="#">' + text + '</a>')
           .click(function () {
-            var fieldset = $(this).parents('fieldset:first')[0];
             // Don't animate multiple times.
-            if (!fieldset.animating) {
-              fieldset.animating = true;
-              Drupal.toggleFieldset(fieldset);
+            if (!$fieldset.get(0).animating) {
+              $fieldset.get(0).animating = true;
+              Drupal.toggleFieldset($fieldset.get(0));
             }
             return false;
           })
           .prepend($('<span class="element-invisible"></span>')
-            .append(fieldset.hasClass('collapsed') ? Drupal.t('Show') : Drupal.t('Hide'))
+            .append($fieldset.hasClass('collapsed') ? Drupal.t('Show') : Drupal.t('Hide'))
             .after(' ')
           )
         )
-        .append(summary)
-        .after(
-          $('<div class="fieldset-wrapper"></div>')
-            .append(fieldset.children(':not(legend):not(.action)'))
-        );
+        .append(summary);
     });
   }
 };
Index: modules/simpletest/simpletest.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/simpletest.test,v
retrieving revision 1.37
diff -u -p -r1.37 simpletest.test
--- modules/simpletest/simpletest.test	24 Dec 2009 08:03:53 -0000	1.37
+++ modules/simpletest/simpletest.test	1 Mar 2010 23:00:06 -0000
@@ -208,11 +208,11 @@ class SimpleTestFunctionalTest extends D
     if ($this->parse()) {
       if ($fieldset = $this->getResultFieldSet()) {
         // Code assumes this is the only test in group.
-        $results['summary'] = $this->asText($fieldset->div[1]);
+        $results['summary'] = $this->asText($fieldset->div->div[1]);
         $results['name'] = $this->asText($fieldset->legend);
 
         $results['assertions'] = array();
-        $tbody = $fieldset->table->tbody;
+        $tbody = $fieldset->div->table->tbody;
         foreach ($tbody->tr as $row) {
           $assertion = array();
           $assertion['message'] = $this->asText($row->td[0]);
@@ -231,8 +231,6 @@ class SimpleTestFunctionalTest extends D
 
   /**
    * Get the fieldset containing the results for group this test is in.
-   *
-   * @return fieldset containing the results for group this test is in.
    */
   function getResultFieldSet() {
     $fieldsets = $this->xpath('//fieldset');
Index: modules/system/system-behavior.css
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system-behavior.css,v
retrieving revision 1.4
diff -u -p -r1.4 system-behavior.css
--- modules/system/system-behavior.css	16 Feb 2010 01:05:52 -0000	1.4
+++ modules/system/system-behavior.css	1 Mar 2010 22:11:36 -0000
@@ -46,13 +46,9 @@ html.js fieldset.collapsed {
   margin-bottom: 0;
   height: 1em;
 }
-html.js fieldset.collapsed * {
+html.js fieldset.collapsed .fieldset-wrapper {
   display: none;
 }
-html.js fieldset.collapsed legend, html.js fieldset.collapsed legend a span.element-invisible {
-  display: block;
-  overflow: hidden;
-}
 html.js fieldset.collapsible legend a {
   display: inline;
   padding-left: 15px; /* LTR */
Index: modules/user/user.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.test,v
retrieving revision 1.84
diff -u -p -r1.84 user.test
--- modules/user/user.test	25 Feb 2010 10:00:38 -0000	1.84
+++ modules/user/user.test	1 Mar 2010 23:13:49 -0000
@@ -143,7 +143,7 @@ class UserRegistrationTestCase extends D
     variable_set('user_default_timezone', DRUPAL_USER_TIMEZONE_SELECT);
     $this->drupalLogout();
     $this->drupalGet('user/register');
-    $this->assertRaw('<fieldset id="edit-account"><legend>Account information</legend>', t('Account settings fieldset was not hidden.'));
+    $this->assertText(t('Account information'), t('Account settings fieldset was not hidden.'));
   }
 }
 
Index: themes/seven/style.css
===================================================================
RCS file: /cvs/drupal/drupal/themes/seven/style.css,v
retrieving revision 1.45
diff -u -p -r1.45 style.css
--- themes/seven/style.css	17 Feb 2010 03:37:12 -0000	1.45
+++ themes/seven/style.css	1 Mar 2010 22:11:36 -0000
@@ -613,25 +613,16 @@ fieldset {
   margin: 0 0 10px;
 }
 
-fieldset legend span,
-fieldset legend a {
+fieldset legend > a,
+fieldset legend > span {
   position: absolute;
   margin-top: 9px;
 }
 
-fieldset legend a span {
-  position: relative;
-  margin-top: 0;
-}
-
 fieldset.collapsed {
-  background: transparent;
+  background-color: transparent;
 }
 
-html.js fieldset.collapsed legend,
-html.js fieldset.collapsed legend * {
-  display: block;
-}
 html.js fieldset.collapsed {
   border-width: 1px;
   margin-bottom: 10px;
@@ -639,11 +630,11 @@ html.js fieldset.collapsed {
 }
 
 fieldset fieldset {
-  background: #fff;
+  background-color: #fff;
 }
 
 fieldset fieldset fieldset {
-  background: #f8f8f8;
+  background-color: #f8f8f8;
 }
 
 html.js fieldset.collapsible .fieldset-wrapper {
Index: themes/seven/template.php
===================================================================
RCS file: /cvs/drupal/drupal/themes/seven/template.php,v
retrieving revision 1.13
diff -u -p -r1.13 template.php
--- themes/seven/template.php	25 Feb 2010 20:57:39 -0000	1.13
+++ themes/seven/template.php	1 Mar 2010 22:11:36 -0000
@@ -5,6 +5,8 @@
  * Override or insert variables into the html template.
  */
 function seven_preprocess_html(&$vars) {
+  // Add conditional CSS for IE8 and below.
+  drupal_add_css(path_to_theme() . '/ie.css', array('weight' => CSS_THEME, 'browsers' => array('IE' => 'lte IE 8', '!IE' => FALSE), 'preprocess' => FALSE));
   // Add conditional CSS for IE6.
   drupal_add_css(path_to_theme() . '/ie6.css', array('weight' => CSS_THEME, 'browsers' => array('IE' => 'lt IE 7', '!IE' => FALSE), 'preprocess' => FALSE));
 }
@@ -76,29 +78,6 @@ function seven_tablesort_indicator($vari
 }
 
 /**
- * Override of theme_fieldset().
- *
- * Add span to legend tag, so we can style it to be inside the fieldset.
- */
-function seven_fieldset($variables) {
-  $element = $variables['element'];
-
-  $output = '<fieldset' . drupal_attributes($element['#attributes']) . '>';
-  if (!empty($element['#title'])) {
-    $output .= '<legend><span>' . $element['#title'] . '</span></legend>';
-  }
-  if (!empty($element['#description'])) {
-    $output .= '<div class="fieldset-description">' . $element['#description'] . '</div>';
-  }
-  $output .= $element['#children'];
-  if (isset($element['#value'])) {
-    $output .= $element['#value'];
-  }
-  $output .= "</fieldset>\n";
-  return $output;
-}
-
-/**
  * Implements hook_css_alter().
  */
 function seven_css_alter(&$css) {
