Merge m-c --> cedar
authorChris Jones <jones.chris.g@gmail.com>
Fri, 03 Sep 2010 14:07:55 -0500
changeset 54073 26d16ccfbdc0832b69003c3999e9a71b1b72fec3
parent 54072 92f995b194320a8396d9369f580ccdca08fe8bea (current diff)
parent 51978 5dbf817b799df0505c79f02115f83a91901a1512 (diff)
child 54074 b3039d94296ea086716f9ddb1442c3fcb7d86ba2
push id15768
push userdougt@mozilla.com
push dateThu, 16 Sep 2010 01:40:23 +0000
treeherdermozilla-central@cdb90b48f19f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone2.0b6pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge m-c --> cedar
browser/base/content/browser.xul
browser/themes/gnomestripe/browser/browser.css
content/base/src/nsFrameLoader.cpp
content/events/src/nsEventStateManager.cpp
dom/base/nsDOMWindowUtils.cpp
dom/interfaces/base/nsIDOMWindowUtils.idl
editor/libeditor/html/crashtests/crashtests.list
gfx/layers/Layers.h
gfx/layers/basic/BasicLayers.cpp
gfx/layers/basic/BasicLayers.h
gfx/layers/ipc/PLayers.ipdl
gfx/layers/ipc/ShadowLayers.cpp
gfx/layers/ipc/ShadowLayers.h
gfx/layers/ipc/ShadowLayersParent.cpp
layout/base/nsDisplayList.cpp
layout/base/nsDisplayList.h
layout/base/nsLayoutUtils.cpp
layout/generic/nsGfxScrollFrame.cpp
layout/generic/nsSubDocumentFrame.cpp
layout/reftests/svg/reftest.list
layout/style/test/Makefile.in
layout/style/test/chrome/hover_helper.html
layout/style/test/chrome/test_hover.html
layout/style/test/hover_helper.html
layout/style/test/test_hover.html
toolkit/mozapps/extensions/test/xpinstall/browser_unsigned_trigger_iframe.js
toolkit/mozapps/extensions/test/xpinstall/installtrigger_frame.html
toolkit/mozapps/update/test/chrome/test_0120_cert_valid_attributes_not_builtin.xul
toolkit/mozapps/update/test/chrome/test_0121_cert_invalid_attribute_name.xul
widget/src/windows/nsWindow.cpp
widget/src/xpwidgets/nsBaseWidget.cpp
xpcom/tests/TestOOM.cpp
--- a/accessible/src/atk/nsAccessibleWrap.cpp
+++ b/accessible/src/atk/nsAccessibleWrap.cpp
@@ -470,20 +470,17 @@ nsAccessibleWrap::CreateMaiInterfaces(vo
       nsCOMPtr<nsIAccessibleTable> accessInterfaceTable;
       QueryInterface(NS_GET_IID(nsIAccessibleTable),
                      getter_AddRefs(accessInterfaceTable));
       if (accessInterfaceTable) {
           interfacesBits |= 1 << MAI_INTERFACE_TABLE;
       }
       
       //nsIAccessibleSelection
-      nsCOMPtr<nsIAccessibleSelectable> accessInterfaceSelection;
-      QueryInterface(NS_GET_IID(nsIAccessibleSelectable),
-                     getter_AddRefs(accessInterfaceSelection));
-      if (accessInterfaceSelection) {
+      if (IsSelect()) {
           interfacesBits |= 1 << MAI_INTERFACE_SELECTION;
       }
     }
 
     return interfacesBits;
 }
 
 static GType
--- a/accessible/src/atk/nsMaiInterfaceSelection.cpp
+++ b/accessible/src/atk/nsMaiInterfaceSelection.cpp
@@ -55,125 +55,81 @@ selectionInterfaceInitCB(AtkSelectionIfa
     aIface->remove_selection = removeSelectionCB;
     aIface->select_all_selection = selectAllSelectionCB;
 }
 
 gboolean
 addSelectionCB(AtkSelection *aSelection, gint i)
 {
     nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
-    if (!accWrap)
+    if (!accWrap || !accWrap->IsSelect())
         return FALSE;
 
-    nsCOMPtr<nsIAccessibleSelectable> accSelection;
-    accWrap->QueryInterface(NS_GET_IID(nsIAccessibleSelectable),
-                            getter_AddRefs(accSelection));
-    NS_ENSURE_TRUE(accSelection, FALSE);
-
-    return NS_SUCCEEDED(accSelection->AddChildToSelection(i));
+    return accWrap->AddItemToSelection(i);
 }
 
 gboolean
 clearSelectionCB(AtkSelection *aSelection)
 {
     nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
-    if (!accWrap)
+    if (!accWrap || !accWrap->IsSelect())
         return FALSE;
 
-    nsCOMPtr<nsIAccessibleSelectable> accSelection;
-    accWrap->QueryInterface(NS_GET_IID(nsIAccessibleSelectable),
-                            getter_AddRefs(accSelection));
-    NS_ENSURE_TRUE(accSelection, FALSE);
-
-    return NS_SUCCEEDED(accSelection->ClearSelection());
+    return accWrap->UnselectAll();
 }
 
 AtkObject *
 refSelectionCB(AtkSelection *aSelection, gint i)
 {
     nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
-    if (!accWrap)
+    if (!accWrap || !accWrap->IsSelect())
         return nsnull;
 
-    nsCOMPtr<nsIAccessibleSelectable> accSelection;
-    accWrap->QueryInterface(NS_GET_IID(nsIAccessibleSelectable),
-                            getter_AddRefs(accSelection));
-    NS_ENSURE_TRUE(accSelection, nsnull);
+    nsAccessible* selectedItem = accWrap->GetSelectedItem(i);
+    if (!selectedItem)
+        return nsnull;
 
-    nsCOMPtr<nsIAccessible> accSelect;
-    accSelection->RefSelection(i, getter_AddRefs(accSelect));
-    if (!accSelect) {
-        return nsnull;
-    }
-
-    AtkObject *atkObj = nsAccessibleWrap::GetAtkObject(accSelect);
+    AtkObject* atkObj = nsAccessibleWrap::GetAtkObject(selectedItem);
     if (atkObj) {
         g_object_ref(atkObj);
     }
     return atkObj;
 }
 
 gint
 getSelectionCountCB(AtkSelection *aSelection)
 {
     nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
-    if (!accWrap)
+    if (!accWrap || !accWrap->IsSelect())
         return -1;
 
-    nsCOMPtr<nsIAccessibleSelectable> accSelection;
-    accWrap->QueryInterface(NS_GET_IID(nsIAccessibleSelectable),
-                            getter_AddRefs(accSelection));
-    NS_ENSURE_TRUE(accSelection, -1);
-
-    PRInt32 num = 0;
-    nsresult rv = accSelection->GetSelectionCount(&num);
-    return (NS_FAILED(rv)) ? -1 : num;
+    return accWrap->SelectedItemCount();
 }
 
 gboolean
 isChildSelectedCB(AtkSelection *aSelection, gint i)
 {
     nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
-    if (!accWrap)
+    if (!accWrap || !accWrap->IsSelect())
         return FALSE;
 
-    nsCOMPtr<nsIAccessibleSelectable> accSelection;
-    accWrap->QueryInterface(NS_GET_IID(nsIAccessibleSelectable),
-                            getter_AddRefs(accSelection));
-    NS_ENSURE_TRUE(accSelection, FALSE);
-
-    PRBool result = FALSE;
-    nsresult rv = accSelection->IsChildSelected(i, &result);
-    return (NS_FAILED(rv)) ? FALSE : result;
+    return accWrap->IsItemSelected(i);
 }
 
 gboolean
 removeSelectionCB(AtkSelection *aSelection, gint i)
 {
     nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
-    if (!accWrap)
+    if (!accWrap || !accWrap->IsSelect())
         return FALSE;
 
-    nsCOMPtr<nsIAccessibleSelectable> accSelection;
-    accWrap->QueryInterface(NS_GET_IID(nsIAccessibleSelectable),
-                            getter_AddRefs(accSelection));
-    NS_ENSURE_TRUE(accSelection, FALSE);
-
-    nsresult rv = accSelection->RemoveChildFromSelection(i);
-    return (NS_FAILED(rv)) ? FALSE : TRUE;
+    return accWrap->RemoveItemFromSelection(i);
 }
 
 gboolean
 selectAllSelectionCB(AtkSelection *aSelection)
 {
     nsAccessibleWrap *accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
-    if (!accWrap)
+    if (!accWrap || !accWrap->IsSelect())
         return FALSE;
 
-    nsCOMPtr<nsIAccessibleSelectable> accSelection;
-    accWrap->QueryInterface(NS_GET_IID(nsIAccessibleSelectable),
-                            getter_AddRefs(accSelection));
-    NS_ENSURE_TRUE(accSelection, FALSE);
-
-    PRBool result = FALSE;
-    nsresult rv = accSelection->SelectAllSelection(&result);
-    return (NS_FAILED(rv)) ? FALSE : result;
+    return accWrap->SelectAll();
 }
--- a/accessible/src/atk/nsMaiInterfaceSelection.h
+++ b/accessible/src/atk/nsMaiInterfaceSelection.h
@@ -37,17 +37,16 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef __MAI_INTERFACE_SELECTION_H__
 #define __MAI_INTERFACE_SELECTION_H__
 
 #include "nsMai.h"
-#include "nsIAccessibleSelectable.h"
 
 G_BEGIN_DECLS
 
 /* selection interface callbacks */
 
 void selectionInterfaceInitCB(AtkSelectionIface *aIface);
 gboolean addSelectionCB(AtkSelection *aSelection, gint i);
 gboolean clearSelectionCB(AtkSelection *aSelection);
--- a/accessible/src/base/nsAccUtils.cpp
+++ b/accessible/src/base/nsAccUtils.cpp
@@ -371,26 +371,21 @@ nsAccessible *
 nsAccUtils::GetSelectableContainer(nsAccessible *aAccessible, PRUint32 aState)
 {
   if (!aAccessible)
     return nsnull;
 
   if (!(aState & nsIAccessibleStates::STATE_SELECTABLE))
     return nsnull;
 
-  nsCOMPtr<nsIAccessibleSelectable> container;
-  nsAccessible *parent = aAccessible;
-  while (!container) {
-    parent = parent->GetParent();
-    if (!parent || Role(parent) == nsIAccessibleRole::ROLE_PANE)
+  nsAccessible* parent = aAccessible;
+  while ((parent = parent->GetParent()) && !parent->IsSelect()) {
+    if (Role(parent) == nsIAccessibleRole::ROLE_PANE)
       return nsnull;
-
-    container = do_QueryObject(parent);
   }
-
   return parent;
 }
 
 nsAccessible *
 nsAccUtils::GetMultiSelectableContainer(nsINode *aNode)
 {
   nsAccessible *accessible = GetAccService()->GetAccessible(aNode);
   nsAccessible *container = GetSelectableContainer(accessible,
--- a/accessible/src/base/nsAccessible.cpp
+++ b/accessible/src/base/nsAccessible.cpp
@@ -150,30 +150,22 @@ nsresult nsAccessible::QueryInterface(RE
 
   if (aIID.Equals(NS_GET_IID(nsAccessible))) {
     *aInstancePtr = static_cast<nsAccessible*>(this);
     NS_ADDREF_THIS();
     return NS_OK;
   }
 
   if (aIID.Equals(NS_GET_IID(nsIAccessibleSelectable))) {
-    if (mRoleMapEntry &&
-        (mRoleMapEntry->attributeMap1 == eARIAMultiSelectable ||
-         mRoleMapEntry->attributeMap2 == eARIAMultiSelectable ||
-         mRoleMapEntry->attributeMap3 == eARIAMultiSelectable)) {
-
-      // If we have an ARIA role attribute present and the role allows multi
-      // selectable state, then we need to support nsIAccessibleSelectable.
-      // If either attribute (role or multiselectable) change, then we'll
-      // destroy this accessible so that we can follow COM identity rules.
-
+    if (IsSelect()) {
       *aInstancePtr = static_cast<nsIAccessibleSelectable*>(this);
       NS_ADDREF_THIS();
       return NS_OK;
     }
+    return NS_ERROR_NO_INTERFACE;
   }
 
   if (aIID.Equals(NS_GET_IID(nsIAccessibleValue))) {
     if (mRoleMapEntry && mRoleMapEntry->valueRule != eNoValue) {
       *aInstancePtr = static_cast<nsIAccessibleValue*>(this);
       NS_ADDREF_THIS();
       return NS_OK;
     }
@@ -2376,144 +2368,119 @@ nsAccessible::DispatchClickEvent(nsICont
     return;
 
   nsCoreUtils::DispatchMouseEvent(NS_MOUSE_BUTTON_UP, presShell, aContent);
 }
 
 // nsIAccessibleSelectable
 NS_IMETHODIMP nsAccessible::GetSelectedChildren(nsIArray **aSelectedAccessibles)
 {
+  NS_ENSURE_ARG_POINTER(aSelectedAccessibles);
   *aSelectedAccessibles = nsnull;
 
-  nsCOMPtr<nsIMutableArray> selectedAccessibles =
-    do_CreateInstance(NS_ARRAY_CONTRACTID);
-  NS_ENSURE_STATE(selectedAccessibles);
-
-  AccIterator iter(this, filters::GetSelected, AccIterator::eTreeNav);
-  nsIAccessible *selected = nsnull;
-  while ((selected = iter.GetNext()))
-    selectedAccessibles->AppendElement(selected, PR_FALSE);
-
-  PRUint32 length = 0;
-  selectedAccessibles->GetLength(&length); 
-  if (length) { // length of nsIArray containing selected options
-    *aSelectedAccessibles = selectedAccessibles;
-    NS_ADDREF(*aSelectedAccessibles);
+  if (IsDefunct() || !IsSelect())
+    return NS_ERROR_FAILURE;
+
+  nsCOMPtr<nsIArray> items = SelectedItems();
+  if (items) {
+    PRUint32 length = 0;
+    items->GetLength(&length);
+    if (length)
+      items.swap(*aSelectedAccessibles);
   }
 
   return NS_OK;
 }
 
 // return the nth selected descendant nsIAccessible object
 NS_IMETHODIMP nsAccessible::RefSelection(PRInt32 aIndex, nsIAccessible **aSelected)
 {
   NS_ENSURE_ARG_POINTER(aSelected);
   *aSelected = nsnull;
 
+  if (IsDefunct() || !IsSelect())
+    return NS_ERROR_FAILURE;
+
   if (aIndex < 0) {
     return NS_ERROR_INVALID_ARG;
   }
 
-  AccIterator iter(this, filters::GetSelected, AccIterator::eTreeNav);
-  nsAccessible *selected = nsnull;
-
-  PRInt32 count = 0;
-  while (count ++ <= aIndex) {
-    selected = iter.GetNext();
-    if (!selected) {
-      // The index is out of range.
-      return NS_ERROR_INVALID_ARG;
-    }
+  *aSelected = GetSelectedItem(aIndex);
+  if (*aSelected) {
+    NS_ADDREF(*aSelected);
+    return NS_OK;
   }
-  NS_IF_ADDREF(*aSelected = selected);
-  return NS_OK;
+
+  return NS_ERROR_INVALID_ARG;
 }
 
 NS_IMETHODIMP nsAccessible::GetSelectionCount(PRInt32 *aSelectionCount)
 {
   NS_ENSURE_ARG_POINTER(aSelectionCount);
   *aSelectionCount = 0;
 
-  AccIterator iter(this, filters::GetSelected, AccIterator::eTreeNav);
-  nsAccessible *selected = nsnull;
-  while ((selected = iter.GetNext()))
-    ++(*aSelectionCount);
-
+  if (IsDefunct() || !IsSelect())
+    return NS_ERROR_FAILURE;
+
+  *aSelectionCount = SelectedItemCount();
   return NS_OK;
 }
 
 NS_IMETHODIMP nsAccessible::AddChildToSelection(PRInt32 aIndex)
 {
-  // Tree views and other container widgets which may have grandchildren should
-  // implement a selection methods for their specific interfaces, because being
-  // able to deal with selection on a per-child basis would not be enough.
-
-  NS_ENSURE_TRUE(aIndex >= 0, NS_ERROR_FAILURE);
-
-  nsAccessible* child = GetChildAt(aIndex);
-  PRUint32 state = nsAccUtils::State(child);
-  if (!(state & nsIAccessibleStates::STATE_SELECTABLE)) {
-    return NS_OK;
-  }
-
-  return child->SetSelected(PR_TRUE);
+  if (IsDefunct() || !IsSelect())
+    return NS_ERROR_FAILURE;
+
+  return aIndex >= 0 && AddItemToSelection(aIndex) ?
+    NS_OK : NS_ERROR_INVALID_ARG;
 }
 
 NS_IMETHODIMP nsAccessible::RemoveChildFromSelection(PRInt32 aIndex)
 {
-  // Tree views and other container widgets which may have grandchildren should
-  // implement a selection methods for their specific interfaces, because being
-  // able to deal with selection on a per-child basis would not be enough.
-
-  NS_ENSURE_TRUE(aIndex >= 0, NS_ERROR_FAILURE);
-
-  nsAccessible* child = GetChildAt(aIndex);
-  PRUint32 state = nsAccUtils::State(child);
-  if (!(state & nsIAccessibleStates::STATE_SELECTED)) {
-    return NS_OK;
-  }
-
-  return child->SetSelected(PR_FALSE);
+  if (IsDefunct() || !IsSelect())
+    return NS_ERROR_FAILURE;
+
+  return aIndex >=0 && RemoveItemFromSelection(aIndex) ?
+    NS_OK : NS_ERROR_INVALID_ARG;
 }
 
 NS_IMETHODIMP nsAccessible::IsChildSelected(PRInt32 aIndex, PRBool *aIsSelected)
 {
-  // Tree views and other container widgets which may have grandchildren should
-  // implement a selection methods for their specific interfaces, because being
-  // able to deal with selection on a per-child basis would not be enough.
-
+  NS_ENSURE_ARG_POINTER(aIsSelected);
   *aIsSelected = PR_FALSE;
+
+  if (IsDefunct() || !IsSelect())
+    return NS_ERROR_FAILURE;
+
   NS_ENSURE_TRUE(aIndex >= 0, NS_ERROR_FAILURE);
 
-  nsAccessible* child = GetChildAt(aIndex);
-  PRUint32 state = nsAccUtils::State(child);
-  if (state & nsIAccessibleStates::STATE_SELECTED) {
-    *aIsSelected = PR_TRUE;
-  }
+  *aIsSelected = IsItemSelected(aIndex);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsAccessible::ClearSelection()
 {
-  AccIterator iter(this, filters::GetSelected, AccIterator::eTreeNav);
-  nsAccessible *selected = nsnull;
-  while ((selected = iter.GetNext()))
-    selected->SetSelected(PR_FALSE);
-
+  if (IsDefunct() || !IsSelect())
+    return NS_ERROR_FAILURE;
+
+  UnselectAll();
   return NS_OK;
 }
 
-NS_IMETHODIMP nsAccessible::SelectAllSelection(PRBool *_retval)
+NS_IMETHODIMP
+nsAccessible::SelectAllSelection(PRBool* aIsMultiSelect)
 {
-  AccIterator iter(this, filters::GetSelectable, AccIterator::eTreeNav);
-  nsAccessible *selectable = nsnull;
-  while((selectable = iter.GetNext()))
-    selectable->SetSelected(PR_TRUE);
-
+  NS_ENSURE_ARG_POINTER(aIsMultiSelect);
+  *aIsMultiSelect = PR_FALSE;
+
+  if (IsDefunct() || !IsSelect())
+    return NS_ERROR_FAILURE;
+
+  *aIsMultiSelect = SelectAll();
   return NS_OK;
 }
 
 // nsIAccessibleHyperLink
 // Because of new-atk design, any embedded object in text can implement
 // nsIAccessibleHyperLink, which helps determine where it is located
 // within containing text
 
@@ -3028,16 +2995,148 @@ nsAccessible::GetAnchorURI(PRUint32 aAnc
               document ? document->GetDocumentCharacterSet().get() : nsnull,
               baseURI);
     return anchorURI;
   }
 
   return nsnull;
 }
 
+
+////////////////////////////////////////////////////////////////////////////////
+// SelectAccessible
+
+bool
+nsAccessible::IsSelect()
+{
+  // If we have an ARIA role attribute present and the role allows multi
+  // selectable state, then we need to support SelectAccessible interface. If
+  // either attribute (role or multiselectable) change, then we'll destroy this
+  // accessible so that we can follow COM identity rules.
+
+  return mRoleMapEntry &&
+    (mRoleMapEntry->attributeMap1 == eARIAMultiSelectable ||
+     mRoleMapEntry->attributeMap2 == eARIAMultiSelectable ||
+     mRoleMapEntry->attributeMap3 == eARIAMultiSelectable);
+}
+
+already_AddRefed<nsIArray>
+nsAccessible::SelectedItems()
+{
+  nsCOMPtr<nsIMutableArray> selectedItems = do_CreateInstance(NS_ARRAY_CONTRACTID);
+  if (!selectedItems)
+    return nsnull;
+
+  AccIterator iter(this, filters::GetSelected, AccIterator::eTreeNav);
+  nsIAccessible* selected = nsnull;
+  while ((selected = iter.GetNext()))
+    selectedItems->AppendElement(selected, PR_FALSE);
+
+  nsIMutableArray* items = nsnull;
+  selectedItems.forget(&items);
+  return items;
+}
+
+PRUint32
+nsAccessible::SelectedItemCount()
+{
+  PRUint32 count = 0;
+  AccIterator iter(this, filters::GetSelected, AccIterator::eTreeNav);
+  nsAccessible* selected = nsnull;
+  while ((selected = iter.GetNext()))
+    ++count;
+
+  return count;
+}
+
+nsAccessible*
+nsAccessible::GetSelectedItem(PRUint32 aIndex)
+{
+  AccIterator iter(this, filters::GetSelected, AccIterator::eTreeNav);
+  nsAccessible* selected = nsnull;
+
+  PRUint32 index = 0;
+  while ((selected = iter.GetNext()) && index < aIndex)
+    index++;
+
+  return selected;
+}
+
+bool
+nsAccessible::IsItemSelected(PRUint32 aIndex)
+{
+  PRUint32 index = 0;
+  AccIterator iter(this, filters::GetSelectable, AccIterator::eTreeNav);
+  nsAccessible* selected = nsnull;
+  while ((selected = iter.GetNext()) && index < aIndex)
+    index++;
+
+  return selected &&
+    nsAccUtils::State(selected) & nsIAccessibleStates::STATE_SELECTED;
+}
+
+bool
+nsAccessible::AddItemToSelection(PRUint32 aIndex)
+{
+  PRUint32 index = 0;
+  AccIterator iter(this, filters::GetSelectable, AccIterator::eTreeNav);
+  nsAccessible* selected = nsnull;
+  while ((selected = iter.GetNext()) && index < aIndex)
+    index++;
+
+  if (selected)
+    selected->SetSelected(PR_TRUE);
+
+  return static_cast<bool>(selected);
+}
+
+bool
+nsAccessible::RemoveItemFromSelection(PRUint32 aIndex)
+{
+  PRUint32 index = 0;
+  AccIterator iter(this, filters::GetSelectable, AccIterator::eTreeNav);
+  nsAccessible* selected = nsnull;
+  while ((selected = iter.GetNext()) && index < aIndex)
+    index++;
+
+  if (selected)
+    selected->SetSelected(PR_FALSE);
+
+  return static_cast<bool>(selected);
+}
+
+bool
+nsAccessible::SelectAll()
+{
+  bool success = false;
+  nsAccessible* selectable = nsnull;
+
+  AccIterator iter(this, filters::GetSelectable, AccIterator::eTreeNav);
+  while((selectable = iter.GetNext())) {
+    success = true;
+    selectable->SetSelected(PR_TRUE);
+  }
+  return success;
+}
+
+bool
+nsAccessible::UnselectAll()
+{
+  bool success = false;
+  nsAccessible* selected = nsnull;
+
+  AccIterator iter(this, filters::GetSelected, AccIterator::eTreeNav);
+  while ((selected = iter.GetNext())) {
+    success = true;
+    selected->SetSelected(PR_FALSE);
+  }
+  return success;
+}
+
+
 ////////////////////////////////////////////////////////////////////////////////
 // nsAccessible protected methods
 
 void
 nsAccessible::CacheChildren()
 {
   nsAccTreeWalker walker(mWeakShell, mContent, GetAllowsAnonChildAccessibles());
 
--- a/accessible/src/base/nsAccessible.h
+++ b/accessible/src/base/nsAccessible.h
@@ -365,16 +365,65 @@ public:
    */
   virtual nsAccessible* GetAnchor(PRUint32 aAnchorIndex);
 
   /**
    * Returns an anchor URI at the given index.
    */
   virtual already_AddRefed<nsIURI> GetAnchorURI(PRUint32 aAnchorIndex);
 
+  //////////////////////////////////////////////////////////////////////////////
+  // SelectAccessible
+
+  /**
+   * Return true if the accessible is a select control containing selectable
+   * items.
+   */
+  virtual bool IsSelect();
+
+  /**
+   * Return an array of selected items.
+   */
+  virtual already_AddRefed<nsIArray> SelectedItems();
+
+  /**
+   * Return the number of selected items.
+   */
+  virtual PRUint32 SelectedItemCount();
+
+  /**
+   * Return selected item at the given index.
+   */
+  virtual nsAccessible* GetSelectedItem(PRUint32 aIndex);
+
+  /**
+   * Determine if item at the given index is selected.
+   */
+  virtual bool IsItemSelected(PRUint32 aIndex);
+
+  /**
+   * Add item at the given index the selection. Return true if success.
+   */
+  virtual bool AddItemToSelection(PRUint32 aIndex);
+
+  /**
+   * Remove item at the given index from the selection. Return if success.
+   */
+  virtual bool RemoveItemFromSelection(PRUint32 aIndex);
+
+  /**
+   * Select all items. Return true if success.
+   */
+  virtual bool SelectAll();
+
+  /**
+   * Unselect all items. Return true if success.
+   */
+  virtual bool UnselectAll();
+
 protected:
 
   //////////////////////////////////////////////////////////////////////////////
   // Initializing, cache and tree traverse methods
 
   /**
    * Cache accessible children.
    */
--- a/accessible/src/base/nsDocAccessible.cpp
+++ b/accessible/src/base/nsDocAccessible.cpp
@@ -1169,17 +1169,17 @@ nsDocAccessible::ARIAAttributeChanged(ns
             eCaseMatters)))) {
     FireDelayedAccessibleEvent(nsIAccessibleEvent::EVENT_VALUE_CHANGE,
                                aContent);
     return;
   }
 
   if (aAttribute == nsAccessibilityAtoms::aria_multiselectable &&
       aContent->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::role)) {
-    // This affects whether the accessible supports nsIAccessibleSelectable.
+    // This affects whether the accessible supports SelectAccessible.
     // COM says we cannot change what interfaces are supported on-the-fly,
     // so invalidate this object. A new one will be created on demand.
     InvalidateCacheSubtree(aContent,
                            nsIAccessibilityService::NODE_SIGNIFICANT_CHANGE);
     return;
   }
 }
 
--- a/accessible/src/html/nsHTMLSelectAccessible.cpp
+++ b/accessible/src/html/nsHTMLSelectAccessible.cpp
@@ -52,273 +52,33 @@
 #include "nsIDOMHTMLInputElement.h"
 #include "nsIDOMHTMLOptGroupElement.h"
 #include "nsIDOMHTMLSelectElement.h"
 #include "nsIListControlFrame.h"
 #include "nsIServiceManager.h"
 #include "nsIMutableArray.h"
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsHTMLSelectableAccessible
-////////////////////////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////////////////////////
-// nsHTMLSelectableAccessible::iterator
-
-nsHTMLSelectableAccessible::iterator::iterator(nsHTMLSelectableAccessible *aParent, nsIWeakReference *aWeakShell): 
-  mWeakShell(aWeakShell), mParentSelect(aParent)
-{
-  mLength = mIndex = 0;
-  mSelCount = 0;
-
-  nsCOMPtr<nsIDOMHTMLSelectElement> htmlSelect =
-    do_QueryInterface(mParentSelect->mContent);
-  if (htmlSelect) {
-    htmlSelect->GetOptions(getter_AddRefs(mOptions));
-    if (mOptions)
-      mOptions->GetLength(&mLength);
-  }
-}
-
-PRBool nsHTMLSelectableAccessible::iterator::Advance() 
-{
-  if (mIndex < mLength) {
-    nsCOMPtr<nsIDOMNode> tempNode;
-    if (mOptions) {
-      mOptions->Item(mIndex, getter_AddRefs(tempNode));
-      mOption = do_QueryInterface(tempNode);
-    }
-    mIndex++;
-    return PR_TRUE;
-  }
-  return PR_FALSE;
-}
-
-void nsHTMLSelectableAccessible::iterator::CalcSelectionCount(PRInt32 *aSelectionCount)
-{
-  PRBool isSelected = PR_FALSE;
-
-  if (mOption)
-    mOption->GetSelected(&isSelected);
-
-  if (isSelected)
-    (*aSelectionCount)++;
-}
-
-void
-nsHTMLSelectableAccessible::iterator::AddAccessibleIfSelected(nsIMutableArray *aSelectedAccessibles, 
-                                                              nsPresContext *aContext)
-{
-  PRBool isSelected = PR_FALSE;
-  nsAccessible *optionAcc = nsnull;
-
-  if (mOption) {
-    mOption->GetSelected(&isSelected);
-    if (isSelected) {
-      nsCOMPtr<nsIContent> optionContent(do_QueryInterface(mOption));
-      optionAcc = GetAccService()->GetAccessibleInWeakShell(optionContent,
-                                                            mWeakShell);
-    }
-  }
-
-  if (optionAcc)
-    aSelectedAccessibles->AppendElement(static_cast<nsIAccessible*>(optionAcc),
-                                        PR_FALSE);
-}
-
-PRBool
-nsHTMLSelectableAccessible::iterator::GetAccessibleIfSelected(PRInt32 aIndex,
-                                                              nsPresContext *aContext, 
-                                                              nsIAccessible **aAccessible)
-{
-  PRBool isSelected = PR_FALSE;
-
-  *aAccessible = nsnull;
-
-  if (mOption) {
-    mOption->GetSelected(&isSelected);
-    if (isSelected) {
-      if (mSelCount == aIndex) {
-        nsCOMPtr<nsIContent> optionContent(do_QueryInterface(mOption));
-        nsAccessible *accessible =
-          GetAccService()->GetAccessibleInWeakShell(optionContent, mWeakShell);
-        NS_IF_ADDREF(*aAccessible = accessible);
-
-        return PR_TRUE;
-      }
-      mSelCount++;
-    }
-  }
-
-  return PR_FALSE;
-}
-
-void nsHTMLSelectableAccessible::iterator::Select(PRBool aSelect)
-{
-  if (mOption)
-    mOption->SetSelected(aSelect);
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// nsHTMLSelectableAccessible
-
-nsHTMLSelectableAccessible::
-  nsHTMLSelectableAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
-  nsAccessibleWrap(aContent, aShell)
-{
-}
-
-NS_IMPL_ISUPPORTS_INHERITED1(nsHTMLSelectableAccessible, nsAccessible, nsIAccessibleSelectable)
-
-// Helper methods
-NS_IMETHODIMP nsHTMLSelectableAccessible::ChangeSelection(PRInt32 aIndex, PRUint8 aMethod, PRBool *aSelState)
-{
-  *aSelState = PR_FALSE;
-
-  nsCOMPtr<nsIDOMHTMLSelectElement> htmlSelect(do_QueryInterface(mContent));
-  if (!htmlSelect)
-    return NS_ERROR_FAILURE;
-
-  nsCOMPtr<nsIDOMHTMLOptionsCollection> options;
-  htmlSelect->GetOptions(getter_AddRefs(options));
-  if (!options)
-    return NS_ERROR_FAILURE;
-
-  nsCOMPtr<nsIDOMNode> tempNode;
-  options->Item(aIndex, getter_AddRefs(tempNode));
-  nsCOMPtr<nsIDOMHTMLOptionElement> tempOption(do_QueryInterface(tempNode));
-  if (!tempOption)
-    return NS_ERROR_FAILURE;
-
-  tempOption->GetSelected(aSelState);
-  nsresult rv = NS_OK;
-  if (eSelection_Add == aMethod && !(*aSelState))
-    rv = tempOption->SetSelected(PR_TRUE);
-  else if (eSelection_Remove == aMethod && (*aSelState))
-    rv = tempOption->SetSelected(PR_FALSE);
-  return rv;
-}
-
-// Interface methods
-NS_IMETHODIMP nsHTMLSelectableAccessible::GetSelectedChildren(nsIArray **_retval)
-{
-  *_retval = nsnull;
-
-  nsCOMPtr<nsIMutableArray> selectedAccessibles =
-    do_CreateInstance(NS_ARRAY_CONTRACTID);
-  NS_ENSURE_STATE(selectedAccessibles);
-  
-  nsPresContext *context = GetPresContext();
-  if (!context)
-    return NS_ERROR_FAILURE;
-
-  nsHTMLSelectableAccessible::iterator iter(this, mWeakShell);
-  while (iter.Advance())
-    iter.AddAccessibleIfSelected(selectedAccessibles, context);
-
-  PRUint32 uLength = 0;
-  selectedAccessibles->GetLength(&uLength); 
-  if (uLength != 0) { // length of nsIArray containing selected options
-    *_retval = selectedAccessibles;
-    NS_ADDREF(*_retval);
-  }
-  return NS_OK;
-}
-
-// return the nth selected child's nsIAccessible object
-NS_IMETHODIMP nsHTMLSelectableAccessible::RefSelection(PRInt32 aIndex, nsIAccessible **_retval)
-{
-  *_retval = nsnull;
-
-  nsPresContext *context = GetPresContext();
-  if (!context)
-    return NS_ERROR_FAILURE;
-
-  nsHTMLSelectableAccessible::iterator iter(this, mWeakShell);
-  while (iter.Advance())
-    if (iter.GetAccessibleIfSelected(aIndex, context, _retval))
-      return NS_OK;
-  
-  // No matched item found
-  return NS_ERROR_FAILURE;
-}
-
-NS_IMETHODIMP nsHTMLSelectableAccessible::GetSelectionCount(PRInt32 *aSelectionCount)
-{
-  *aSelectionCount = 0;
-
-  nsHTMLSelectableAccessible::iterator iter(this, mWeakShell);
-  while (iter.Advance())
-    iter.CalcSelectionCount(aSelectionCount);
-  return NS_OK;
-}
-
-NS_IMETHODIMP nsHTMLSelectableAccessible::AddChildToSelection(PRInt32 aIndex)
-{
-  PRBool isSelected;
-  return ChangeSelection(aIndex, eSelection_Add, &isSelected);
-}
-
-NS_IMETHODIMP nsHTMLSelectableAccessible::RemoveChildFromSelection(PRInt32 aIndex)
-{
-  PRBool isSelected;
-  return ChangeSelection(aIndex, eSelection_Remove, &isSelected);
-}
-
-NS_IMETHODIMP nsHTMLSelectableAccessible::IsChildSelected(PRInt32 aIndex, PRBool *_retval)
-{
-  *_retval = PR_FALSE;
-  return ChangeSelection(aIndex, eSelection_GetState, _retval);
-}
-
-NS_IMETHODIMP nsHTMLSelectableAccessible::ClearSelection()
-{
-  nsHTMLSelectableAccessible::iterator iter(this, mWeakShell);
-  while (iter.Advance())
-    iter.Select(PR_FALSE);
-  return NS_OK;
-}
-
-NS_IMETHODIMP nsHTMLSelectableAccessible::SelectAllSelection(PRBool *_retval)
-{
-  *_retval = PR_FALSE;
-  
-  nsCOMPtr<nsIDOMHTMLSelectElement> htmlSelect(do_QueryInterface(mContent));
-  if (!htmlSelect)
-    return NS_ERROR_FAILURE;
-
-  htmlSelect->GetMultiple(_retval);
-  if (*_retval) {
-    nsHTMLSelectableAccessible::iterator iter(this, mWeakShell);
-    while (iter.Advance())
-      iter.Select(PR_TRUE);
-  }
-  return NS_OK;
-}
-
-
-////////////////////////////////////////////////////////////////////////////////
 // nsHTMLSelectListAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 nsHTMLSelectListAccessible::
   nsHTMLSelectListAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
-  nsHTMLSelectableAccessible(aContent, aShell)
+  nsAccessibleWrap(aContent, aShell)
 {
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsHTMLSelectListAccessible: nsAccessible public
 
 nsresult
 nsHTMLSelectListAccessible::GetStateInternal(PRUint32 *aState,
                                              PRUint32 *aExtraState)
 {
-  nsresult rv = nsHTMLSelectableAccessible::GetStateInternal(aState,
-                                                             aExtraState);
+  nsresult rv = nsAccessibleWrap::GetStateInternal(aState, aExtraState);
   NS_ENSURE_A11Y_SUCCESS(rv, rv);
 
   // As a nsHTMLSelectListAccessible we can have the following states:
   //   nsIAccessibleStates::STATE_MULTISELECTABLE
   //   nsIAccessibleStates::STATE_EXTSELECTABLE
 
   nsCOMPtr<nsIDOMHTMLSelectElement> select(do_QueryInterface(mContent));
   if (select) {
@@ -348,16 +108,43 @@ nsHTMLSelectListAccessible::GetRoleInter
     *aRole = nsIAccessibleRole::ROLE_COMBOBOX_LIST;
   else
     *aRole = nsIAccessibleRole::ROLE_LISTBOX;
 
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
+// nsHTMLSelectListAccessible: SelectAccessible
+
+bool
+nsHTMLSelectListAccessible::IsSelect()
+{
+  return true;
+}
+
+bool
+nsHTMLSelectListAccessible::SelectAll()
+{
+  nsCOMPtr<nsIDOMHTMLSelectElement> selectElm(do_QueryInterface(mContent));
+  PRBool isMultiple = PR_FALSE;
+  selectElm->GetMultiple(&isMultiple);
+  return isMultiple ? nsAccessibleWrap::SelectAll() : false;
+}
+
+bool
+nsHTMLSelectListAccessible::UnselectAll()
+{
+  nsCOMPtr<nsIDOMHTMLSelectElement> selectElm(do_QueryInterface(mContent));
+  PRBool isMultiple = PR_FALSE;
+  selectElm->GetMultiple(&isMultiple);
+  return isMultiple ? nsAccessibleWrap::UnselectAll() : false;
+}
+
+////////////////////////////////////////////////////////////////////////////////
 // nsHTMLSelectListAccessible: nsAccessible protected
 
 void
 nsHTMLSelectListAccessible::CacheChildren()
 {
   // Cache accessibles for <optgroup> and <option> DOM decendents as children,
   // as well as the accessibles for them. Avoid whitespace text nodes. We want
   // to count all the <optgroup>s and <option>s as children because we want
@@ -671,16 +458,26 @@ NS_IMETHODIMP nsHTMLSelectOptionAccessib
       }
     }
     return NS_OK;
   }
 
   return NS_ERROR_INVALID_ARG;
 }
 
+NS_IMETHODIMP
+nsHTMLSelectOptionAccessible::SetSelected(PRBool aSelect)
+{
+  if (IsDefunct())
+    return NS_ERROR_FAILURE;
+
+  nsCOMPtr<nsIDOMHTMLOptionElement> optionElm(do_QueryInterface(mContent));
+  return optionElm->SetSelected(aSelect);
+}
+
 ////////////////////////////////////////////////////////////////////////////////
 // nsHTMLSelectOptionAccessible: static methods
 
 /**
   * Helper method for getting the focused DOM Node from our parent(list) node. We
   *  need to use the frame to get the focused option because for some reason we
   *  weren't getting the proper notification when the focus changed using the DOM
   */
--- a/accessible/src/html/nsHTMLSelectAccessible.h
+++ b/accessible/src/html/nsHTMLSelectAccessible.h
@@ -34,17 +34,16 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 #ifndef __nsHTMLSelectAccessible_h__
 #define __nsHTMLSelectAccessible_h__
 
-#include "nsIAccessibleSelectable.h"
 #include "nsAccessibilityAtoms.h"
 #include "nsHTMLFormControlAccessible.h"
 #include "nsIDOMHTMLOptionsCollection.h"
 #include "nsIDOMHTMLOptionElement.h"
 #include "nsIDOMNode.h"
 
 class nsIMutableArray;
 
@@ -58,78 +57,35 @@ class nsIMutableArray;
   *        - nsHTMLSelectOptionAccessible
   *
   *  Comboboxes:
   *     - nsHTMLComboboxAccessible
   *        - nsHTMLComboboxListAccessible  [ inserted in accessible tree ]
   *           - nsHTMLSelectOptionAccessible(s)
   */
 
-/** ------------------------------------------------------ */
-/**  First, the common widgets                             */
-/** ------------------------------------------------------ */
-
-/*
- * The HTML implementation of nsIAccessibleSelectable.
- */
-class nsHTMLSelectableAccessible : public nsAccessibleWrap
-{
-public:
-
-  NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_NSIACCESSIBLESELECTABLE
-
-  nsHTMLSelectableAccessible(nsIContent *aContent, nsIWeakReference *aShell);
-  virtual ~nsHTMLSelectableAccessible() {}
-
-protected:
-
-  NS_IMETHOD ChangeSelection(PRInt32 aIndex, PRUint8 aMethod, PRBool *aSelState);
-
-  class iterator 
-  {
-  protected:
-    PRUint32 mLength;
-    PRUint32 mIndex;
-    PRInt32 mSelCount;
-    nsCOMPtr<nsIDOMHTMLOptionsCollection> mOptions;
-    nsCOMPtr<nsIDOMHTMLOptionElement> mOption;
-    nsCOMPtr<nsIWeakReference> mWeakShell;
-    nsHTMLSelectableAccessible *mParentSelect;
-
-  public:
-    iterator(nsHTMLSelectableAccessible *aParent, nsIWeakReference *aWeakShell);
-
-    void CalcSelectionCount(PRInt32 *aSelectionCount);
-    void Select(PRBool aSelect);
-    void AddAccessibleIfSelected(nsIMutableArray *aSelectedAccessibles, 
-                                 nsPresContext *aContext);
-    PRBool GetAccessibleIfSelected(PRInt32 aIndex, nsPresContext *aContext,
-                                   nsIAccessible **aAccessible);
-
-    PRBool Advance();
-  };
-
-  friend class iterator;
-};
-
 /*
  * The list that contains all the options in the select.
  */
-class nsHTMLSelectListAccessible : public nsHTMLSelectableAccessible
+class nsHTMLSelectListAccessible : public nsAccessibleWrap
 {
 public:
   
   nsHTMLSelectListAccessible(nsIContent *aContent, nsIWeakReference *aShell);
   virtual ~nsHTMLSelectListAccessible() {}
 
   // nsAccessible
   virtual nsresult GetRoleInternal(PRUint32 *aRole);
   virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
 
+  // SelectAccessible
+  virtual bool IsSelect();
+  virtual bool SelectAll();
+  virtual bool UnselectAll();
+
 protected:
 
   // nsAccessible
   virtual void CacheChildren();
 
   // nsHTMLSelectListAccessible
 
   /**
@@ -148,16 +104,17 @@ public:
   
   nsHTMLSelectOptionAccessible(nsIContent *aContent, nsIWeakReference *aShell);
   virtual ~nsHTMLSelectOptionAccessible() {}
 
   // nsIAccessible
   NS_IMETHOD DoAction(PRUint8 index);
   NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
   NS_IMETHOD GetNumActions(PRUint8 *_retval);
+  NS_IMETHOD SetSelected(PRBool aSelect);
 
   // nsAccessible
   virtual nsresult GetNameInternal(nsAString& aName);
   virtual nsresult GetRoleInternal(PRUint32 *aRole);
   virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
 
   virtual PRInt32 GetLevelInternal();
   virtual void GetPositionAndSizeInternal(PRInt32 *aPosInSet,
--- a/accessible/src/msaa/nsAccessibleWrap.cpp
+++ b/accessible/src/msaa/nsAccessibleWrap.cpp
@@ -39,17 +39,16 @@
 #include "nsAccessibleWrap.h"
 
 #include "nsAccessibilityAtoms.h"
 #include "nsAccUtils.h"
 #include "nsCoreUtils.h"
 #include "nsRelUtils.h"
 
 #include "nsIAccessibleDocument.h"
-#include "nsIAccessibleSelectable.h"
 #include "nsIAccessibleEvent.h"
 #include "nsIAccessibleWin32Object.h"
 
 #include "Accessible2_i.c"
 #include "AccessibleStates.h"
 
 #include "nsIMutableArray.h"
 #include "nsIDOMDocument.h"
@@ -692,17 +691,17 @@ AccessibleEnumerator::Skip(unsigned long
   mCurIndex += celt;
 } __except(nsAccessNodeWrap::FilterA11yExceptions(::GetExceptionCode(), GetExceptionInformation())) { }
   return S_OK;
 }
 
 /**
   * This method is called when a client wants to know which children of a node
   *  are selected. Note that this method can only find selected children for
-  *  nsIAccessible object which implement nsIAccessibleSelectable.
+  *  nsIAccessible object which implement SelectAccessible.
   *
   * The VARIANT return value arguement is expected to either contain a single IAccessible
   *  or an IEnumVARIANT of IAccessibles. We return the IEnumVARIANT regardless of the number
   *  of children selected, unless there are none selected in which case we return an empty
   *  VARIANT.
   *
   * We get the selected options from the select's accessible object and wrap
   *  those in an AccessibleEnumerator which we then put in the return VARIANT.
@@ -712,27 +711,22 @@ AccessibleEnumerator::Skip(unsigned long
   *  - the object is not the type that can have children selected
   */
 STDMETHODIMP nsAccessibleWrap::get_accSelection(VARIANT __RPC_FAR *pvarChildren)
 {
 __try {
   VariantInit(pvarChildren);
   pvarChildren->vt = VT_EMPTY;
 
-  nsCOMPtr<nsIAccessibleSelectable> 
-    select(do_QueryInterface(static_cast<nsIAccessible*>(this)));
-
-  if (select) {  // do we have an nsIAccessibleSelectable?
-    // we have an accessible that can have children selected
-    nsCOMPtr<nsIArray> selectedOptions;
-    // gets the selected options as nsIAccessibles.
-    select->GetSelectedChildren(getter_AddRefs(selectedOptions));
-    if (selectedOptions) { // false if the select has no children or none are selected
+  if (IsSelect()) {
+    nsCOMPtr<nsIArray> selectedItems = SelectedItems();
+    if (selectedItems) {
       // 1) Create and initialize the enumeration
-      nsRefPtr<AccessibleEnumerator> pEnum = new AccessibleEnumerator(selectedOptions);
+      nsRefPtr<AccessibleEnumerator> pEnum =
+        new AccessibleEnumerator(selectedItems);
 
       // 2) Put the enumerator in the VARIANT
       if (!pEnum)
         return E_OUTOFMEMORY;
       pvarChildren->vt = VT_UNKNOWN;    // this must be VT_UNKNOWN for an IEnumVARIANT
       NS_ADDREF(pvarChildren->punkVal = pEnum);
     }
   }
--- a/accessible/src/xforms/nsXFormsAccessible.cpp
+++ b/accessible/src/xforms/nsXFormsAccessible.cpp
@@ -311,290 +311,247 @@ nsXFormsEditableAccessible::GetStateInte
 
 NS_IMETHODIMP
 nsXFormsEditableAccessible::GetAssociatedEditor(nsIEditor **aEditor)
 {
   nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mContent));
   return sXFormsService->GetEditor(DOMNode, aEditor);
 }
 
+////////////////////////////////////////////////////////////////////////////////
 // nsXFormsSelectableAccessible
-
-
-NS_IMPL_ISUPPORTS_INHERITED1(nsXFormsSelectableAccessible,
-                             nsXFormsEditableAccessible,
-                             nsIAccessibleSelectable)
+////////////////////////////////////////////////////////////////////////////////
 
 nsXFormsSelectableAccessible::
   nsXFormsSelectableAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
   nsXFormsEditableAccessible(aContent, aShell), mIsSelect1Element(nsnull)
 {
   mIsSelect1Element =
     mContent->NodeInfo()->Equals(nsAccessibilityAtoms::select1);
 }
 
-NS_IMETHODIMP
-nsXFormsSelectableAccessible::GetSelectedChildren(nsIArray **aAccessibles)
+bool
+nsXFormsSelectableAccessible::IsSelect()
 {
-  NS_ENSURE_ARG_POINTER(aAccessibles);
+  return true;
+}
 
-  *aAccessibles = nsnull;
-
-  nsCOMPtr<nsIMutableArray> accessibles =
+already_AddRefed<nsIArray>
+nsXFormsSelectableAccessible::SelectedItems()
+{
+  nsCOMPtr<nsIMutableArray> selectedItems =
     do_CreateInstance(NS_ARRAY_CONTRACTID);
-  NS_ENSURE_TRUE(accessibles, NS_ERROR_OUT_OF_MEMORY);
+  if (!selectedItems)
+    return nsnull;
 
   nsresult rv;
   nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mContent));
 
   if (mIsSelect1Element) {
-    nsCOMPtr<nsIDOMNode> item;
+    nsCOMPtr<nsIDOMNode> itemDOMNode;
     rv = sXFormsService->GetSelectedItemForSelect1(DOMNode,
-                                                   getter_AddRefs(item));
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    if (!item)
-      return NS_OK;
+                                                   getter_AddRefs(itemDOMNode));
+    if (NS_FAILED(rv) || !itemDOMNode)
+      return nsnull;
 
-    nsCOMPtr<nsIAccessible> accessible;
-    GetAccService()->GetAccessibleFor(item, getter_AddRefs(accessible));
-    NS_ENSURE_TRUE(accessible, NS_ERROR_FAILURE);
+    nsCOMPtr<nsINode> itemNode(do_QueryInterface(itemDOMNode));
+    nsIAccessible* item = GetAccService()->GetAccessibleInWeakShell(itemNode,
+                                                                    mWeakShell);
+    if (item)
+      selectedItems->AppendElement(item, PR_FALSE);
 
-    accessibles->AppendElement(accessible, PR_FALSE);
-    NS_ADDREF(*aAccessibles = accessibles);
-    return NS_OK;
+    nsIMutableArray* items = nsnull;
+    selectedItems.forget(&items);
+    return items;
   }
 
-  nsCOMPtr<nsIDOMNodeList> items;
+  nsCOMPtr<nsIDOMNodeList> itemNodeList;
   rv = sXFormsService->GetSelectedItemsForSelect(DOMNode,
-                                                 getter_AddRefs(items));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  if (!items)
-    return NS_OK;
+                                                 getter_AddRefs(itemNodeList));
+  if (NS_FAILED(rv) || !itemNodeList)
+    return nsnull;
 
   PRUint32 length = 0;
-  items->GetLength(&length);
-  if (!length)
-    return NS_OK;
-
+  itemNodeList->GetLength(&length);
   for (PRUint32 index = 0; index < length; index++) {
-    nsCOMPtr<nsIDOMNode> item;
-    items->Item(index, getter_AddRefs(item));
-    NS_ENSURE_TRUE(item, NS_ERROR_FAILURE);
+    nsCOMPtr<nsIDOMNode> itemDOMNode;
+    itemNodeList->Item(index, getter_AddRefs(itemDOMNode));
+    if (!itemDOMNode)
+      return nsnull;
 
-    nsCOMPtr<nsIAccessible> accessible;
-    GetAccService()->GetAccessibleFor(item, getter_AddRefs(accessible));
-    NS_ENSURE_TRUE(accessible, NS_ERROR_FAILURE);
-
-    accessibles->AppendElement(accessible, PR_FALSE);
+    nsCOMPtr<nsINode> itemNode(do_QueryInterface(itemDOMNode));
+    nsIAccessible* item = GetAccService()->GetAccessibleInWeakShell(itemNode,
+                                                                    mWeakShell);
+    if (item)
+      selectedItems->AppendElement(item, PR_FALSE);
   }
 
-  NS_ADDREF(*aAccessibles = accessibles);
-  return NS_OK;
+  nsIMutableArray* items = nsnull;
+  selectedItems.forget(&items);
+  return items;
 }
 
-NS_IMETHODIMP
-nsXFormsSelectableAccessible::GetSelectionCount(PRInt32 *aCount)
+PRUint32
+nsXFormsSelectableAccessible::SelectedItemCount()
 {
-  NS_ENSURE_ARG_POINTER(aCount);
-
-  *aCount = 0;
-
   nsresult rv;
   nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mContent));
 
   if (mIsSelect1Element) {
     nsCOMPtr<nsIDOMNode> item;
     rv = sXFormsService->GetSelectedItemForSelect1(DOMNode,
                                                    getter_AddRefs(item));
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    if (item)
-      *aCount = 1;
-
-    return NS_OK;
+    return NS_SUCCEEDED(rv) && item ? 1 : 0;
   }
 
-  nsCOMPtr<nsIDOMNodeList> items;
+  nsCOMPtr<nsIDOMNodeList> itemNodeList;
   rv = sXFormsService->GetSelectedItemsForSelect(DOMNode,
-                                                 getter_AddRefs(items));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  if (!items)
-    return NS_OK;
+                                                 getter_AddRefs(itemNodeList));
+  if (NS_FAILED(rv) || !itemNodeList)
+    return 0;
 
   PRUint32 length = 0;
-  items->GetLength(&length);
-  if (length)
-    *aCount = length;
-
-  return NS_OK;
+  itemNodeList->GetLength(&length);
+  return length;
 }
 
-NS_IMETHODIMP
-nsXFormsSelectableAccessible::AddChildToSelection(PRInt32 aIndex)
+bool
+nsXFormsSelectableAccessible::AddItemToSelection(PRUint32 aIndex)
 {
-  nsCOMPtr<nsIDOMNode> item = GetItemByIndex(&aIndex);
-  if (!item)
-    return NS_OK;
+  nsCOMPtr<nsIDOMNode> itemDOMNode(do_QueryInterface(GetItemByIndex(&aIndex)));
+  if (!itemDOMNode)
+    return false;
 
   nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mContent));
   if (mIsSelect1Element)
-    return sXFormsService->SetSelectedItemForSelect1(DOMNode, item);
+    sXFormsService->SetSelectedItemForSelect1(DOMNode, itemDOMNode);
+  else
+    sXFormsService->AddItemToSelectionForSelect(DOMNode, itemDOMNode);
 
-  return sXFormsService->AddItemToSelectionForSelect(DOMNode, item);
+  return true;
 }
 
-NS_IMETHODIMP
-nsXFormsSelectableAccessible::RemoveChildFromSelection(PRInt32 aIndex)
+bool
+nsXFormsSelectableAccessible::RemoveItemFromSelection(PRUint32 aIndex)
 {
-  nsCOMPtr<nsIDOMNode> item = GetItemByIndex(&aIndex);
-  if (!item)
-    return NS_OK;
+  nsCOMPtr<nsIDOMNode> itemDOMNode(do_QueryInterface(GetItemByIndex(&aIndex)));
+  if (!itemDOMNode)
+    return false;
 
   nsresult rv;
   nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mContent));
   if (mIsSelect1Element) {
-    nsCOMPtr<nsIDOMNode> selitem;
-    rv = sXFormsService->GetSelectedItemForSelect1(DOMNode,
-                                                   getter_AddRefs(selitem));
-    NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
+    nsCOMPtr<nsIDOMNode> selItemDOMNode;
+    sXFormsService->GetSelectedItemForSelect1(DOMNode,
+                                              getter_AddRefs(selItemDOMNode));
+    if (selItemDOMNode == itemDOMNode)
+      sXFormsService->SetSelectedItemForSelect1(DOMNode, nsnull);
 
-    if (selitem != item)
-      return NS_ERROR_FAILURE;
-    return sXFormsService->SetSelectedItemForSelect1(DOMNode, nsnull);
+    return true;
   }
 
-  return sXFormsService->RemoveItemFromSelectionForSelect(DOMNode, item);
+  sXFormsService->RemoveItemFromSelectionForSelect(DOMNode, itemDOMNode);
+  return true;
 }
 
-NS_IMETHODIMP
-nsXFormsSelectableAccessible::RefSelection(PRInt32 aIndex,
-                                           nsIAccessible **aAccessible)
+nsAccessible*
+nsXFormsSelectableAccessible::GetSelectedItem(PRUint32 aIndex)
 {
-  NS_ENSURE_ARG_POINTER(aAccessible);
-  *aAccessible = nsnull;
-
   nsresult rv;
   nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mContent));
   if (mIsSelect1Element) {
     if (aIndex != 0)
-      return NS_OK;
+      return nsnull;
 
-    nsCOMPtr<nsIDOMNode> item;
+    nsCOMPtr<nsIDOMNode> itemDOMNode;
     rv = sXFormsService->GetSelectedItemForSelect1(DOMNode,
-                                                   getter_AddRefs(item));
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    if (item)
-      return GetAccService()->GetAccessibleFor(item, aAccessible);
-    return NS_OK;
+                                                   getter_AddRefs(itemDOMNode));
+    if (NS_SUCCEEDED(rv) && itemDOMNode) {
+      nsCOMPtr<nsINode> itemNode(do_QueryInterface(itemDOMNode));
+      return GetAccService()->GetAccessibleInWeakShell(itemNode, mWeakShell);
+    }
+    return nsnull;
   }
 
-  nsCOMPtr<nsIDOMNodeList> items;
+  nsCOMPtr<nsIDOMNodeList> itemNodeList;
   rv = sXFormsService->GetSelectedItemsForSelect(DOMNode,
-                                                 getter_AddRefs(items));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  if (!items)
-    return NS_OK;
+                                                 getter_AddRefs(itemNodeList));
+  if (NS_FAILED(rv) || !itemNodeList)
+    return nsnull;
 
-  PRUint32 length = 0;
-  items->GetLength(&length);
-  if (aIndex < 0 || PRUint32(aIndex) >= length)
-    return NS_OK;
+  nsCOMPtr<nsIDOMNode> itemDOMNode;
+  itemNodeList->Item(aIndex, getter_AddRefs(itemDOMNode));
 
-  nsCOMPtr<nsIDOMNode> item;
-  items->Item(aIndex, getter_AddRefs(item));
-
-  nsCOMPtr<nsIAccessible> accessible;
-  return GetAccService()->GetAccessibleFor(item, getter_AddRefs(accessible));
+  nsCOMPtr<nsINode> itemNode(do_QueryInterface(itemDOMNode));
+  return GetAccService()->GetAccessibleInWeakShell(itemNode, mWeakShell);
 }
 
-NS_IMETHODIMP
-nsXFormsSelectableAccessible::IsChildSelected(PRInt32 aIndex,
-                                              PRBool *aIsSelected)
+bool
+nsXFormsSelectableAccessible::IsItemSelected(PRUint32 aIndex)
 {
-  NS_ENSURE_ARG_POINTER(aIsSelected);
-  *aIsSelected = PR_FALSE;
-
-  nsCOMPtr<nsIDOMNode> item = GetItemByIndex(&aIndex);
-  if (!item)
-    return NS_OK;
+  nsCOMPtr<nsIDOMNode> itemDOMNode(do_QueryInterface(GetItemByIndex(&aIndex)));
+  if (!itemDOMNode)
+    return false;
 
   nsresult rv;
   nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mContent));
   if (mIsSelect1Element) {
-    nsCOMPtr<nsIDOMNode> selitem;
-    rv = sXFormsService->GetSelectedItemForSelect1(DOMNode,
-                                                   getter_AddRefs(selitem));
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    if (selitem == item)
-      *aIsSelected = PR_TRUE;
-    return NS_OK;
+    nsCOMPtr<nsIDOMNode> selItemDOMNode;
+    sXFormsService->GetSelectedItemForSelect1(DOMNode,
+                                              getter_AddRefs(selItemDOMNode));
+    return selItemDOMNode == itemDOMNode;
   }
 
-  return sXFormsService->IsSelectItemSelected(DOMNode, item, aIsSelected);
+  PRBool isSelected = PR_FALSE;
+  sXFormsService->IsSelectItemSelected(DOMNode, itemDOMNode, &isSelected);
+  return isSelected;
 }
 
-NS_IMETHODIMP
-nsXFormsSelectableAccessible::ClearSelection()
+bool
+nsXFormsSelectableAccessible::UnselectAll()
 {
   nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mContent));
   if (mIsSelect1Element)
-    return sXFormsService->SetSelectedItemForSelect1(DOMNode, nsnull);
+    sXFormsService->SetSelectedItemForSelect1(DOMNode, nsnull);
 
-  return sXFormsService->ClearSelectionForSelect(DOMNode);
+  sXFormsService->ClearSelectionForSelect(DOMNode);
+  return true;
 }
 
-NS_IMETHODIMP
-nsXFormsSelectableAccessible::SelectAllSelection(PRBool *aMultipleSelection)
+bool
+nsXFormsSelectableAccessible::SelectAll()
 {
-  NS_ENSURE_ARG_POINTER(aMultipleSelection);
+  if (mIsSelect1Element)
+    return false;
 
-  if (mIsSelect1Element) {
-    *aMultipleSelection = PR_FALSE;
-    return NS_OK;
-  }
-
-  *aMultipleSelection = PR_TRUE;
   nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mContent));
-  return sXFormsService->SelectAllItemsForSelect(DOMNode);
+  sXFormsService->SelectAllItemsForSelect(DOMNode);
+  return true;
 }
 
-already_AddRefed<nsIDOMNode>
-nsXFormsSelectableAccessible::GetItemByIndex(PRInt32 *aIndex,
-                                             nsIAccessible *aAccessible)
+nsIContent*
+nsXFormsSelectableAccessible::GetItemByIndex(PRUint32* aIndex,
+                                             nsAccessible* aAccessible)
 {
-  nsRefPtr<nsAccessible> accessible(do_QueryObject(aAccessible));
-  if (!accessible)
-    accessible = this;
-
+  nsAccessible* accessible = aAccessible ? aAccessible : this;
   PRInt32 childCount = accessible->GetChildCount();
   for (PRInt32 childIdx = 0; childIdx < childCount; childIdx++) {
     nsAccessible *child = accessible->GetChildAt(childIdx);
-
-    nsCOMPtr<nsIDOMNode> childNode(child->GetDOMNode());
-    nsCOMPtr<nsIContent> childContent(do_QueryInterface(childNode));
-    if (!childContent)
-      continue;
-
+    nsIContent* childContent = child->GetContent();
     nsINodeInfo *nodeInfo = childContent->NodeInfo();
     if (nodeInfo->NamespaceEquals(NS_LITERAL_STRING(NS_NAMESPACE_XFORMS))) {
       if (nodeInfo->Equals(nsAccessibilityAtoms::item)) {
         if (!*aIndex)
-          return childNode.forget();
+          return childContent;
 
         --*aIndex;
       } else if (nodeInfo->Equals(nsAccessibilityAtoms::choices)) {
-        nsIDOMNode *itemNode = GetItemByIndex(aIndex, child).get();
-        if (itemNode)
-          return itemNode;
+        nsIContent* itemContent = GetItemByIndex(aIndex, child);
+        if (itemContent)
+          return itemContent;
       }
     }
   }
 
   return nsnull;
 }
 
 
--- a/accessible/src/xforms/nsXFormsAccessible.h
+++ b/accessible/src/xforms/nsXFormsAccessible.h
@@ -157,22 +157,31 @@ public:
  * The class is base for accessible objects for XForms select and XForms
  * select1 elements.
  */
 class nsXFormsSelectableAccessible : public nsXFormsEditableAccessible
 {
 public:
   nsXFormsSelectableAccessible(nsIContent *aContent, nsIWeakReference *aShell);
 
-  NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_NSIACCESSIBLESELECTABLE
+  // SelectAccessible
+  virtual bool IsSelect();
+  virtual already_AddRefed<nsIArray> SelectedItems();
+  virtual PRUint32 SelectedItemCount();
+  virtual nsAccessible* GetSelectedItem(PRUint32 aIndex);
+  virtual bool IsItemSelected(PRUint32 aIndex);
+  virtual bool AddItemToSelection(PRUint32 aIndex);
+  virtual bool RemoveItemFromSelection(PRUint32 aIndex);
+  virtual bool SelectAll();
+  virtual bool UnselectAll();
 
 protected:
-  already_AddRefed<nsIDOMNode> GetItemByIndex(PRInt32 *aIndex,
-                                              nsIAccessible *aAccessible = nsnull);
+  nsIContent* GetItemByIndex(PRUint32* aIndex,
+                             nsAccessible* aAccessible = nsnull);
+
   PRBool mIsSelect1Element;
 };
 
 
 /**
  * The class is base for accessible objects for XForms item elements.
  */
 class nsXFormsSelectableItemAccessible : public nsXFormsAccessible
--- a/accessible/src/xul/nsXULListboxAccessible.cpp
+++ b/accessible/src/xul/nsXULListboxAccessible.cpp
@@ -874,17 +874,16 @@ nsXULListitemAccessible::
   nsXULMenuitemAccessible(aContent, aShell)
 {
   mIsCheckbox = mContent->AttrValueIs(kNameSpaceID_None,
                                       nsAccessibilityAtoms::type,
                                       nsAccessibilityAtoms::checkbox,
                                       eCaseMatters);
 }
 
-/** Inherit the ISupports impl from nsAccessible, we handle nsIAccessibleSelectable */
 NS_IMPL_ISUPPORTS_INHERITED0(nsXULListitemAccessible, nsAccessible)
 
 nsAccessible *
 nsXULListitemAccessible::GetListAccessible()
 {
   if (IsDefunct())
     return nsnull;
   
--- a/accessible/src/xul/nsXULMenuAccessible.cpp
+++ b/accessible/src/xul/nsXULMenuAccessible.cpp
@@ -60,209 +60,217 @@
 
 
 static NS_DEFINE_CID(kLookAndFeelCID, NS_LOOKANDFEEL_CID);
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULSelectableAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
-// Helper methos
 nsXULSelectableAccessible::
   nsXULSelectableAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
   nsAccessibleWrap(aContent, aShell)
 {
   mSelectControl = do_QueryInterface(aContent);
 }
 
-NS_IMPL_ISUPPORTS_INHERITED1(nsXULSelectableAccessible, nsAccessible, nsIAccessibleSelectable)
+////////////////////////////////////////////////////////////////////////////////
+// nsXULSelectableAccessible: nsAccessNode
 
 void
 nsXULSelectableAccessible::Shutdown()
 {
   mSelectControl = nsnull;
   nsAccessibleWrap::Shutdown();
 }
 
-nsresult nsXULSelectableAccessible::ChangeSelection(PRInt32 aIndex, PRUint8 aMethod, PRBool *aSelState)
-{
-  *aSelState = PR_FALSE;
-
-  if (!mSelectControl) {
-    return NS_ERROR_FAILURE;
-  }
-  nsAccessible* child = GetChildAt(aIndex);
-  NS_ENSURE_TRUE(child, NS_ERROR_FAILURE);
-
-  nsCOMPtr<nsIDOMNode> childNode;
-  child->GetDOMNode(getter_AddRefs(childNode));
-  nsCOMPtr<nsIDOMXULSelectControlItemElement> item(do_QueryInterface(childNode));
-  NS_ENSURE_TRUE(item, NS_ERROR_FAILURE);
+////////////////////////////////////////////////////////////////////////////////
+// nsXULSelectableAccessible: SelectAccessible
 
-  item->GetSelected(aSelState);
-  if (eSelection_GetState == aMethod) {
-    return NS_OK;
-  }
-
-  nsCOMPtr<nsIDOMXULMultiSelectControlElement> xulMultiSelect =
-    do_QueryInterface(mSelectControl);
-
-  if (eSelection_Add == aMethod && !(*aSelState)) {
-    return xulMultiSelect ? xulMultiSelect->AddItemToSelection(item) :
-                            mSelectControl->SetSelectedItem(item);
-  }
-  if (eSelection_Remove == aMethod && (*aSelState)) {
-    return xulMultiSelect ? xulMultiSelect->RemoveItemFromSelection(item) :
-                            mSelectControl->SetSelectedItem(nsnull);
-  }
-  return NS_ERROR_FAILURE;
+bool
+nsXULSelectableAccessible::IsSelect()
+{
+  return !!mSelectControl;
 }
 
 // Interface methods
-NS_IMETHODIMP nsXULSelectableAccessible::GetSelectedChildren(nsIArray **aChildren)
+already_AddRefed<nsIArray>
+nsXULSelectableAccessible::SelectedItems()
 {
-  *aChildren = nsnull;
-  if (!mSelectControl) {
-    return NS_ERROR_FAILURE;
-  }
-
-  nsCOMPtr<nsIMutableArray> selectedAccessibles =
+  nsCOMPtr<nsIMutableArray> selectedItems =
     do_CreateInstance(NS_ARRAY_CONTRACTID);
-  NS_ENSURE_STATE(selectedAccessibles);
+  if (!selectedItems)
+    return nsnull;
 
   // For XUL multi-select control
   nsCOMPtr<nsIDOMXULMultiSelectControlElement> xulMultiSelect =
     do_QueryInterface(mSelectControl);
   if (xulMultiSelect) {
     PRInt32 length = 0;
     xulMultiSelect->GetSelectedCount(&length);
     for (PRInt32 index = 0; index < length; index++) {
-      nsCOMPtr<nsIDOMXULSelectControlItemElement> selectedItem;
-      xulMultiSelect->GetSelectedItem(index, getter_AddRefs(selectedItem));
-      nsCOMPtr<nsIContent> selectedContent(do_QueryInterface(selectedItem));
-      nsAccessible *selectedAcc =
-        GetAccService()->GetAccessibleInWeakShell(selectedContent, mWeakShell);
-      if (selectedAcc)
-        selectedAccessibles->AppendElement(static_cast<nsIAccessible*>(selectedAcc),
-                                           PR_FALSE);
+      nsCOMPtr<nsIDOMXULSelectControlItemElement> itemElm;
+      xulMultiSelect->GetSelectedItem(index, getter_AddRefs(itemElm));
+      nsCOMPtr<nsINode> itemNode(do_QueryInterface(itemElm));
+      nsAccessible* item =
+        GetAccService()->GetAccessibleInWeakShell(itemNode, mWeakShell);
+      if (item)
+        selectedItems->AppendElement(static_cast<nsIAccessible*>(item),
+                                     PR_FALSE);
     }
   }
   else {  // Single select?
-    nsCOMPtr<nsIDOMXULSelectControlItemElement> selectedItem;
-    mSelectControl->GetSelectedItem(getter_AddRefs(selectedItem));
-    nsCOMPtr<nsIContent> selectedContent(do_QueryInterface(selectedItem));
-    if(selectedContent) {
-      nsAccessible *selectedAcc =
-        GetAccService()->GetAccessibleInWeakShell(selectedContent, mWeakShell);
-      if (selectedAcc)
-        selectedAccessibles->AppendElement(static_cast<nsIAccessible*>(selectedAcc),
-                                           PR_FALSE);
+    nsCOMPtr<nsIDOMXULSelectControlItemElement> itemElm;
+    mSelectControl->GetSelectedItem(getter_AddRefs(itemElm));
+    nsCOMPtr<nsINode> itemNode(do_QueryInterface(itemElm));
+    if(itemNode) {
+      nsAccessible* item =
+        GetAccService()->GetAccessibleInWeakShell(itemNode, mWeakShell);
+      if (item)
+        selectedItems->AppendElement(static_cast<nsIAccessible*>(item),
+                                     PR_FALSE);
     }
   }
 
-  PRUint32 uLength = 0;
-  selectedAccessibles->GetLength(&uLength);
-  if (uLength != 0) { // length of nsIArray containing selected options
-    NS_ADDREF(*aChildren = selectedAccessibles);
-  }
-
-  return NS_OK;
+  nsIMutableArray* items = nsnull;
+  selectedItems.forget(&items);
+  return items;
 }
 
-// return the nth selected child's nsIAccessible object
-NS_IMETHODIMP nsXULSelectableAccessible::RefSelection(PRInt32 aIndex, nsIAccessible **aAccessible)
+nsAccessible*
+nsXULSelectableAccessible::GetSelectedItem(PRUint32 aIndex)
 {
-  *aAccessible = nsnull;
-  if (!mSelectControl) {
-    return NS_ERROR_FAILURE;
-  }
-
-  nsCOMPtr<nsIDOMXULSelectControlItemElement> selectedItem;
-  nsCOMPtr<nsIDOMXULMultiSelectControlElement> xulMultiSelect =
+  nsCOMPtr<nsIDOMXULMultiSelectControlElement> multiSelectControl =
     do_QueryInterface(mSelectControl);
-  if (xulMultiSelect)
-    xulMultiSelect->GetSelectedItem(aIndex, getter_AddRefs(selectedItem));
 
-  if (aIndex == 0)
-    mSelectControl->GetSelectedItem(getter_AddRefs(selectedItem));
-
-  if (!selectedItem)
-    return NS_ERROR_FAILURE;
+  nsCOMPtr<nsIDOMXULSelectControlItemElement> itemElm;
+  if (multiSelectControl)
+    multiSelectControl->GetSelectedItem(aIndex, getter_AddRefs(itemElm));
+  else if (aIndex == 0)
+    mSelectControl->GetSelectedItem(getter_AddRefs(itemElm));
 
-  nsCOMPtr<nsIContent> selectedContent(do_QueryInterface(selectedItem));
-  nsAccessible *selectedAcc =
-    GetAccService()->GetAccessibleInWeakShell(selectedContent, mWeakShell);
-  if (!selectedAcc)
-    return NS_ERROR_FAILURE;
-
-  NS_ADDREF(*aAccessible = selectedAcc);
-  return NS_OK;
+  nsCOMPtr<nsINode> itemNode(do_QueryInterface(itemElm));
+  return itemNode ?
+    GetAccService()->GetAccessibleInWeakShell(itemNode, mWeakShell) : nsnull;
 }
 
-NS_IMETHODIMP nsXULSelectableAccessible::GetSelectionCount(PRInt32 *aSelectionCount)
+PRUint32
+nsXULSelectableAccessible::SelectedItemCount()
 {
-  *aSelectionCount = 0;
-  if (!mSelectControl) {
-    return NS_ERROR_FAILURE;
+  // For XUL multi-select control
+  nsCOMPtr<nsIDOMXULMultiSelectControlElement> multiSelectControl =
+    do_QueryInterface(mSelectControl);
+  if (multiSelectControl) {
+    PRInt32 count = 0;
+    multiSelectControl->GetSelectedCount(&count);
+    return count;
   }
 
-  // For XUL multi-select control
-  nsCOMPtr<nsIDOMXULMultiSelectControlElement> xulMultiSelect =
-    do_QueryInterface(mSelectControl);
-  if (xulMultiSelect)
-    return xulMultiSelect->GetSelectedCount(aSelectionCount);
-
   // For XUL single-select control/menulist
   PRInt32 index;
   mSelectControl->GetSelectedIndex(&index);
-  if (index >= 0)
-    *aSelectionCount = 1;
-  return NS_OK;
-}
-
-NS_IMETHODIMP nsXULSelectableAccessible::AddChildToSelection(PRInt32 aIndex)
-{
-  PRBool isSelected;
-  return ChangeSelection(aIndex, eSelection_Add, &isSelected);
+  return (index >= 0) ? 1 : 0;
 }
 
-NS_IMETHODIMP nsXULSelectableAccessible::RemoveChildFromSelection(PRInt32 aIndex)
+bool
+nsXULSelectableAccessible::AddItemToSelection(PRUint32 aIndex)
 {
-  PRBool isSelected;
-  return ChangeSelection(aIndex, eSelection_Remove, &isSelected);
-}
+  nsAccessible* item = GetChildAt(aIndex);
+  if (!item)
+    return false;
+
+  nsCOMPtr<nsIDOMXULSelectControlItemElement> itemElm =
+    do_QueryInterface(item->GetContent());
+  if (!itemElm)
+    return false;
 
-NS_IMETHODIMP nsXULSelectableAccessible::IsChildSelected(PRInt32 aIndex, PRBool *aIsSelected)
-{
-  *aIsSelected = PR_FALSE;
-  return ChangeSelection(aIndex, eSelection_GetState, aIsSelected);
+  PRBool isItemSelected = PR_FALSE;
+  itemElm->GetSelected(&isItemSelected);
+  if (isItemSelected)
+    return true;
+
+  nsCOMPtr<nsIDOMXULMultiSelectControlElement> multiSelectControl =
+    do_QueryInterface(mSelectControl);
+
+  if (multiSelectControl)
+    multiSelectControl->AddItemToSelection(itemElm);
+  else
+    mSelectControl->SetSelectedItem(itemElm);
+
+  return true;
 }
 
-NS_IMETHODIMP nsXULSelectableAccessible::ClearSelection()
+bool
+nsXULSelectableAccessible::RemoveItemFromSelection(PRUint32 aIndex)
 {
-  if (!mSelectControl) {
-    return NS_ERROR_FAILURE;
-  }
-  nsCOMPtr<nsIDOMXULMultiSelectControlElement> xulMultiSelect =
+  nsAccessible* item = GetChildAt(aIndex);
+  if (!item)
+    return false;
+
+  nsCOMPtr<nsIDOMXULSelectControlItemElement> itemElm =
+      do_QueryInterface(item->GetContent());
+  if (!itemElm)
+    return false;
+
+  PRBool isItemSelected = PR_FALSE;
+  itemElm->GetSelected(&isItemSelected);
+  if (!isItemSelected)
+    return true;
+
+  nsCOMPtr<nsIDOMXULMultiSelectControlElement> multiSelectControl =
     do_QueryInterface(mSelectControl);
-  return xulMultiSelect ? xulMultiSelect->ClearSelection() : mSelectControl->SetSelectedIndex(-1);
+
+  if (multiSelectControl)
+    multiSelectControl->RemoveItemFromSelection(itemElm);
+  else
+    mSelectControl->SetSelectedItem(nsnull);
+
+  return true;
 }
 
-NS_IMETHODIMP nsXULSelectableAccessible::SelectAllSelection(PRBool *aSucceeded)
+bool
+nsXULSelectableAccessible::IsItemSelected(PRUint32 aIndex)
 {
-  *aSucceeded = PR_TRUE;
+  nsAccessible* item = GetChildAt(aIndex);
+  if (!item)
+    return false;
+
+  nsCOMPtr<nsIDOMXULSelectControlItemElement> itemElm =
+    do_QueryInterface(item->GetContent());
+  if (!itemElm)
+    return false;
+
+  PRBool isItemSelected = PR_FALSE;
+  itemElm->GetSelected(&isItemSelected);
+  return isItemSelected;
+}
 
-  nsCOMPtr<nsIDOMXULMultiSelectControlElement> xulMultiSelect =
+bool
+nsXULSelectableAccessible::UnselectAll()
+{
+  nsCOMPtr<nsIDOMXULMultiSelectControlElement> multiSelectControl =
     do_QueryInterface(mSelectControl);
-  if (xulMultiSelect)
-    return xulMultiSelect->SelectAll();
+  multiSelectControl ?
+    multiSelectControl->ClearSelection() : mSelectControl->SetSelectedIndex(-1);
+
+  return true;
+}
+
+bool
+nsXULSelectableAccessible::SelectAll()
+{
+  nsCOMPtr<nsIDOMXULMultiSelectControlElement> multiSelectControl =
+    do_QueryInterface(mSelectControl);
+  if (multiSelectControl) {
+    multiSelectControl->SelectAll();
+    return true;
+  }
 
   // otherwise, don't support this method
-  *aSucceeded = PR_FALSE;
-  return NS_ERROR_NOT_IMPLEMENTED;
+  return false;
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULMenuitemAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 nsXULMenuitemAccessible::
--- a/accessible/src/xul/nsXULMenuAccessible.h
+++ b/accessible/src/xul/nsXULMenuAccessible.h
@@ -35,37 +35,42 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef _nsXULMenuAccessible_H_
 #define _nsXULMenuAccessible_H_
 
 #include "nsAccessibleWrap.h"
-#include "nsIAccessibleSelectable.h"
 #include "nsIDOMXULSelectCntrlEl.h"
 
 /**
- * The basic implementation of nsIAccessibleSelectable.
+ * The basic implementation of SelectAccessible for XUL select controls.
  */
 class nsXULSelectableAccessible : public nsAccessibleWrap
 {
 public:
-  NS_DECL_ISUPPORTS_INHERITED
-  NS_DECL_NSIACCESSIBLESELECTABLE
-
   nsXULSelectableAccessible(nsIContent *aContent, nsIWeakReference *aShell);
   virtual ~nsXULSelectableAccessible() {}
 
   // nsAccessNode
   virtual void Shutdown();
 
+  // SelectAccessible
+  virtual bool IsSelect();
+  virtual already_AddRefed<nsIArray> SelectedItems();
+  virtual PRUint32 SelectedItemCount();
+  virtual nsAccessible* GetSelectedItem(PRUint32 aIndex);
+  virtual bool IsItemSelected(PRUint32 aIndex);
+  virtual bool AddItemToSelection(PRUint32 aIndex);
+  virtual bool RemoveItemFromSelection(PRUint32 aIndex);
+  virtual bool SelectAll();
+  virtual bool UnselectAll();
+
 protected:
-  nsresult ChangeSelection(PRInt32 aIndex, PRUint8 aMethod, PRBool *aSelState);
-
   // nsIDOMXULMultiSelectControlElement inherits from this, so we'll always have
   // one of these if the widget is valid and not defunct
   nsCOMPtr<nsIDOMXULSelectControlElement> mSelectControl;
 };
 
 /**
  * Used for XUL menu, menuitem elements.
  */
--- a/accessible/src/xul/nsXULTreeAccessible.cpp
+++ b/accessible/src/xul/nsXULTreeAccessible.cpp
@@ -52,17 +52,17 @@
 #include "nsComponentManagerUtils.h"
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULTreeAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 nsXULTreeAccessible::
   nsXULTreeAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
-  nsXULSelectableAccessible(aContent, aShell)
+  nsAccessibleWrap(aContent, aShell)
 {
   mTree = nsCoreUtils::GetTreeBoxObject(aContent);
   if (mTree)
     mTree->GetView(getter_AddRefs(mTreeView));
 
   NS_ASSERTION(mTree && mTreeView, "Can't get mTree or mTreeView!\n");
 
   mAccessibleCache.Init(kDefaultTreeCacheSize);
@@ -80,20 +80,20 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsXULTreeAccessible,
                                                 nsAccessible)
 ClearCache(tmp->mAccessibleCache);
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsXULTreeAccessible)
 NS_INTERFACE_MAP_STATIC_AMBIGUOUS(nsXULTreeAccessible)
-NS_INTERFACE_MAP_END_INHERITING(nsXULSelectableAccessible)
+NS_INTERFACE_MAP_END_INHERITING(nsAccessible)
 
-NS_IMPL_ADDREF_INHERITED(nsXULTreeAccessible, nsXULSelectableAccessible)
-NS_IMPL_RELEASE_INHERITED(nsXULTreeAccessible, nsXULSelectableAccessible)
+NS_IMPL_ADDREF_INHERITED(nsXULTreeAccessible, nsAccessible)
+NS_IMPL_RELEASE_INHERITED(nsXULTreeAccessible, nsAccessible)
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULTreeAccessible: nsAccessible implementation
 
 nsresult
 nsXULTreeAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState)
 {
   // Get focus status from base class.
@@ -155,32 +155,32 @@ nsXULTreeAccessible::GetValue(nsAString&
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULTreeAccessible: nsAccessNode implementation
 
 PRBool
 nsXULTreeAccessible::IsDefunct()
 {
-  return nsXULSelectableAccessible::IsDefunct() || !mTree || !mTreeView;
+  return nsAccessibleWrap::IsDefunct() || !mTree || !mTreeView;
 }
 
 void
 nsXULTreeAccessible::Shutdown()
 {
   // XXX: we don't remove accessible from document cache if shutdown wasn't
   // initiated by document destroying. Note, we can't remove accessible from
   // document cache here while document is going to be shutdown. Note, this is
   // not unique place where we have similar problem.
   ClearCache(mAccessibleCache);
 
   mTree = nsnull;
   mTreeView = nsnull;
 
-  nsXULSelectableAccessible::Shutdown();
+  nsAccessibleWrap::Shutdown();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULTreeAccessible: nsAccessible implementation (put methods here)
 
 nsresult
 nsXULTreeAccessible::GetRoleInternal(PRUint32 *aRole)
 {
@@ -257,191 +257,183 @@ nsXULTreeAccessible::GetChildAtPoint(PRI
   nsCOMPtr<nsITreeColumn> column;
   nsCAutoString childEltUnused;
   mTree->GetCellAt(clientX, clientY, &row, getter_AddRefs(column),
                    childEltUnused);
 
   // If we failed to find tree cell for the given point then it might be
   // tree columns.
   if (row == -1 || !column)
-    return nsXULSelectableAccessible::
-      GetChildAtPoint(aX, aY, aDeepestChild, aChild);
+    return nsAccessibleWrap::GetChildAtPoint(aX, aY, aDeepestChild, aChild);
 
   nsAccessible *child = GetTreeItemAccessible(row);
   if (aDeepestChild && child) {
     // Look for accessible cell for the found item accessible.
     nsRefPtr<nsXULTreeItemAccessibleBase> treeitem = do_QueryObject(child);
 
     nsAccessible *cell = treeitem->GetCellAccessible(column);
     if (cell)
       child = cell;
   }
 
   NS_IF_ADDREF(*aChild = child);
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-// nsXULTreeAccessible: nsAccessibleSelectable implementation
+// nsXULTreeAccessible: SelectAccessible
 
-NS_IMETHODIMP nsXULTreeAccessible::GetSelectedChildren(nsIArray **_retval)
+bool
+nsXULTreeAccessible::IsSelect()
 {
-  // Ask tree selection to get all selected children
-  *_retval = nsnull;
+  return true;
+}
 
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
+already_AddRefed<nsIArray>
+nsXULTreeAccessible::SelectedItems()
+{
   nsCOMPtr<nsITreeSelection> selection;
   mTreeView->GetSelection(getter_AddRefs(selection));
   if (!selection)
-    return NS_ERROR_FAILURE;
-  nsCOMPtr<nsIMutableArray> selectedAccessibles =
+    return nsnull;
+
+  nsCOMPtr<nsIMutableArray> selectedItems =
     do_CreateInstance(NS_ARRAY_CONTRACTID);
-  NS_ENSURE_STATE(selectedAccessibles);
+  if (!selectedItems)
+    return nsnull;
 
   PRInt32 rowIndex, rowCount;
   PRBool isSelected;
   mTreeView->GetRowCount(&rowCount);
   for (rowIndex = 0; rowIndex < rowCount; rowIndex++) {
     selection->IsSelected(rowIndex, &isSelected);
     if (isSelected) {
-      nsIAccessible *tempAccessible = GetTreeItemAccessible(rowIndex);
-      NS_ENSURE_STATE(tempAccessible);
-
-      selectedAccessibles->AppendElement(tempAccessible, PR_FALSE);
+      nsIAccessible* item = GetTreeItemAccessible(rowIndex);
+      if (item)
+        selectedItems->AppendElement(item, PR_FALSE);
     }
   }
 
-  PRUint32 length;
-  selectedAccessibles->GetLength(&length);
-  if (length != 0) {
-    *_retval = selectedAccessibles;
-    NS_IF_ADDREF(*_retval);
-  }
-
-  return NS_OK;
+  nsIMutableArray* items = nsnull;
+  selectedItems.forget(&items);
+  return items;
 }
 
-NS_IMETHODIMP nsXULTreeAccessible::GetSelectionCount(PRInt32 *aSelectionCount)
+PRUint32
+nsXULTreeAccessible::SelectedItemCount()
 {
-  *aSelectionCount = 0;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
   nsCOMPtr<nsITreeSelection> selection;
   mTreeView->GetSelection(getter_AddRefs(selection));
-  if (selection)
-    selection->GetCount(aSelectionCount);
+  if (selection) {
+    PRInt32 count = 0;
+    selection->GetCount(&count);
+    return count;
+  }
 
-  return NS_OK;
+  return 0;
 }
 
-NS_IMETHODIMP nsXULTreeAccessible::ChangeSelection(PRInt32 aIndex, PRUint8 aMethod, PRBool *aSelState)
+bool
+nsXULTreeAccessible::AddItemToSelection(PRUint32 aIndex)
 {
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
   nsCOMPtr<nsITreeSelection> selection;
   mTreeView->GetSelection(getter_AddRefs(selection));
   if (selection) {
-    selection->IsSelected(aIndex, aSelState);
-    if ((!(*aSelState) && eSelection_Add == aMethod) || 
-        ((*aSelState) && eSelection_Remove == aMethod))
-      return selection->ToggleSelect(aIndex);
-  }
-
-  return NS_OK;
-}
+    PRBool isSelected = PR_FALSE;
+    selection->IsSelected(aIndex, &isSelected);
+    if (!isSelected)
+      selection->ToggleSelect(aIndex);
 
-NS_IMETHODIMP nsXULTreeAccessible::AddChildToSelection(PRInt32 aIndex)
-{
-  PRBool isSelected;
-  return ChangeSelection(aIndex, eSelection_Add, &isSelected);
-}
-
-NS_IMETHODIMP nsXULTreeAccessible::RemoveChildFromSelection(PRInt32 aIndex)
-{
-  PRBool isSelected;
-  return ChangeSelection(aIndex, eSelection_Remove, &isSelected);
+    return true;
+  }
+  return false;
 }
 
-NS_IMETHODIMP nsXULTreeAccessible::IsChildSelected(PRInt32 aIndex, PRBool *_retval)
+bool
+nsXULTreeAccessible::RemoveItemFromSelection(PRUint32 aIndex)
 {
-  return ChangeSelection(aIndex, eSelection_GetState, _retval);
-}
-
-NS_IMETHODIMP nsXULTreeAccessible::ClearSelection()
-{
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
   nsCOMPtr<nsITreeSelection> selection;
   mTreeView->GetSelection(getter_AddRefs(selection));
-  if (selection)
-    selection->ClearSelection();
+  if (selection) {
+    PRBool isSelected = PR_FALSE;
+    selection->IsSelected(aIndex, &isSelected);
+    if (isSelected)
+      selection->ToggleSelect(aIndex);
 
-  return NS_OK;
+    return true;
+  }
+  return false;
 }
 
-NS_IMETHODIMP
-nsXULTreeAccessible::RefSelection(PRInt32 aIndex, nsIAccessible **aAccessible)
+bool
+nsXULTreeAccessible::IsItemSelected(PRUint32 aIndex)
 {
-  NS_ENSURE_ARG_POINTER(aAccessible);
-  *aAccessible = nsnull;
+  nsCOMPtr<nsITreeSelection> selection;
+  mTreeView->GetSelection(getter_AddRefs(selection));
+  if (selection) {
+    PRBool isSelected = PR_FALSE;
+    selection->IsSelected(aIndex, &isSelected);
+    return isSelected;
+  }
+  return false;
+}
 
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
+bool
+nsXULTreeAccessible::UnselectAll()
+{
   nsCOMPtr<nsITreeSelection> selection;
   mTreeView->GetSelection(getter_AddRefs(selection));
   if (!selection)
-    return NS_ERROR_FAILURE;
+    return false;
+
+  selection->ClearSelection();
+  return true;
+}
+
+nsAccessible*
+nsXULTreeAccessible::GetSelectedItem(PRUint32 aIndex)
+{
+  nsCOMPtr<nsITreeSelection> selection;
+  mTreeView->GetSelection(getter_AddRefs(selection));
+  if (!selection)
+    return nsnull;
 
   PRInt32 rowIndex, rowCount;
   PRInt32 selCount = 0;
   PRBool isSelected;
   mTreeView->GetRowCount(&rowCount);
   for (rowIndex = 0; rowIndex < rowCount; rowIndex++) {
     selection->IsSelected(rowIndex, &isSelected);
     if (isSelected) {
-      if (selCount == aIndex) {
-        NS_IF_ADDREF(*aAccessible = GetTreeItemAccessible(rowIndex));
-        return NS_OK;
-      }
+      if (selCount == aIndex)
+        return GetTreeItemAccessible(rowIndex);
+
       selCount++;
     }
   }
 
-  return NS_OK;
+  return nsnull;
 }
 
-NS_IMETHODIMP
-nsXULTreeAccessible::SelectAllSelection(PRBool *aIsMultiSelectable)
+bool
+nsXULTreeAccessible::SelectAll()
 {
-  NS_ENSURE_ARG_POINTER(aIsMultiSelectable);
-  *aIsMultiSelectable = PR_FALSE;
-
-  if (IsDefunct())
-    return NS_ERROR_FAILURE;
-
   // see if we are multiple select if so set ourselves as such
   nsCOMPtr<nsITreeSelection> selection;
   mTreeView->GetSelection(getter_AddRefs(selection));
   if (selection) {
     PRBool single = PR_FALSE;
     selection->GetSingle(&single);
     if (!single) {
-      *aIsMultiSelectable = PR_TRUE;
       selection->SelectAll();
+      return true;
     }
   }
 
-  return NS_OK;
+  return false;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULTreeAccessible: nsAccessible implementation
 
 nsAccessible*
 nsXULTreeAccessible::GetChildAt(PRUint32 aIndex)
 {
--- a/accessible/src/xul/nsXULTreeAccessible.h
+++ b/accessible/src/xul/nsXULTreeAccessible.h
@@ -56,17 +56,17 @@ const PRUint32 kDefaultTreeCacheSize = 2
 #define NS_XULTREEACCESSIBLE_IMPL_CID                   \
 {  /* 2692e149-6176-42ee-b8e1-2c44b04185e3 */           \
   0x2692e149,                                           \
   0x6176,                                               \
   0x42ee,                                               \
   { 0xb8, 0xe1, 0x2c, 0x44, 0xb0, 0x41, 0x85, 0xe3 }    \
 }
 
-class nsXULTreeAccessible : public nsXULSelectableAccessible
+class nsXULTreeAccessible : public nsAccessibleWrap
 {
 public:
   using nsAccessible::GetChildCount;
   using nsAccessible::GetChildAt;
   using nsAccessible::GetChildAtPoint;
 
   nsXULTreeAccessible(nsIContent *aContent, nsIWeakReference *aShell);
 
@@ -74,33 +74,41 @@ public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsXULTreeAccessible,
                                            nsAccessible)
 
   // nsIAccessible
   NS_IMETHOD GetValue(nsAString& aValue);
   NS_IMETHOD GetFocusedChild(nsIAccessible **aFocusedChild);
 
-  // nsIAccessibleSelectable
-  NS_DECL_NSIACCESSIBLESELECTABLE
-
   // nsAccessNode
   virtual PRBool IsDefunct();
   virtual void Shutdown();
 
   // nsAccessible
   virtual nsresult GetRoleInternal(PRUint32 *aRole);
   virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
   virtual nsresult GetChildAtPoint(PRInt32 aX, PRInt32 aY,
                                    PRBool aDeepestChild,
                                    nsIAccessible **aChild);
 
   virtual nsAccessible* GetChildAt(PRUint32 aIndex);
   virtual PRInt32 GetChildCount();
 
+  // SelectAccessible
+  virtual bool IsSelect();
+  virtual already_AddRefed<nsIArray> SelectedItems();
+  virtual PRUint32 SelectedItemCount();
+  virtual nsAccessible* GetSelectedItem(PRUint32 aIndex);
+  virtual bool IsItemSelected(PRUint32 aIndex);
+  virtual bool AddItemToSelection(PRUint32 aIndex);
+  virtual bool RemoveItemFromSelection(PRUint32 aIndex);
+  virtual bool SelectAll();
+  virtual bool UnselectAll();
+
   // nsXULTreeAccessible
 
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_XULTREEACCESSIBLE_IMPL_CID)
 
   /**
    * Return tree item accessible at the givem row. If accessible doesn't exist
    * in the cache then create and cache it.
    *
@@ -139,18 +147,16 @@ protected:
   /**
    * Creates tree item accessible for the given row index.
    */
   virtual already_AddRefed<nsAccessible> CreateTreeItemAccessible(PRInt32 aRow);
 
   nsCOMPtr<nsITreeBoxObject> mTree;
   nsCOMPtr<nsITreeView> mTreeView;
   nsAccessibleHashtable mAccessibleCache;
-
-  NS_IMETHOD ChangeSelection(PRInt32 aIndex, PRUint8 aMethod, PRBool *aSelState);
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsXULTreeAccessible,
                               NS_XULTREEACCESSIBLE_IMPL_CID)
 
 /**
  * Base class for tree item accessibles.
  */
--- a/accessible/tests/mochitest/actions/test_anchors.html
+++ b/accessible/tests/mochitest/actions/test_anchors.html
@@ -8,21 +8,21 @@
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/events.js"></script>
+          src="../events.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/actions.js"></script>
+          src="../actions.js"></script>
 
   <script type="application/javascript">
     ////////////////////////////////////////////////////////////////////////////
     // Event checkers
 
     function scrollingChecker(aAcc)
     {
       this.type = EVENT_SCROLLING_START;
--- a/accessible/tests/mochitest/actions/test_aria.html
+++ b/accessible/tests/mochitest/actions/test_aria.html
@@ -7,21 +7,21 @@
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/events.js"></script>
+          src="../events.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/actions.js"></script>
+          src="../actions.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {
       var actionsArray = [
         {
           ID: "clickable",
           actionName: "click",
--- a/accessible/tests/mochitest/actions/test_general.html
+++ b/accessible/tests/mochitest/actions/test_general.html
@@ -7,21 +7,21 @@
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/events.js"></script>
+          src="../events.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/actions.js"></script>
+          src="../actions.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {
       var actionsArray = [
         {
           ID: "li_clickable1",
           actionName: "click",
--- a/accessible/tests/mochitest/actions/test_general.xul
+++ b/accessible/tests/mochitest/actions/test_general.xul
@@ -1,30 +1,30 @@
 <?xml version="1.0"?>
 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
                  type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/a11y/accessible/nsIAccessible_name.css"
+<?xml-stylesheet href="../nsIAccessible_name.css"
                  type="text/css"?>
 
 
 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         title="nsIAccessible actions testing">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js" />
+          src="../common.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/events.js" />
+          src="../events.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/actions.js" />
+          src="../actions.js" />
 
   <script type="application/javascript">
   <![CDATA[
     function doTest()
     {
       var actionsArray = [
         {
           ID: "menu",
--- a/accessible/tests/mochitest/actions/test_inputs.html
+++ b/accessible/tests/mochitest/actions/test_inputs.html
@@ -7,21 +7,21 @@
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/events.js"></script>
+          src="../events.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/actions.js"></script>
+          src="../actions.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {
       var actionsArray = [
         {
           ID: "button",
           actionName: "press",
--- a/accessible/tests/mochitest/actions/test_link.html
+++ b/accessible/tests/mochitest/actions/test_link.html
@@ -7,21 +7,21 @@
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/events.js"></script>
+          src="../events.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/actions.js"></script>
+          src="../actions.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {
       var actionsArray = [
         {
           ID: "link1",
           actionName: "jump",
@@ -79,21 +79,21 @@
     Mozilla Bug 423409
   </a>
   <p id="display"></p>
   <div id="content" style="display: none"></div>
   <pre id="test">
   </pre>
 
   <a href="http://mozilla.org" id="link1">
-    <img src="chrome://mochikit/content/a11y/accessible/moz.png" id="img1">
+    <img src="../moz.png" id="img1">
   </a>
   <a id="link2" onmousedown="">
-    <img src="chrome://mochikit/content/a11y/accessible/moz.png" id="img2">
+    <img src="../moz.png" id="img2">
   </a>
   <a id="link3" onclick="">
-    <img src="chrome://mochikit/content/a11y/accessible/moz.png" id="img3">
+    <img src="../moz.png" id="img3">
   </a>
   <a id="link4" onmouseup="">
-    <img src="chrome://mochikit/content/a11y/accessible/moz.png" id="img4">
+    <img src="../moz.png" id="img4">
   </a>
 </body>
 </html>
--- a/accessible/tests/mochitest/actions/test_tree.xul
+++ b/accessible/tests/mochitest/actions/test_tree.xul
@@ -7,26 +7,26 @@
         title="Accessible XUL tree actions tests">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js" />
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/treeview.js" />
+          src="../treeview.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js" />
+          src="../common.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/states.js" />
+          src="../states.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/events.js" />
+          src="../events.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/actions.js" />
+          src="../actions.js" />
 
   <script type="application/javascript">
   <![CDATA[
     ////////////////////////////////////////////////////////////////////////////
     // Accessible tree testers
 
     function focusChecker(aAcc, aStates)
     {
--- a/accessible/tests/mochitest/actions/test_treegrid.xul
+++ b/accessible/tests/mochitest/actions/test_treegrid.xul
@@ -1,34 +1,34 @@
 <?xml version="1.0"?>
 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
                  type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/a11y/accessible/treeview.css"
+<?xml-stylesheet href="../treeview.css"
                  type="text/css"?>
 
 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         title="Accessible XUL tree actions tests">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js" />
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/treeview.js" />
+          src="../treeview.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js" />
+          src="../common.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/states.js" />
+          src="../states.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/events.js" />
+          src="../events.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/actions.js" />
+          src="../actions.js" />
 
   <script type="application/javascript">
   <![CDATA[
     ////////////////////////////////////////////////////////////////////////////
     // Accessible tree testers
 
     function focusChecker(aAcc, aStates)
     {
--- a/accessible/tests/mochitest/attributes/test_obj.html
+++ b/accessible/tests/mochitest/attributes/test_obj.html
@@ -10,19 +10,19 @@ https://bugzilla.mozilla.org/show_bug.cg
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/attributes.js"></script>
+          src="../attributes.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {
       // aria
       testAttrs("atomic", {"atomic" : "true"}, true);
       testAttrs("autocomplete", {"autocomplete" : "true"}, true);
       testAttrs("checkbox", {"checkable" : "true"}, true); 
--- a/accessible/tests/mochitest/attributes/test_obj_css.html
+++ b/accessible/tests/mochitest/attributes/test_obj_css.html
@@ -9,19 +9,19 @@ https://bugzilla.mozilla.org/show_bug.cg
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/attributes.js"></script>
+          src="../attributes.js"></script>
 
   <script type="application/javascript">
     function testCSSAttrs(aID)
     {
       var node = document.getElementById(aID);
       var computedStyle = document.defaultView.getComputedStyle(node, "");
 
       var attrs = {
--- a/accessible/tests/mochitest/attributes/test_obj_group.html
+++ b/accessible/tests/mochitest/attributes/test_obj_group.html
@@ -6,19 +6,19 @@
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/attributes.js"></script>
+          src="../attributes.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {
       //////////////////////////////////////////////////////////////////////////
       // HTML select
       testGroupAttrs("opt1", 1, 2);
       testGroupAttrs("opt2", 2, 2);
--- a/accessible/tests/mochitest/attributes/test_obj_group.xul
+++ b/accessible/tests/mochitest/attributes/test_obj_group.xul
@@ -7,19 +7,19 @@
         title="Accessibility Group Attributes ('level', 'setsize', 'posinset') Test.">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js" />
+          src="../common.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/attributes.js" />
+          src="../attributes.js" />
 
   <script type="application/javascript">
   <![CDATA[
     function doTest()
     {
       //////////////////////////////////////////////////////////////////////////
       // xul:listbox (bug 417317)
       testGroupAttrs("item1", 1, 2);
--- a/accessible/tests/mochitest/attributes/test_obj_group_tree.xul
+++ b/accessible/tests/mochitest/attributes/test_obj_group_tree.xul
@@ -7,22 +7,22 @@
         title="Accessible XUL tree attributes tests">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js" />
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/treeview.js" />
+          src="../treeview.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js" />
+          src="../common.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/attributes.js" />
+          src="../attributes.js" />
 
   <script type="application/javascript">
   <![CDATA[
     ////////////////////////////////////////////////////////////////////////////
     // Test
 
     function doTestAttrs()
     {
--- a/accessible/tests/mochitest/attributes/test_text.html
+++ b/accessible/tests/mochitest/attributes/test_text.html
@@ -5,21 +5,21 @@
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/attributes.js"></script>
+          src="../attributes.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/events.js"></script>
+          src="../events.js"></script>
 
   <script type="application/javascript">
 
     const nsIDOMNSEditableElement =
       Components.interfaces.nsIDOMNSEditableElement;
 
     var gComputedStyle = null;
 
--- a/accessible/tests/mochitest/events/test_aria_alert.html
+++ b/accessible/tests/mochitest/events/test_aria_alert.html
@@ -7,21 +7,21 @@
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/states.js"></script>
+          src="../states.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/events.js"></script>
+          src="../events.js"></script>
 
   <script type="application/javascript">
     function showAlert(aID)
     {
       this.DOMNode = document.createElement("div");
 
       this.invoke = function showAlert_invoke()
       {
--- a/accessible/tests/mochitest/events/test_aria_statechange.html
+++ b/accessible/tests/mochitest/events/test_aria_statechange.html
@@ -7,21 +7,21 @@
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/states.js"></script>
+          src="../states.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/events.js"></script>
+          src="../events.js"></script>
 
   <script type="application/javascript">
 
 
     /**
      * Do tests.
      */
     var gQueue = null;
--- a/accessible/tests/mochitest/events/test_attrs.html
+++ b/accessible/tests/mochitest/events/test_attrs.html
@@ -9,21 +9,21 @@
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/events.js"></script>
+          src="../events.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/attributes.js"></script>
+          src="../attributes.js"></script>
 
   <script type="application/javascript">
 
     /**
      * Test "event-from-input" object attribute.
      */
     function checker(aValue, aNoTargetID)
     {
--- a/accessible/tests/mochitest/events/test_caretmove.html
+++ b/accessible/tests/mochitest/events/test_caretmove.html
@@ -9,19 +9,19 @@
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/events.js"></script>
+          src="../events.js"></script>
 
   <script type="application/javascript">
     /**
      * Generic checker.
      */
     function checker(aCaretOffset)
     {
       this.check = function checker_check(aEvent)
--- a/accessible/tests/mochitest/events/test_coalescence.html
+++ b/accessible/tests/mochitest/events/test_coalescence.html
@@ -9,19 +9,19 @@
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/events.js"></script>
+          src="../events.js"></script>
 
   <script type="application/javascript">
 
     ////////////////////////////////////////////////////////////////////////////
     // Invoker base classes
 
     const kRemoveElm = 1;
     const kHideElm = 2;
--- a/accessible/tests/mochitest/events/test_docload.html
+++ b/accessible/tests/mochitest/events/test_docload.html
@@ -7,23 +7,23 @@
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="../role.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/states.js"></script>
+          src="../states.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/events.js"></script>
+          src="../events.js"></script>
 
   <script type="application/javascript">
     ////////////////////////////////////////////////////////////////////////////
     // Invokers
 
     function changeIframeSrc(aIdentifier, aURL)
     {
       this.DOMNode = getNode(aIdentifier);
@@ -181,17 +181,17 @@
       {
         return "open dialog '" + aURL + "'";
       }
     }
 
     function openWndShutdownDoc()
     {
       this.__proto__ =
-        new openDialogWnd("chrome://mochikit/content/a11y/accessible/events/docload_wnd.html");
+        new openDialogWnd("../events/docload_wnd.html");
 
       var thisObj = this;
       var docChecker = {
         type: EVENT_HIDE,
         get target()
         {
           var iframe = this.invoker.mDialog.document.getElementById("iframe");
           this.invoker.iframeDoc = iframe.contentDocument;
--- a/accessible/tests/mochitest/events/test_docload.xul
+++ b/accessible/tests/mochitest/events/test_docload.xul
@@ -9,29 +9,29 @@
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="../role.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/events.js"></script>
+          src="../events.js"></script>
 
   <script type="application/javascript">
   <![CDATA[
     // var gA11yEventDumpID = "eventdump"; // debug stuff
 
     function doTest()
     {
-      var w = window.openDialog("chrome://mochikit/content/a11y/accessible/events/docload_wnd.xul",
+      var w = window.openDialog("../events/docload_wnd.xul",
                                 "docload_test",
                                 "chrome,width=600,height=600");
     }
 
     SimpleTest.waitForExplicitFinish();
     addLoadEvent(doTest);
   ]]>
   </script>
--- a/accessible/tests/mochitest/events/test_dragndrop.html
+++ b/accessible/tests/mochitest/events/test_dragndrop.html
@@ -7,22 +7,22 @@
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/events.js"></script>
+          src="../events.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/attributes.js"></script>
+          src="../attributes.js"></script>
 
   <script type="application/javascript">
 
     /**
      * Do tests.
      */
     var gQueue = null;
 
--- a/accessible/tests/mochitest/events/test_flush.html
+++ b/accessible/tests/mochitest/events/test_flush.html
@@ -9,19 +9,19 @@
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/events.js"></script>
+          src="../events.js"></script>
 
   <script type="application/javascript">
 
     var gFocusHandler = {
       handleEvent: function(aEvent) {
         switch (this.count) {
           case 0:
             is(aEvent.DOMNode, getNode("input1"),
--- a/accessible/tests/mochitest/events/test_focus.html
+++ b/accessible/tests/mochitest/events/test_focus.html
@@ -9,19 +9,19 @@
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/events.js"></script>
+          src="../events.js"></script>
 
   <script type="application/javascript">
     function openCloseDialog(aID)
     {
       this.DOMNode = getNode(aID);
 
       this.invoke = function openCloseDialog_invoke()
       {
--- a/accessible/tests/mochitest/events/test_focus.xul
+++ b/accessible/tests/mochitest/events/test_focus.xul
@@ -9,19 +9,19 @@
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js" />
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js" />
+          src="../common.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/events.js" />
+          src="../events.js" />
 
   <script type="application/javascript">
     /**
      * Click menu item invoker.
      */
     function clickMenuItem(aNodeOrID, aFocusNodeOrID)
     {
       this.DOMNode = getNode(aFocusNodeOrID);
--- a/accessible/tests/mochitest/events/test_focus_name.html
+++ b/accessible/tests/mochitest/events/test_focus_name.html
@@ -9,19 +9,19 @@
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/events.js"></script>
+          src="../events.js"></script>
 
   <script type="application/javascript">
     /**
      * Checker for invokers.
      */
     function actionChecker(aDescription)
     {
       this.check = function actionChecker_check(aEvent)
--- a/accessible/tests/mochitest/events/test_focusdoc.html
+++ b/accessible/tests/mochitest/events/test_focusdoc.html
@@ -7,21 +7,21 @@
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
     src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
       src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   
   <script type="application/javascript"
-      src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+      src="../common.js"></script>
   <script type="application/javascript"
-    src="chrome://mochikit/content/a11y/accessible/events.js"></script>
+    src="../events.js"></script>
     <script type="application/javascript"
-      src="chrome://mochikit/content/a11y/accessible/states.js"></script>
+      src="../states.js"></script>
 
   <script type="application/javascript">
 
     /**
      * Focus invoker.
      */
     function takeFocus(aAcc)
     {
--- a/accessible/tests/mochitest/events/test_mutation.html
+++ b/accessible/tests/mochitest/events/test_mutation.html
@@ -14,19 +14,19 @@
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/events.js"></script>
+          src="../events.js"></script>
 
   <script type="application/javascript">
     /**
      * Invokers.
      */
     var kNoEvents = 0;
 
     var kShowEvent = 1;
--- a/accessible/tests/mochitest/events/test_scroll.xul
+++ b/accessible/tests/mochitest/events/test_scroll.xul
@@ -14,22 +14,25 @@
 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js" />
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/treeview.js" />
+          src="chrome://mochitests/content/a11y/accessible/treeview.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js" />
+          src="../common.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/events.js" />
+          src="../events.js" />
+
+  <script type="application/javascript"
+          src="chrome://mochikit/content/chrome-harness.js"/>
 
   <script type="application/javascript">
   <![CDATA[
 
     ////////////////////////////////////////////////////////////////////////////
     // Hack to make xul:tabbrowser work
 
     const Ci = Components.interfaces;
@@ -55,19 +58,30 @@
         }
       }
     };
 
     function doTest()
     {
       registerA11yEventListener(EVENT_SCROLLING_START, gScrollHandler);
 
-      var url =
-        "chrome://mochikit/content/a11y/accessible/events/scroll.html#link1";
+      var rootDir = getRootDirectory(window.location.href);
 
+      /*
+       * When tests are packed in a .jar, we need to extract them so we 
+       * can access the specific url with a file:// protocol which appears
+       * to be required by loadURI() (at least a file without an embedded .jar)
+       */
+      var jar = getJar(rootDir);
+      if (jar) {
+        var tmpdir = extractJarToTmp(jar);
+        rootDir = "file://" + tmpdir.path;
+      }
+
+      var url = rootDir + "/scroll.html#link1";
       var tabBrowser = document.getElementById("tabBrowser");
       tabBrowser.loadURI(url);
     }
 
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(doTest);
   ]]>
   </script>
--- a/accessible/tests/mochitest/events/test_selection.html
+++ b/accessible/tests/mochitest/events/test_selection.html
@@ -9,21 +9,21 @@
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/events.js"></script>
+          src="../events.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/states.js"></script>
+          src="../states.js"></script>
 
   <script type="application/javascript">
     ////////////////////////////////////////////////////////////////////////////
     // Invokers
 
     function addSelection(aNode, aOption)
     {
       this.DOMNode = aNode;
--- a/accessible/tests/mochitest/events/test_statechange.html
+++ b/accessible/tests/mochitest/events/test_statechange.html
@@ -7,21 +7,21 @@
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/events.js"></script>
+          src="../events.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/states.js"></script>
+          src="../states.js"></script>
 
   <script type="application/javascript">
     ////////////////////////////////////////////////////////////////////////////
     // Invokers
 
     function makeEditableDoc(aDocNode, aIsEnabled)
     {
       this.DOMNode = aDocNode;
--- a/accessible/tests/mochitest/events/test_text.html
+++ b/accessible/tests/mochitest/events/test_text.html
@@ -9,19 +9,19 @@
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/events.js"></script>
+          src="../events.js"></script>
 
   <script type="application/javascript">
     ////////////////////////////////////////////////////////////////////////////
     // Invokers
 
     /**
      * Base text remove invoker and checker.
      */
--- a/accessible/tests/mochitest/events/test_tree.xul
+++ b/accessible/tests/mochitest/events/test_tree.xul
@@ -12,22 +12,22 @@
         title="DOM TreeViewChanged/TreeRowCountChanged and a11y name change events.">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js" />
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/treeview.js" />
+          src="../treeview.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js" />
+          src="../common.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/events.js" />
+          src="../events.js" />
 
   <script type="application/javascript">
   <![CDATA[
 
     ////////////////////////////////////////////////////////////////////////////
     // Invoker's checkers
 
     /**
--- a/accessible/tests/mochitest/events/test_valuechange.html
+++ b/accessible/tests/mochitest/events/test_valuechange.html
@@ -7,22 +7,22 @@
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/events.js"></script>
+          src="../events.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/value.js"></script>
+          src="../value.js"></script>
 
   <script type="application/javascript">
 
 
     /**
      * Do tests.
      */
     var gQueue = null;
--- a/accessible/tests/mochitest/name.css
+++ b/accessible/tests/mochitest/name.css
@@ -1,11 +1,11 @@
 box.first {
-  -moz-binding: url('chrome://mochikit/content/a11y/accessible/name.xbl#first');
+  -moz-binding: url('name.xbl#first');
 }
 
 .second {
-  -moz-binding: url('chrome://mochikit/content/a11y/accessible/name.xbl#second');
+  -moz-binding: url('name.xbl#second');
 }
 
 .third {
-  -moz-binding: url('chrome://mochikit/content/a11y/accessible/name.xbl#third');
-}
\ No newline at end of file
+  -moz-binding: url('name.xbl#third');
+}
--- a/accessible/tests/mochitest/name.js
+++ b/accessible/tests/mochitest/name.js
@@ -13,18 +13,17 @@ function testName(aAccOrElmOrID, aName, 
     ok(false, msg + "Can't get name of the accessible for " + txtID);
   }
   return acc;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // Name tests described by "namerules.xml" file.
 
-var gNameRulesFileURL =
-  "chrome://mochikit/content/a11y/accessible/namerules.xml";
+var gNameRulesFileURL = "namerules.xml";
 
 var gRuleDoc = null;
 
 /**
  * Start name tests. Run through markup elements and test names for test
  * element (see namerules.xml for details).
  */
 function testNames()
--- a/accessible/tests/mochitest/relations/test_general.html
+++ b/accessible/tests/mochitest/relations/test_general.html
@@ -5,21 +5,21 @@
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/relations.js"></script>
+          src="../relations.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="../role.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {
       // html:label@for
       testRelation("label1", RELATION_LABEL_FOR, "checkbox1");
       testRelation("checkbox1", RELATION_LABELLED_BY, "label1");
 
--- a/accessible/tests/mochitest/relations/test_general.xul
+++ b/accessible/tests/mochitest/relations/test_general.xul
@@ -7,21 +7,21 @@
         title="nsIAccessible::getAccessibleRelated() tests">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js" />
+          src="../common.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/relations.js" />
+          src="../relations.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js" />
+          src="../role.js" />
 
   <script type="application/javascript">
   <![CDATA[
     function doTest()
     {
       // xul:label@control
       testRelation("label1", RELATION_LABEL_FOR, "checkbox1");
       testRelation("checkbox1", RELATION_LABELLED_BY, "label1");
--- a/accessible/tests/mochitest/relations/test_tabbrowser.xul
+++ b/accessible/tests/mochitest/relations/test_tabbrowser.xul
@@ -9,21 +9,21 @@
         title="Accessible XUL tabbrowser relation tests">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js" />
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js" />
+          src="../common.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js" />
+          src="../role.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/relations.js" />
+          src="../relations.js" />
 
   <script type="application/javascript">
   <![CDATA[
     ////////////////////////////////////////////////////////////////////////////
     // Test
 
     const Ci = Components.interfaces;
 
--- a/accessible/tests/mochitest/relations/test_tree.xul
+++ b/accessible/tests/mochitest/relations/test_tree.xul
@@ -7,22 +7,22 @@
         title="Accessible XUL tree relations tests">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js" />
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/treeview.js" />
+          src="../treeview.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js" />
+          src="../common.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/relations.js" />
+          src="../relations.js" />
 
   <script type="application/javascript">
   <![CDATA[
     ////////////////////////////////////////////////////////////////////////////
     // Test
 
     function doTestRelations()
     {
--- a/accessible/tests/mochitest/selectable.js
+++ b/accessible/tests/mochitest/selectable.js
@@ -1,36 +1,82 @@
 /**
  * Test selection getter methods of nsIAccessibleSelectable.
  *
  * @param aIdentifier        [in] selectable container accessible
  * @param aSelectedChildren  [in] array of selected children
  */
-function testSelectableSelection(aIdentifier, aSelectedChildren)
+function testSelectableSelection(aIdentifier, aSelectedChildren, aMsg)
 {
   var acc = getAccessible(aIdentifier, [nsIAccessibleSelectable]);
   if (!acc)
     return;
 
+  var msg = aMsg ? aMsg : "";
   var len = aSelectedChildren.length;
 
   // getSelectedChildren
   var selectedChildren = acc.GetSelectedChildren();
-  is(selectedChildren ? selectedChildren.length : 0, aSelectedChildren.length,
-     "getSelectedChildren: wrong selected children count for " + prettyName(aIdentifier));
+  is(selectedChildren ? selectedChildren.length : 0, len,
+     msg + "getSelectedChildren: wrong selected children count for " +
+     prettyName(aIdentifier));
 
   for (var idx = 0; idx < len; idx++) {
     var expectedAcc = getAccessible(aSelectedChildren[idx]);
-    is(selectedChildren.queryElementAt(idx, nsIAccessible), expectedAcc,
-       "getSelectedChildren: wrong selected child at index " + idx + " for " + prettyName(aIdentifier));
+    var actualAcc = selectedChildren.queryElementAt(idx, nsIAccessible);
+    is(actualAcc, expectedAcc,
+       msg + "getSelectedChildren: wrong selected child at index " + idx +
+       " for " + prettyName(aIdentifier) + " { actual : " +
+       prettyName(actualAcc) + ", expected: " + prettyName(expectedAcc) + "}");
   }
 
   // selectionCount
-  is(acc.selectionCount, aSelectedChildren.length,
-     "selectionCount: wrong selected children count for " + prettyName(aIdentifier));
+  // XXX: nsIAccessibleText and nsIAccessibleSelectable both have
+  // selectionCount property.
+  //is(acc.selectionCount, aSelectedChildren.length,
+  //   "selectionCount: wrong selected children count for " + prettyName(aIdentifier));
 
   // refSelection
   for (var idx = 0; idx < len; idx++) {
     var expectedAcc = getAccessible(aSelectedChildren[idx]);
     is(acc.refSelection(idx), expectedAcc,
-       "refSelection: wrong selected child at index " + idx + " for " + prettyName(aIdentifier));
+       msg + "refSelection: wrong selected child at index " + idx + " for " +
+       prettyName(aIdentifier));
+  }
+
+  // isChildSelected
+  testIsChildSelected(acc, acc, { value: 0 }, aSelectedChildren, msg);
+}
+
+/**
+ * Test isChildSelected method, helper for testSelectableSelection
+ */
+function testIsChildSelected(aSelectAcc, aTraversedAcc, aIndexObj, aSelectedChildren, aMsg)
+{
+  var childCount = aTraversedAcc.childCount;
+  for (var idx = 0; idx < childCount; idx++) {
+    var child = aTraversedAcc.getChildAt(idx);
+    var [state, extraState] = getStates(child);
+    if (state & STATE_SELECTABLE) {
+      var isSelected = false;
+      var len = aSelectedChildren.length;
+      for (var jdx = 0; jdx < len; jdx++) {
+        if (child == getAccessible(aSelectedChildren[jdx])) {
+          isSelected = true;
+          break;
+        }
+      }
+
+      // isChildSelected
+      is(aSelectAcc.isChildSelected(aIndexObj.value++), isSelected,
+         aMsg + "isChildSelected: wrong selected child " + prettyName(child) +
+         " for " + prettyName(aSelectAcc));
+
+      // selected state
+      testStates(child, isSelected ? STATE_SELECTED : 0, 0,
+                 !isSelected ? STATE_SELECTED : 0 , 0);
+
+      continue;
+    }
+
+    testIsChildSelected(aSelectAcc, child, aIndexObj, aSelectedChildren);
   }
 }
--- a/accessible/tests/mochitest/selectable/Makefile.in
+++ b/accessible/tests/mochitest/selectable/Makefile.in
@@ -42,14 +42,17 @@ srcdir		= @srcdir@
 VPATH		= @srcdir@
 relativesrcdir  = accessible/selectable
 
 include $(DEPTH)/config/autoconf.mk
 include $(topsrcdir)/config/rules.mk
 
 _TEST_FILES =\
 		test_aria.html \
+		test_listbox.xul \
+		test_menu.xul \
+		test_menulist.xul \
 		test_select.html \
 		test_tree.xul \
 		$(NULL)
 
 libs:: $(_TEST_FILES)
 	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/a11y/$(relativesrcdir)
--- a/accessible/tests/mochitest/selectable/test_aria.html
+++ b/accessible/tests/mochitest/selectable/test_aria.html
@@ -9,21 +9,23 @@
   </style>
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
+  <script type="application/javascript"
+          src="../role.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="../states.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/selectable.js"></script>
+          src="../selectable.js"></script>
 
   <script type="application/javascript">
     function testSelectable(aID, aSelectableChildren)
     {
       var acc = getAccessible(aID, [nsIAccessibleSelectable]);
 
       testSelectableSelection(acc, []);
 
@@ -31,42 +33,98 @@
       testSelectableSelection(acc, aSelectableChildren);
 
       acc.clearSelection();
       testSelectableSelection(acc, []);
     }
 
     function doTest()
     {
+      //////////////////////////////////////////////////////////////////////////
+      // role="list"
+
       var id = "list1";
       ok(isAccessible(id, [nsIAccessibleSelectable]),
          "No selectable accessible for " + id);
 
+      testSelectableSelection(id, [ ]);
+
+      var select = getAccessible(id, [nsIAccessibleSelectable]);
+      select.addChildToSelection(0);
+      testSelectableSelection(id, [ ]);
+      select.removeChildFromSelection(0);
+      testSelectableSelection(id, [ ]);
+      select.selectAllSelection();
+      testSelectableSelection(id, [ ]);
+      select.clearSelection();
+      testSelectableSelection(id, [ ]);
+
+      //////////////////////////////////////////////////////////////////////////
+      // role="listbox"
+
       id = "listbox1";
       ok(isAccessible(id, [nsIAccessibleSelectable]),
          "No selectable accessible for " + id);
 
+      testSelectableSelection(id, [ ]);
+
+      //////////////////////////////////////////////////////////////////////////
+      // role="listbox" aria-multiselectable
+
       id = "listbox2";
       ok(isAccessible(id, [nsIAccessibleSelectable]),
          "No selectable accessible for " + id);
 
+      testSelectableSelection(id, [ ]);
+
+      select = getAccessible(id, [nsIAccessibleSelectable]);
+      select.addChildToSelection(0);
+      testSelectableSelection(id, [ "listbox2_item1" ]);
+      select.removeChildFromSelection(0);
+      testSelectableSelection(id, [ ]);
+      select.selectAllSelection();
+      testSelectableSelection(id, [ "listbox2_item1", "listbox2_item2" ]);
+      select.clearSelection();
+      testSelectableSelection(id, [ ]);
+
+      //////////////////////////////////////////////////////////////////////////
+      // role="grid"
+
       id = "grid1";
       ok(isAccessible(id, [nsIAccessibleSelectable]),
          "No selectable accessible for " + id);
 
+      testSelectableSelection(id, [ ]);
+
+      //////////////////////////////////////////////////////////////////////////
+      // role="tree"
+
       id = "tree1";
       ok(isAccessible(id, [nsIAccessibleSelectable]),
          "No selectable accessible for " + id);
 
+      testSelectableSelection(id, [ ]);
+
+      //////////////////////////////////////////////////////////////////////////
+      // role="treegrid"
+
       id = "treegrid1";
       ok(isAccessible(id, [nsIAccessibleSelectable]),
          "No selectable accessible for " + id);
 
-      // Test selection methods for selectable children in subtree.
-      testSelectable("grid2",
+      testSelectableSelection(id, [ ]);
+
+      //////////////////////////////////////////////////////////////////////////
+      // role="grid" aria-multiselectable, selectable children in subtree
+
+      id = "grid2";
+      ok(isAccessible(id, [nsIAccessibleSelectable]),
+         "No selectable accessible for " + id);
+
+      testSelectable(id,
                      ["grid2_colhead1", "grid2_colhead2", "grid2_colhead3",
                       "grid2_rowhead", "grid2_cell1", "grid2_cell2"]);
 
       SimpleTest.finish();
     }
 
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(doTest);
@@ -81,34 +139,39 @@
      title="ARIA single selectable widget should implement nsIAccessibleSelectable">
     Mozilla Bug 530014
   </a><br>
   <a target="_blank"
      href="https://bugzilla.mozilla.org/show_bug.cgi?id=566551"
      title="ARIA grid and accessible selectable methods shouldn't use GetNextSibling">
     Mozilla Bug 566551
   </a><br>
+  <a target="_blank"
+     href="https://bugzilla.mozilla.org/show_bug.cgi?id=590176"
+     title="add pseudo SelectAccessible interface">
+    Mozilla Bug 590176
+  </a><br>
   <p id="display"></p>
   <div id="content" style="display: none"></div>
   <pre id="test">
   </pre>
 
   <div role="list" id="list1">
     <div role="listitem">item1</div>
     <div role="listitem">item2</div>
   </div>
 
   <div role="listbox" id="listbox1">
     <div role="listitem">item1</div>
     <div role="listitem">item2</div>
   </div>
 
   <div role="listbox" id="listbox2" aria-multiselectable="true">
-    <div role="listitem">item1</div>
-    <div role="listitem">item2</div>
+    <div role="listitem" id="listbox2_item1">item1</div>
+    <div role="listitem" id="listbox2_item2">item2</div>
   </div>
 
   <div role="grid" id="grid1">
     <div role="row">
       <span role="gridcell">cell</span>
       <span role="gridcell">cell</span>
     </div>
     <div role="row">
new file mode 100644
--- /dev/null
+++ b/accessible/tests/mochitest/selectable/test_listbox.xul
@@ -0,0 +1,155 @@
+<?xml version="1.0"?>
+<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
+<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
+                 type="text/css"?>
+<?xml-stylesheet href="chrome://mochikit/content/a11y/accessible/treeview.css"
+                 type="text/css"?>
+
+<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+        title="XUL tree selectable tests">
+
+  <script type="application/javascript" 
+          src="chrome://mochikit/content/MochiKit/packed.js" />
+  <script type="application/javascript"
+          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
+
+  <script type="application/javascript"
+          src="../common.js" />
+  <script type="application/javascript"
+          src="../role.js" />
+  <script type="application/javascript"
+          src="../states.js" />
+  <script type="application/javascript"
+          src="../selectable.js" />
+
+  <script type="application/javascript">
+  <![CDATA[
+
+    ////////////////////////////////////////////////////////////////////////////
+    // Test
+
+    //gA11yEventDumpID = "debug";
+
+    var gQueue = null;
+
+    function doTest()
+    {
+      //////////////////////////////////////////////////////////////////////////
+      // single selectable listbox
+
+      var id = "listbox";
+      ok(isAccessible(id, [nsIAccessibleSelectable]),
+         "No selectable accessible for list of " + id);
+
+      var select = getAccessible(id, [nsIAccessibleSelectable]);
+      testSelectableSelection(select, [ ]);
+
+      select.addChildToSelection(1);
+      testSelectableSelection(select, [ "lb1_item2" ], "addChildToSelect(1): ");
+
+      select.removeChildFromSelection(1);
+      testSelectableSelection(select, [ ],
+                              "removeChildFromSelection(1): ");
+
+      todo(select.selectAllSelection() == false,
+           "No way to select all items in listbox '" + id + "'");
+      testSelectableSelection(select, [ "lb1_item1" ], "selectAllSelection: ");
+
+      select.addChildToSelection(1);
+      select.clearSelection();
+      testSelectableSelection(select, [ ], "clearSelection: ");
+
+      //////////////////////////////////////////////////////////////////////////
+      // multiple selectable listbox
+
+      var id = "listbox2";
+      ok(isAccessible(id, [nsIAccessibleSelectable]),
+         "No selectable accessible for list of " + id);
+
+      var select = getAccessible(id, [nsIAccessibleSelectable]);
+      testSelectableSelection(select, [ ]);
+
+      select.addChildToSelection(1);
+      testSelectableSelection(select, [ "lb2_item2" ], "addChildToSelect(1): ");
+
+      select.removeChildFromSelection(1);
+      testSelectableSelection(select, [ ],
+                              "removeChildFromSelection(1): ");
+
+      is(select.selectAllSelection(), true,
+         "All items should be selected in listbox '" + id + "'");
+      testSelectableSelection(select, [ "lb2_item1", "lb2_item2" ],
+                              "selectAllSelection: ");
+
+      select.clearSelection();
+      testSelectableSelection(select, [ ], "clearSelection: ");
+
+      //////////////////////////////////////////////////////////////////////////
+      // listbox with headers
+
+      // XXX: addChildToSelection/removeChildFromSelection don't work correctly
+      // on listboxes with headers because header is inserted into hierarchy
+      // and child indexes that are used in these methods are shifted (see bug
+      // 591939).
+      todo(false,
+           "Fix addChildToSelection/removeChildFromSelection on listboxes with headers.");
+
+      SimpleTest.finish();
+    }
+
+    SimpleTest.waitForExplicitFinish();
+    addA11yLoadEvent(doTest);
+  ]]>
+  </script>
+
+  <hbox flex="1" style="overflow: auto;">
+    <body xmlns="http://www.w3.org/1999/xhtml">
+      <a target="_blank"
+        href="https://bugzilla.mozilla.org/show_bug.cgi?id=590176"
+        title="add pseudo SelectAccessible interface">
+       Mozilla Bug 590176
+      </a><br/>
+      <p id="display"></p>
+      <div id="content" style="display: none">
+      </div>
+      <pre id="test">
+      </pre>
+    </body>
+
+    <vbox flex="1">
+      <listbox id="listbox">
+        <listcols>
+          <listcol flex="1"/>
+          <listcol flex="1"/>
+        </listcols>
+        <listitem id="lb1_item1">
+          <listcell label="cell0"/>
+          <listcell label="cell1"/>
+        </listitem>
+        <listitem id="lb1_item2">
+          <listcell label="cell3"/>
+          <listcell label="cell4"/>
+        </listitem>
+      </listbox>
+
+      <listbox id="listbox2" seltype="multiple">
+        <listcols>
+          <listcol flex="1"/>
+          <listcol flex="1"/>
+        </listcols>
+        <listitem id="lb2_item1">
+          <listcell label="cell0"/>
+          <listcell label="cell1"/>
+        </listitem>
+        <listitem id="lb2_item2">
+          <listcell label="cell3"/>
+          <listcell label="cell4"/>
+        </listitem>
+      </listbox>
+
+      <vbox id="debug"/>
+    </vbox>
+  </hbox>
+
+</window>
+
new file mode 100644
--- /dev/null
+++ b/accessible/tests/mochitest/selectable/test_menu.xul
@@ -0,0 +1,81 @@
+<?xml version="1.0"?>
+<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
+<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
+                 type="text/css"?>
+<?xml-stylesheet href="chrome://mochikit/content/a11y/accessible/treeview.css"
+                 type="text/css"?>
+
+<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+        title="XUL tree selectable tests">
+
+  <script type="application/javascript" 
+          src="chrome://mochikit/content/MochiKit/packed.js" />
+  <script type="application/javascript"
+          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
+
+  <script type="application/javascript"
+          src="../common.js" />
+  <script type="application/javascript"
+          src="../role.js" />
+  <script type="application/javascript"
+          src="../states.js" />
+  <script type="application/javascript"
+          src="../selectable.js" />
+
+  <script type="application/javascript">
+  <![CDATA[
+
+    ////////////////////////////////////////////////////////////////////////////
+    // Test
+
+    //gA11yEventDumpID = "debug";
+
+    var gQueue = null;
+
+    function doTest()
+    {
+      //////////////////////////////////////////////////////////////////////////
+      // menu
+
+      var id = "menu";
+      var menu = getAccessible("menu");
+      var menuList = menu.firstChild;
+      todo(isAccessible(menuList, [nsIAccessibleSelectable]),
+           "No selectable accessible for list of menu '" + id + "'");
+
+      SimpleTest.finish();
+    }
+
+    SimpleTest.waitForExplicitFinish();
+    addA11yLoadEvent(doTest);
+  ]]>
+  </script>
+
+  <hbox flex="1" style="overflow: auto;">
+    <body xmlns="http://www.w3.org/1999/xhtml">
+      <a target="_blank"
+        href="https://bugzilla.mozilla.org/show_bug.cgi?id=590176"
+        title="add pseudo SelectAccessible interface">
+       Mozilla Bug 590176
+      </a><br/>
+      <p id="display"></p>
+      <div id="content" style="display: none">
+      </div>
+      <pre id="test">
+      </pre>
+    </body>
+
+    <vbox flex="1">
+      <menu label="menu" id="menu">
+        <menupopup>
+          <menuitem label="item1" id="m_item1"/>
+          <menuitem label="item2" id="m_item2"/>
+        </menupopup>
+      </menu>
+
+      <vbox id="debug"/>
+    </vbox>
+  </hbox>
+
+</window>
+
new file mode 100644
--- /dev/null
+++ b/accessible/tests/mochitest/selectable/test_menulist.xul
@@ -0,0 +1,99 @@
+<?xml version="1.0"?>
+<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
+<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
+                 type="text/css"?>
+<?xml-stylesheet href="chrome://mochikit/content/a11y/accessible/treeview.css"
+                 type="text/css"?>
+
+<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+        title="XUL tree selectable tests">
+
+  <script type="application/javascript" 
+          src="chrome://mochikit/content/MochiKit/packed.js" />
+  <script type="application/javascript"
+          src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
+
+  <script type="application/javascript"
+          src="../common.js" />
+  <script type="application/javascript"
+          src="../role.js" />
+  <script type="application/javascript"
+          src="../states.js" />
+  <script type="application/javascript"
+          src="../selectable.js" />
+
+  <script type="application/javascript">
+  <![CDATA[
+
+    ////////////////////////////////////////////////////////////////////////////
+    // Test
+
+    //gA11yEventDumpID = "debug";
+
+    var gQueue = null;
+
+    function doTest()
+    {
+      //////////////////////////////////////////////////////////////////////////
+      // menulist aka combobox
+
+      var id = "combobox";
+      var combobox = getAccessible(id);
+      var comboboxList = combobox.firstChild;
+      ok(isAccessible(comboboxList, [nsIAccessibleSelectable]),
+         "No selectable accessible for list of " + id);
+
+      var select = getAccessible(comboboxList, [nsIAccessibleSelectable]);
+      testSelectableSelection(select, [ "cb1_item1" ]);
+
+      select.addChildToSelection(1);
+      testSelectableSelection(select, [ "cb1_item2" ], "addChildToSelect(1): ");
+
+      select.removeChildFromSelection(1);
+      testSelectableSelection(select, [ ],
+                              "removeChildFromSelection(1): ");
+
+      is(select.selectAllSelection(), false,
+         "No way to select all items in combobox '" + id + "'");
+      testSelectableSelection(select, [ ], "selectAllSelection: ");
+
+      select.addChildToSelection(1);
+      select.clearSelection();
+      testSelectableSelection(select, [ ], "clearSelection: ");
+
+      SimpleTest.finish();
+    }
+
+    SimpleTest.waitForExplicitFinish();
+    addA11yLoadEvent(doTest);
+  ]]>
+  </script>
+
+  <hbox flex="1" style="overflow: auto;">
+    <body xmlns="http://www.w3.org/1999/xhtml">
+      <a target="_blank"
+        href="https://bugzilla.mozilla.org/show_bug.cgi?id=590176"
+        title="add pseudo SelectAccessible interface">
+       Mozilla Bug 590176
+      </a><br/>
+      <p id="display"></p>
+      <div id="content" style="display: none">
+      </div>
+      <pre id="test">
+      </pre>
+    </body>
+
+    <vbox flex="1">
+      <menulist id="combobox">
+        <menupopup>
+          <menuitem id="cb1_item1" label="item1"/>
+          <menuitem id="cb1_item2" label="item2"/>
+        </menupopup>
+      </menulist>
+
+      <vbox id="debug"/>
+    </vbox>
+  </hbox>
+
+</window>
+
--- a/accessible/tests/mochitest/selectable/test_select.html
+++ b/accessible/tests/mochitest/selectable/test_select.html
@@ -9,58 +9,237 @@
   </style>
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
+  <script type="application/javascript"
+          src="../role.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="../states.js"></script>
+  <script type="application/javascript"
+          src="../selectable.js"></script>
 
   <script type="application/javascript">
 
     function doTest()
     {
-      var combobox = getAccessible("combobox");
+      //////////////////////////////////////////////////////////////////////////
+      // select@size="1" aka combobox
+
+      var id = "combobox";
+      var combobox = getAccessible(id);
       var comboboxList = combobox.firstChild;
       ok(isAccessible(comboboxList, [nsIAccessibleSelectable]),
          "No selectable accessible for list of " + id);
 
+      var select = getAccessible(comboboxList, [nsIAccessibleSelectable]);
+      testSelectableSelection(select, [ "cb1_item1" ]);
+
+      // select 2nd item
+      select.addChildToSelection(1);
+      testSelectableSelection(select, [ "cb1_item2" ], "addChildToSelect(1): ");
+
+      // unselect 2nd item, 1st item gets selected automatically
+      select.removeChildFromSelection(1);
+      testSelectableSelection(select, [ "cb1_item1" ],
+                              "removeChildFromSelection(1): ");
+
+      // doesn't change selection
+      is(select.selectAllSelection(), false,
+         "No way to select all items in combobox '" + id + "'");
+      testSelectableSelection(select, [ "cb1_item1" ], "selectAllSelection: ");
+
+      // doesn't change selection
+      select.clearSelection();
+      testSelectableSelection(select, [ "cb1_item1" ], "clearSelection: ");
+
+      //////////////////////////////////////////////////////////////////////////
+      // select@size="1" with optgroups
+
+      id = "combobox2";
+      combobox = getAccessible(id);
+      comboboxList = combobox.firstChild;
+      ok(isAccessible(comboboxList, [nsIAccessibleSelectable]),
+         "No selectable accessible for list of " + id);
+
+      select = getAccessible(comboboxList, [nsIAccessibleSelectable]);
+      testSelectableSelection(select, [ "cb2_item1" ]);
+
+      select.addChildToSelection(1);
+      testSelectableSelection(select, [ "cb2_item2" ]);
+
+      select.removeChildFromSelection(1);
+      testSelectableSelection(select, [ "cb2_item1" ]);
+
+      is(select.selectAllSelection(), false,
+         "No way to select all items in combobox " + id + "'");
+      testSelectableSelection(select, [ "cb2_item1" ]);
+
+      select.clearSelection();
+      testSelectableSelection(select, [ "cb2_item1" ]);
+
+      //////////////////////////////////////////////////////////////////////////
+      // select@size="4" aka single selectable listbox
+
       var id = "listbox";
       ok(isAccessible(id, [nsIAccessibleSelectable]),
          "No selectable accessible for " + id);
 
+      select = getAccessible(id, [nsIAccessibleSelectable]);
+      testSelectableSelection(select, [ ]);
+
+      // select 2nd item
+      select.addChildToSelection(1);
+      testSelectableSelection(select, [ "lb1_item2" ], "addChildToSelect(1): ");
+
+      // unselect 2nd item, 1st item gets selected automatically
+      select.removeChildFromSelection(1);
+      testSelectableSelection(select, [ ],
+                              "removeChildFromSelection(1): ");
+
+      // doesn't change selection
+      is(select.selectAllSelection(), false,
+         "No way to select all items in single selectable listbox '" + id + "'");
+      testSelectableSelection(select, [ ], "selectAllSelection: ");
+
+      // doesn't change selection
+      select.clearSelection();
+      testSelectableSelection(select, [ ], "clearSelection: ");
+
+      //////////////////////////////////////////////////////////////////////////
+      // select@size="4" with optgroups, single selectable
+
+      id = "listbox2";
+      ok(isAccessible(id, [nsIAccessibleSelectable]),
+         "No selectable accessible for " + id);
+
+      select = getAccessible(id, [nsIAccessibleSelectable]);
+      testSelectableSelection(select, [ ]);
+
+      select.addChildToSelection(1);
+      testSelectableSelection(select, [ "lb2_item2" ]);
+
+      select.removeChildFromSelection(1);
+      testSelectableSelection(select, [ ]);
+
+      is(select.selectAllSelection(), false,
+         "No way to select all items in single selectable listbox " + id + "'");
+      testSelectableSelection(select, [ ]);
+
+      select.clearSelection();
+      testSelectableSelection(select, [ ]);
+
+      //////////////////////////////////////////////////////////////////////////
+      // select@size="4" multiselect aka listbox
+
+      id = "listbox3";
+      ok(isAccessible(id, [nsIAccessibleSelectable]),
+         "No selectable accessible for " + id);
+
+      select = getAccessible(id, [nsIAccessibleSelectable]);
+      testSelectableSelection(select, [ ]);
+
+      select.addChildToSelection(0);
+      testSelectableSelection(select, [ "lb3_item1" ], "addChildToSelection: ");
+
+      select.removeChildFromSelection(0);
+      testSelectableSelection(select, [ ], "removeChildFromSelection: ");
+
+      is(select.selectAllSelection(), true,
+         "All items in listbox '" + id + "' should be selected");
+      testSelectableSelection(select, [ "lb3_item1", "lb3_item2"],
+                              "selectAllSelection: ");
+
+      select.clearSelection();
+      testSelectableSelection(select, [ ], "clearSelection: ");
+
+      //////////////////////////////////////////////////////////////////////////
+      // select@size="4" multiselect with optgroups
+
+      var id = "listbox4";
+      ok(isAccessible(id, [nsIAccessibleSelectable]),
+         "No selectable accessible for " + id);
+
+      select = getAccessible(id, [nsIAccessibleSelectable]);
+      testSelectableSelection(select, [ ]);
+
+      select.addChildToSelection(0);
+      testSelectableSelection(select, [ "lb4_item1" ]);
+
+      select.removeChildFromSelection(0);
+      testSelectableSelection(select, [ ]);
+
+      is(select.selectAllSelection(), true,
+         "All items in listbox '" + id + "' should be selected");
+      testSelectableSelection(select, [ "lb4_item1", "lb4_item2"]);
+
+      select.clearSelection();
+      testSelectableSelection(select, [ ]);
+
       SimpleTest.finish();
     }
 
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(doTest);
   </script>
 
 </head>
 
 <body>
 
   <a target="_blank"
      href="https://bugzilla.mozilla.org/show_bug.cgi?id=530014"
      title="ARIA single selectable widget should implement nsIAccessibleSelectable">
     Mozilla Bug 530014
   </a><br>
+  <a target="_blank"
+     href="https://bugzilla.mozilla.org/show_bug.cgi?id=590176"
+     title="add pseudo SelectAccessible interface">
+    Mozilla Bug 590176
+  </a><br>
   <p id="display"></p>
   <div id="content" style="display: none"></div>
   <pre id="test">
   </pre>
 
   <select id="combobox">
-    <option>option</option>
-    <option>option</option>
+    <option id="cb1_item1">option1</option>
+    <option id="cb1_item2">option2</option>
+  </select>
+
+  <select id="combobox2">
+    <option id="cb2_item1">option1</option>
+    <optgroup>optgroup
+      <option id="cb2_item2">option2</option>
+    </optgroup>
   </select>
 
   <select id="listbox" size="4">
-    <option>option</option>
-    <option>option</option>
+    <option id="lb1_item1">option1</option>
+    <option id="lb1_item2">option2</option>
+  </select>
+
+  <select id="listbox2" size="4">
+    <option id="lb2_item1">option1</option>
+    <optgroup>optgroup>
+      <option id="lb2_item2">option2</option>
+    </optgroup>
+  </select>
+
+  <select id="listbox3" size="4" multiple="true">
+    <option id="lb3_item1">option1</option>
+    <option id="lb3_item2">option2</option>
+  </select>
+
+  <select id="listbox4" size="4" multiple="true">
+    <option id="lb4_item1">option1</option>
+    <optgroup>optgroup>
+      <option id="lb4_item2">option2</option>
+    </optgroup>
   </select>
 
 </body>
 </html>
--- a/accessible/tests/mochitest/selectable/test_tree.xul
+++ b/accessible/tests/mochitest/selectable/test_tree.xul
@@ -1,34 +1,34 @@
 <?xml version="1.0"?>
 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
                  type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/a11y/accessible/treeview.css"
+<?xml-stylesheet href="../treeview.css"
                  type="text/css"?>
 
 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         title="XUL tree selectable tests">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js" />
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/treeview.js" />
+          src="../treeview.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js" />
+          src="../common.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js" />
+          src="../role.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/states.js" />
+          src="../states.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/events.js" />
+          src="../events.js" />
 
   <script type="application/javascript">
   <![CDATA[
     ////////////////////////////////////////////////////////////////////////////
     // Test
 
     // gA11yEventDumpID = "debug";
 
--- a/accessible/tests/mochitest/states/test_aria.html
+++ b/accessible/tests/mochitest/states/test_aria.html
@@ -17,21 +17,21 @@
   </style>
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="../role.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/states.js"></script>
+          src="../states.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {
       // aria_autocomplete
       testStates("textbox_autocomplete_inline", 0, EXT_STATE_SUPPORTS_AUTOCOMPLETION);
       testStates("textbox_autocomplete_list", STATE_HASPOPUP, EXT_STATE_SUPPORTS_AUTOCOMPLETION);
       testStates("textbox_autocomplete_both", STATE_HASPOPUP, EXT_STATE_SUPPORTS_AUTOCOMPLETION);
--- a/accessible/tests/mochitest/states/test_aria_imgmap.html
+++ b/accessible/tests/mochitest/states/test_aria_imgmap.html
@@ -7,21 +7,21 @@
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="../role.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/states.js"></script>
+          src="../states.js"></script>
 
   <script type="application/javascript">
   function doTest()
   {
     //XXX We send a useless mouse move to the image to force it to setup its
     // image map, because flushing layout won't do it. Hopefully bug 135040
     // will make this not suck.
     synthesizeMouse($("imagemap"), 10, 10, { type: "mousemove" });
--- a/accessible/tests/mochitest/states/test_doc.html
+++ b/accessible/tests/mochitest/states/test_doc.html
@@ -10,19 +10,19 @@ https://bugzilla.mozilla.org/show_bug.cg
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/states.js"></script>
+          src="../states.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {
       // Bug 566542: root accesible should expose active state when focused.
       testStates(getRootAccessible(), 0, EXT_STATE_ACTIVE);
 
       // Bug 509696
--- a/accessible/tests/mochitest/states/test_docarticle.html
+++ b/accessible/tests/mochitest/states/test_docarticle.html
@@ -6,19 +6,19 @@
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/states.js"></script>
+          src="../states.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {      
       var docAcc = getAccessible(document, [nsIAccessibleDocument]);
       if (docAcc) {
         testStates(docAcc, STATE_READONLY);
         testStates("article", STATE_READONLY);
--- a/accessible/tests/mochitest/states/test_editablebody.html
+++ b/accessible/tests/mochitest/states/test_editablebody.html
@@ -8,19 +8,19 @@ https://bugzilla.mozilla.org/show_bug.cg
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/states.js"></script>
+          src="../states.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {
       testStates(document, 0, EXT_STATE_EDITABLE);
       testStates("p", 0, EXT_STATE_EDITABLE);
 
       SimpleTest.finish();
--- a/accessible/tests/mochitest/states/test_frames.html
+++ b/accessible/tests/mochitest/states/test_frames.html
@@ -7,19 +7,19 @@
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/states.js"></script>
+          src="../states.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {
       frameDoc = document.getElementById("frame_doc").contentDocument;
       frameDocArticle = document.getElementById("frame_doc_article").contentDocument;
       frameDocCheckbox = document.getElementById("frame_doc_checkbox").contentDocument;
       frameDocTextbox = document.getElementById("frame_doc_textbox").contentDocument;
--- a/accessible/tests/mochitest/states/test_link.html
+++ b/accessible/tests/mochitest/states/test_link.html
@@ -7,21 +7,21 @@
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="../role.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/states.js"></script>
+          src="../states.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {
       // strong roles
       testStates("link1", STATE_LINKED);
       testStates("link2", STATE_LINKED);
       testStates("link3", STATE_LINKED);
--- a/accessible/tests/mochitest/states/test_popup.xul
+++ b/accessible/tests/mochitest/states/test_popup.xul
@@ -7,19 +7,19 @@
         title="XUL popup attribute test">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js" />
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js" />
+          src="../common.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/states.js" />
+          src="../states.js" />
 
   <script type="application/javascript">
   <![CDATA[
     function doTest()
     {
       // label with popup
       testStates("labelWithPopup", STATE_HASPOPUP);
 
--- a/accessible/tests/mochitest/states/test_tree.xul
+++ b/accessible/tests/mochitest/states/test_tree.xul
@@ -1,32 +1,32 @@
 <?xml version="1.0"?>
 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
                  type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/a11y/accessible/treeview.css"
+<?xml-stylesheet href="../treeview.css"
                  type="text/css"?>
 
 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         title="Accessible XUL tree states tests">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js" />
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/treeview.js" />
+          src="../treeview.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js" />
+          src="../common.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/states.js" />
+          src="../states.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/events.js" />
+          src="../events.js" />
 
   <script type="application/javascript">
   <![CDATA[
     ////////////////////////////////////////////////////////////////////////////
     // Test
 
     // gA11yEventDumpID = "debug";
 
--- a/accessible/tests/mochitest/table/test_headers_ariagrid.html
+++ b/accessible/tests/mochitest/table/test_headers_ariagrid.html
@@ -7,19 +7,19 @@
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/table.js"></script>
+          src="../table.js"></script>
 
   <script type="application/javascript">
 
     function doTest()
     {
       //////////////////////////////////////////////////////////////////////////
       // column and row headers from markup
 
--- a/accessible/tests/mochitest/table/test_headers_listbox.xul
+++ b/accessible/tests/mochitest/table/test_headers_listbox.xul
@@ -7,19 +7,19 @@
         title="Table header information cells for XUL listbox">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/table.js"></script>
+          src="../table.js"></script>
 
   <script type="application/javascript">
   <![CDATA[
     function doTest()
     {
       //////////////////////////////////////////////////////////////////////////
       // XUL listbox
 
--- a/accessible/tests/mochitest/table/test_headers_table.html
+++ b/accessible/tests/mochitest/table/test_headers_table.html
@@ -7,19 +7,19 @@
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/table.js"></script>
+          src="../table.js"></script>
 
   <script type="application/javascript">
 
     function doTest()
     {
       //////////////////////////////////////////////////////////////////////////
       // column header from thead and row header from @scope inside of tfoot
 
--- a/accessible/tests/mochitest/table/test_headers_tree.xul
+++ b/accessible/tests/mochitest/table/test_headers_tree.xul
@@ -7,22 +7,22 @@
         title="Table header information cells for XUL tree">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js" />
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/treeview.js" />
+          src="../treeview.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js" />
+          src="../common.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/table.js" />
+          src="../table.js" />
 
   <script type="application/javascript">
   <![CDATA[
     ////////////////////////////////////////////////////////////////////////////
     // Test
 
     var gTree = null;
     var gTreeBox = null;
--- a/accessible/tests/mochitest/table/test_indexes_ariagrid.html
+++ b/accessible/tests/mochitest/table/test_indexes_ariagrid.html
@@ -6,21 +6,21 @@
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/attributes.js"></script>
+          src="../attributes.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/table.js"></script>
+          src="../table.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {
       //////////////////////////////////////////////////////////////////////////
       // ARIA grid
       var idxes = [
         [0, 1, 2],
--- a/accessible/tests/mochitest/table/test_indexes_listbox.xul
+++ b/accessible/tests/mochitest/table/test_indexes_listbox.xul
@@ -7,19 +7,19 @@
         title="Table indices of accessible table for XUL listbox">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/table.js"></script>
+          src="../table.js"></script>
 
   <script type="application/javascript">
   <![CDATA[
     function doTest()
     {
       var idxes = [
         [0, 1, 2],
         [3, 4, 5],
--- a/accessible/tests/mochitest/table/test_indexes_table.html
+++ b/accessible/tests/mochitest/table/test_indexes_table.html
@@ -9,19 +9,19 @@ https://bugzilla.mozilla.org/show_bug.cg
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/table.js"></script>
+          src="../table.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {
       //////////////////////////////////////////////////////////////////////////
       // table
       var idxes = [
         [0, 1, 2],
--- a/accessible/tests/mochitest/table/test_indexes_tree.xul
+++ b/accessible/tests/mochitest/table/test_indexes_tree.xul
@@ -7,22 +7,22 @@
         title="Accessible Table indexes tests">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js" />
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/treeview.js" />
+          src="../treeview.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js" />
+          src="../common.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/table.js" />
+          src="../table.js" />
 
   <script type="application/javascript">
   <![CDATA[
     ////////////////////////////////////////////////////////////////////////////
     // Test
 
     var gTree = null;
     var gTreeBox = null;
--- a/accessible/tests/mochitest/table/test_layoutguess.html
+++ b/accessible/tests/mochitest/table/test_layoutguess.html
@@ -6,19 +6,19 @@
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/attributes.js"></script>
+          src="../attributes.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {
       // Attribute we're looking for
       var attr = {
         "layout-guess": "true"
       };
--- a/accessible/tests/mochitest/table/test_sels_ariagrid.html
+++ b/accessible/tests/mochitest/table/test_sels_ariagrid.html
@@ -9,21 +9,21 @@ https://bugzilla.mozilla.org/show_bug.cg
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/states.js"></script>
+          src="../states.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/table.js"></script>
+          src="../table.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {
       //////////////////////////////////////////////////////////////////////////
       // ARIA grid
       var cellsArray =
       [
--- a/accessible/tests/mochitest/table/test_sels_listbox.xul
+++ b/accessible/tests/mochitest/table/test_sels_listbox.xul
@@ -7,19 +7,19 @@
         title="nsIAccessibleTable selection methods on xul:listbox test.">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/table.js"></script>
+          src="../table.js"></script>
 
   <script type="application/javascript">
   <![CDATA[
     function doTest()
     {
       var id = "listbox3";
       var acc = getAccessible(id, [nsIAccessibleTable]);
 
--- a/accessible/tests/mochitest/table/test_sels_table.html
+++ b/accessible/tests/mochitest/table/test_sels_table.html
@@ -7,21 +7,21 @@
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/states.js"></script>
+          src="../states.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/table.js"></script>
+          src="../table.js"></script>
 
   <script type="text/javascript">
 
     function doTest()
     {
       //////////////////////////////////////////////////////////////////////////
       // table
 
--- a/accessible/tests/mochitest/table/test_sels_tree.xul
+++ b/accessible/tests/mochitest/table/test_sels_tree.xul
@@ -7,24 +7,24 @@
         title="Accessible Table selection tests">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js" />
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/treeview.js" />
+          src="../treeview.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js" />
+          src="../common.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/states.js" />
+          src="../states.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/table.js" />
+          src="../table.js" />
 
   <script type="application/javascript">
   <![CDATA[
     ////////////////////////////////////////////////////////////////////////////
     // Test
 
     var gTree = null;
     var gTreeBox = null;
--- a/accessible/tests/mochitest/table/test_struct_ariagrid.html
+++ b/accessible/tests/mochitest/table/test_struct_ariagrid.html
@@ -7,21 +7,21 @@
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="../role.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/table.js"></script>
+          src="../table.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {
       //////////////////////////////////////////////////////////////////////////
       // Pure ARIA grid
       var cellsArray = [
         [kColHeaderCell, kColHeaderCell, kColHeaderCell],
--- a/accessible/tests/mochitest/table/test_struct_ariatreegrid.html
+++ b/accessible/tests/mochitest/table/test_struct_ariatreegrid.html
@@ -7,21 +7,21 @@
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="../role.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/table.js"></script>
+          src="../table.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {
       //////////////////////////////////////////////////////////////////////////
       // HTML based ARIA tree grid
 
       var cellsArray = [
--- a/accessible/tests/mochitest/table/test_struct_listbox.xul
+++ b/accessible/tests/mochitest/table/test_struct_listbox.xul
@@ -7,21 +7,21 @@
         title="Table accessible tree and table interface tests for XUL listboxes">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="../role.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/table.js"></script>
+          src="../table.js"></script>
 
   <script type="application/javascript">
   <![CDATA[
     function doTest()
     {
       //////////////////////////////////////////////////////////////////////////
       // Multicolumn listbox.
 
--- a/accessible/tests/mochitest/table/test_struct_table.html
+++ b/accessible/tests/mochitest/table/test_struct_table.html
@@ -7,21 +7,21 @@
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="../role.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/table.js"></script>
+          src="../table.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {
       //////////////////////////////////////////////////////////////////////////
       // column headers from thead and tfoot
 
       cellsArray = [
--- a/accessible/tests/mochitest/table/test_struct_tree.xul
+++ b/accessible/tests/mochitest/table/test_struct_tree.xul
@@ -7,24 +7,24 @@
         title="Table accessible tree and table interface tests for XUL trees">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js" />
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/treeview.js" />
+          src="../treeview.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js" />
+          src="../common.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js" />
+          src="../role.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/table.js" />
+          src="../table.js" />
 
   <script type="application/javascript">
   <![CDATA[
     ////////////////////////////////////////////////////////////////////////////
     // Test
 
     var gTree = null;
     var gTreeBox = null;
--- a/accessible/tests/mochitest/table/test_table_1.html
+++ b/accessible/tests/mochitest/table/test_table_1.html
@@ -4,17 +4,17 @@
   <meta http-equiv="content-type" content="text/html; charset=UTF-8">
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
 
   <script type="application/javascript">
 
 function doTest()
 {
   var accTable = getAccessible("table", [nsIAccessibleTable]);
 
   var s = window.getSelection();
--- a/accessible/tests/mochitest/table/test_table_2.html
+++ b/accessible/tests/mochitest/table/test_table_2.html
@@ -4,19 +4,19 @@
   <meta http-equiv="content-type" content="text/html; charset=UTF-8">
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="../role.js"></script>
 
   <script type="text/javascript">
 
 function doTest()
 {
   // Test table with display:inline. We shouldn't create table accessible and
   // table cell accessible in this case
   var accNotCreated = (!isAccessible("table1"));
--- a/accessible/tests/mochitest/test_aria_activedescendant.html
+++ b/accessible/tests/mochitest/test_aria_activedescendant.html
@@ -8,17 +8,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="common.js"></script>
 
   <script type="application/javascript">
     const ELEMENT_NODE = nsIDOMNode.ELEMENT_NODE;
 
     var gContainerFocused = false;
 
     function doTest()
     {
--- a/accessible/tests/mochitest/test_aria_role_article.html
+++ b/accessible/tests/mochitest/test_aria_role_article.html
@@ -8,19 +8,19 @@ https://bugzilla.mozilla.org/show_bug.cg
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="role.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {
       // Test article exposed as document
       testRole("testArticle", ROLE_DOCUMENT);
 
       var articleAcc = getAccessible("testArticle");
--- a/accessible/tests/mochitest/test_aria_role_equation.html
+++ b/accessible/tests/mochitest/test_aria_role_equation.html
@@ -8,19 +8,19 @@ https://bugzilla.mozilla.org/show_bug.cg
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="role.js"></script>
 
   <script type="application/javascript">
     function testThis(aID)
     {
       getRole(aID, ROLE_FLAT_EQUATION);
       var eqAcc = getAccessible(aID);
       if (eqAcc)
         is(eqAcc.name, "x^2 + y^2 + z^2", "Wrong name for " + aID + "!");
--- a/accessible/tests/mochitest/test_aria_roles.html
+++ b/accessible/tests/mochitest/test_aria_roles.html
@@ -11,19 +11,19 @@ https://bugzilla.mozilla.org/show_bug.cg
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="role.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {
       // Note:
       // The phrase "weak foo" here means that there is no good foo-to-platform
       // role mapping. Similarly "strong foo" means there is a good foo-to-
       // platform role mapping.
--- a/accessible/tests/mochitest/test_aria_roles.xul
+++ b/accessible/tests/mochitest/test_aria_roles.xul
@@ -7,17 +7,17 @@
         title="Accessibility Name Calculating Test.">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="common.js"></script>
 
   <script type="application/javascript">
   <![CDATA[
     function doTest()
     {
       ok(!isAccessible("presentation_label"),
                       "Presentation label shouldn't be accessible.");
       ok(!isAccessible("presentation_descr"),
--- a/accessible/tests/mochitest/test_aria_token_attrs.html
+++ b/accessible/tests/mochitest/test_aria_token_attrs.html
@@ -8,21 +8,21 @@ https://bugzilla.mozilla.org/show_bug.cg
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="role.js"></script>
   <script type="application/javascript"
-      src="chrome://mochikit/content/a11y/accessible/states.js"></script>
+      src="states.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {
       // test aria-pressed state mapping to roles PUSHBUTTON vs TOGGLEBUTTON
       testRole("button_pressed_true", ROLE_TOGGLE_BUTTON);
       testRole("button_pressed_false", ROLE_TOGGLE_BUTTON);
       testRole("button_pressed_empty", ROLE_PUSHBUTTON);
--- a/accessible/tests/mochitest/test_bug420863.html
+++ b/accessible/tests/mochitest/test_bug420863.html
@@ -8,21 +8,21 @@ https://bugzilla.mozilla.org/show_bug.cg
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/events.js"></script>
+          src="events.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/actions.js"></script>
+          src="actions.js"></script>
 
   <script type="application/javascript">
     var gClickHandler = null;
 
     function doTest()
     {
       // Actions should be exposed on any accessible having related DOM node
       // with registered 'click' event handler.
--- a/accessible/tests/mochitest/test_childAtPoint.html
+++ b/accessible/tests/mochitest/test_childAtPoint.html
@@ -5,19 +5,19 @@
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/layout.js"></script>
+          src="layout.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {
       // Not specific case, child and deepchild testing.
       var list = getAccessible("list");
       var listitem = getAccessible("listitem");
       var image = getAccessible("image");
--- a/accessible/tests/mochitest/test_childAtPoint.xul
+++ b/accessible/tests/mochitest/test_childAtPoint.xul
@@ -7,22 +7,22 @@
         title="nsIAccessible::getChildAtPoint and getDeepestChildAtPoint">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js" />
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/treeview.js" />
+          src="treeview.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js" />
+          src="common.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/layout.js" />
+          src="layout.js" />
 
   <script type="application/javascript">
   <![CDATA[
     function doTest()
     {
       // Initialize the tree
       var view = new inTreeView();
       view.mRowCount = 5;
--- a/accessible/tests/mochitest/test_descr.html
+++ b/accessible/tests/mochitest/test_descr.html
@@ -4,17 +4,17 @@
   <title>nsIAccessible::description tests</title>
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="common.js"></script>
 
   <script type="application/javascript">
     function testDescr(aAccOrElmOrID, aDescr)
     {
       var acc = getAccessible(aAccOrElmOrID);
       if (!acc)
         return;
 
--- a/accessible/tests/mochitest/test_editabletext_1.html
+++ b/accessible/tests/mochitest/test_editabletext_1.html
@@ -7,19 +7,19 @@ https://bugzilla.mozilla.org/show_bug.cg
   <title>nsIAccessibleEditableText chrome tests</title>
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/editabletext.js"></script>
+          src="editabletext.js"></script>
 
   <script type="application/javascript">
     var gParagraphAcc;
 
     function testEditable(aID)
     {
       var et = new nsEditableText(aID);
 
--- a/accessible/tests/mochitest/test_editabletext_2.html
+++ b/accessible/tests/mochitest/test_editabletext_2.html
@@ -5,19 +5,19 @@
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/editabletext.js"></script>
+          src="editabletext.js"></script>
 
   <script type="application/javascript">
     var gParagraphAcc;
 
     function doTest()
     {
       var et = new nsEditableText("input");
 
--- a/accessible/tests/mochitest/test_elm_listbox.xul
+++ b/accessible/tests/mochitest/test_elm_listbox.xul
@@ -7,19 +7,19 @@
         title="XUL listbox element test.">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="role.js"></script>
 
   <script type="application/javascript">
   <![CDATA[
     function doTest()
     {
       var id = "";
       var listbox = null, acc = null;
 
--- a/accessible/tests/mochitest/test_elm_media.html
+++ b/accessible/tests/mochitest/test_elm_media.html
@@ -8,25 +8,25 @@ https://bugzilla.mozilla.org/show_bug.cg
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/events.js"></script>
+          src="events.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/actions.js"></script>
+          src="actions.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="role.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/states.js"></script>
+          src="states.js"></script>
 
   <script type="application/javascript">
 
     // gA11yEventDumpID = "eventDump";
 
     function focusChecker(aAcc)
     {
       this.type = EVENT_FOCUS;
@@ -147,14 +147,14 @@ https://bugzilla.mozilla.org/show_bug.cg
   <a target="_blank"
      title="Expose HTML5 video and audio elements' embedded controls through accessibility APIs"
      href="https://bugzilla.mozilla.org/show_bug.cgi?id=483573">Mozilla Bug 483573</a>
   <p id="display"></p>
   <div id="content" style="display: none"></div>
   <pre id="test">
   </pre>
 
-  <audio id="audio" src="chrome://mochikit/content/a11y/accessible/bug461281.ogg"
+  <audio id="audio" src="bug461281.ogg"
          controls="true"></audio>
 
   <div id="eventDump"></div>
 </body>
 </html>
--- a/accessible/tests/mochitest/test_elm_nsApplicationAcc.html
+++ b/accessible/tests/mochitest/test_elm_nsApplicationAcc.html
@@ -5,19 +5,19 @@
   <link rel="stylesheet" type="text/css" 
          href="chrome://mochikit/content/tests/SimpleTest/test.css" />
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript" 
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript" 
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="common.js"></script>
   <script type="application/javascript" 
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="role.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {
         var accessible = getApplicationAccessible();
         if (!accessible) {
           SimpleTest.finish();
           return;
--- a/accessible/tests/mochitest/test_elm_plugin.html
+++ b/accessible/tests/mochitest/test_elm_plugin.html
@@ -6,21 +6,21 @@
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="role.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/states.js"></script>
+          src="states.js"></script>
 
   <script type="application/javascript">
 
     function doTest()
     {
       if (!WIN) {
         ok(true,
            "Nothing to test because accessible plugins are supported on Windows only");
--- a/accessible/tests/mochitest/test_name.html
+++ b/accessible/tests/mochitest/test_name.html
@@ -6,19 +6,19 @@
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/name.js"></script>
+          src="name.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {
       // aria-label
 
       // Simple label provided via ARIA
       testName("btn_simple_aria_label", "I am a button");
--- a/accessible/tests/mochitest/test_name.xul
+++ b/accessible/tests/mochitest/test_name.xul
@@ -1,30 +1,30 @@
 <?xml version="1.0"?>
 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
                  type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/a11y/accessible/name.css"
+<?xml-stylesheet href="name.css"
                  type="text/css"?>
 
 
 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         title="Accessibility Name Calculating Test.">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="role.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/name.js"></script>
+          src="name.js"></script>
 
   <script type="application/javascript">
   <![CDATA[
     function doTest()
     {
       // aria-label
 
       // Simple label provided via ARIA
--- a/accessible/tests/mochitest/test_name_button.html
+++ b/accessible/tests/mochitest/test_name_button.html
@@ -5,19 +5,19 @@
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/name.js"></script>
+          src="name.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {
       // html:button, aria-label
       testName("btn_aria_label", "button label");
 
       // html:button, aria-labelledby
--- a/accessible/tests/mochitest/test_name_link.html
+++ b/accessible/tests/mochitest/test_name_link.html
@@ -7,19 +7,19 @@
         type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/name.js"></script>
+          src="name.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {
       // aria-label
       testName("aria_label", "anchor label");
 
       // aria-labelledby
--- a/accessible/tests/mochitest/test_name_markup.html
+++ b/accessible/tests/mochitest/test_name_markup.html
@@ -5,21 +5,21 @@
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/events.js"></script>
+          src="events.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/name.js"></script>
+          src="name.js"></script>
 
   <script type="application/javascript">
     // gA11yEventDumpID = "eventdump";
 
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(testNames);
   </script>
 
--- a/accessible/tests/mochitest/test_name_nsRootAcc.xul
+++ b/accessible/tests/mochitest/test_name_nsRootAcc.xul
@@ -9,21 +9,21 @@
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="role.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/events.js"></script>
+          src="events.js"></script>
 
   <script type="application/javascript">
   <![CDATA[
     // var gA11yEventDumpID = "eventdump"; // debug stuff
 
     function doTest()
     {
       // Actually, just disable this test everywhere -- bug 586818.
@@ -31,17 +31,17 @@
       return;
 
       if (LINUX) {
         todo(false, "Enable test on Linux - see bug 525175.");
         SimpleTest.finish();
         return;
       }
 
-      var w = window.openDialog("chrome://mochikit/content/a11y/accessible/name_nsRootAcc_wnd.xul",
+      var w = window.openDialog("name_nsRootAcc_wnd.xul",
                                 "nsRootAcc_name_test", 
                                 "chrome,width=600,height=600");
     }
 
     SimpleTest.waitForExplicitFinish();
     addLoadEvent(doTest);
   ]]>
   </script>
--- a/accessible/tests/mochitest/test_nsIAccessNode_utils.html
+++ b/accessible/tests/mochitest/test_nsIAccessNode_utils.html
@@ -6,17 +6,17 @@
   <link rel="stylesheet" type="text/css"
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="common.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {
       var elmObj = {};
       var acc = getAccessible("span", [nsIAccessNode], elmObj);
       computedStyle = document.defaultView.getComputedStyle(elmObj.value, "");
 
--- a/accessible/tests/mochitest/test_nsIAccessibleDocument.html
+++ b/accessible/tests/mochitest/test_nsIAccessibleDocument.html
@@ -5,21 +5,24 @@ https://bugzilla.mozilla.org/show_bug.cg
 <head>
   <title>nsIAccessibleDocument chrome tests</title>
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-    src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+    src="common.js"></script>
+  <script type="application/javascript"
+    src="role.js"></script>
   <script type="application/javascript"
-    src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+    src="states.js"></script>
+
   <script type="application/javascript"
-    src="chrome://mochikit/content/a11y/accessible/states.js"></script>
+          src="chrome://mochikit/content/chrome-harness.js"/>
 
   <script type="application/javascript">
     function doTest()
     {
       var docAcc = getAccessible(document, [nsIAccessibleDocument]);
       if (docAcc) {
         // nsIAccessible
         is(docAcc.name, "nsIAccessibleDocument chrome tests",
@@ -34,17 +37,18 @@ https://bugzilla.mozilla.org/show_bug.cg
         is(docAcc.numActions, 0, "Wrong number of actions for document!");
 
         // attributes should contain tag:body
         attributes = docAcc.attributes;
         is(attributes.getStringProperty("tag"), "BODY",
            "Wrong attribute on document!");
 
         // nsIAccessibleDocument
-        is(docAcc.URL, "chrome://mochikit/content/a11y/accessible/test_nsIAccessibleDocument.html",
+        var rootDir = getRootDirectory(window.location.href);
+        is(docAcc.URL, rootDir.path + "test_nsIAccessibleDocument.html",
            "Wrong URL for document!");
         is(docAcc.title, "nsIAccessibleDocument chrome tests",        
            "Wrong title for document!");
         is(docAcc.mimeType, "text/html",
            "Wrong mime type for document!");
         // nsDocAccessible::getDocType currently returns NS_ERROR_FAILURE.
         // See bug 442005. After fixing, please remove this comment and
         // uncomment the below two lines to enable the test.
--- a/accessible/tests/mochitest/test_nsIAccessibleHyperText.html
+++ b/accessible/tests/mochitest/test_nsIAccessibleHyperText.html
@@ -8,17 +8,17 @@ https://bugzilla.mozilla.org/show_bug.cg
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="common.js"></script>
 
   <script type="application/javascript">
     var gParagraphAcc;
 
     function testLinkIndexAtOffset(aID, aOffset, aIndex)
     {
       var htAcc = getAccessible(aID, [nsIAccessibleHyperText]);
       is(htAcc.getLinkIndexAtOffset(aOffset), aIndex,
--- a/accessible/tests/mochitest/test_nsIAccessibleImage.html
+++ b/accessible/tests/mochitest/test_nsIAccessibleImage.html
@@ -8,21 +8,21 @@ https://bugzilla.mozilla.org/show_bug.cg
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="role.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/attributes.js"></script>
+          src="attributes.js"></script>
 
   <script type="application/javascript">
     function testCoordinates(aID, aAcc, aWidth, aHeight)
     {
       var screenX = {}, screenY = {}, windowX = {}, windowY = {}, parentX = {},
           parentY = {};
 
       // get screen coordinates.
--- a/accessible/tests/mochitest/test_nsIAccessible_comboboxes.xul
+++ b/accessible/tests/mochitest/test_nsIAccessible_comboboxes.xul
@@ -11,19 +11,19 @@
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js" />
+          src="common.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/events.js" />        
+          src="events.js" />        
 
   <script type="application/javascript">
   <![CDATA[
     function openHideCombobox(aComboboxNodeOrID, aIsOpen)
     {
       this.invoke = function invoke()
       {
         synthesizeMouse(this.DOMNode, 5, 5, {});
--- a/accessible/tests/mochitest/test_nsIAccessible_focus.html
+++ b/accessible/tests/mochitest/test_nsIAccessible_focus.html
@@ -6,19 +6,19 @@
   <link rel="stylesheet" type="text/css"
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/events.js"></script>
+          src="events.js"></script>
 
   <script type="application/javascript">
     ////////////////////////////////////////////////////////////////////////////
     // Test
 
     function doTest()
     {
       // focus ARIA link
--- a/accessible/tests/mochitest/test_nsIAccessible_selects.html
+++ b/accessible/tests/mochitest/test_nsIAccessible_selects.html
@@ -4,21 +4,21 @@
   <title>nsIAccessible selects tests</title>
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="role.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/nsIAccessible_selects.js"></script>
+          src="nsIAccessible_selects.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {
       // Label and combo, separate tags
       var names = [
         "Foo:", // combobox
         "Foo:", // combobox list
--- a/accessible/tests/mochitest/test_nsOuterDocAccessible.html
+++ b/accessible/tests/mochitest/test_nsOuterDocAccessible.html
@@ -7,21 +7,21 @@ https://bugzilla.mozilla.org/show_bug.cg
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/states.js"></script>
+          src="states.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="role.js"></script>
 
   <script type="application/javascript">
     // needed error return value
     const ns_error_invalid_arg = Components.results.NS_ERROR_INVALID_ARG;
 
     function doTest()
     {
       // Get accessible for body tag.
--- a/accessible/tests/mochitest/test_role_nsHyperTextAcc.html
+++ b/accessible/tests/mochitest/test_role_nsHyperTextAcc.html
@@ -5,19 +5,19 @@
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="role.js"></script>
 
   <script type="application/javascript">
     function doTests()
     {
       // Test html:form.
       testRole("frm", ROLE_FORM);
 
       // test html:div
--- a/accessible/tests/mochitest/test_text_caret.html
+++ b/accessible/tests/mochitest/test_text_caret.html
@@ -7,19 +7,19 @@
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/events.js"></script>
+          src="events.js"></script>
 
   <script type="application/javascript">
 
     /**
      * Checkers.
      */
     function caretMovedChecker(aID, aOffset)
     {
--- a/accessible/tests/mochitest/test_textboxes.html
+++ b/accessible/tests/mochitest/test_textboxes.html
@@ -8,24 +8,24 @@ https://bugzilla.mozilla.org/show_bug.cg
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="role.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/states.js"></script>
+          src="states.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/testTextboxes.js"></script>
+          src="testTextboxes.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {
       //////////////////////////////////////////////////////////////////////////
       // normal textbox without content and with no proper label
       testThis("unlabelled_Textbox", // ID
                null, // name
--- a/accessible/tests/mochitest/test_textboxes.xul
+++ b/accessible/tests/mochitest/test_textboxes.xul
@@ -7,24 +7,24 @@
         title="nsIAccessible XUL textboxes chrome tests">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js" />
+          src="common.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js" />
+          src="role.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/states.js" />
+          src="states.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/testTextboxes.js" />
+          src="testTextboxes.js" />
 
   <script type="application/javascript">
   <![CDATA[
     function doTest()
     {
       //////////////////////////////////////////////////////////////////////////
       // normal textbox without content and with no proper label
       testThis("unlabelled_Textbox", // ID
--- a/accessible/tests/mochitest/test_value.html
+++ b/accessible/tests/mochitest/test_value.html
@@ -17,30 +17,34 @@
   </style>
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="common.js"></script>
+
+  <script type="application/javascript"
+          src="chrome://mochikit/content/chrome-harness.js"/>
 
   <script type="application/javascript">
     function doTest()
     {
       function testValue(aID, aValue)
       {
         var acc = getAccessible(aID);
         if (!acc)
           return;
         is(acc.value, aValue, "Wrong value for " + aID + "!");
       }
 
-      var href = "chrome://mochikit/content/a11y/accessible/foo";
+      var rootDir = getRootDirectory(window.location.href);
+      var href = rootDir.path + "/foo";
 
       // roles that can't live as nsHTMLLinkAccessibles
       testValue("aria_menuitem_link", "");
       testValue("aria_button_link", "");
       testValue("aria_checkbox_link", "");
       testValue("aria_application_link", "");
 
       // roles that can live as nsHTMLLinkAccessibles
--- a/accessible/tests/mochitest/test_value.xul
+++ b/accessible/tests/mochitest/test_value.xul
@@ -7,19 +7,19 @@
         title="XUL progressmeter tests">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js" />
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js" />
+          src="common.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/value.js" />
+          src="value.js" />
 
   <script type="application/javascript">
   <![CDATA[
     function doTest()
     {
       // progressmeter
       testValue("pm1", "50%", .5, 0, 1, 0);
       testValue("pm2", "50%", 500, 0, 1000, 0);
--- a/accessible/tests/mochitest/tree/test_applicationacc.xul
+++ b/accessible/tests/mochitest/tree/test_applicationacc.xul
@@ -7,28 +7,28 @@
         title="Accessible Application Accessible hierarchy tests">
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js" />
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js" />
+          src="../common.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js" />
+          src="../role.js" />
 
   <script type="application/javascript">
   <![CDATA[
     ////////////////////////////////////////////////////////////////////////////
     // Test
 
     // Note: bug 560239 can be tested if this test runs in standalone mode only.
  
-    var gURL = "chrome://mochikit/content/a11y/accessible/tree/wnd.xul"
+    var gURL = "../tree/wnd.xul"
     var gWnd = window.openDialog(gURL, "wnd", "chrome,width=600,height=600");
 
     function doTest()
     {
       // Application accessible should contain two root document accessibles,
       // one is for browser window, another one is for open dialog window.
       var accTree = {
         role: ROLE_APP_ROOT,
--- a/accessible/tests/mochitest/tree/test_aria_globals.html
+++ b/accessible/tests/mochitest/tree/test_aria_globals.html
@@ -6,19 +6,19 @@
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="../role.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {
       var accTree = {
         role: ROLE_GROUPING,
         children: [
           {  role: ROLE_TEXT_CONTAINER }, // pawn
--- a/accessible/tests/mochitest/tree/test_aria_imgmap.html
+++ b/accessible/tests/mochitest/tree/test_aria_imgmap.html
@@ -7,21 +7,21 @@
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="../role.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/states.js"></script>
+          src="../states.js"></script>
 
   <script type="application/javascript">
   function doTest()
   {
     //XXX We send a useless mouse move to the image to force it to setup its
     // image map, because flushing layout won't do it. Hopefully bug 135040
     // will make this not suck.
     synthesizeMouse($("imagemap"), 10, 10, { type: "mousemove" });
--- a/accessible/tests/mochitest/tree/test_button.xul
+++ b/accessible/tests/mochitest/tree/test_button.xul
@@ -7,19 +7,19 @@
         title="Accessible XUL button hierarchy tests">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js" />
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js" />
+          src="../common.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js" />
+          src="../role.js" />
 
   <script type="application/javascript">
   <![CDATA[
     ////////////////////////////////////////////////////////////////////////////
     // Test
 
     function doTest()
     {
--- a/accessible/tests/mochitest/tree/test_colorpicker.xul
+++ b/accessible/tests/mochitest/tree/test_colorpicker.xul
@@ -7,19 +7,19 @@
         title="Accessible XUL button hierarchy tests">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js" />
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js" />
+          src="../common.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js" />
+          src="../role.js" />
 
   <script type="application/javascript">
   <![CDATA[
     ////////////////////////////////////////////////////////////////////////////
     // Test
 
     function doTest()
     {
--- a/accessible/tests/mochitest/tree/test_combobox.xul
+++ b/accessible/tests/mochitest/tree/test_combobox.xul
@@ -7,19 +7,19 @@
         title="Accessible XUL menulist and textbox @autocomplete hierarchy tests">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js" />
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js" />
+          src="../common.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js" />
+          src="../role.js" />
 
   <script type="application/javascript">
   <![CDATA[
     ////////////////////////////////////////////////////////////////////////////
     // Test
 
     function doTest()
     {
--- a/accessible/tests/mochitest/tree/test_cssoverflow.html
+++ b/accessible/tests/mochitest/tree/test_cssoverflow.html
@@ -15,19 +15,19 @@
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/events.js"></script>
+          src="../events.js"></script>
 
   <script type="application/javascript">
     ////////////////////////////////////////////////////////////////////////////
     // Invokers
 
     function focusAnchor(aID)
     {
       this.DOMNode = getNode(aID);
--- a/accessible/tests/mochitest/tree/test_filectrl.html
+++ b/accessible/tests/mochitest/tree/test_filectrl.html
@@ -8,19 +8,19 @@ https://bugzilla.mozilla.org/show_bug.cg
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="../role.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {
       var accTree = {
         role: ROLE_TEXT_CONTAINER,
         children: [
           {
--- a/accessible/tests/mochitest/tree/test_formctrl.html
+++ b/accessible/tests/mochitest/tree/test_formctrl.html
@@ -7,19 +7,19 @@
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="../role.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {
       // input@type="checkbox"
       var accTree = {
         role: ROLE_CHECKBUTTON,
         children: [ ]
--- a/accessible/tests/mochitest/tree/test_formctrl.xul
+++ b/accessible/tests/mochitest/tree/test_formctrl.xul
@@ -7,19 +7,19 @@
         title="Accessible XUL checkbox and radio hierarchy tests">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js" />
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js" />
+          src="../common.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js" />
+          src="../role.js" />
 
   <script type="application/javascript">
   <![CDATA[
     ////////////////////////////////////////////////////////////////////////////
     // Test
 
     function doTest()
     {
--- a/accessible/tests/mochitest/tree/test_gencontent.html
+++ b/accessible/tests/mochitest/tree/test_gencontent.html
@@ -16,19 +16,19 @@
   </style>
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="../role.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {
       // :before and :after pseudo styles
       var accTree = {
         role: ROLE_SECTION,
         children: [
--- a/accessible/tests/mochitest/tree/test_groupbox.xul
+++ b/accessible/tests/mochitest/tree/test_groupbox.xul
@@ -7,19 +7,19 @@
         title="Accessible XUL groupbox hierarchy tests">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js" />
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js" />
+          src="../common.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js" />
+          src="../role.js" />
 
   <script type="application/javascript">
   <![CDATA[
     ////////////////////////////////////////////////////////////////////////////
     // Test
 
     function doTest()
     {
--- a/accessible/tests/mochitest/tree/test_iframe.html
+++ b/accessible/tests/mochitest/tree/test_iframe.html
@@ -6,19 +6,19 @@
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="../role.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {
       var accTree = {
         role: ROLE_INTERNAL_FRAME,
         children: [
           {
--- a/accessible/tests/mochitest/tree/test_img.html
+++ b/accessible/tests/mochitest/tree/test_img.html
@@ -6,19 +6,19 @@
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="../role.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {
       // image map
       var accTree = {
         role: ROLE_IMAGE_MAP,
         children: [
@@ -66,14 +66,14 @@
     <area href="http://www.bbc.co.uk/radio4/atoz/index.shtml#b"
           coords="17,0,30,14" alt="b" shape="rect">
     <area href="http://www.bbc.co.uk/radio4/atoz/index.shtml#a"
           coords="0,0,13,14" alt="a" shape="rect">
   </map>
 
   <img id="imgmap" width="447" height="15"
        usemap="#atoz_map"
-       src="chrome://mochikit/content/a11y/accessible/letters.gif">
+       src="../letters.gif">
 
-  <img id="img" src="chrome://mochikit/content/a11y/accessible/moz.png">
+  <img id="img" src="../moz.png">
 
 </body>
 </html>
--- a/accessible/tests/mochitest/tree/test_list.html
+++ b/accessible/tests/mochitest/tree/test_list.html
@@ -6,19 +6,19 @@
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="../role.js"></script>
 
   <script type="application/javascript">
     function listItemTree(aBulletText, aName, aSubtree)
     {
       var obj = {
         role: ROLE_LISTITEM,
         children: [
           {
--- a/accessible/tests/mochitest/tree/test_list_invalidate.html
+++ b/accessible/tests/mochitest/tree/test_list_invalidate.html
@@ -7,21 +7,21 @@
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="../role.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/events.js"></script>
+          src="../events.js"></script>
 
   <script type="application/javascript">
 
     ////////////////////////////////////////////////////////////////////////////
     // Helpers
 
     function testLiAccessibleTree()
     {
--- a/accessible/tests/mochitest/tree/test_media.html
+++ b/accessible/tests/mochitest/tree/test_media.html
@@ -8,21 +8,21 @@ https://bugzilla.mozilla.org/show_bug.cg
   <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="../role.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/states.js"></script>
+          src="../states.js"></script>
 
   <script type="application/javascript">
 
     function doTest()
     {
       //////////////////////////////////////////////////////////////////////////
       // test the accessible tree
 
@@ -60,14 +60,14 @@ https://bugzilla.mozilla.org/show_bug.cg
   <a target="_blank"
      title="Expose HTML5 video and audio elements' embedded controls through accessibility APIs"
      href="https://bugzilla.mozilla.org/show_bug.cgi?id=483573">Mozilla Bug 483573</a>
   <p id="display"></p>
   <div id="content" style="display: none"></div>
   <pre id="test">
   </pre>
 
-  <audio id="audio" src="chrome://mochikit/content/a11y/accessible/bug461281.ogg"
+  <audio id="audio" src="../bug461281.ogg"
          controls="true"></audio>
 
   <div id="eventDump"></div>
 </body>
 </html>
--- a/accessible/tests/mochitest/tree/test_menu.xul
+++ b/accessible/tests/mochitest/tree/test_menu.xul
@@ -7,19 +7,19 @@
         title="Accessible XUL menu hierarchy tests">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js" />
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js" />
+          src="../common.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js" />
+          src="../role.js" />
 
   <script type="application/javascript">
   <![CDATA[
     ////////////////////////////////////////////////////////////////////////////
     // Test
 
     function doTest()
     {
--- a/accessible/tests/mochitest/tree/test_select.html
+++ b/accessible/tests/mochitest/tree/test_select.html
@@ -6,19 +6,19 @@
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="../role.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {
       var accTree = {
         role: ROLE_LISTBOX,
         children: [
           {
--- a/accessible/tests/mochitest/tree/test_tabbox.xul
+++ b/accessible/tests/mochitest/tree/test_tabbox.xul
@@ -7,19 +7,19 @@
         title="Accessible XUL tabbox hierarchy tests">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js" />
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js" />
+          src="../common.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js" />
+          src="../role.js" />
 
   <script type="application/javascript">
   <![CDATA[
     ////////////////////////////////////////////////////////////////////////////
     // Test
 
     function doTest()
     {
--- a/accessible/tests/mochitest/tree/test_tabbrowser.xul
+++ b/accessible/tests/mochitest/tree/test_tabbrowser.xul
@@ -15,19 +15,19 @@
         title="Accessible XUL tabbrowser hierarchy tests">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js" />
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js" />
+          src="../common.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js" />
+          src="../role.js" />
 
   <script type="application/javascript">
   <![CDATA[
     ////////////////////////////////////////////////////////////////////////////
     // Test
 
     const Ci = Components.interfaces;
 
--- a/accessible/tests/mochitest/tree/test_table.html
+++ b/accessible/tests/mochitest/tree/test_table.html
@@ -6,19 +6,19 @@
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="../role.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {
       //////////////////////////////////////////////////////////////////////////
       // table1
 
       var accTree = {
--- a/accessible/tests/mochitest/tree/test_tree.xul
+++ b/accessible/tests/mochitest/tree/test_tree.xul
@@ -7,24 +7,24 @@
         title="Accessible XUL tree hierarchy tests">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js" />
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/treeview.js" />
+          src="../treeview.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js" />
+          src="../common.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js" />
+          src="../role.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/events.js" />
+          src="../events.js" />
 
   <script type="application/javascript">
   <![CDATA[
     ////////////////////////////////////////////////////////////////////////////
     // Accessible tree testers
 
     function getTreeItemAccTree(aTableRole, acolumnCount)
     {
--- a/accessible/tests/mochitest/tree/test_txtcntr.html
+++ b/accessible/tests/mochitest/tree/test_txtcntr.html
@@ -7,19 +7,19 @@
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="../role.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {
       var accTree = {
         role: ROLE_SECTION,
         children: [
           { // text child
--- a/accessible/tests/mochitest/tree/test_txtctrl.html
+++ b/accessible/tests/mochitest/tree/test_txtctrl.html
@@ -7,19 +7,19 @@
         href="chrome://mochikit/content/tests/SimpleTest/test.css" />
 
   <script type="application/javascript"
           src="chrome://mochikit/content/MochiKit/packed.js"></script>
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js"></script>
+          src="../common.js"></script>
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js"></script>
+          src="../role.js"></script>
 
   <script type="application/javascript">
     function doTest()
     {
       // editable div
       var accTree = {
         role: ROLE_SECTION,
         children: [
--- a/accessible/tests/mochitest/tree/test_txtctrl.xul
+++ b/accessible/tests/mochitest/tree/test_txtctrl.xul
@@ -7,19 +7,19 @@
         title="Accessible XUL textbox and textarea hierarchy tests">
 
   <script type="application/javascript" 
           src="chrome://mochikit/content/MochiKit/packed.js" />
   <script type="application/javascript"
           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
 
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/common.js" />
+          src="../common.js" />
   <script type="application/javascript"
-          src="chrome://mochikit/content/a11y/accessible/role.js" />
+          src="../role.js" />
 
   <script type="application/javascript">
   <![CDATA[
     ////////////////////////////////////////////////////////////////////////////
     // Test
 
     function doTest()
     {
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -85,16 +85,33 @@ pref("app.update.timer", 600000);
 // App-specific update preferences
 
 // The interval to check for updates (app.update.interval) is defined in
 // firefox-branding.js
 
 // Enables some extra Application Update Logging (can reduce performance)
 pref("app.update.log", false);
 
+// When |app.update.cert.requireBuiltIn| is true or not specified the
+// final certificate and all certificates the connection is redirected to before
+// the final certificate for the url specified in the |app.update.url|
+// preference must be built-in.
+pref("app.update.cert.requireBuiltIn", true);
+
+// When |app.update.cert.checkAttributes| is true or not specified the
+// certificate attributes specified in the |app.update.certs.| preference branch
+// are checked against the certificate for the url specified by the
+// |app.update.url| preference.
+pref("app.update.cert.checkAttributes", true);
+
+// The number of certificate attribute check failures to allow for background
+// update checks before notifying the user of the failure. User initiated update
+// checks always notify the user of the certificate attribute check failure.
+pref("app.update.cert.maxErrors", 5);
+
 // The |app.update.certs.| preference branch contains branches that are
 // sequentially numbered starting at 1 that contain attribute name / value
 // pairs for the certificate used by the server that hosts the update xml file
 // as specified in the |app.update.url| preference. When these preferences are
 // present the following conditions apply for a successful update check:
 // 1. the uri scheme must be https
 // 2. the preference name must exist as an attribute name on the certificate and
 //    the value for the name must be the same as the value for the attribute name
--- a/browser/base/content/browser-fullZoom.js
+++ b/browser/base/content/browser-fullZoom.js
@@ -251,20 +251,20 @@ var FullZoom = {
     if (aURI.spec == "about:blank") {
       this._applyPrefToSetting(undefined, aBrowser);
       return;
     }
 
     var self = this;
     Services.contentPrefs.getPref(aURI, this.name, function (aResult) {
       // Check that we're still where we expect to be in case this took a while.
-      let isSaneURI = (aBrowser && aBrowser.currentURI) ?
-        aURI.equals(aBrowser.currentURI) : false;
-      if (!aBrowser || isSaneURI)
-        self._applyPrefToSetting(aResult, aBrowser);
+      let browser = aBrowser || gBrowser.selectedBrowser;
+      if (aURI.equals(browser.currentURI)) {
+        self._applyPrefToSetting(aResult, browser);
+      }
     });
   },
 
   // update state of zoom type menu item
 
   updateMenu: function FullZoom_updateMenu() {
     var menuItem = document.getElementById("toggle_zoom");
 
--- a/browser/base/content/browser.css
+++ b/browser/base/content/browser.css
@@ -95,16 +95,23 @@ toolbar[printpreview="true"] {
   -moz-binding: url("chrome://global/content/bindings/general.xml#windowdragbox");
 }
 %endif
 
 toolbarpaletteitem[place="palette"] > toolbaritem > hbox[type="places"] {
   display: none;
 }
 
+#wrapper-urlbar-container #urlbar-container > #urlbar > toolbarbutton,
+#urlbar-container:not([combined]) > #urlbar > toolbarbutton,
+#urlbar-container[combined] + #reload-button + #stop-button,
+#urlbar-container[combined] + #reload-button,
+toolbar:not([mode="icons"]) > #urlbar-container > #urlbar > toolbarbutton,
+toolbar[mode="icons"] > #urlbar-container > #urlbar > #urlbar-reload-button:not([displaystop]) + #urlbar-stop-button,
+toolbar[mode="icons"] > #urlbar-container > #urlbar > #urlbar-reload-button[displaystop],
 toolbar[mode="icons"] > #reload-button:not([displaystop]) + #stop-button,
 toolbar[mode="icons"] > #reload-button[displaystop] {
   visibility: collapse;
 }
 
 #main-window:-moz-lwtheme {
   background-repeat: no-repeat;
   background-position: top right;
@@ -173,18 +180,22 @@ richlistitem[type~="action"]:-moz-locale
 #feed-button > .button-box > .button-menu-dropmarker {
   display: none;
 }
 
 #feed-menu > .feed-menuitem:-moz-locale-dir(rtl) {
   direction: rtl;
 }
 
+#urlbar-container[combined] > #urlbar > #urlbar-icons > #go-button,
 #urlbar[pageproxystate="invalid"] > #urlbar-icons > .urlbar-icon:not(#go-button),
-#urlbar[pageproxystate="valid"] > #urlbar-icons > #go-button {
+#urlbar[pageproxystate="valid"] > #urlbar-icons > #go-button,
+#urlbar[pageproxystate="invalid"][focused="true"] > #urlbar-go-button ~ toolbarbutton,
+#urlbar[pageproxystate="valid"] > #urlbar-go-button,
+#urlbar:not([focused="true"]) > #urlbar-go-button {
   visibility: collapse;
 }
 
 #identity-icon-labels {
   max-width: 18em;
 }
 
 #identity-icon-country-label {
@@ -343,8 +354,12 @@ window[chromehidden~="toolbar"] toolbar:
   display: none;
   -moz-user-focus: normal;
 }
 
 #notification-popup-box[anchorid="geo-notification-icon"] > #geo-notification-icon,
 #notification-popup-box[anchorid="addons-notification-icon"] > #addons-notification-icon {
   display: -moz-box;
 }
+
+#geolocation-notification {
+  -moz-binding: url("chrome://browser/content/urlbarBindings.xml#geolocation-notification");
+}
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -319,21 +319,16 @@ function SetClickAndHoldHandlers() {
     forwardButton.setAttribute("type", "menu");
     forwardButton.appendChild(popup);
     _addClickAndHoldListenersOnElement(forwardButton);
     unifiedButton._clickHandlersAttached = true;
   }
 }
 #endif
 
-function BookmarkThisTab(aTab) {
-  PlacesCommandHook.bookmarkPage(aTab.linkedBrowser,
-                                 PlacesUtils.bookmarksMenuFolderId, true);
-}
-
 const gSessionHistoryObserver = {
   observe: function(subject, topic, data)
   {
     if (topic != "browser:purge-session-history")
       return;
 
     var backCommand = document.getElementById("Browser:Back");
     backCommand.setAttribute("disabled", "true");
@@ -2360,20 +2355,23 @@ function losslessDecodeURI(aURI) {
   return value;
 }
 
 function UpdateUrlbarSearchSplitterState()
 {
   var splitter = document.getElementById("urlbar-search-splitter");
   var urlbar = document.getElementById("urlbar-container");
   var searchbar = document.getElementById("search-container");
+  var stop = document.getElementById("stop-button");
 
   var ibefore = null;
   if (urlbar && searchbar) {
-    if (urlbar.nextSibling == searchbar)
+    if (urlbar.nextSibling == searchbar ||
+        urlbar.getAttribute("combined") &&
+        stop && stop.nextSibling == searchbar)
       ibefore = searchbar;
     else if (searchbar.nextSibling == urlbar)
       ibefore = urlbar;
   }
 
   if (ibefore) {
     if (!splitter) {
       splitter = document.createElement("splitter");
@@ -4456,33 +4454,40 @@ var XULBrowserWindow = {
   }
 };
 
 var CombinedStopReload = {
   init: function () {
     if (this._initialized)
       return;
 
-    var stop = document.getElementById("stop-button");
-    if (!stop)
-      return;
-
+    var urlbar = document.getElementById("urlbar-container");
     var reload = document.getElementById("reload-button");
-    if (!reload)
-      return;
-
-    if (!(reload.nextSibling == stop))
+    var stop = document.getElementById("stop-button");
+
+    if (urlbar) {
+      if (urlbar.parentNode.getAttribute("mode") != "icons" ||
+          !reload || urlbar.nextSibling != reload ||
+          !stop || reload.nextSibling != stop)
+        urlbar.removeAttribute("combined");
+      else {
+        urlbar.setAttribute("combined", "true");
+        reload = document.getElementById("urlbar-reload-button");
+        stop = document.getElementById("urlbar-stop-button");
+      }
+    }
+    if (!stop || !reload || reload.nextSibling != stop)
       return;
 
     this._initialized = true;
     if (XULBrowserWindow.stopCommand.getAttribute("disabled") != "true")
       reload.setAttribute("displaystop", "true");
     stop.addEventListener("click", this, false);
+    this.reload = reload;
     this.stop = stop;
-    this.reload = reload;
   },
 
   uninit: function () {
     if (!this._initialized)
       return;
 
     this._cancelTransition();
     this._initialized = false;
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -131,20 +131,16 @@
         <menupopup id="context_tabViewMenuPopup"
                    onpopupshowing="if (event.target == this) TabView.updateContextMenu(TabContextMenu.contextTab, this);">
           <menuseparator id="context_tabViewNamedGroups" hidden="true"/>
           <menuitem label="&moveToNewGroup.label;"
                     oncommand="TabView.moveTabTo(TabContextMenu.contextTab, null);"/>
         </menupopup>
       </menu>
       <menuseparator/>
-      <menuitem id="context_bookmarkTab"
-                label="&bookmarkThisTab.label;"
-                accesskey="&bookmarkThisTab.accesskey;"
-                oncommand="BookmarkThisTab(TabContextMenu.contextTab);"/>
       <menuitem id="context_bookmarkAllTabs"
                 label="&bookmarkAllTabs.label;"
                 accesskey="&bookmarkAllTabs.accesskey;"
                 command="Browser:BookmarkAllTabs"/>
       <menuseparator/>
       <menuitem id="context_closeOtherTabs" label="&closeOtherTabs.label;" accesskey="&closeOtherTabs.accesskey;"
                 oncommand="gBrowser.removeAllTabsBut(TabContextMenu.contextTab);"/>
       <menuitem id="context_undoCloseTab"
@@ -483,17 +479,17 @@
                </menu>
           </hbox>
           <menuitem id="appmenu_privateBrowsing"
                     class="menuitem-iconic"
                     label="&privateBrowsingCmd.start.label;"
                     startlabel="&privateBrowsingCmd.start.label;"
                     stoplabel="&privateBrowsingCmd.stop.label;"
                     command="Tools:PrivateBrowsing"/>
-          <menuseparator/>
+          <menuseparator class="appmenu-menuseparator"/>
           <hbox class="split-menuitem">
             <menuitem id="appmenu-edit-menuitem"
                       label="&editMenu.label;"
                       disabled="true"/>
             <toolbarbutton id="appmenu-cut"
                            class="appmenu-edit-button"
                            command="cmd_cut"
                            onclick="if (!this.disabled) hidePopup();"
@@ -507,17 +503,17 @@
                            class="appmenu-edit-button"
                            command="cmd_paste"
                            onclick="if (!this.disabled) hidePopup();"
                            tooltiptext="&pasteButton.tooltip;"/>
           </hbox>
           <menuitem id="appmenu_find"
                     label="&appMenuFind.label;"
                     command="cmd_find"/>
-          <menuseparator/>
+          <menuseparator class="appmenu-menuseparator"/>
           <menuitem id="appmenu_savePage"
                     label="&savePageCmd.label;"
                     command="Browser:SavePage"/>
           <menuitem id="appmenu_sendLink"
                     label="&sendPageCmd.label;"
                     command="Browser:SendLink"/>
           <hbox flex="1"
                 class="split-menuitem">
@@ -536,17 +532,17 @@
                           label="&printPreviewCmd.label;"
                           command="cmd_printPreview"/>
                 <menuitem id="appmenu_printSetup"
                           label="&printSetupCmd.label;"
                           command="cmd_pageSetup"/>
               </menupopup>
             </menu>
           </hbox>
-          <menuseparator/>
+          <menuseparator class="appmenu-menuseparator"/>
           <menu id="appmenu_developer"
                 label="&developerMenu.label;">
             <menupopup id="appmenu_developer_popup">
               <menuitem id="appmenu_webConsole"
                         label="&webConsoleCmd.label;"
                         type="checkbox"
                         oncommand="HUDConsoleUI.toggleHUD();"/>
               <menuitem id="appmenu_pageInspect"
@@ -558,17 +554,17 @@
                         label="&viewPageSourceCmd.label;"
                         command="View:PageSource"/>
               <menuseparator/>
               <menuitem label="&goOfflineCmd.label;"
                         type="checkbox"
                         oncommand="BrowserOffline.toggleOfflineStatus();"/>
             </menupopup>
           </menu>
-          <menuseparator/>
+          <menuseparator class="appmenu-menuseparator"/>
           <menuitem id="appmenu_fullScreen"
                     label="&fullScreenCmd.label;"
                     type="checkbox"
                     observes="View:FullScreen"/>
           <menuitem id="appmenu-quit"
                     class="menuitem-iconic"
 #ifdef XP_WIN
                     label="&quitApplicationCmdWin.label;"
@@ -789,20 +785,20 @@
       </toolbaritem>
     </toolbar>
 
     <toolbar id="nav-bar" class="toolbar-primary chromeclass-toolbar"
              toolbarname="&navbarCmd.label;" accesskey="&navbarCmd.accesskey;"
              fullscreentoolbar="true" mode="icons" customizable="true"
 #ifdef WINCE
              iconsize="small" defaulticonsize="small"
-             defaultset="unified-back-forward-button,reload-button,stop-button,home-button,urlbar-container,search-container,bookmarks-menu-button-container,navigator-throbber,fullscreenflex,window-controls"
+             defaultset="unified-back-forward-button,home-button,urlbar-container,reload-button,stop-button,search-container,bookmarks-menu-button-container,navigator-throbber,fullscreenflex,window-controls"
 #else
              iconsize="large"
-             defaultset="unified-back-forward-button,reload-button,stop-button,home-button,urlbar-container,search-container,bookmarks-menu-button-container,fullscreenflex,window-controls"
+             defaultset="unified-back-forward-button,home-button,urlbar-container,reload-button,stop-button,search-container,bookmarks-menu-button-container,fullscreenflex,window-controls"
 #endif
              context="toolbar-context-menu">
 
       <toolbaritem id="unified-back-forward-button" class="chromeclass-toolbar-additional"
                    context="backForwardMenu" removable="true"
                    title="&backForwardItem.title;">
         <toolbarbutton id="back-button" class="toolbarbutton-1"
                        label="&backCmd.label;"
@@ -826,37 +822,26 @@
                      onpopupshowing="return FillHistoryMenu(event.target);"
                      oncommand="gotoHistoryIndex(event); event.stopPropagation();"
                      onclick="checkForMiddleClick(this, event);"/>
           <observes element="Browser:Back" attribute="disabled"/>
           <observes element="Browser:Forward" attribute="disabled"/>
         </toolbarbutton>
       </toolbaritem>
 
-      <toolbarbutton id="reload-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
-                     label="&reloadCmd.label;" removable="true"
-                     command="Browser:ReloadOrDuplicate"
-                     onclick="checkForMiddleClick(this, event);"
-                     tooltiptext="&reloadButton.tooltip;"/>
-
-      <toolbarbutton id="stop-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
-                     label="&stopCmd.label;" removable="true"
-                     command="Browser:Stop"
-                     tooltiptext="&stopButton.tooltip;"/>
-
       <toolbarbutton id="home-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
                      persist="class" removable="true"
                      label="&homeButton.label;"
                      ondragover="homeButtonObserver.onDragOver(event)"
                      ondragenter="homeButtonObserver.onDragOver(event)"
                      ondrop="homeButtonObserver.onDrop(event)"
                      ondragleave="homeButtonObserver.onDragLeave(event)"
                      onclick="BrowserGoHome(event);"/>
 
-      <toolbaritem id="urlbar-container" align="center" flex="400" persist="width"
+      <toolbaritem id="urlbar-container" align="center" flex="400" persist="width" combined="true"
                    title="&locationItem.title;" class="chromeclass-location" removable="true">
         <textbox id="urlbar" flex="1"
                  placeholder="&urlbar.placeholder;"
                  type="autocomplete"
                  autocompletesearch="history"
                  autocompletesearchparam="enable-actions"
                  autocompletepopup="PopupAutoCompleteRichResult"
                  completeselectedindex="true"
@@ -918,19 +903,40 @@
             <image id="star-button"
                    class="urlbar-icon"
                    onclick="PlacesStarButton.onClick(event);"/>
             <image id="go-button"
                    class="urlbar-icon"
                    tooltiptext="&goEndCap.tooltip;"
                    onclick="gURLBar.handleCommand(event);"/>
           </hbox>
+          <toolbarbutton id="urlbar-go-button"
+                         onclick="gURLBar.handleCommand(event);"
+                         tooltiptext="&goEndCap.tooltip;"/>
+          <toolbarbutton id="urlbar-reload-button"
+                         command="Browser:ReloadOrDuplicate"
+                         onclick="checkForMiddleClick(this, event);"
+                         tooltiptext="&reloadButton.tooltip;"/>
+          <toolbarbutton id="urlbar-stop-button"
+                         command="Browser:Stop"
+                         tooltiptext="&stopButton.tooltip;"/>
         </textbox>
       </toolbaritem>
 
+      <toolbarbutton id="reload-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
+                     label="&reloadCmd.label;" removable="true"
+                     command="Browser:ReloadOrDuplicate"
+                     onclick="checkForMiddleClick(this, event);"
+                     tooltiptext="&reloadButton.tooltip;"/>
+
+      <toolbarbutton id="stop-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
+                     label="&stopCmd.label;" removable="true"
+                     command="Browser:Stop"
+                     tooltiptext="&stopButton.tooltip;"/>
+
       <toolbaritem id="search-container" title="&searchItem.title;"
                    align="center" class="chromeclass-toolbar-additional"
                    flex="100" persist="width" removable="true">
         <searchbar id="searchbar" flex="1"/>
       </toolbaritem>
 
       <toolbaritem id="bookmarks-menu-button-container"
                    class="chromeclass-toolbar-additional"
--- a/browser/base/content/nsContextMenu.js
+++ b/browser/base/content/nsContextMenu.js
@@ -399,17 +399,18 @@ nsContextMenu.prototype = {
     this.showItem("context-media-pause", onMedia && !this.target.paused && !this.target.ended);
     this.showItem("context-media-mute",   onMedia && !this.target.muted);
     this.showItem("context-media-unmute", onMedia && this.target.muted);
     this.showItem("context-media-showcontrols", onMedia && !this.target.controls);
     this.showItem("context-media-hidecontrols", onMedia && this.target.controls);
     this.showItem("context-video-fullscreen", this.onVideo);
     // Disable them when there isn't a valid media source loaded.
     if (onMedia) {
-      var hasError = (this.target.error != null);
+      var hasError = this.target.error != null ||
+                     this.target.networkState == this.target.NETWORK_NO_SOURCE;
       this.setItemAttr("context-media-play",  "disabled", hasError);
       this.setItemAttr("context-media-pause", "disabled", hasError);
       this.setItemAttr("context-media-mute",   "disabled", hasError);
       this.setItemAttr("context-media-unmute", "disabled", hasError);
       this.setItemAttr("context-media-showcontrols", "disabled", hasError);
       this.setItemAttr("context-media-hidecontrols", "disabled", hasError);
       if (this.onVideo)
         this.setItemAttr("context-video-fullscreen",  "disabled", hasError);
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -803,16 +803,18 @@
                                           true, false);
             }
 
             // Don't switch the fast find or update the titlebar (bug 540248) - this tab switch is temporary
             if (!this._previewMode) {
               this._fastFind.setDocShell(this.mCurrentBrowser.docShell);
 
               this.updateTitlebar();
+
+              this.mCurrentTab.removeAttribute("titlechanged");
             }
 
             // If the new tab is busy, and our current state is not busy, then
             // we need to fire a start to all progress listeners.
             const nsIWebProgressListener = Components.interfaces.nsIWebProgressListener;
             if (this.mCurrentTab.hasAttribute("busy") && !this.mIsBusy) {
               this.mIsBusy = true;
               this._callProgressListeners(null, "onStateChange",
@@ -2444,16 +2446,18 @@
           var contentWin = event.target.defaultView;
           if (contentWin != contentWin.top)
             return;
 
           var tab = this._getTabForContentWindow(contentWin);
           this.setTabTitle(tab);
           if (tab == this.mCurrentTab)
             this.updateTitlebar();
+          else if (!tab.hasAttribute("busy"))
+            tab.setAttribute("titlechanged", "true");
         ]]>
       </handler>
     </handlers>
   </binding>
 
   <binding id="tabbrowser-tabbox"
            extends="chrome://global/content/bindings/tabbox.xml#tabbox">
     <implementation>
@@ -2768,17 +2772,26 @@
             }, 150, this._animateElement);
           }
         ]]></body>
       </method>
 
       <method name="_getDragTargetTab">
         <parameter name="event"/>
         <body><![CDATA[
-          return event.target.localName == "tab" ? event.target : null;
+          let tab = event.target.localName == "tab" ? event.target : null;
+          if (tab &&
+              (event.type == "drop" || event.type == "dragover") &&
+              event.dataTransfer.dropEffect == "link") {
+            let boxObject = tab.boxObject;
+            if (event.screenX < boxObject.screenX + boxObject.width * .25 ||
+                event.screenX > boxObject.screenX + boxObject.width * .75)
+              return null;
+          }
+          return tab;
         ]]></body>
       </method>
 
       <method name="_getDropIndex">
         <parameter name="event"/>
         <body><![CDATA[
           var tabs = this.childNodes;
           var tab = this._getDragTargetTab(event);
@@ -3017,16 +3030,17 @@
 
         if (effects == "link") {
           let tab = this._getDragTargetTab(event);
           if (tab) {
             if (!this._dragTime)
               this._dragTime = Date.now();
             if (Date.now() >= this._dragTime + this._dragOverDelay)
               this.selectedItem = tab;
+            ind.collapsed = true;
             return;
           }
         }
 
         var newIndex = this._getDropIndex(event);
         var scrollRect = tabStrip.scrollClientRect;
         var rect = this.getBoundingClientRect();
         var minMargin = scrollRect.left - rect.left;
--- a/browser/base/content/tabview/modules/utils.jsm
+++ b/browser/base/content/tabview/modules/utils.jsm
@@ -461,32 +461,43 @@ Subscribable.prototype = {
 };
 
 // ##########
 // Class: Utils
 // Singelton with common utility functions.
 let Utils = {
   // ___ Logging
 
+  useConsole: true, // as opposed to dump
+  showTime: false,
+
   // ----------
   // Function: log
   // Prints the given arguments to the JavaScript error console as a message.
   // Pass as many arguments as you want, it'll print them all.
   log: function() {
     var text = this.expandArgumentsForLog(arguments);
-    Services.console.logStringMessage(text);
+    var prefix = this.showTime ? Date.now() + ': ' : '';
+    if (this.useConsole)    
+      Services.console.logStringMessage(prefix + text);
+    else
+      dump(prefix + text + '\n');
   },
 
   // ----------
   // Function: error
   // Prints the given arguments to the JavaScript error console as an error.
   // Pass as many arguments as you want, it'll print them all.
   error: function() {
     var text = this.expandArgumentsForLog(arguments);
-    Cu.reportError("tabview error: " + text);
+    var prefix = this.showTime ? Date.now() + ': ' : '';
+    if (this.useConsole)    
+      Cu.reportError(prefix + "tabview error: " + text);
+    else
+      dump(prefix + "TABVIEW ERROR: " + text + '\n');
   },
 
   // ----------
   // Function: trace
   // Prints the given arguments to the JavaScript error console as a message,
   // along with a full stack trace.
   // Pass as many arguments as you want, it'll print them all.
   trace: function() {
--- a/browser/base/content/tabview/tabview.css
+++ b/browser/base/content/tabview/tabview.css
@@ -1,479 +1,173 @@
+/* Platform-independent structural styling for 
+ * <strike>Tab Candy</strike> Panorama
+----------------------------------*/
+
 html {
   overflow: hidden;
 /*   image-rendering: -moz-crisp-edges; */
 }
 
 body {
-  background-color: transparent;  
-  font-family: Tahoma, sans-serif !important;
   padding: 0px;
-  color: rgba(0,0,0,0.4);
-  font-size: 12px;
-  line-height: 16px;
   margin: 0 auto;
 }
 
 #content {
   position: absolute;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
 }
 
 #bg {
-  background: -moz-linear-gradient(top,#C4C4C4,#9E9E9E);
   position: absolute;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   z-index: -999999;
 }
 
-/* Tab Styling
+/* Tabs
 ----------------------------------*/
 
-
 .tab {
   position: absolute;
-  padding: 4px 6px 6px 4px;
-  border: 1px solid rgba(230,230,230,1);
-  background-color: rgba(245,245,245,1);
   overflow: visible !important;
-  -moz-border-radius: 0.4em;
-  -moz-box-shadow: inset rgba(255, 255, 255, 0.6) 0 0 0 2px;
-  cursor: pointer;
 }
 
 .tab canvas,
 .cached-thumb {
-  border: 1px solid rgba(0,0,0,0.2);
   width: 100%;
   height: 100%;
   position: absolute;
   top: 0px;
   left: 0px;
 }
 
 .thumb {
   position: relative;
   width: 100%;
   height: 100%;
 }
 
 .thumb-shadow {
   position: absolute;
-  border-bottom: 5px solid rgba(0,0,0,0.05);
-  margin-right: -12px;
-  bottom: 2px;
-  width: 94.5%;
 }
 
 .favicon {
   position: absolute;
-  background-color: rgba(245,245,245,1);
-  -moz-border-radius-bottomright: 0.4em;
-  -moz-box-shadow:
-    inset rgba(255, 255, 255, 0.6) 0 -2px 0px,
-    inset rgba(255, 255, 255, 0.6) -2px 0px 0px;
-  padding: 4px 6px 6px 4px;
-  top: 4px;
-  left: 4px;
-  border-right: 1px solid rgba(0,0,0,0.2);
-  border-bottom: 1px solid rgba(0,0,0,0.2);
-  height: 17px;
-  width: 17px;
-}
-
-.favicon img {
-  border: none;
-  width: 16px;
-  height: 16px;
 }
 
 .close {
   position: absolute;
-  top: 6px;
-  right: 6px;
-  width: 16px;
-  height: 16px;
-  /* background is set in platform.css */
-  opacity: 0.2;
   cursor: pointer;
 }
 
-.close:hover {
-  opacity: 1.0;
-}
-
 .expander {
   position: absolute;
-  bottom: 6px;
-  right: 6px;
-  width: 16px;
-  height: 16px;
-  background: url(chrome://global/skin/icons/resizer.png) no-repeat;
-  opacity: 0.2;
-}
-
-.expander:hover {
-  opacity: 1.0;
-}
-
-.favicon img:hover, 
-.close img:hover, 
-.expander img:hover {
-  opacity: 1;
-  border: none;
 }
 
 .tab-title {
   position: absolute;
-  top: 100%;
-  text-align: center;
-  width: 94.5%;
-  white-space: nowrap;
-  overflow: hidden;
 }
 
-.stacked {
-  padding: 0;
-}
-
-.stacked .tab-title {
-  display: none;
-}
-
+.stacked .tab-title,
 .stacked .thumb-shadow {
   display: none;
 }
 
-.stacked .thumb {
-  -moz-box-shadow: rgba(0,0,0,.2) 1px 1px 6px;
-}
-
 .stack-trayed .tab-title {
   display: block !important;
-  text-shadow: rgba(0,0,0,1) 1px 1px 2px;
-  color: #EEE;
-  font-size: 11px;
-}
-
-.stack-trayed .thumb {
-  -moz-box-shadow: none !important;
-}
-
-.focus {
-  -moz-box-shadow:  rgba(54,79,225,1) 0px 0px 5px -1px !important;
-}
-
-.front .tab-title, 
-.front .close, 
-.front .favicon, 
-.front .expander, 
-.front .thumb-shadow {
-  display: none;
-}
-
-.front .focus {
-  -moz-box-shadow: none !important;
-}
-
-/* Tab GroupItem
-----------------------------------*/
-
-.tabInGroupItem {
-  border: none;
-  -moz-box-shadow: none !important;
 }
 
+/* Tab: Zooming
+----------------------------------*/
 
-.groupItem {
-  position: absolute;
-/*   float: left;  */
-  cursor: move;
-  border: 1px solid rgba(230,230,230,1);
-  background-color: rgba(248,248,248,1);
-  -moz-border-radius: 0.4em;
-  -moz-box-shadow:
-    inset rgba(255, 255, 255, 0.6) 0 0 0 2px,
-    rgba(0,0,0,0.2) 1px 1px 4px;
-}
-
-.groupItem.activeGroupItem {
-  -moz-box-shadow:
-    rgba(0,0,0,0.6) 1px 1px 8px;
-}
-
-.phantom {
-  border: 1px solid rgba(190,190,190,1);
+.front {
+  z-index: 999999 !important;
+  -moz-border-radius: 0 !important;
+  -moz-box-shadow: none !important;
+  -moz-transform: none !important;
+  image-rendering: -moz-crisp-edges;
 }
 
-.overlay {
-  background-color: rgba(0,0,0,.7) !important;
-  -moz-box-shadow: 3px 3px 8px rgba(0,0,0,.5);
-  -moz-border-radius: 0.4em;
-  /*
-  border: 1px solid rgba(230,230,230,1);
-  background-color: rgba(248,248,248,1);
-  -moz-box-shadow:
-    rgba(0,0,0, .3) 2px 2px 8px,
-    inset rgba(255, 255, 255, 0.6) 0 0 0 2px; */
-}
-
-/* InfoItems
+/* Other Items
 ----------------------------------*/
 
+.groupItem,
 .info-item {
   position: absolute;
-  cursor: move;
-  border: 1px solid rgba(230,230,230,1);
-  background-color: rgba(248,248,248,1);
-  -moz-border-radius: 0.4em;
-  -moz-box-shadow:
-    inset rgba(255, 255, 255, 0.6) 0 0 0 2px,
-    rgba(0,0,0, .2) 1px 1px 4px;
-}
-
-.intro {
-  margin: 10px;
 }
 
 /* Trenches
 ----------------------------------*/
 
 .guideTrench, 
 .visibleTrench, 
 .activeVisibleTrench {
   position: absolute;
 }
 
 .guideTrench {
   z-index: -101;
-  opacity: 0.9;
-  border: 1px dashed  rgba(0,0,0,.12);
-  border-bottom: none;
-  border-right: none;
-  -moz-box-shadow: 1px 1px 0 rgba(255,255,255,.15);
 }
 
 .visibleTrench {
   z-index: -103;
-  opacity: 0.05;
 }
 
 .activeVisibleTrench {
   z-index: -102;
-  opacity: 0;
-}
-
-.activeVisibleTrench.activeTrench {
-  opacity: 0.45;
-}
-
-.visibleTrench.border, 
-.activeVisibleTrench.border {
-  background-color: red;
-}
-
-.visibleTrench.guide, 
-.activeVisibleTrench.guide {
-  background-color: blue;
 }
 
 /* Other
 ----------------------------------*/
 
 .newTabButton {
-  width: 16px;
-  height: 15px;
-  bottom: 10px;
-  left: 10px;
   position: absolute !important;
-  cursor: pointer;
-  opacity: .3;
-  background-image: url(chrome://browser/skin/tabview/new-tab.png);
-  z-index: 99999;
-}
-
-.newTabButton:hover {
-  opacity: 1;
-}
-
-.newTabButtonAlt {
-  position: absolute;
-  cursor: pointer;
   z-index: 99999;
-  border: none;
-  -moz-border-radius: 4px;
-  font-size: 50px;
-  line-height: 50px;
-  height: 57px !important;
-  width: 70px !important;
-  margin-top: 4px !important;
-  text-align: center;
-  background-color: #888888;
-  -moz-box-shadow: inset 0px 0px 5px rgba(0,0,0,.5), 0 1px 0 rgba(255,255,255,.3);
-}
-
-.newTabButtonAlt > span {
-  color: #909090;
-  text-shadow: 0px 0px 7px rgba(0,0,0,.4), 0 -1px 0 rgba(255,255,255,.6);
-  font-weight: bold;
-}
-
-.active {
-  -moz-box-shadow: 5px 5px 4px rgba(0,0,0,.5);
-}
-
-.acceptsDrop {
-  -moz-box-shadow: 2px 2px 10px -1px rgba(0,0,0,.6);
-}
-
-.titlebar {
-  font-size: 12px;
-  line-height: 18px;
-  height: 18px;
-}
-
-input.name {
-  background: transparent;
-  border: 1px solid transparent;
-  color: #999;
-  margin: 3px 0px 0px 3px;
-  padding: 1px;
-  background-image: url(chrome://browser/skin/tabview/edit-light.png);
-  padding-left: 20px;
-}
-
-.title-container:hover input.name {
-  border: 1px solid #ddd;
-}
-
-.title-container:hover input.name-locked {
-  border: 1px solid transparent !important;
-  cursor: default;
-}
-
-input.name:focus {
-  color: #555;
-}
-
-input.defaultName {
-  font-style: italic !important;
-  background-image-opacity: .1;
-  color: transparent;
-}
-
-.title-container:hover input.defaultName {
-  color: #CCC;
-}
-
-.title-container {
-  cursor: text;
 }
 
 .title-shield {
   position: absolute;
-  margin: 3px 0px 0px 3px;
-  padding: 1px;
   left: 0;
   top: 0;
   width: 100%;
   height: 100%;
   z-index: 10;
 }
 
 .transparentBorder {
   border: 1px solid transparent !important;
 }
 
 .stackExpander {
   position: absolute;
-  opacity: .4;
-  cursor: pointer;
-  background-image: url(chrome://browser/skin/tabview/stack-expander.png);
-  width: 24px;
-  height: 24px;
-}
-
-.stackExpander:hover {
-  opacity: .7 !important;
 }
 
 .shield {
-	left: 0;
-	top: 0;
-	width: 100%;
-	height: 100%;
-	position: absolute;
+  left: 0;
+  top: 0;
+  width: 100%;
+  height: 100%;
+  position: absolute;
 }
 
 /* Resizable
 ----------------------------------*/
 .resizer {
-  background-image: url(chrome://global/skin/icons/resizer.png);
   position: absolute;
-	width: 16px;
-	height: 16px;
-	bottom: 0px;
-	right: 0px;
-  opacity: .2;
 }
 
-.iq-resizable { }
-
 .iq-resizable-handle {
   position: absolute;
-  font-size: 0.1px;
   z-index: 99999;
   display: block;
 }
 
 .iq-resizable-disabled .iq-resizable-handle, 
 .iq-resizable-autohide .iq-resizable-handle {
   display: none;
 }
-
-.iq-resizable-se {
-  cursor: se-resize;
-  width: 12px;
-  height: 12px;
-  right: 1px;
-  bottom: 1px;
-}
-
-/* Utils
-----------------------------------*/
-
-.front {
-  z-index: 999999 !important;
-  -moz-border-radius: 0 !important;
-  -moz-box-shadow: none !important;
-  -moz-transform: none !important;
-  image-rendering: -moz-crisp-edges;
-}
-
-/* Feedback
-----------------------------------*/
-
-.bottomButton {
-  position: absolute;
-  bottom: 0px;
-  width: 100px;
-  height: 20px;
-  line-height: 20px;
-  z-index: 99999 !important;
-  background-color: blue;
-  text-align: center;
-  color: white;
-  background-color: #9E9E9E;
-  -moz-box-shadow: 0px 0px 4px rgba(0,0,0,.3), inset 0px 1px 0px rgba(255,255,255,.4);
-}
-
-.bottomButton:hover {
-  cursor: pointer;
-  background-color: #A5A5A5;
-  -moz-box-shadow: 0px 0px 5px rgba(0,0,0,.6), inset 0px 1px 0px rgba(255,255,255,.4);
-}
--- a/browser/base/content/tabview/ui.js
+++ b/browser/base/content/tabview/ui.js
@@ -76,16 +76,20 @@ var UIManager = {
   // TabView UI and re-orders the tabs when switcing back to main browser.
   _reorderTabsOnHide : [],
 
   // Variable: _currentTab
   // Keeps track of which xul:tab we are currently on.
   // Used to facilitate zooming down from a previous tab.
   _currentTab : null,
 
+  // Variable: _eventListeners
+  // Keeps track of event listeners added to the AllTabs object.
+  _eventListeners: {},
+
   // ----------
   // Function: init
   // Must be called after the object is created.
   init: function() {
     try {
       let self = this;
 
       // ___ storage
@@ -233,16 +237,17 @@ var UIManager = {
     }
   },
 
   uninit: function() {
     TabItems.uninit();
     GroupItems.uninit();
     Storage.uninit();
 
+    this._removeTabActionHandlers();
     this._currentTab = null;
     this._pageBounds = null;
     this._reorderTabItemsOnShow = null;
     this._reorderTabsOnHide = null;
   },
 
   // ----------
   // Function: getActiveTab
@@ -402,17 +407,17 @@ var UIManager = {
 #endif
 
   // ----------
   // Function: _addTabActionHandlers
   // Adds handlers to handle tab actions.
   _addTabActionHandlers: function() {
     var self = this;
 
-    AllTabs.register("close", function(tab) {
+    this._eventListeners.close = function(tab) {
       if (tab.ownerDocument.defaultView != gWindow)
         return;
 
       if (self._isTabViewVisible()) {
         // just closed the selected tab in the TabView interface.
         if (self._currentTab == tab)
           self._closedSelectedTabInTabView = true;
       } else {
@@ -433,33 +438,44 @@ var UIManager = {
             self._closedLastVisibleTab = true;
             // remove the zoom prep.
             if (tab && tab.tabItem)
               tab.tabItem.setZoomPrep(false);
             self.showTabView();
           }
         }
       }
-    });
+    };
 
-    AllTabs.register("move", function(tab) {
+    this._eventListeners.move = function(tab) {
       if (tab.ownerDocument.defaultView != gWindow)
         return;
 
       let activeGroupItem = GroupItems.getActiveGroupItem();
       if (activeGroupItem)
         self.setReorderTabItemsOnShow(activeGroupItem);
-    });
+    };
 
-    AllTabs.register("select", function(tab) {
+    this._eventListeners.select = function(tab) {
       if (tab.ownerDocument.defaultView != gWindow)
         return;
 
       self.onTabSelect(tab);
-    });
+    };
+
+    for (let name in this._eventListeners)
+      AllTabs.register(name, this._eventListeners[name]);
+  },
+
+  // ----------
+  // Function: _removeTabActionHandlers
+  // Removes handlers to handle tab actions.
+  _removeTabActionHandlers: function() {
+    for (let name in this._eventListeners)
+      AllTabs.unregister(name, this._eventListeners[name]);
   },
 
   // ----------
   // Function: onTabSelect
   // Called when the user switches from one tab to another outside of the TabView UI.
   onTabSelect: function(tab) {
     let currentTab = this._currentTab;
     this._currentTab = tab;
--- a/browser/base/content/test/Makefile.in
+++ b/browser/base/content/test/Makefile.in
@@ -85,16 +85,18 @@ endif
 # The following tests are disabled because they are unreliable:
 #   browser_bug423833.js is bug 428712
 #   browser_sanitize-download-history.js is bug 432425
 #
 # browser_sanitizeDialog_treeView.js is disabled until the tree view is added
 # back to the clear recent history dialog (santize.xul), if it ever is (bug
 # 480169)
 
+# browser_drag.js is disabled, as it needs to be updated for the new behavior from bug 320638.
+
 _BROWSER_FILES = \
                  browser_typeAheadFind.js \
                  browser_NetworkPrioritizer.js \
                  browser_allTabsPanel.js \
                  browser_alltabslistener.js \
                  browser_bug304198.js \
                  browser_bug321000.js \
                  title_test.svg \
@@ -131,29 +133,29 @@ endif
                  browser_bug520538.js \
                  browser_bug521216.js \
                  browser_bug537474.js \
                  browser_bug550565.js \
                  browser_bug553455.js \
                  browser_bug555224.js \
                  browser_bug555767.js \
                  browser_bug556061.js \
+                 browser_bug559991.js \
                  browser_bug561623.js \
                  browser_bug562649.js \
                  browser_bug563588.js \
                  browser_bug577121.js \
                  browser_bug579872.js \
                  browser_bug580956.js \
                  browser_bug581242.js \
                  browser_bug581947.js \
                  browser_bug585830.js \
                  browser_contextSearchTabPosition.js \
                  browser_ctrlTab.js \
                  browser_discovery.js \
-                 browser_drag.js \
                  browser_duplicateIDs.js \
                  browser_gestureSupport.js \
                  browser_getshortcutoruri.js \
                  browser_hide_removing.js \
                  browser_inspector_initialization.js \
                  browser_inspector_treeSelection.js \
                  browser_inspector_highlighter.js \
                  browser_inspector_stylePanel.js \
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/browser_bug559991.js
@@ -0,0 +1,64 @@
+function test() {
+
+  // ----------
+  // Test setup
+
+  waitForExplicitFinish();
+
+  let oldOLC = FullZoom.onLocationChange;
+  FullZoom.onLocationChange = function(aURI, aIsTabSwitch, aBrowser) {
+    // Ignore calls that are not about tab switching on this test
+    if (aIsTabSwitch)
+      oldOLC.call(FullZoom, aURI, aIsTabSwitch, aBrowser);
+  };
+
+  gPrefService.setBoolPref("browser.zoom.updateBackgroundTabs", true);
+  gPrefService.setBoolPref("browser.zoom.siteSpecific", true);
+
+  let oldAPTS = FullZoom._applyPrefToSetting;
+  let uri = "http://example.org/browser/browser/base/content/test/dummy_page.html";
+
+  // ------------------------------------------------------
+  // Test 1 - Zoom should not be called if URIs don't match
+  FullZoom._applyPrefToSetting = function() {
+    ok(false, "This should not be called");
+  };
+  FullZoom.onLocationChange(makeURI(uri), true);
+
+  let tab = gBrowser.addTab();
+  tab.linkedBrowser.addEventListener("load", function(event) {
+    tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
+
+    // -------------------------------------------------------------------
+    // Test 2 - Trigger a tab switch that should now update the zoom level
+    FullZoom._applyPrefToSetting = function() {
+      ok(true, "applyPrefToSetting was called");
+      endTest();
+    }
+    gBrowser.selectedTab = tab;
+
+  }, true); 
+  tab.linkedBrowser.loadURI(uri);
+
+  // -------------
+  // Test clean-up
+  function endTest() {
+    gBrowser.removeTab(tab);
+    FullZoom._applyPrefToSetting = oldAPTS;
+    FullZoom.onLocationChange = oldOLC;
+
+    oldAPTS = null;
+    oldOLC = null;
+    tab = null;
+
+    if (gPrefService.prefHasUserValue("browser.zoom.updateBackgroundTabs"))
+      gPrefService.clearUserPref("browser.zoom.updateBackgroundTabs");
+
+    if (gPrefService.prefHasUserValue("browser.zoom.siteSpecific"))
+      gPrefService.clearUserPref("browser.zoom.siteSpecific");
+
+    finish();
+  }
+
+}
+
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -683,9 +683,42 @@
             }
             return label;
           ]]>
         </body>
       </method>
 
     </implementation>
   </binding>
+
+  <binding id="geolocation-notification" extends="chrome://global/content/bindings/notification.xml#popup-notification">
+    <content>
+      <xul:image class="popup-notification-icon"
+                 xbl:inherits="popupid"/>
+      <xul:vbox>
+        <xul:description class="popup-notification-description"
+                         xbl:inherits="value=label"/>
+        <xul:spacer flex="1"/>
+        <xul:hbox pack="end">
+          <xul:label anonid="learnmore" class="text-link geolocation-text-link"/>
+          <xul:spacer flex="1"/>
+          <xul:button anonid="button"
+                      class="popup-notification-menubutton"
+                      xbl:inherits="oncommand=buttoncommand,label=buttonlabel,accesskey=buttonaccesskey,type=buttontype">
+            <xul:menupopup anonid="menupopup"
+                           xbl:inherits="oncommand=menucommand">
+              <children/>
+            </xul:menupopup>
+          </xul:button>
+        </xul:hbox>
+      </xul:vbox>
+    </content>
+    <implementation>  
+      <constructor><![CDATA[
+        let link = document.getAnonymousElementByAttribute(this, "anonid", "learnmore");
+        link.value = gNavigatorBundle.getString("geolocation.learnMore");
+        
+        let formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"].getService(Ci.nsIURLFormatter);
+        link.href = formatter.formatURLPref("browser.geolocation.warning.infoURL");
+      ]]></constructor>
+    </implementation>
+  </binding>
 </bindings>
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -584,17 +584,17 @@ BrowserGlue.prototype = {
 
     var brandBundle  = Services.strings.createBundle("chrome://branding/locale/brand.properties");
     var rightsBundle = Services.strings.createBundle("chrome://global/locale/aboutRights.properties");
 
     var buttonLabel      = rightsBundle.GetStringFromName("buttonLabel");
     var buttonAccessKey  = rightsBundle.GetStringFromName("buttonAccessKey");
     var productName      = brandBundle.GetStringFromName("brandFullName");
     var notifyRightsText = rightsBundle.formatStringFromName("notifyRightsText", [productName], 1);
-    
+
     var buttons = [
                     {
                       label:     buttonLabel,
                       accessKey: buttonAccessKey,
                       popup:     null,
                       callback: function(aNotificationBar, aButton) {
                         browser.selectedTab = browser.addTab("about:rights");
                       }
@@ -990,17 +990,17 @@ BrowserGlue.prototype = {
     var notifyBox = browser.getNotificationBox();
     var box = notifyBox.appendNotification(text, title, null,
                                            notifyBox.PRIORITY_CRITICAL_MEDIUM,
                                            buttons);
     box.persistence = -1; // Until user closes it
   },
 
   _migrateUI: function BG__migrateUI() {
-    const UI_VERSION = 2;
+    const UI_VERSION = 3;
     let currentUIVersion = 0;
     try {
       currentUIVersion = Services.prefs.getIntPref("browser.migration.version");
     } catch(ex) {}
     if (currentUIVersion >= UI_VERSION)
       return;
 
     this._rdf = Cc["@mozilla.org/rdf/rdf-service;1"].getService(Ci.nsIRDFService);
@@ -1048,16 +1048,35 @@ BrowserGlue.prototype = {
         }
         else {
           currentset += ",bookmarks-menu-button-container";
         }
         this._setPersist(toolbarResource, currentsetResource, currentset);
       }
     }
 
+    if (currentUIVersion < 3) {
+      // This code merges the reload/stop/go button into the url bar.
+      let currentsetResource = this._rdf.GetResource("currentset");
+      let toolbarResource = this._rdf.GetResource("chrome://browser/content/browser.xul#nav-bar");
+      let currentset = this._getPersist(toolbarResource, currentsetResource);
+      // Need to migrate only if toolbar is customized and all 3 elements are found.
+      if (currentset &&
+          currentset.indexOf("reload-button") != -1 &&
+          currentset.indexOf("stop-button") != -1 &&
+          currentset.indexOf("urlbar-container") != -1 &&
+          currentset.indexOf("urlbar-container,reload-button,stop-button") == -1) {
+        currentset = currentset.replace(/(^|,)reload-button($|,)/, "$1$2").
+                                replace(/(^|,)stop-button($|,)/, "$1$2").
+                                replace(/(^|,)urlbar-container($|,)/,
+                                        "$1urlbar-container,reload-button,stop-button$2");
+        this._setPersist(toolbarResource, currentsetResource, currentset);
+      }
+    }
+
     if (this._dirty)
       this._dataSource.QueryInterface(Ci.nsIRDFRemoteDataSource).Flush();
 
     delete this._rdf;
     delete this._dataSource;
 
     // Update the migration version.
     Services.prefs.setIntPref("browser.migration.version", UI_VERSION);
@@ -1085,17 +1104,17 @@ BrowserGlue.prototype = {
       }
     }
     catch(ex) {}
   },
 
   // ------------------------------
   // public nsIBrowserGlue members
   // ------------------------------
-  
+
   sanitize: function BG_sanitize(aParentWindow) {
     this._sanitizer.sanitize(aParentWindow);
   },
 
   ensurePlacesDefaultQueriesInitialized:
   function BG_ensurePlacesDefaultQueriesInitialized() {
     // This is actual version of the smart bookmarks, must be increased every
     // time smart bookmarks change.
@@ -1224,17 +1243,17 @@ BrowserGlue.prototype = {
           smartBookmark.itemId = bmsvc.insertBookmark(smartBookmark.parent,
                                                       smartBookmark.uri,
                                                       smartBookmark.position,
                                                       smartBookmark.title);
           annosvc.setItemAnnotation(smartBookmark.itemId,
                                     SMART_BOOKMARKS_ANNO, smartBookmark.queryId,
                                     0, annosvc.EXPIRE_NEVER);
         }
-        
+
         // If we are creating all Smart Bookmarks from ground up, add a
         // separator below them in the bookmarks menu.
         if (smartBookmarksCurrentVersion == 0 &&
             smartBookmarkItemIds.length == 0) {
           let id = bmsvc.getIdForItemAt(bmsvc.bookmarksMenuFolder,
                                         bookmarksMenuIndex);
           // Don't add a separator if the menu was empty or there is one already.
           if (id != -1 && bmsvc.getItemType(id) != bmsvc.TYPE_SEPARATOR)
@@ -1319,17 +1338,17 @@ GeolocationPrompt.prototype = {
       return;
 
     var result = Services.perms.testExactPermission(requestingURI, "geo");
 
     if (result == Ci.nsIPermissionManager.ALLOW_ACTION) {
       request.allow();
       return;
     }
-    
+
     if (result == Ci.nsIPermissionManager.DENY_ACTION) {
       request.cancel();
       return;
     }
 
     function getChromeWindow(aWindow) {
       var chromeWin = aWindow 
         .QueryInterface(Ci.nsIInterfaceRequestor)
--- a/browser/installer/windows/nsis/defines.nsi.in
+++ b/browser/installer/windows/nsis/defines.nsi.in
@@ -43,8 +43,21 @@
 #ifdef HAVE_64BIT_OS
 !define HAVE_64BIT_OS
 !define ARCH "x64"
 !define MinSupportedVer "Microsoft Windows Vista x64"
 #else
 !define ARCH "x86"
 !define MinSupportedVer "Microsoft Windows 2000"
 #endif
+
+# File details shared by both the installer and uninstaller
+VIProductVersion "1.0.0.0"
+VIAddVersionKey "ProductName"     "${BrandShortName}"
+VIAddVersionKey "CompanyName"     "${CompanyName}"
+#ifdef MOZ_OFFICIAL_BRANDING
+VIAddVersionKey "LegalTrademarks" "${BrandShortName} is a Trademark of The Mozilla Foundation."
+#endif
+VIAddVersionKey "LegalCopyright"  "${CompanyName}"
+VIAddVersionKey "FileVersion"     "${AppVersion}"
+VIAddVersionKey "ProductVersion"  "${AppVersion}"
+# Comments is not used but left below commented out for future reference
+# VIAddVersionKey "Comments"        "Comments"
--- a/browser/installer/windows/nsis/installer.nsi
+++ b/browser/installer/windows/nsis/installer.nsi
@@ -83,17 +83,16 @@ Var PageName
 !insertmacro WordFind
 !insertmacro WordReplace
 
 ; The following includes are custom.
 !include branding.nsi
 !include defines.nsi
 !include common.nsh
 !include locales.nsi
-!include version.nsh
 
 VIAddVersionKey "FileDescription" "${BrandShortName} Installer"
 VIAddVersionKey "OriginalFilename" "setup.exe"
 
 ; Must be inserted before other macros that use logging
 !insertmacro _LoggingCommon
 
 ; Most commonly used macros for managing shortcuts
@@ -266,37 +265,16 @@ Section "-Application" APP_IDX
   ${LogUninstall} "File: \components\compreg.dat"
   ${LogUninstall} "File: \components\xpti.dat"
   ${LogUninstall} "File: \active-update.xml"
   ${LogUninstall} "File: \install.log"
   ${LogUninstall} "File: \install_status.log"
   ${LogUninstall} "File: \install_wizard.log"
   ${LogUninstall} "File: \updates.xml"
 
-  ; Check if QuickTime is installed and copy the nsIQTScriptablePlugin.xpt from
-  ; its plugins directory into the app's components directory.
-  ClearErrors
-  ReadRegStr $R0 HKLM "Software\Apple Computer, Inc.\QuickTime" "InstallDir"
-  ${Unless} ${Errors}
-    ${GetLongPath} "$R0" $R0
-    ${Unless} "$R0" == ""
-      ClearErrors
-      GetFullPathName $R0 "$R0\Plugins\nsIQTScriptablePlugin.xpt"
-      ${Unless} ${Errors}
-        ${LogHeader} "Copying QuickTime Scriptable Component"
-        CopyFiles /SILENT "$R0" "$INSTDIR\components"
-        ${If} ${Errors}
-          ${LogMsg} "** ERROR Installing File: $INSTDIR\components\nsIQTScriptablePlugin.xpt **"
-        ${Else}
-          ${LogMsg} "Installed File: $INSTDIR\components\nsIQTScriptablePlugin.xpt"
-          ${LogUninstall} "File: \components\nsIQTScriptablePlugin.xpt"
-        ${EndIf}
-      ${EndUnless}
-    ${EndUnless}
-  ${EndUnless}
   ClearErrors
 
   ; Default for creating Start Menu folder and shortcuts
   ; (1 = create, 0 = don't create)
   ${If} $AddStartMenuSC == ""
     StrCpy $AddStartMenuSC "1"
   ${EndIf}
 
--- a/browser/installer/windows/nsis/uninstaller.nsi
+++ b/browser/installer/windows/nsis/uninstaller.nsi
@@ -76,17 +76,16 @@ Var TmpVal
 
 !insertmacro un.GetParent
 
 ; The following includes are custom.
 !include branding.nsi
 !include defines.nsi
 !include common.nsh
 !include locales.nsi
-!include version.nsh
 
 ; This is named BrandShortName helper because we use this for software update
 ; post update cleanup.
 VIAddVersionKey "FileDescription" "${BrandShortName} Helper"
 VIAddVersionKey "OriginalFilename" "helper.exe"
 
 ; Most commonly used macros for managing shortcuts
 !insertmacro _LoggingShortcutsCommon
--- a/browser/locales/en-US/chrome/browser/browser.dtd
+++ b/browser/locales/en-US/chrome/browser/browser.dtd
@@ -22,18 +22,16 @@
 <!ENTITY  openTabInNewWindow.accesskey       "W">
 <!ENTITY  pinTab.label                       "Make into App Tab">
 <!ENTITY  pinTab.accesskey                   "p">
 <!ENTITY  unpinTab.label                     "Make into Normal Tab">
 <!ENTITY  unpinTab.accesskey                 "k">
 <!ENTITY  moveToGroup.label                  "Move to Group">
 <!ENTITY  moveToGroup.accesskey              "M">
 <!ENTITY  moveToNewGroup.label               "New Group">
-<!ENTITY  bookmarkThisTab.label              "Bookmark This Tab">
-<!ENTITY  bookmarkThisTab.accesskey          "B">
 <!ENTITY  bookmarkAllTabs.label              "Bookmark All Tabs…">
 <!ENTITY  bookmarkAllTabs.accesskey          "T">
 <!ENTITY  undoCloseTab.label                 "Undo Close Tab">
 <!ENTITY  undoCloseTab.accesskey             "U">
 <!ENTITY  closeTab.label                     "Close Tab">
 <!ENTITY  closeTab.accesskey                 "c">
 
 <!ENTITY  listAllTabs.label      "List all tabs">
--- a/browser/themes/gnomestripe/browser/browser.css
+++ b/browser/themes/gnomestripe/browser/browser.css
@@ -696,17 +696,17 @@ toolbar[iconsize="small"] #stop-button[d
 
 toolbar[iconsize="small"] #reload-button {
   list-style-image: url("moz-icon://stock/gtk-refresh?size=menu");
 }
 toolbar[iconsize="small"] #reload-button[disabled="true"] {
   list-style-image: url("moz-icon://stock/gtk-refresh?size=menu&state=disabled");
 }
 
-toolbar[iconsize="small"] #home-button ,
+toolbar[iconsize="small"] #home-button,
 #home-button.bookmark-item {
   list-style-image: url("moz-icon://stock/gtk-home?size=menu");
 }
 toolbar[iconsize="small"] #home-button[disabled="true"],
 #home-button.bookmark-item[disabled="true"] {
   list-style-image: url("moz-icon://stock/gtk-home?size=menu&state=disabled");
 }
 
@@ -782,16 +782,17 @@ toolbar[iconsize="small"] #fullscreen-bu
   list-style-image: url("chrome://global/skin/icons/Close.gif");
 }
 
 /* Location bar */
 #urlbar {
   width: 7em;
   min-width: 7em;
   -moz-appearance: textfield;
+  padding: 0;
 }
 
 #urlbar > .autocomplete-textbox-container {
   -moz-appearance: none;
   /* keep the URL bar content LTR */
   direction: ltr;
 }
 
@@ -1022,16 +1023,21 @@ toolbar[iconsize="small"] #fullscreen-bu
 .notification-anchor-icon:-moz-focusring {
   outline: 1px dotted -moz-DialogText;
 }
 
 #geo-notification-icon {
   list-style-image: url(chrome://browser/skin/Geolocation-16.png);
 }
 
+.geolocation-text-link {
+  -moz-padding-start: 13px;
+  padding-top: 10px;
+}
+
 #addons-notification-icon {
   list-style-image: url(chrome://mozapps/skin/extensions/extensionGeneric-16.png);
 }
 
 /* Feed icon */
 #feed-button,
 #feed-button > .button-box,
 #feed-button:hover:active > .button-box {
@@ -1103,21 +1109,82 @@ richlistitem[type~="action"][actiontype=
   font-size: smaller;
 }
 
 .autocomplete-treebody::-moz-tree-cell(suggesthint) {
   border-top: 1px solid GrayText;
 }
 
 /* Go button */
+
 #go-button {
   padding: 3px 2px 2px 2px;
   list-style-image: url("chrome://browser/skin/Go-arrow.png");
 }
 
+/* Combined go/reload/stop button in location bar */
+
+#urlbar > toolbarbutton {
+  -moz-appearance: none;
+  list-style-image: url("chrome://browser/skin/reload-stop-go.png");
+  margin: -1px;
+  -moz-margin-start: 0;
+  padding: 0 3px;
+  background-origin: border-box;
+  border: none;
+  border-left: 1px solid rgba(0,0,0,.35);
+  -moz-border-radius-topright: 2px;
+  -moz-border-radius-bottomright: 2px;
+}
+
+#urlbar > toolbarbutton:active:hover {
+  padding-left: 4px;
+  border-left: none;
+  -moz-box-shadow: 0 0 9px rgba(0,0,0,.4) inset,
+                   0 0 3px rgba(0,0,0,.4) inset;
+}
+
+#urlbar-go-button {
+  -moz-image-region: rect(0px, 56px, 14px, 42px);
+  background-image: -moz-linear-gradient(rgb(143,219,69), rgb(115,177,57));
+  -moz-box-shadow: 0 1px 0 rgba(0,0,0,.1) inset,
+                   -1px -1px 0 rgba(255,255,255,.2) inset;
+}
+
+#urlbar-go-button:hover {
+  background-image: -moz-linear-gradient(rgb(163,232,92), rgb(137,196,81));
+}
+
+#urlbar-reload-button {
+  -moz-image-region: rect(0px, 14px, 14px, 0px);
+}
+
+#urlbar-reload-button:hover {
+  -moz-image-region: rect(0px, 28px, 14px, 14px);
+  background-image: -moz-linear-gradient(rgb(137,183,233), rgb(79,130,195));
+  -moz-box-shadow: 0 1px 0 rgba(0,0,0,.1) inset,
+                   -1px -1px 0 rgba(255,255,255,.2) inset;
+}
+
+#urlbar-stop-button {
+  -moz-image-region: rect(0px, 42px, 14px, 28px);
+  background-image: -moz-linear-gradient(rgb(226,99,99), rgb(199,68,68));
+  -moz-box-shadow: 0 1px 0 rgba(0,0,0,.1) inset,
+                   -1px -1px 0 rgba(255,255,255,.2) inset;
+}
+
+#urlbar-stop-button:hover {
+  background-image: -moz-linear-gradient(rgb(237,120,120), rgb(216,92,92));
+}
+
+
+#urlbar-stop-button[disabled="true"] > .toolbarbutton-icon {
+  opacity: .5;
+}
+
 /* Star button */
 #star-button {
   padding: 1px;
   list-style-image: url("chrome://browser/skin/places/starPage.png");
 }
 
 #star-button[starred="true"] {
   list-style-image: url("chrome://browser/skin/places/pageStarred.png");
@@ -1225,16 +1292,20 @@ statusbarpanel#statusbar-display {
 .tabbrowser-tab[pinned] {
   min-height: 20px; /* corresponds to the max. height of non-textual tab contents, i.e. the tab close button */
 }
 
 .tabbrowser-tab[pinned] + .tabbrowser-tab:not([pinned]) {
   -moz-margin-start: 0;
 }
 
+.tabbrowser-tab[pinned][titlechanged]:not([selected="true"]) {
+  -moz-box-shadow: 0 0 0 1em rgba(255,0,0,.5) inset;
+}
+
 .tab-icon-image {
   width: 16px;
   height: 16px;
   -moz-margin-start: 1px;
   -moz-margin-end: 4px;
   list-style-image: url("chrome://global/skin/icons/folder-item.png");
   -moz-image-region: rect(0px, 16px, 16px, 0px);
 }
--- a/browser/themes/gnomestripe/browser/jar.mn
+++ b/browser/themes/gnomestripe/browser/jar.mn
@@ -21,16 +21,17 @@ browser.jar:
   skin/classic/browser/KUI-close.png
   skin/classic/browser/monitor.png
   skin/classic/browser/monitor_16-10.png
 * skin/classic/browser/pageInfo.css
   skin/classic/browser/pageInfo.png
   skin/classic/browser/page-livemarks.png
   skin/classic/browser/Privacy-16.png
   skin/classic/browser/Privacy-48.png
+  skin/classic/browser/reload-stop-go.png
   skin/classic/browser/searchbar.css                  (searchbar.css)
   skin/classic/browser/section_collapsed.png
   skin/classic/browser/section_collapsed-rtl.png
   skin/classic/browser/section_expanded.png
   skin/classic/browser/Secure.png
   skin/classic/browser/Security-broken.png
   skin/classic/browser/setDesktopBackground.css
   skin/classic/browser/Toolbar.png
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..922a4c4c62e8ecd1bd380a62673dbc0b429b1756
GIT binary patch
literal 1608
zc$@)92DkZ%P)<h;3K|Lk000e1NJLTq001}u000gM1^@s6dZpj40000PbVXQnQ*UN;
zcVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBU%>PbXFRCwCdR%>h(MHHUd*~fjh_x3@N
zVik}A)f5wHYl}t1z9>*=A-0jCqyz}i<U%4?2_=9fv?z&0v@r+@2&Eu34ayr)1F2vI
z8X!QywuD<C^!>Vzy?b{&gN58~Zy`1Dhnsvmd(NDhGvAyua~4xd(f{>%F^N<{v#jBi
z*FKO9H<$_2k|wSHHwz(QG5P-V<1sc2M&EB<0gd7%ymv$ji5$oV`$jNh>f7PGz;80>
zbr~4rK&sN49!2>Xx;B8k5^NWhSNvq|Pat*(!Z;rzoPaPgB8u)HL@z?u4w!u&A>3@a
zu`1Db%&QnLgC-S_cbU>=AAJZkI{`;QU-~qHV`lQz9FG*Qf<1~$wbdQ>Uewy~k3TY}
zr=$g0E#*3$q_<eC*G=YtW|zxpR@}}dydW$h97ozZIvxGU4UJ2{9Jda`>$$Mt`p{r&
zduv;#WPi}a2u;Lb!t<nCL(ZU+q%_6tws0J`Z32+3rnCjxU=d_hRjs@vrGworAn6z|
zf)a8O0ed(vB@lqEBh$#*x?|om{Rn2xNC~%E1Iq%;X2+bIc|~tbdaD}LY*B_CrCUB$
z6*&={B9*Eda<M~z_ZpMY(Dvzi+rb6zX50d`6Ch1UT`=p)_4?ruNpOx#zT;rg?yBR*
zx30;~Ug+rPFbW)3{5r<P62}#QAEP-i@Lo}Q`S$qKRJZ2L?Szz!=0)TIa<XW^-5g=d
zg54!Z1V2S1Q^@AJ6W+=`XV7RcZr1B{rfD<hYyxuILB)3Aj}^=EGMznLiIB2Lk|ZPu
zLLY*XAVQj9v~Ja+G9Y&pR5gHF@%c&7S8p@~bA)t&>rU8RZ4|t)_}@w@D!#H<t@j00
z<>AnM#9AgZJ?m$7eWD@YXi<;4MI-K#47f|sV+Rm+G6*`<1G1CX;eruKB)1PiNhIke
zlj&M=YWf}!+nFvmd&Xz7?6S4CwjjIRj_h~uqNb*%KC4s_9Ul=MR&QIFeG0@LrW3*^
z&PS9cQK}NEdPRT)GVzmP@`Nc<&Mw}#u~H(WRl@ioYnjaStiRul$Rjrqu?yfNjF^B~
zin<=@c<hEt$H_w<$K%CMHYICDGO=0$ErjEL1-b2U$9Lt2cSCbt<HO^Vo*c#mj;#2g
zH=X}6XgtRj*Pt1v_&Y=Ka25@M5XY;k3o{#4rJvhuaV1Nao~xo%_A`V<RN*l4fO8M#
zU_JQJPQw*|*(VPdoHr$5*4`(ZQgQgCDv4sdqo-?#W-@jom1*$(6HgB=P`ys<Y-#J%
z-m13&zi4n)yVBP%4uTXe^eT$U7!u-HRaSP9wM=Gu)~_97HHF<$Tu6|eNR*wFS7fLH
zuq^<p!q$6b4re63x2tsR!3y6LrRD%jwJf{ia%QK;52C!$5fQ`cTH4x2@k8Ur4W=$a
zozr7NwkWC^st*eCZm6t0GdVl^G;5j6^sJxR`HnkZ)>wSK!n69yK6(A6Z{!kB4;6th
z2ZV{o!I8Piwr`7<e|^|D6Ca(yoZR`JQi{6+Os4(WSyN+uC!Lu-<<047leeTLC5CDj
zT3ncaP!f0<>f8sAvST&1aXerN6nTqwTn(gOR7}ims7K1iLx+yM5+7g1(wwzSX8Neu
z*qb%|)0ExPe?ErC0g-edNp%R^;*7%GALf;u1bv6ULN6UC+g)(_#E}9Bw$ABtU+{R8
z%Pf-^TrPKq!EBzocmEGn8izvRrqXvl`C`v(MNtHp>MsZ^6nQin5DCORA=bc^_pY6|
z>hDkMPHpY*7a}7sXf6~H^s%6~`#H;fp3&*TF`Z7=u_Cu<M_!hV9RtVH{$#>xE>&k8
zI<PORrTO7lx7!tDFq&_KgoZWb%zgjI$T8zsZE5x6$9nYCxrv3vr3ts|?ZX^Srv-}r
z{V^{^G!?DRKbsH}%{HZLpjxdh1<%m;d0w7oJy5iK+n1TibAJcX^~_&2R@ebijBM|B
zb1!NE?x*<D0U`h_9VI|#Z>lu<-n{?86V-dE$pabuEx-T<{bG<=UxnWQ0000<MNUMn
GLSTYm5&hQy
--- a/browser/themes/gnomestripe/browser/tabview/tabview.css
+++ b/browser/themes/gnomestripe/browser/tabview/tabview.css
@@ -1,7 +1,343 @@
 /* This file is for platform-specific CSS for TabView, and is loaded after the
   platform-independent tabview.css, to allow overwriting.
 */
 
+body {
+  background-color: transparent;  
+  font-family: Tahoma, sans-serif !important;
+  color: rgba(0,0,0,0.4);
+  font-size: 12px;
+  line-height: 16px;
+}
+
+#bg {
+  background: -moz-linear-gradient(top,#C4C4C4,#9E9E9E);
+}
+
+/* Tabs
+----------------------------------*/
+
+.tab {
+  padding: 4px 6px 6px 4px;
+  border: 1px solid rgba(230,230,230,1);
+  background-color: rgba(245,245,245,1);
+  -moz-border-radius: 0.4em;
+  -moz-box-shadow: inset rgba(255, 255, 255, 0.6) 0 0 0 2px;
+  cursor: pointer;
+}
+
+.tab canvas,
+.cached-thumb {
+  border: 1px solid rgba(0,0,0,0.2);
+}
+
+.thumb-shadow {
+  border-bottom: 5px solid rgba(0,0,0,0.05);
+  margin-right: -12px;
+  bottom: 2px;
+  width: 94.5%;
+}
+
+.favicon {
+  background-color: rgba(245,245,245,1);
+  -moz-border-radius-bottomright: 0.4em;
+  -moz-box-shadow:
+    inset rgba(255, 255, 255, 0.6) 0 -2px 0px,
+    inset rgba(255, 255, 255, 0.6) -2px 0px 0px;
+  padding: 4px 6px 6px 4px;
+  top: 4px;
+  left: 4px;
+  border-right: 1px solid rgba(0,0,0,0.2);
+  border-bottom: 1px solid rgba(0,0,0,0.2);
+  height: 17px;
+  width: 17px;
+}
+
+.favicon img {
+  border: none;
+  width: 16px;
+  height: 16px;
+}
+
 .close {
+  top: 6px;
+  right: 6px;
+  width: 16px;
+  height: 16px;
+  opacity: 0.2;
   background: url("moz-icon://stock/gtk-close?size=menu") no-repeat;
 }
+
+.close:hover {
+  opacity: 1.0;
+}
+
+.expander {
+  bottom: 6px;
+  right: 6px;
+  width: 16px;
+  height: 16px;
+  background: url(chrome://global/skin/icons/resizer.png) no-repeat;
+  opacity: 0.2;
+}
+
+.expander:hover {
+  opacity: 1.0;
+}
+
+.favicon img:hover, 
+.close img:hover, 
+.expander img:hover {
+  opacity: 1;
+  border: none;
+}
+
+.tab-title {
+  top: 100%;
+  text-align: center;
+  width: 94.5%;
+  white-space: nowrap;
+  overflow: hidden;
+}
+
+.stacked {
+  padding: 0;
+}
+
+.stacked .thumb {
+  -moz-box-shadow: rgba(0,0,0,.2) 1px 1px 6px;
+}
+
+.stack-trayed .tab-title {
+  text-shadow: rgba(0,0,0,1) 1px 1px 2px;
+  color: #EEE;
+  font-size: 11px;
+}
+
+.stack-trayed .thumb {
+  -moz-box-shadow: none !important;
+}
+
+.focus {
+  -moz-box-shadow:  rgba(54,79,225,1) 0px 0px 5px -1px !important;
+}
+
+/* Tab: Zooming
+----------------------------------*/
+
+.front .tab-title, 
+.front .close, 
+.front .favicon, 
+.front .expander, 
+.front .thumb-shadow {
+  display: none;
+}
+
+.front .focus {
+  -moz-box-shadow: none !important;
+}
+
+/* Tab GroupItem
+----------------------------------*/
+
+.tabInGroupItem {
+  border: none;
+  -moz-box-shadow: none !important;
+}
+
+.groupItem {
+  cursor: move;
+  border: 1px solid rgba(230,230,230,1);
+  background-color: rgba(248,248,248,1);
+  -moz-border-radius: 0.4em;
+  -moz-box-shadow:
+    inset rgba(255, 255, 255, 0.6) 0 0 0 2px,
+    rgba(0,0,0,0.2) 1px 1px 4px;
+}
+
+.groupItem.activeGroupItem {
+  -moz-box-shadow:
+    rgba(0,0,0,0.6) 1px 1px 8px;
+}
+
+.phantom {
+  border: 1px solid rgba(190,190,190,1);
+}
+
+.overlay {
+  background-color: rgba(0,0,0,.7) !important;
+  -moz-box-shadow: 3px 3px 8px rgba(0,0,0,.5);
+  -moz-border-radius: 0.4em;
+  /*
+  border: 1px solid rgba(230,230,230,1);
+  background-color: rgba(248,248,248,1);
+  -moz-box-shadow:
+    rgba(0,0,0, .3) 2px 2px 8px,
+    inset rgba(255, 255, 255, 0.6) 0 0 0 2px; */
+}
+
+/* InfoItems
+----------------------------------*/
+
+.info-item {
+  cursor: move;
+  border: 1px solid rgba(230,230,230,1);
+  background-color: rgba(248,248,248,1);
+  -moz-border-radius: 0.4em;
+  -moz-box-shadow:
+    inset rgba(255, 255, 255, 0.6) 0 0 0 2px,
+    rgba(0,0,0, .2) 1px 1px 4px;
+}
+
+.intro {
+  margin: 10px;
+}
+
+/* Trenches
+----------------------------------*/
+
+.guideTrench {
+  opacity: 0.9;
+  border: 1px dashed  rgba(0,0,0,.12);
+  border-bottom: none;
+  border-right: none;
+  -moz-box-shadow: 1px 1px 0 rgba(255,255,255,.15);
+}
+
+.visibleTrench {
+  opacity: 0.05;
+}
+
+.activeVisibleTrench {
+  opacity: 0;
+}
+
+.activeVisibleTrench.activeTrench {
+  opacity: 0.45;
+}
+
+.visibleTrench.border, 
+.activeVisibleTrench.border {
+  background-color: red;
+}
+
+.visibleTrench.guide, 
+.activeVisibleTrench.guide {
+  background-color: blue;
+}
+
+/* Other
+----------------------------------*/
+
+.newTabButton {
+  width: 16px;
+  height: 15px;
+  bottom: 10px;
+  left: 10px;
+  cursor: pointer;
+  opacity: .3;
+  background-image: url(chrome://browser/skin/tabview/new-tab.png);
+}
+
+.newTabButton:hover {
+  opacity: 1;
+}
+
+.active {
+  -moz-box-shadow: 5px 5px 4px rgba(0,0,0,.5);
+}
+
+.acceptsDrop {
+  -moz-box-shadow: 2px 2px 10px -1px rgba(0,0,0,.6);
+}
+
+.titlebar {
+  font-size: 12px;
+  line-height: 18px;
+  height: 18px;
+}
+
+input.name {
+  background: transparent;
+  border: 1px solid transparent;
+  color: #999;
+  margin: 3px 0px 0px 3px;
+  padding: 1px;
+  background-image: url(chrome://browser/skin/tabview/edit-light.png);
+  padding-left: 20px;
+}
+
+.title-container:hover input.name {
+  border: 1px solid #ddd;
+}
+
+.title-container:hover input.name-locked {
+  border: 1px solid transparent !important;
+  cursor: default;
+}
+
+input.name:focus {
+  color: #555;
+}
+
+input.defaultName {
+  font-style: italic !important;
+  background-image-opacity: .1;
+  color: transparent;
+}
+
+.title-container:hover input.defaultName {
+  color: #CCC;
+}
+
+.title-container {
+  cursor: text;
+}
+
+.title-shield {
+  margin: 3px 0px 0px 3px;
+  padding: 1px;
+  left: 0;
+  top: 0;
+  width: 100%;
+  height: 100%;
+}
+
+.transparentBorder {
+  border: 1px solid transparent !important;
+}
+
+.stackExpander {
+  opacity: .4;
+  cursor: pointer;
+  background-image: url(chrome://browser/skin/tabview/stack-expander.png);
+  width: 24px;
+  height: 24px;
+}
+
+.stackExpander:hover {
+  opacity: .7 !important;
+}
+
+/* Resizable
+----------------------------------*/
+.resizer {
+  background-image: url(chrome://global/skin/icons/resizer.png);
+  width: 16px;
+  height: 16px;
+  bottom: 0px;
+  right: 0px;
+  opacity: .2;
+}
+
+.iq-resizable-handle {
+  font-size: 0.1px;
+}
+
+.iq-resizable-se {
+  cursor: se-resize;
+  width: 12px;
+  height: 12px;
+  right: 1px;
+  bottom: 1px;
+}
\ No newline at end of file
--- a/browser/themes/pinstripe/browser/browser.css
+++ b/browser/themes/pinstripe/browser/browser.css
@@ -686,16 +686,19 @@ toolbar[iconsize="small"][mode="icons"] 
   background-image: -moz-linear-gradient(#D6D6D6, #D6D6D6 1px, #F7F7F7 1px, #F7F7F7 2px, #FFF 2px, #FFF),
                     -moz-linear-gradient(rgba(0,0,0,.1), rgba(0,0,0,.1));
   -moz-box-shadow: @focusRingShadow@;
 }
 
 #urlbar {
   -moz-border-radius: @toolbarbuttonCornerRadius@;
   direction: ltr;
+}
+
+#urlbar-container:not([combined]) > #urlbar {
   -moz-padding-end: 3px;
 }
 
 #identity-box {
   margin: 1px;
   -moz-border-radius: 2px;
   padding: 1px;
   -moz-box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
@@ -894,25 +897,74 @@ richlistitem[type~="action"][actiontype=
 .autocomplete-treebody::-moz-tree-cell(suggesthint) {
   border-top: 1px solid GrayText;
 }
 
 /* ----- GO BUTTON ----- */
 
 #go-button {
   list-style-image: url("chrome://browser/skin/Go-arrow.png");
-  -moz-image-region: rect(0px, 16px, 16px, 0px);  
+  -moz-image-region: rect(0px, 16px, 16px, 0px);
 }
 
 #go-button:hover {
-  -moz-image-region: rect(0px, 32px, 16px, 16px);  
+  -moz-image-region: rect(0px, 32px, 16px, 16px);
 }
 
 #go-button:hover:active {
-  -moz-image-region: rect(0px, 48px, 16px, 32px);  
+  -moz-image-region: rect(0px, 48px, 16px, 32px);
+}
+
+/* ----- COMBINED GO/RELOAD/STOP BUTTON IN LOCATION BAR ----- */
+
+#urlbar > toolbarbutton {
+  list-style-image: url("chrome://browser/skin/reload-stop-go.png");
+  margin: 0;
+  -moz-margin-start: 2px;
+  padding: 0 3px;
+  background-origin: border-box;
+  border: none;
+  border-left: 1px solid rgba(0,0,0,.25);
+  -moz-border-radius-topright: 2px;
+  -moz-border-radius-bottomright: 2px;
+}
+
+#urlbar > toolbarbutton:active:hover {
+  -moz-box-shadow: @toolbarbuttonPressedInnerShadow@;
+  padding-left: 4px;
+  border-left: none;
+}
+
+#urlbar-go-button {
+  -moz-image-region: rect(0px, 56px, 14px, 42px);
+  background-image: -moz-linear-gradient(rgb(184,221,142), rgb(154,201,111) 49%, rgb(130,187,92) 51%, rgb(114,171,79));
+  -moz-box-shadow: 0 1px 0 rgba(0,0,0,.1) inset,
+                   -1px -1px 1px rgba(255,255,255,.15) inset;
+}
+
+#urlbar-reload-button {
+  -moz-image-region: rect(0px, 14px, 14px, 0px);
+}
+
+#urlbar-reload-button:hover {
+  -moz-image-region: rect(0px, 28px, 14px, 14px);
+  background-image: -moz-linear-gradient(rgb(162,207,241), rgb(111,178,225) 49%, rgb(91,159,217) 51%, rgb(62,138,200));
+  -moz-box-shadow: 0 1px 0 rgba(0,0,0,.1) inset,
+                   -1px -1px 1px rgba(255,255,255,.15) inset;
+}
+
+#urlbar-stop-button {
+  -moz-image-region: rect(0px, 42px, 14px, 28px);
+  background-image: -moz-linear-gradient(rgb(231,162,140), rgb(209,119,100) 49%, rgb(193,92,78) 51%, rgb(173,72,58));
+  -moz-box-shadow: 0 1px 0 rgba(0,0,0,.1) inset,
+                   -1px -1px 1px rgba(255,255,255,.15) inset;
+}
+
+#urlbar-stop-button[disabled="true"] > .toolbarbutton-icon {
+  opacity: .4;
 }
 
 /* STAR BUTTON */
 #star-button {
   padding: 1px;
   -moz-padding-start: 4px;
   list-style-image: url("chrome://browser/skin/places/star-icons.png");
   -moz-image-region: rect(0px, 16px, 16px, 0px);  
@@ -1479,16 +1531,20 @@ toolbarbutton.chevron > .toolbarbutton-m
   background-image: none;
   background-color: -moz-mac-chrome-active;
 }
 
 .tabbrowser-tab[selected="true"]:-moz-window-inactive {
   background-color: -moz-mac-chrome-inactive;
 }
 
+.tabbrowser-tab[pinned][titlechanged]:not([selected="true"]) {
+  background-color: rgba(255,0,0,.5) !important;
+}
+
 #tabbrowser-tabs[tabsontop="true"] > .tabbrowser-tab[selected="true"] {
   -moz-border-top-colors: rgba(0,0,0,.04) rgba(0,0,0,.17) rgba(255,255,255,.9);
   -moz-border-right-colors: rgba(0,0,0,.04) rgba(0,0,0,.17) rgba(255,255,255,.6);
   -moz-border-left-colors: rgba(0,0,0,.04) rgba(0,0,0,.17) rgba(255,255,255,.6);
   background-image: -moz-linear-gradient(rgba(255,255,255,.7), rgba(255,255,255,.58));
 }
 
 .tabbrowser-tab:focus > .tab-text {
@@ -1850,16 +1906,17 @@ toolbarbutton.chevron > .toolbarbutton-m
   background-color: transparent;
   margin-top: -3px;
   margin-left: -23px;
   min-width: 280px;
   -moz-border-image: url(chrome://browser/skin/hud-panel.png) 26 18 22 50 / 26px 18px 22px 50px repeat;
 }
 
 #notification-popup {
+  color: #fff;
   margin-top: -1px;
   margin-left: -27px;
 }
 
 #notification-popup-box {
   margin: 0 3px;
 }
 
@@ -1873,24 +1930,24 @@ toolbarbutton.chevron > .toolbarbutton-m
   -moz-box-shadow: 0 0 3px 1px -moz-mac-focusring inset,
                    0 0 3px 2px -moz-mac-focusring;
 }
 
 #geo-notification-icon {
   list-style-image: url(chrome://browser/skin/Geolocation-16.png);
 }
 
+.geolocation-text-link {
+  color: #fff;
+}
+
 #addons-notification-icon {
   list-style-image: url(chrome://mozapps/skin/extensions/extensionGeneric-16.png);
 }
 
-.popup-notification-description {
-  color: #fff;
-}
-
 .popup-notification-icon {
   width: 64px;
   height: 64px;
   -moz-margin-end: 10px;
 }
 
 .popup-notification-icon[popupid="geolocation"] {
   list-style-image: url(chrome://browser/skin/Geolocation-64.png);
--- a/browser/themes/pinstripe/browser/jar.mn
+++ b/browser/themes/pinstripe/browser/jar.mn
@@ -36,16 +36,17 @@ browser.jar:
   skin/classic/browser/menu-back.png
   skin/classic/browser/menu-forward.png
   skin/classic/browser/page-livemarks.png
   skin/classic/browser/livemark-item.png
   skin/classic/browser/pageInfo.css
   skin/classic/browser/Popup-blocked.png
   skin/classic/browser/Privacy-16.png
   skin/classic/browser/Privacy-48.png
+  skin/classic/browser/reload-stop-go.png
   skin/classic/browser/searchbar-dropmarker.png
   skin/classic/browser/searchbar.css
   skin/classic/browser/Search.png
   skin/classic/browser/Search-addengines.png
   skin/classic/browser/section_collapsed.png
   skin/classic/browser/section_collapsed-rtl.png
   skin/classic/browser/section_expanded.png
   skin/classic/browser/Secure-Glyph-White.png
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0406477f52e20d343d5d7903aee28d6d05bcbc63
GIT binary patch
literal 1516
zc$@+31rz#-P)<h;3K|Lk000e1NJLTq001}u000gM1^@s6dZpj40000PbVXQnQ*UN;
zcVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBU%j!8s8RCwClR(()ZRTO{s-S^&p?;^Ue
zAHahZK@CM?%mi^ls!5qNMxAl8FenvshAFi&KXR-bOHE2MaA{1c889<zOa(Pd9We8&
z!cSC0Bnq~~T0VC7?R&3t4IKCNHb18R>CB$F@1A$|-t)WXch7l9mSyVyEcBf?8w`f2
zce4rRN6+{-gVv?6YeDU|<I5-jSZSJ`3_1cKWQFW{BuP33<0ly7Y>wlmfm@{t02_r+
z9z~&%FpZ)R)k?|o5qK^K9S`pcU@TMqZy1LjgJJ*o0l8gax4@7M_Rmzaf~X8cqs{sh
zb`$XLqwbS}5Dp;frKs6#9>%ilA`OVuYHe{i9KW@+wDk3OJdR*6C^8_#4{VQyfQuhJ
z64Cf|SPCcdj%&&NdEdE<P27d176U9T060uZqE@`LKU)D}GNPzOG{)y8QJi(62jp-7
z2eu7hONPi+0>}zw(8i%$ElpDaSRYHW{F5wEtGZ4K$HHdNVzF5Ddi~3hk&*uS^XG3V
zC@820b0<k^PEO90`uh5zkX1@h929`FVTO4%(qi#%T(#iL__3o-gSm}lF?ZJDjP3gl
z8v!^4*+j~XOLy+}ESvfCwbte<vA~Y?_i|_sm__mo;CQRu{`-=WGLI_dX(Z5?@{wm)
zy00Y3#Q^#nNLF!YozVU_fRMc@kT_jYQBfs;+Y2Tyu{)j4sX*JII-QOp0F`1g81g&1
z{kUZLyjlQ9DA;m+QCHS9gjo|pv`;1o5eh2*d;fzE9VxBa^TnKT507uX(&S_@E(Ws%
z;9{fgj*j(Jd#YT627jwcQ3eGWi~<Nz*9izeK@{Z-cuqH_avM5+2y6){G5{c*=lRCM
z!onNiqN1Xv0_bT39E=p)KME)uvXMl|8EGj=?YWPPxdD#tpZz3I_6Y#R$daU|#GoEV
zjY^zdd{VNzq<ZfTXB__rEs8c!ht1*izV{cn4dBzEN;?LLEJq70hy9!e2RM%I<}`E{
z!y*cFu4y>8G$ex%yb(a0?FC1qt*z})Z_wey?+<DXdfnxl{e+8Ok$LTH7R0WPSFfyu
zAV&8d9fz@R%ldVdFTPvS5w<EbGyxc-5fXtPaDIRzC@~sNE9K|TJiV}R>G2SNMx(LI
z>-Aa`>s;>9uwphD0?og8l-W7ZqqmfF4w)GSFGr$ijEaeY46yRgjhBpHZY+E4b9d>y
zT19oeiJ~&Y(K1aVs4+4v2{MzJmesN1`QoFl*u*MuIT}LIgoK28pU;;JG)=mbeso{z
zpteiRtud@??4UdCWdt0{;I%+YKFZ+?tl71vX7!HhgLXbX0Jd224t)Bk1BBdR8p{Z2
ztbH8Jx`iJ!ZeFwfQvgTqF=<b72*8OGC+>o~CO|cP3ED#lNSn=;WVhR=M@L7Slp7W0
zPpa0ijLdTE61aOIAjzC{WfkItF=n+OO=feBEQ(3}?2h1DReSfxB@cARBn~KBy>s`z
z=r~@0cm2%~5fj2RHx912_VIDgw12(v_<;#olh%QCo7$c2?Sopk+da9Wq9XU|)vHWr
zXXjbyeNE8%;<Q@rKq%b;H2f8Hb#=;K6Y=5JsztLG7pDk8iL`=qpiQtO4~IAyQ!;I{
zMl5YSwDq7$m}w;oUYIj(dj6^S(1N0GzHolV_V?YXv)@=%3iI!jf6RIIfo*TjeWxxZ
zF|`_|q|%DFZ1f;~YHDiI%gf70H8eE1{C>X)3Xd1)+mM%+cPKM6lN1iMJK;KU>iqO&
zZ*LlK;P8(oZ&$a@q}Td0M-1`4^4wGPX+x4Xflou2{YQYFQ8{@%=si7jQxo#ZNbcIT
zTU`aD_}JEh#)9@EEF(n`^jFX;puT@tCjvABl+fGQ6EOK$sJWdW{!95&fB^vXVi?_!
SEg&=i0000<MNUMnLSTY6BhV-S
--- a/browser/themes/pinstripe/browser/tabview/tabview.css
+++ b/browser/themes/pinstripe/browser/tabview/tabview.css
@@ -1,7 +1,343 @@
 /* This file is for platform-specific CSS for TabView, and is loaded after the
   platform-independent tabview.css, to allow overwriting.
 */
 
+body {
+  background-color: transparent;  
+  font-family: Tahoma, sans-serif !important;
+  color: rgba(0,0,0,0.4);
+  font-size: 12px;
+  line-height: 16px;
+}
+
+#bg {
+  background: -moz-linear-gradient(top,#C4C4C4,#9E9E9E);
+}
+
+/* Tabs
+----------------------------------*/
+
+.tab {
+  padding: 4px 6px 6px 4px;
+  border: 1px solid rgba(230,230,230,1);
+  background-color: rgba(245,245,245,1);
+  -moz-border-radius: 0.4em;
+  -moz-box-shadow: inset rgba(255, 255, 255, 0.6) 0 0 0 2px;
+  cursor: pointer;
+}
+
+.tab canvas,
+.cached-thumb {
+  border: 1px solid rgba(0,0,0,0.2);
+}
+
+.thumb-shadow {
+  border-bottom: 5px solid rgba(0,0,0,0.05);
+  margin-right: -12px;
+  bottom: 2px;
+  width: 94.5%;
+}
+
+.favicon {
+  background-color: rgba(245,245,245,1);
+  -moz-border-radius-bottomright: 0.4em;
+  -moz-box-shadow:
+    inset rgba(255, 255, 255, 0.6) 0 -2px 0px,
+    inset rgba(255, 255, 255, 0.6) -2px 0px 0px;
+  padding: 4px 6px 6px 4px;
+  top: 4px;
+  left: 4px;
+  border-right: 1px solid rgba(0,0,0,0.2);
+  border-bottom: 1px solid rgba(0,0,0,0.2);
+  height: 17px;
+  width: 17px;
+}
+
+.favicon img {
+  border: none;
+  width: 16px;
+  height: 16px;
+}
+
 .close {
+  top: 6px;
+  right: 6px;
+  width: 16px;
+  height: 16px;
+  opacity: 0.2;
   background: url(chrome://global/skin/icons/closetab.png) no-repeat;
 }
+
+.close:hover {
+  opacity: 1.0;
+}
+
+.expander {
+  bottom: 6px;
+  right: 6px;
+  width: 16px;
+  height: 16px;
+  background: url(chrome://global/skin/icons/resizer.png) no-repeat;
+  opacity: 0.2;
+}
+
+.expander:hover {
+  opacity: 1.0;
+}
+
+.favicon img:hover, 
+.close img:hover, 
+.expander img:hover {
+  opacity: 1;
+  border: none;
+}
+
+.tab-title {
+  top: 100%;
+  text-align: center;
+  width: 94.5%;
+  white-space: nowrap;
+  overflow: hidden;
+}
+
+.stacked {
+  padding: 0;
+}
+
+.stacked .thumb {
+  -moz-box-shadow: rgba(0,0,0,.2) 1px 1px 6px;
+}
+
+.stack-trayed .tab-title {
+  text-shadow: rgba(0,0,0,1) 1px 1px 2px;
+  color: #EEE;
+  font-size: 11px;
+}
+
+.stack-trayed .thumb {
+  -moz-box-shadow: none !important;
+}
+
+.focus {
+  -moz-box-shadow:  rgba(54,79,225,1) 0px 0px 5px -1px !important;
+}
+
+/* Tab: Zooming
+----------------------------------*/
+
+.front .tab-title, 
+.front .close, 
+.front .favicon, 
+.front .expander, 
+.front .thumb-shadow {
+  display: none;
+}
+
+.front .focus {
+  -moz-box-shadow: none !important;
+}
+
+/* Tab GroupItem
+----------------------------------*/
+
+.tabInGroupItem {
+  border: none;
+  -moz-box-shadow: none !important;
+}
+
+.groupItem {
+  cursor: move;
+  border: 1px solid rgba(230,230,230,1);
+  background-color: rgba(248,248,248,1);
+  -moz-border-radius: 0.4em;
+  -moz-box-shadow:
+    inset rgba(255, 255, 255, 0.6) 0 0 0 2px,
+    rgba(0,0,0,0.2) 1px 1px 4px;
+}
+
+.groupItem.activeGroupItem {
+  -moz-box-shadow:
+    rgba(0,0,0,0.6) 1px 1px 8px;
+}
+
+.phantom {
+  border: 1px solid rgba(190,190,190,1);
+}
+
+.overlay {
+  background-color: rgba(0,0,0,.7) !important;
+  -moz-box-shadow: 3px 3px 8px rgba(0,0,0,.5);
+  -moz-border-radius: 0.4em;
+  /*
+  border: 1px solid rgba(230,230,230,1);
+  background-color: rgba(248,248,248,1);
+  -moz-box-shadow:
+    rgba(0,0,0, .3) 2px 2px 8px,
+    inset rgba(255, 255, 255, 0.6) 0 0 0 2px; */
+}
+
+/* InfoItems
+----------------------------------*/
+
+.info-item {
+  cursor: move;
+  border: 1px solid rgba(230,230,230,1);
+  background-color: rgba(248,248,248,1);
+  -moz-border-radius: 0.4em;
+  -moz-box-shadow:
+    inset rgba(255, 255, 255, 0.6) 0 0 0 2px,
+    rgba(0,0,0, .2) 1px 1px 4px;
+}
+
+.intro {
+  margin: 10px;
+}
+
+/* Trenches
+----------------------------------*/
+
+.guideTrench {
+  opacity: 0.9;
+  border: 1px dashed  rgba(0,0,0,.12);
+  border-bottom: none;
+  border-right: none;
+  -moz-box-shadow: 1px 1px 0 rgba(255,255,255,.15);
+}
+
+.visibleTrench {
+  opacity: 0.05;
+}
+
+.activeVisibleTrench {
+  opacity: 0;
+}
+
+.activeVisibleTrench.activeTrench {
+  opacity: 0.45;
+}
+
+.visibleTrench.border, 
+.activeVisibleTrench.border {
+  background-color: red;
+}
+
+.visibleTrench.guide, 
+.activeVisibleTrench.guide {
+  background-color: blue;
+}
+
+/* Other
+----------------------------------*/
+
+.newTabButton {
+  width: 16px;
+  height: 15px;
+  bottom: 10px;
+  left: 10px;
+  cursor: pointer;
+  opacity: .3;
+  background-image: url(chrome://browser/skin/tabview/new-tab.png);
+}
+
+.newTabButton:hover {
+  opacity: 1;
+}
+
+.active {
+  -moz-box-shadow: 5px 5px 4px rgba(0,0,0,.5);
+}
+
+.acceptsDrop {
+  -moz-box-shadow: 2px 2px 10px -1px rgba(0,0,0,.6);
+}
+
+.titlebar {
+  font-size: 12px;
+  line-height: 18px;
+  height: 18px;
+}
+
+input.name {
+  background: transparent;
+  border: 1px solid transparent;
+  color: #999;
+  margin: 3px 0px 0px 3px;
+  padding: 1px;
+  background-image: url(chrome://browser/skin/tabview/edit-light.png);
+  padding-left: 20px;
+}
+
+.title-container:hover input.name {
+  border: 1px solid #ddd;
+}
+
+.title-container:hover input.name-locked {
+  border: 1px solid transparent !important;
+  cursor: default;
+}
+
+input.name:focus {
+  color: #555;
+}
+
+input.defaultName {
+  font-style: italic !important;
+  background-image-opacity: .1;
+  color: transparent;
+}
+
+.title-container:hover input.defaultName {
+  color: #CCC;
+}
+
+.title-container {
+  cursor: text;
+}
+
+.title-shield {
+  margin: 3px 0px 0px 3px;
+  padding: 1px;
+  left: 0;
+  top: 0;
+  width: 100%;
+  height: 100%;
+}
+
+.transparentBorder {
+  border: 1px solid transparent !important;
+}
+
+.stackExpander {
+  opacity: .4;
+  cursor: pointer;
+  background-image: url(chrome://browser/skin/tabview/stack-expander.png);
+  width: 24px;
+  height: 24px;
+}
+
+.stackExpander:hover {
+  opacity: .7 !important;
+}
+
+/* Resizable
+----------------------------------*/
+.resizer {
+  background-image: url(chrome://global/skin/icons/resizer.png);
+  width: 16px;
+  height: 16px;
+  bottom: 0px;
+  right: 0px;
+  opacity: .2;
+}
+
+.iq-resizable-handle {
+  font-size: 0.1px;
+}
+
+.iq-resizable-se {
+  cursor: se-resize;
+  width: 12px;
+  height: 12px;
+  right: 1px;
+  bottom: 1px;
+}
\ No newline at end of file
--- a/browser/themes/winstripe/browser/browser.css
+++ b/browser/themes/winstripe/browser/browser.css
@@ -194,16 +194,27 @@ statusbarpanel#statusbar-display {
   #appmenuSecondaryPane {
     -moz-appearance: none;
     background-color: #f1f5fb;
     -moz-box-shadow: 1px 0 3px rgb(204,214,234) inset;
     border: 0;
     padding-top: 5px;
     font-family: "Segoe UI Semibold", "Segoe UI", sans-serif;
   }
+
+  .appmenu-menuseparator {
+    -moz-appearance: none;
+    margin-top: 3px;
+    margin-bottom: 3px;
+    -moz-margin-start: 30px;
+    padding: 0;
+    border-top: 1px solid #d6e5f5;
+    border-bottom: none;
+  }
+
   .appmenu-edit-button:not([disabled]):hover {
     border: 1px solid #b8d6fb;
     -moz-box-shadow: inset 0 0 1px white;
     background: -moz-linear-gradient(#fafbfd, #ebf3fd);
     -moz-transition: .2s ease-in;
   }
 }
 
@@ -1165,21 +1176,80 @@ richlistitem[type~="action"][actiontype=
 .autocomplete-treebody::-moz-tree-cell(suggesthint) {
   border-top: 1px solid GrayText;
 }
 
 /* go button */
 
 #go-button {
   list-style-image: url("chrome://browser/skin/Go-arrow.png");
-  -moz-image-region: rect(0px 16px 16px 0px);
+  -moz-image-region: rect(0px, 16px, 16px, 0px);
 }
 
 #go-button:hover {
-  -moz-image-region: rect(16px 16px 32px 0px);
+  -moz-image-region: rect(16px, 16px, 32px, 0px);
+}
+
+/* combined go/reload/stop button in location bar */
+
+#urlbar > toolbarbutton {
+  -moz-appearance: none;
+  list-style-image: url("chrome://browser/skin/reload-stop-go.png");
+  margin: -2px;
+  -moz-margin-start: 0;
+  padding: 0 3px;
+  background-origin: border-box;
+  border: none;
+  border-left: 1px solid rgba(0,0,0,.25);
+  -moz-border-radius-topright: 2px;
+  -moz-border-radius-bottomright: 2px;
+}
+
+#urlbar > toolbarbutton:active:hover {
+  padding-left: 4px;
+  border-left: none;
+  -moz-box-shadow: 0 0 9px rgba(0,0,0,.4) inset,
+                   0 0 3px rgba(0,0,0,.4) inset;
+}
+
+#urlbar-go-button {
+  -moz-image-region: rect(0px, 56px, 14px, 42px);
+  background-image: -moz-linear-gradient(rgb(115,213,115), rgb(96,190,96) 49%, rgb(82,174,82) 51%, rgb(79,155,79));
+  -moz-box-shadow: 0 1px 0 rgba(0,0,0,.1) inset,
+                   -1px -1px 1px rgba(255,255,255,.25) inset;
+}
+
+#urlbar-go-button:hover {
+  background-image: -moz-linear-gradient(rgb(96,221,96), rgb(71,191,71) 49%, rgb(54,171,54) 51%, rgb(50,147,50));
+}
+
+#urlbar-reload-button {
+  -moz-image-region: rect(0px, 14px, 14px, 0px);
+}
+
+#urlbar-reload-button:hover {
+  -moz-image-region: rect(0px, 28px, 14px, 14px);
+  background-image: -moz-linear-gradient(rgb(162,207,241), rgb(111,178,225) 49%, rgb(91,159,217) 51%, rgb(62,138,200));
+  -moz-box-shadow: 0 1px 0 rgba(0,0,0,.1) inset,
+                   -1px -1px 1px rgba(255,255,255,.25) inset;
+}
+
+#urlbar-stop-button {
+  -moz-image-region: rect(0px, 42px, 14px, 28px);
+  background-image: -moz-linear-gradient(rgb(231,162,140), rgb(209,119,100) 49%, rgb(193,92,78) 51%, rgb(173,72,58));
+  -moz-box-shadow: 0 1px 0 rgba(0,0,0,.1) inset,
+                   -1px -1px 1px rgba(255,255,255,.25) inset;
+}
+
+#urlbar-stop-button:hover {
+  background-image: -moz-linear-gradient(rgb(244,156,128), rgb(215,101,77) 49%, rgb(194,66,48) 51%, rgb(170,41,23));
+}
+
+#urlbar-stop-button[disabled="true"] > .toolbarbutton-icon {
+  opacity: .5;
 }
 
 /* star button */
 
 #star-button {
   list-style-image: url("chrome://browser/skin/places/bookmark.png");
   -moz-image-region: rect(0px 16px 16px 0px);
 }
@@ -1351,16 +1421,20 @@ richlistitem[type~="action"][actiontype=
   background-image: -moz-linear-gradient(hsla(0,0%,60%,.5), hsla(0,0%,45%,.5) 50%);
 }
 
 .tabbrowser-tab:-moz-lwtheme-darktext:not([selected="true"]):hover,
 .tabs-newtab-button:-moz-lwtheme-darktext:hover {
   background-image: -moz-linear-gradient(hsla(0,0%,80%,.5), hsla(0,0%,60%,.5) 50%);
 }
 
+.tabbrowser-tab[pinned][titlechanged]:not([selected="true"]) {
+  background-image: -moz-linear-gradient(rgba(255,0,0,.5), rgba(255,0,0,.5)) !important;
+}
+
 .tabbrowser-tab[busy] > .tab-icon-image {
   list-style-image: url("chrome://browser/skin/tabbrowser/progress.png") !important;
   -moz-image-region: rect(0, 16px, 16px, 0);
 }
 .tabbrowser-tab[busy][stalled] > .tab-icon-image {
   list-style-image: url("chrome://browser/skin/tabbrowser/progress-pulsing.png") !important;
 }
 .tabbrowser-tab[busy][progress="1"] > .tab-icon-image {
@@ -1787,16 +1861,20 @@ toolbarbutton.bookmark-item[dragover="tr
   height: 64px;
   -moz-margin-end: 10px;
 }
 
 .popup-notification-icon[popupid="geolocation"] {
   list-style-image: url(chrome://browser/skin/Geolocation-64.png);
 }
 
+.geolocation-text-link {
+  padding-top: 5px;
+}
+
 .popup-notification-icon[popupid="xpinstall-disabled"],
 .popup-notification-icon[popupid="addon-install-blocked"],
 .popup-notification-icon[popupid="addon-install-failed"],
 .popup-notification-icon[popupid="addon-install-complete"] {
   list-style-image: url(chrome://mozapps/skin/extensions/extensionGeneric.png);
   width: 32px;
   height: 32px;
 }
--- a/browser/themes/winstripe/browser/jar.mn
+++ b/browser/themes/winstripe/browser/jar.mn
@@ -27,16 +27,17 @@ browser.jar:
         skin/classic/browser/mainwindow-dropdown-arrow.png
         skin/classic/browser/pageInfo.css
         skin/classic/browser/pageInfo.png                            (pageInfo.png)
         skin/classic/browser/page-livemarks.png                      (feeds/feedIcon16.png)
         skin/classic/browser/livemark-item.png                       (livemark-item.png)
         skin/classic/browser/livemark-folder.png                     (livemark-folder.png)
         skin/classic/browser/Privacy-16.png
         skin/classic/browser/Privacy-48.png
+        skin/classic/browser/reload-stop-go.png
         skin/classic/browser/Secure.png                              (Secure.png)
         skin/classic/browser/Secure24.png                            (Secure24.png)
         skin/classic/browser/Security-broken.png                     (Security-broken.png)
         skin/classic/browser/Toolbar.png                             (Toolbar.png)
         skin/classic/browser/Go-arrow.png                            (Go-arrow.png)
 *       skin/classic/browser/searchbar.css                           (searchbar.css)
         skin/classic/browser/Search-addengines.png
         skin/classic/browser/section_collapsed.png
@@ -142,16 +143,17 @@ browser.jar:
         skin/classic/aero/browser/mainwindow-dropdown-arrow.png      (mainwindow-dropdown-arrow-aero.png)
         skin/classic/aero/browser/pageInfo.css
         skin/classic/aero/browser/pageInfo.png                       (pageInfo-aero.png)
         skin/classic/aero/browser/page-livemarks.png                 (feeds/feedIcon16-aero.png)
         skin/classic/aero/browser/livemark-item.png                  (livemark-item-aero.png)
         skin/classic/aero/browser/livemark-folder.png                (livemark-folder-aero.png)
         skin/classic/aero/browser/Privacy-16.png                     (Privacy-16-aero.png)
         skin/classic/aero/browser/Privacy-48.png                     (Privacy-48-aero.png)
+        skin/classic/aero/browser/reload-stop-go.png
         skin/classic/aero/browser/Secure.png                         (Secure-aero.png)
         skin/classic/aero/browser/Secure24.png                       (Secure24-aero.png)
         skin/classic/aero/browser/Security-broken.png                (Security-broken-aero.png)
         skin/classic/aero/browser/Toolbar.png
         skin/classic/aero/browser/Go-arrow.png                       (Go-arrow-aero.png)
 *       skin/classic/aero/browser/searchbar.css                      (searchbar.css)
         skin/classic/aero/browser/Search-addengines.png
         skin/classic/aero/browser/section_collapsed.png
@@ -166,16 +168,17 @@ browser.jar:
         skin/classic/aero/browser/feeds/feed-icons-16.png            (feeds/feed-icons-16-aero.png)
         skin/classic/aero/browser/feeds/feedIcon.png                 (feeds/feedIcon-aero.png)
         skin/classic/aero/browser/feeds/feedIcon16.png               (feeds/feedIcon16-aero.png)
         skin/classic/aero/browser/feeds/audioFeedIcon.png            (feeds/audioFeedIcon-aero.png)
         skin/classic/aero/browser/feeds/audioFeedIcon16.png          (feeds/audioFeedIcon16-aero.png)
         skin/classic/aero/browser/feeds/videoFeedIcon.png            (feeds/videoFeedIcon-aero.png)
         skin/classic/aero/browser/feeds/videoFeedIcon16.png          (feeds/videoFeedIcon16-aero.png)
         skin/classic/aero/browser/feeds/subscribe.css                (feeds/subscribe.css)
+        skin/classic/aero/browser/feeds/subscribe-ui.css             (feeds/subscribe-ui.css)
 *       skin/classic/aero/browser/places/places.css                  (places/places-aero.css)
 *       skin/classic/aero/browser/places/organizer.css               (places/organizer-aero.css)
         skin/classic/aero/browser/places/bookmark.png                (places/bookmark-aero.png)
         skin/classic/aero/browser/places/editBookmark.png            (places/editBookmark-aero.png)
         skin/classic/aero/browser/places/query.png                   (places/query-aero.png)
         skin/classic/aero/browser/places/bookmarksMenu.png           (places/bookmarksMenu-aero.png)
         skin/classic/aero/browser/places/bookmarksToolbar.png        (places/bookmarksToolbar-aero.png)
         skin/classic/aero/browser/places/calendar.png                (places/calendar-aero.png)
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..e070eb424b03f8bedf69aaeab810f398cc3b28ec
GIT binary patch
literal 1590
zc$@(?2Fdw}P)<h;3K|Lk000e1NJLTq001}u000gM1^@s6dZpj40000PbVXQnQ*UN;
zcVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBU%*hxe|RCwCdmTOE@M-+f(?sMOuMdjr#
z1!arXSZf94DOijMVig)~MZs=WsI{>%Hl!*BEU^*ArivgKYOP641+1d7h+@EqRhw9w
z0P$57QH#|0U|G1!?wy`X7YfTRtxf#VxjC7cbLY;S@18Sf1`|Ti|Fz&iY8g~x$aOK#
z)fnnUCQMqqB<sHzLhHg;yac$VP)UHZp}pSKIA&mH-ohj;Mbnu)%f~~l1@E@>^jM7u
zkzAHx(>R{bhG98Q06Y=Kuow=3?r4Nj8zST~w7&(J3-3OFy2SCjH#qzbRCT{t$P)*>
z8&tDEU*XE|pn#w$&9|B@(3B(!AVu)x4wrxc7b}y=D|k*Omn-DW8nya(XIGb>V6hk&
zicVvBo)d)bq2BQe55YA31;Ekcbly+(0lItFZnbbXTOQ1W=nn%p8i_Wu6S!oI&<6OC
zH>PlS)fGD=wB2Z$-YeQ{dKkk4<oC`1o2nXX6Eo&}RGzI=KvzHnMF1oL$owII2@4i#
z6$)jULaFG8i;Z2s=-uQ?pf-W1KHr>^V-|#XmSK?1YITJ3q!}h>q??;inwQx;H)ci?
zs2@pQT(D|mSY_=+6@Wtk5bS7R(aBTo*((iC+gk691)zdAIlLOwHmMD8x=~(U&o&j7
zv=0-d$Bz{rMM-Ou6DrPB$N<oSY$zP-DMYUQ4cQCGF<d6c@v7*^$WH;T3{=l0{i2k#
ztWh2w@iL_f90A)E4^BvGrE<BcOP~vL*EIl~6oL<WC-skBf@xL_-*gj+5M!&Ob<^LD
zy<B9hIl4M-_T096Ej}zw?*z37aAU`Kd7BE1HAerS2|o?mcY3NGvW5xKs0UHR0@e%A
z??N)v4R92)Vi8$;Au&Mi=ua}dOtw(1R{flsvZNnw@zS&`2-a*uVPt{OG@DJx+&MVX
zL`1@-P7HjqU`}K|92+oeDW>QYfMSR!D!}ausCg$IFzW*K#f8<UPxxqc&ncVD6U5uo
z+oxmCUvPWvQ8X|mngPm$IMRXSV5b6gAZ0J0fOzmAN4f#N6Mkt7glk;C2Qf{JWN5ao
z4^AqFzT1BQs`}wFnIKqYN`?GxADmQrZk>_(4gWG3nh$Q@b_k3JXYC4(rn?Up>^k(>
z?n2Yh)CuNe!ayxTOA>-O@E!O7JSX;!uo4m*GW+q7T@?@e0eO~tX0=+p9HzTt7nen&
zR$5wrZ+G-g{XhMfz7on|4a3m6*k)6W_VqP0EK45Vxve^0TC(NG;-Ym84%wA7i9_Z!
z<Qv>dYfE9{!GjT#5Ro91=a*M;EO)g(L^T>sJ-iKDW>^{gB4<(X<e*2lTibkD|Cpc`
zJ;x+CmZ86fu+)wA_Oaww)tujcqWYYd&d&n6vC=yjGs5AsEdvG5#CJ>2mMVZk@~LcI
z=sW^&Cjjn<^gsFmBf>)qD2fu)YRwNHW_&yd((uum;M5iATi;7HjC3^eljTX(Jj)Q4
zV>iLx8w4r!S^wyC`qfB{GeEUQ6HjcmKo2i(>ki}TI<5Y-V&8G&OSYdpRXawj>w$Lx
z8h7_Zmj`_aHb96*1DFUYMn3<o`M7LrnGxWQ_QCazvtQL@-yArYaka52m!fD+B;<m0
z)Ij>1fH9fTY3dYgww~mDdv;ejtmA&5+_)iQ<IagaR#7?%u7R|`lsZ^r0&Ee=bCmn$
zI~U5&Ik9nSVdnbPajDB2{RSr#MeEHQD=PODPtN!<uL$~=oB_^RGbgM1O0^y~nI$ne
z(Q-KV@JWC>HV|$gpj1Yjzi=`3OkG_{SGOe;LiQDad#vF3hM1^`gJCnK*T9%3PS*0j
z(s&~^`>Xxq>o5MQ?l5=B)e4yqF>O*u*4nh|Qzz;7!<gS(IAR(|^N?%_kRY#vTplLM
zqtbKJ-@o5}pDE8PKjsY15wO>jAX*R)DWTb~L4QbI0qGuQF?WzKkU;5jU^n<W$a#>b
oFY&$|1tMMRDxJYe<xc?y00@FH8IbQNc>n+a07*qoM6N<$f*HQzl>h($
--- a/browser/themes/winstripe/browser/tabview/tabview.css
+++ b/browser/themes/winstripe/browser/tabview/tabview.css
@@ -1,53 +1,343 @@
 /* This file is for platform-specific CSS for TabView, and is loaded after the
   platform-independent tabview.css, to allow overwriting.
 */
 
-.close {
-  background: url(chrome://global/skin/icons/Close.gif) no-repeat;
+body {
+  background-color: transparent;  
+  font-family: Tahoma, sans-serif !important;
+  color: rgba(0,0,0,0.4);
+  font-size: 12px;
+  line-height: 16px;
 }
 
 #bg {
   background: -moz-linear-gradient(top,#F1F5FB,#EDF4FB);
-  position: absolute;
-  top: 0;
-  left: 0;
-  width: 100%;
-  height: 100%;
-  z-index: -999999;
+}
+
+/* Tabs
+----------------------------------*/
+
+.tab {
+  padding: 4px 6px 6px 4px;
+  border: 1px solid rgba(230,230,230,1);
+  background-color: rgba(245,245,245,1);
+  -moz-border-radius: 0.4em;
+  -moz-box-shadow: inset rgba(255, 255, 255, 0.6) 0 0 0 2px;
+  cursor: pointer;
+}
+
+.tab canvas,
+.cached-thumb {
+  border: 1px solid rgba(0,0,0,0.2);
+}
+
+.thumb-shadow {
+  border-bottom: 5px solid rgba(0,0,0,0.05);
+  margin-right: -12px;
+  bottom: 2px;
+  width: 94.5%;
+}
+
+.favicon {
+  background-color: rgba(245,245,245,1);
+  -moz-border-radius-bottomright: 0.4em;
+  -moz-box-shadow:
+    inset rgba(255, 255, 255, 0.6) 0 -2px 0px,
+    inset rgba(255, 255, 255, 0.6) -2px 0px 0px;
+  padding: 4px 6px 6px 4px;
+  top: 4px;
+  left: 4px;
+  border-right: 1px solid rgba(0,0,0,0.2);
+  border-bottom: 1px solid rgba(0,0,0,0.2);
+  height: 17px;
+  width: 17px;
+}
+
+.favicon img {
+  border: none;
+  width: 16px;
+  height: 16px;
+}
+
+.close {
+  top: 6px;
+  right: 6px;
+  width: 16px;
+  height: 16px;
+  opacity: 0.2;
+  background: url(chrome://global/skin/icons/Close.gif) no-repeat;
+}
+
+.close:hover {
+  opacity: 1.0;
+}
+
+.expander {
+  bottom: 6px;
+  right: 6px;
+  width: 16px;
+  height: 16px;
+  background: url(chrome://global/skin/icons/resizer.png) no-repeat;
+  opacity: 0.2;
+}
+
+.expander:hover {
+  opacity: 1.0;
+}
+
+.favicon img:hover, 
+.close img:hover, 
+.expander img:hover {
+  opacity: 1;
+  border: none;
+}
+
+.tab-title {
+  top: 100%;
+  text-align: center;
+  width: 94.5%;
+  white-space: nowrap;
+  overflow: hidden;
+}
+
+.stacked {
+  padding: 0;
+}
+
+.stacked .thumb {
+  -moz-box-shadow: rgba(0,0,0,.2) 1px 1px 6px;
+}
+
+.stack-trayed .tab-title {
+  text-shadow: rgba(0,0,0,1) 1px 1px 2px;
+  color: #EEE;
+  font-size: 11px;
+}
+
+.stack-trayed .thumb {
+  -moz-box-shadow: none !important;
+}
+
+.focus {
+  -moz-box-shadow:  rgba(54,79,225,1) 0px 0px 5px -1px !important;
+}
+
+/* Tab: Zooming
+----------------------------------*/
+
+.front .tab-title, 
+.front .close, 
+.front .favicon, 
+.front .expander, 
+.front .thumb-shadow {
+  display: none;
+}
+
+.front .focus {
+  -moz-box-shadow: none !important;
+}