### Eclipse Workspace Patch 1.0
#P drupal-head
Index: misc/tableheader.js
===================================================================
RCS file: /cvs/drupal/drupal/misc/tableheader.js,v
retrieving revision 1.29
diff -u -r1.29 tableheader.js
--- misc/tableheader.js	18 Dec 2009 08:17:26 -0000	1.29
+++ misc/tableheader.js	2 May 2010 10:19:15 -0000
@@ -9,8 +9,25 @@
 
 Drupal.behaviors.tableHeader = {
   attach: function (context, settings) {
-    // This breaks in anything less than IE 7. Prevent it from running.
-    if ($.browser.msie && parseInt($.browser.version, 10) < 7) {
+    // Test for position:fixed support.
+    // http://yura.thinkweb2.com/cft/
+    var isSupported = null;
+    if (document.createElement) {
+      var el = document.createElement('div');
+      if (el && el.style) {
+        el.style.position = 'fixed';
+        el.style.top = '10px';
+        var root = document.body;
+        if (root && root.appendChild && root.removeChild) {
+          root.appendChild(el);
+          isSupported = (el.offsetTop === 10);
+          root.removeChild(el);
+        }
+      }
+    }
+
+    // This breaks if position:fixed is not supported. Prevent it from running.
+    if(!isSupported) {
       return;
     }
 
@@ -41,15 +58,17 @@
 
     // Track positioning and visibility.
     function tracker(e) {
+      $e = $(e);
+      $eTable = $(e.table);
       // Reset top position of sticky table headers to the current top offset.
-      var topOffset = Drupal.settings.tableHeaderOffset ? eval(Drupal.settings.tableHeaderOffset + '()') : 0;
+      var topOffset = Drupal.settings.tableHeaderOffset ? offsetHeight(Drupal.settings.tableHeaderOffset) : 0;
       $('.sticky-header').css('top', topOffset + 'px');
       // Save positioning data.
       var viewHeight = document.documentElement.scrollHeight || document.body.scrollHeight;
       if (e.viewHeight != viewHeight) {
         e.viewHeight = viewHeight;
-        e.vPosition = $(e.table).offset().top - 4 - topOffset;
-        e.hPosition = $(e.table).offset().left;
+        e.vPosition = $eTable.offset().top - 4 - topOffset;
+        e.hPosition = $eTable.offset().left;
         e.vLength = e.table.clientHeight - 100;
         // Resize header and its cell widths.
         var parentCell = $('th', e.table);
@@ -61,36 +80,49 @@
           }
           $(this).css('width', cellWidth);
         });
-        $(e).css('width', $(e.table).css('width'));
+        $e.css('width', $eTable.css('width'));
       }
 
       // Track horizontal positioning relative to the viewport and set visibility.
       var hScroll = document.documentElement.scrollLeft || document.body.scrollLeft;
       var vOffset = (document.documentElement.scrollTop || document.body.scrollTop) - e.vPosition;
       var visState = (vOffset > 0 && vOffset < e.vLength) ? 'visible' : 'hidden';
-      $(e).css({ left: -hScroll + e.hPosition + 'px', visibility: visState });
+      $e.css({ left: -hScroll + e.hPosition + 'px', visibility: visState });
 
       // Check the previous anchor to see if we need to scroll to make room for the header.
       // Get the height of the header table and scroll up that amount.
       if (prevAnchor != location.hash) {
         if (location.hash != '') {
-          var scrollLocation = $('td' + location.hash).offset().top - $(e).height();
+          var scrollLocation = $('td' + location.hash).offset().top - $e.height();
           $('body, html').scrollTop(scrollLocation);
         }
         prevAnchor = location.hash;
       }
     }
 
+    // Calculate an offset using the function's paramater as a selector.
+    function offsetHeight(selector) {
+      var $e = $(selector);
+      var height = $e.outerHeight();
+      // In IE, Shadow filter adds some extra height, so we need to remove it from
+      // the returned height.
+      if (filter = $e.css('filter')) {
+        if (filter.match(/DXImageTransform\.Microsoft\.Shadow/)) {
+          height -= $e.get(0).filters.item("DXImageTransform.Microsoft.Shadow").strength;
+        }
+      }
+      return height;
+    };
+
     // Only attach to scrollbars once, even if Drupal.attachBehaviors is called
-    //  multiple times.
+    // multiple times.
     $('body').once(function () {
-      $(window).scroll(Drupal.tableHeaderDoScroll);
-      $(document.documentElement).scroll(Drupal.tableHeaderDoScroll);
+      $([window, document.documentElement]).bind('scroll.drupal-tableheader', Drupal.tableHeaderDoScroll);
     });
 
     // Track scrolling.
     Drupal.tableHeaderOnScroll = function () {
-      $('table.sticky-header').each(function () {
+      $('table.sticky-header', context).each(function () {
         tracker(this);
       });
     };
@@ -103,7 +135,7 @@
         return;
       }
       time = setTimeout(function () {
-        $('table.sticky-header').each(function () {
+        $('table.sticky-header', context).each(function () {
           // Force cell width calculation.
           this.viewHeight = 0;
           tracker(this);
@@ -112,7 +144,7 @@
         time = null;
       }, 250);
     };
-    $(window).resize(resize);
+    $(window).bind('resize.drupal-tableheader', resize);
   }
 };
 
Index: modules/toolbar/toolbar.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/toolbar/toolbar.module,v
retrieving revision 1.37
diff -u -r1.37 toolbar.module
--- modules/toolbar/toolbar.module	29 Apr 2010 05:19:50 -0000	1.37
+++ modules/toolbar/toolbar.module	2 May 2010 10:19:16 -0000
@@ -151,6 +151,16 @@
 }
 
 /**
+ * Preprocess template variables for toolbar.tpl.php.
+ *
+ * Adding the 'overlay-displace-top' class to the toolbar pushes the overlay
+ * down, so it appears below the toolbar.
+ */
+function toolbar_preprocess_toolbar(&$variables) {
+  $variables['classes_array'][] = "overlay-displace-top";
+}
+
+/**
  * Implements hook_system_info_alter().
  *
  * Indicate that the 'page_top' region (in which the toolbar will be displayed)
@@ -180,7 +190,7 @@
         $module_path . '/toolbar.js',
         array('data' => 'misc/jquery.cookie.js', 'weight' => JS_LIBRARY + 2),
         array(
-          'data' => array('tableHeaderOffset' => 'Drupal.toolbar.height'),
+          'data' => array('tableHeaderOffset' => '#toolbar'),
           'type' => 'setting'
         ),
       ),
