Index: vertical-tabs.css
===================================================================
RCS file: /cvs/drupal/drupal/misc/vertical-tabs.css,v
retrieving revision 1.6
diff -u -r1.6 vertical-tabs.css
--- vertical-tabs.css	31 May 2009 00:51:41 -0000	1.6
+++ vertical-tabs.css	27 Sep 2009 15:45:33 -0000
@@ -4,7 +4,7 @@
   margin: 1em 0 1em 15em;
   border: 1px solid #ccc;
 }
-div.vertical-tabs ul.vertical-tabs-list {
+div.vertical-tabs dl.vertical-tabs-list {
   width: 15em;
   list-style: none;
   list-style-image: none; /* IE6 */
@@ -25,7 +25,7 @@
 }
 
 /* Layout of each tab */
-div.vertical-tabs ul.vertical-tabs-list li {
+div.vertical-tabs dl.vertical-tabs-list dt {
   background: #eee;
   border: 1px solid #ccc;
   border-top: 0;
@@ -33,36 +33,44 @@
   margin: 0;
   height: 1%;
 }
-div.vertical-tabs ul.vertical-tabs-list li a {
+div.vertical-tabs dl.vertical-tabs-list dt a {
   display: block;
   text-decoration: none;
   padding: 0.5em 0.6em;
   line-height: 1.3em;
   height: 1%;
 }
-div.vertical-tabs ul.vertical-tabs-list li a:focus {
+div.vertical-tabs dl.vertical-tabs-list dt a:focus {
+  background: Highlight;
+  outline: 3px dotted;
   position: relative;
   z-index: 5;
 }
-div.vertical-tabs ul.vertical-tabs-list li a:hover {
+
+div.vertical-tabs dl.vertical-tabs-list dt a:hover {
+  background: Highlight;
   text-decoration: none;
 }
-div.vertical-tabs ul.vertical-tabs-list li.selected {
-  background: #fff;
+
+div.vertical-tabs dl.vertical-tabs-list dt.selected {
+  background: White;
   border-right-width: 0;
   position: relative;
 }
-div.vertical-tabs ul.vertical-tabs-list li.selected a:focus {
-  outline: 0;
+
+div.vertical-tabs dl.vertical-tabs-list dt.selected a:focus {
+  outline: 2px solid;
 }
-div.vertical-tabs ul.vertical-tabs-list li.selected strong,
-div.vertical-tabs ul.vertical-tabs-list li.selected small {
+div.vertical-tabs dl.vertical-tabs-list dd.selected strong,
+div.vertical-tabs dl.vertical-tabs-list dd.selected small {
   color: #000;
 }
-div.vertical-tabs ul.vertical-tabs-list .summary {
+div.vertical-tabs dl.vertical-tabs-list .summary {
   display: block;
+  font-size: smaller;
+  padding-bottom: 0;
 }
-div.vertical-tabs ul.vertical-tabs ul.vertical-tabs-list .summary {
+div.vertical-tabs dl.vertical-tabs dl.vertical-tabs-list .summary {
   line-height: normal;
   margin-bottom: 0;
 }
Index: vertical-tabs.js
===================================================================
RCS file: /cvs/drupal/drupal/misc/vertical-tabs.js,v
retrieving revision 1.7
diff -u -r1.7 vertical-tabs.js
--- vertical-tabs.js	31 Aug 2009 05:51:08 -0000	1.7
+++ vertical-tabs.js	28 Sep 2009 12:58:22 -0000
@@ -17,31 +17,34 @@
   attach: function (context) {
     $('.vertical-tabs-panes', context).once('vertical-tabs', function () {
       var focusID = $(':hidden.vertical-tabs-active-tab', this).val();
-      var focus;
+      var tabfocus;  // Refactoring names - too much "focus"
       // Create the tab column.
-      var list = $('<ul class="vertical-tabs-list"></ul>');
-      $(this).wrap('<div class="vertical-tabs clearfix"></div>').before(list);
+      var tablist = $('<dl class="vertical-tabs-list"></dl>');
+      $(this).wrap('<div class="vertical-tabs clearfix"></div>').before(tablist);
 
       // Transform each fieldset into a tab.
       $('> fieldset', this).each(function () {
-        var tab = new Drupal.verticalTab({ title: $('> legend', this).text(), fieldset: $(this) });
-        list.append(tab.item);
+        var vtab = new Drupal.verticalTab({
+          title:    $('> legend', this).text(),
+          fieldset: $(this)
+        });
+        tablist.append(vtab.item);
         $(this)
           .removeClass('collapsible collapsed')
           .addClass('vertical-tabs-pane')
-          .data('verticalTab', tab);
+          .data('verticalTab', vtab);
         if (this.id == focusID) {
-          focus = $(this);
+          tabfocus = $(this);
         }
       });
 
-      $('> li:first', list).addClass('first');
-      $('> li:last', list).addClass('last');
+      $('> dt:first', tablist).addClass('first');
+      $('> dt:last', tablist).addClass('last');
 
-      if (!focus) {
-        focus = $('> .vertical-tabs-pane:first', this);
+      if (!tabfocus) {
+        tabfocus = $('> .vertical-tabs-pane:first', this);
       }
-      focus.data('verticalTab').focus();
+      tabfocus.data('verticalTab').focus();
     });
   }
 };
@@ -63,6 +66,27 @@
     return false;
   });
 
+  // Keyboard events added:
+  // Pressing the Enter key will open the tab pane
+  this.link.keydown(function(event) {
+    if (event.keyCode == 13) {
+      self.focus();
+      // Set focus on the first input field of the visible fieldset/tab pane
+      $("fieldset.vertical-tabs-pane input:visible:enabled:first").focus();
+      return false;
+    }
+  });
+
+  // Pressing the Enter key lets you leave the tab again
+  this.fieldset.keydown(function(event) {
+    // Enter key should not trigger inside <textarea> to allow for multi-line entries
+    if (event.keyCode == 13 && event.target.nodeName != "TEXTAREA") {
+      // Set focus on the selected tab button again
+      $(".vertical-tab-button.selected a").focus();
+      return false;
+    }
+  });
+
   this.fieldset
     .bind('summaryUpdated', function () {
       self.updateSummary();
@@ -108,10 +132,10 @@
  */
 Drupal.theme.prototype.verticalTab = function (settings) {
   var tab = {};
-  tab.item = $('<li class="vertical-tab-button"></li>')
-    .append(tab.link = $('<a href="#"></a>')
+    tab.item = $('<dt class="vertical-tab-button" tabindex="-1"></dt>')
+      .append(tab.link = $('<a href="#"></a>')
       .append(tab.title = $('<strong></strong>').text(settings.title))
-      .append(tab.summary = $('<small class="summary"></small>')
+      .append(tab.summary = $('<dd class="summary"></dd>')
     )
   );
   return tab;
