Updating bsmedberg's patches to current actionmonkey.
authorJohnny Stenback <jst@mozilla.com>
Tue, 08 Jul 2008 12:05:16 -0700
changeset 149 13eaa3adde4be1d470346a98e7cc7ab6b2ada1c8
parent 148 52f5b813aad6c6cb8696c5f381973297bd5f4480
child 150 1c04169f4d4554e160914c40347481a10244dcfd
push id30
push userbsmedberg@mozilla.com
push dateSun, 13 Jul 2008 14:45:31 +0000
Updating bsmedberg's patches to current actionmonkey.
automatic-garburator
automatic-gcobject
automatic-remove-addrefs
generate-automatic-patches.sh
jst-build-fixes
series
tamarin-bug-427030-v1.patch
tamarin-const-workitem.patch
tamarin-debug-print-finalizers
tamarin-double-mark-is-ok
tamarin-enable-traces
tamarin-finalizable-merge-fixup
tamarin-gcc43-strict-warnings
tamarin-gcstack-access
tamarin-remove-extra-auto-storage-specifiers
tamarin-remove-finalize-method
tamarin-stack-access2
tamarin-uninline-fixedmalloc
tamarin-valgrind-annotations
tamarin-workitems-notgc-noassert
--- a/automatic-garburator
+++ b/automatic-garburator
@@ -1,14 +1,14 @@
 Automatically generated patch: convert stack nsCOMPtrs to raw pointers
 
-diff --git a/accessible/src/atk/nsAccessibleWrap.cpp b/accessible/src/atk/nsAccessibleWrap.cpp
---- a/accessible/src/atk/nsAccessibleWrap.cpp
-+++ b/accessible/src/atk/nsAccessibleWrap.cpp
-@@ -429,74 +429,74 @@ nsAccessibleWrap::CreateMaiInterfaces(vo
+diff -r 332906b0e686 accessible/src/atk/nsAccessibleWrap.cpp
+--- a/accessible/src/atk/nsAccessibleWrap.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/atk/nsAccessibleWrap.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -429,74 +429,74 @@
      }
  
      //nsIAccessibleText
 -    nsCOMPtr<nsIAccessibleText> accessInterfaceText;
 +    nsIAccessibleText* accessInterfaceText = nsnull;
      QueryInterface(NS_GET_IID(nsIAccessibleText),
 -                   getter_AddRefs(accessInterfaceText));
 +                   (void**)&accessInterfaceText);
@@ -91,28 +91,28 @@ diff --git a/accessible/src/atk/nsAccess
 -      nsCOMPtr<nsIAccessibleSelectable> accessInterfaceSelection;
 +      nsIAccessibleSelectable* accessInterfaceSelection = nsnull;
        QueryInterface(NS_GET_IID(nsIAccessibleSelectable),
 -                     getter_AddRefs(accessInterfaceSelection));
 +                     (void**)&accessInterfaceSelection);
        if (accessInterfaceSelection) {
            interfacesBits |= 1 << MAI_INTERFACE_SELECTION;
        }
-@@ -789,8 +789,8 @@ GetAttributeSet(nsIAccessible* aAccessib
+@@ -789,8 +789,8 @@
  GetAttributeSet(nsIAccessible* aAccessible)
  {
      AtkAttributeSet *objAttributeSet = nsnull;
 -    nsCOMPtr<nsIPersistentProperties> attributes;
 -    aAccessible->GetAttributes(getter_AddRefs(attributes));
 +    nsIPersistentProperties* attributes = nsnull;
 +    aAccessible->GetAttributes(&attributes);
      
      if (attributes) {
          // Deal with attributes that we only need to expose in ATK
-@@ -803,15 +803,15 @@ GetAttributeSet(nsIAccessible* aAccessib
+@@ -803,15 +803,15 @@
                                          oldValueUnused);
          }
  
 -        nsCOMPtr<nsISimpleEnumerator> propEnum;
 -        nsresult rv = attributes->Enumerate(getter_AddRefs(propEnum));
 +        nsISimpleEnumerator* propEnum = nsnull;
 +        nsresult rv = attributes->Enumerate(&propEnum);
          NS_ENSURE_SUCCESS(rv, nsnull);
@@ -123,28 +123,28 @@ diff --git a/accessible/src/atk/nsAccess
 -            rv = propEnum->GetNext(getter_AddRefs(sup));
 -            nsCOMPtr<nsIPropertyElement> propElem(do_QueryInterface(sup));
 +            nsISupports* sup = nsnull;
 +            rv = propEnum->GetNext(&sup);
 +            nsIPropertyElement* propElem(do_QueryInterface(sup));
              NS_ENSURE_TRUE(propElem, nsnull);
  
              nsCAutoString name;
-@@ -849,8 +849,8 @@ getParentCB(AtkObject *aAtkObj)
+@@ -849,8 +849,8 @@
              return nsnull;
          }
  
 -        nsCOMPtr<nsIAccessible> accParent;
 -        nsresult rv = accWrap->GetParent(getter_AddRefs(accParent));
 +        nsIAccessible* accParent = nsnull;
 +        nsresult rv = accWrap->GetParent(&accParent);
          if (NS_FAILED(rv) || !accParent)
              return nsnull;
  
-@@ -869,15 +869,15 @@ getChildCountCB(AtkObject *aAtkObj)
+@@ -869,15 +869,15 @@
      }
  
      PRInt32 count = 0;
 -    nsCOMPtr<nsIAccessibleHyperText> hyperText;
 -    accWrap->QueryInterface(NS_GET_IID(nsIAccessibleHyperText), getter_AddRefs(hyperText));
 +    nsIAccessibleHyperText* hyperText = nsnull;
 +    accWrap->QueryInterface(NS_GET_IID(nsIAccessibleHyperText), (void**)&hyperText);
      if (hyperText) {
@@ -154,17 +154,17 @@ diff --git a/accessible/src/atk/nsAccess
      else {
 -        nsCOMPtr<nsIAccessibleText> accText;
 -        accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText), getter_AddRefs(accText));
 +        nsIAccessibleText* accText = nsnull;
 +        accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText), (void**)&accText);
          if (!accText) {    // Accessible text that is not a HyperText has no children
              accWrap->GetChildCount(&count);
          }
-@@ -902,20 +902,20 @@ refChildCB(AtkObject *aAtkObj, gint aChi
+@@ -902,20 +902,20 @@
          return nsnull;
      }
  
 -    nsCOMPtr<nsIAccessible> accChild;
 -    nsCOMPtr<nsIAccessibleHyperText> hyperText;
 -    accWrap->QueryInterface(NS_GET_IID(nsIAccessibleHyperText), getter_AddRefs(hyperText));
 +    nsIAccessible* accChild = nsnull;
 +    nsIAccessibleHyperText* hyperText = nsnull;
@@ -183,17 +183,17 @@ diff --git a/accessible/src/atk/nsAccess
 +        nsIAccessibleText* accText = nsnull;
 +        accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText), (void**)&accText);
          if (!accText) {  // Accessible Text that is not HyperText has no children
 -            accWrap->GetChildAt(aChildIndex, getter_AddRefs(accChild));
 +            accWrap->GetChildAt(aChildIndex, &accChild);
          }
      }
  
-@@ -944,14 +944,14 @@ getIndexInParentCB(AtkObject *aAtkObj)
+@@ -944,14 +944,14 @@
          return -1;
      }
  
 -    nsCOMPtr<nsIAccessible> parent;
 -    accWrap->GetParent(getter_AddRefs(parent));
 +    nsIAccessible* parent = nsnull;
 +    accWrap->GetParent(&parent);
      if (!parent) {
@@ -202,270 +202,270 @@ diff --git a/accessible/src/atk/nsAccess
  
 -    nsCOMPtr<nsIAccessible> sibling;
 -    parent->GetFirstChild(getter_AddRefs(sibling));
 +    nsIAccessible* sibling = nsnull;
 +    parent->GetFirstChild(&sibling);
      if (!sibling) {
          return -1;  // Error, parent has no children
      }
-@@ -968,9 +968,9 @@ getIndexInParentCB(AtkObject *aAtkObj)
+@@ -968,9 +968,9 @@
          ++ currentIndex;
        }
  
 -      nsCOMPtr<nsIAccessible> tempAccessible;
 -      sibling->GetNextSibling(getter_AddRefs(tempAccessible));
 -      sibling.swap(tempAccessible);
 +      nsIAccessible* tempAccessible = nsnull;
 +      sibling->GetNextSibling(&tempAccessible);
 +      swap(sibling, tempAccessible);
      }
  
      return currentIndex;
-@@ -1084,10 +1084,10 @@ nsAccessibleWrap *GetAccessibleWrap(AtkO
+@@ -1084,10 +1084,10 @@
  
      NS_ENSURE_TRUE(tmpAccWrap->GetAtkObject() == aAtkObj, nsnull);
  
 -    nsRefPtr<nsApplicationAccessibleWrap> appAccWrap =
 +    nsApplicationAccessibleWrap* appAccWrap =
          nsAccessNode::GetApplicationAccessible();
      nsAccessibleWrap* tmpAppAccWrap =
 -        static_cast<nsAccessibleWrap*>(appAccWrap.get());
 +        static_cast<nsAccessibleWrap*>(appAccWrap);
  
      if (tmpAppAccWrap != tmpAccWrap && !tmpAccWrap->IsValidObject())
          return nsnull;
-@@ -1101,8 +1101,8 @@ nsAccessibleWrap::FireAccessibleEvent(ns
+@@ -1101,8 +1101,8 @@
      nsresult rv = nsAccessible::FireAccessibleEvent(aEvent);
      NS_ENSURE_SUCCESS(rv, rv);
  
 -    nsCOMPtr<nsIAccessible> accessible;
 -    aEvent->GetAccessible(getter_AddRefs(accessible));
 +    nsIAccessible* accessible = nsnull;
 +    aEvent->GetAccessible(&accessible);
      NS_ENSURE_TRUE(accessible, NS_ERROR_FAILURE);
  
      PRUint32 type = 0;
-@@ -1138,11 +1138,11 @@ nsAccessibleWrap::FireAccessibleEvent(ns
+@@ -1138,11 +1138,11 @@
      case nsIAccessibleEvent::EVENT_FOCUS:
        {
          MAI_LOG_DEBUG(("\n\nReceived: EVENT_FOCUS\n"));
 -        nsRefPtr<nsRootAccessible> rootAccWrap = accWrap->GetRootAccessible();
 +        nsRootAccessible* rootAccWrap = accWrap->GetRootAccessible();
          if (rootAccWrap && rootAccWrap->mActivated) {
              atk_focus_tracker_notify(atkObj);
              // Fire state change event for focus
 -            nsCOMPtr<nsIAccessibleStateChangeEvent> stateChangeEvent =
 +            nsIAccessibleStateChangeEvent* stateChangeEvent =
                new nsAccStateChangeEvent(accessible,
                                          nsIAccessibleStates::STATE_FOCUSED,
                                          PR_FALSE, PR_TRUE);
-@@ -1153,7 +1153,7 @@ nsAccessibleWrap::FireAccessibleEvent(ns
+@@ -1153,7 +1153,7 @@
      case nsIAccessibleEvent::EVENT_VALUE_CHANGE:
        {
          MAI_LOG_DEBUG(("\n\nReceived: EVENT_VALUE_CHANGE\n"));
 -        nsCOMPtr<nsIAccessibleValue> value(do_QueryInterface(accessible));
 +        nsIAccessibleValue* value(do_QueryInterface(accessible));
          if (value) {    // Make sure this is a numeric value
              // Don't fire for MSAA string value changes (e.g. text editing)
              // ATK values are always numeric
-@@ -1175,7 +1175,7 @@ nsAccessibleWrap::FireAccessibleEvent(ns
+@@ -1175,7 +1175,7 @@
        {
          MAI_LOG_DEBUG(("\n\nReceived: EVENT_TEXT_CARET_MOVED\n"));
  
 -        nsCOMPtr<nsIAccessibleCaretMoveEvent> caretMoveEvent(do_QueryInterface(aEvent));
 +        nsIAccessibleCaretMoveEvent* caretMoveEvent(do_QueryInterface(aEvent));
          NS_ASSERTION(caretMoveEvent, "Event needs event data");
          if (!caretMoveEvent)
              break;
-@@ -1198,7 +1198,7 @@ nsAccessibleWrap::FireAccessibleEvent(ns
+@@ -1198,7 +1198,7 @@
      case nsIAccessibleEvent::EVENT_TABLE_ROW_INSERT:
        {
          MAI_LOG_DEBUG(("\n\nReceived: EVENT_TABLE_ROW_INSERT\n"));
 -        nsCOMPtr<nsIAccessibleTableChangeEvent> tableEvent = do_QueryInterface(aEvent);
 +        nsIAccessibleTableChangeEvent* tableEvent = do_QueryInterface(aEvent);
          NS_ENSURE_TRUE(tableEvent, NS_ERROR_FAILURE);
  
          PRInt32 rowIndex, numRows;
-@@ -1216,7 +1216,7 @@ nsAccessibleWrap::FireAccessibleEvent(ns
+@@ -1216,7 +1216,7 @@
     case nsIAccessibleEvent::EVENT_TABLE_ROW_DELETE:
       {
          MAI_LOG_DEBUG(("\n\nReceived: EVENT_TABLE_ROW_DELETE\n"));
 -        nsCOMPtr<nsIAccessibleTableChangeEvent> tableEvent = do_QueryInterface(aEvent);
 +        nsIAccessibleTableChangeEvent* tableEvent = do_QueryInterface(aEvent);
          NS_ENSURE_TRUE(tableEvent, NS_ERROR_FAILURE);
  
          PRInt32 rowIndex, numRows;
-@@ -1241,7 +1241,7 @@ nsAccessibleWrap::FireAccessibleEvent(ns
+@@ -1241,7 +1241,7 @@
      case nsIAccessibleEvent::EVENT_TABLE_COLUMN_INSERT:
        {
          MAI_LOG_DEBUG(("\n\nReceived: EVENT_TABLE_COLUMN_INSERT\n"));
 -        nsCOMPtr<nsIAccessibleTableChangeEvent> tableEvent = do_QueryInterface(aEvent);
 +        nsIAccessibleTableChangeEvent* tableEvent = do_QueryInterface(aEvent);
          NS_ENSURE_TRUE(tableEvent, NS_ERROR_FAILURE);
  
          PRInt32 colIndex, numCols;
-@@ -1259,7 +1259,7 @@ nsAccessibleWrap::FireAccessibleEvent(ns
+@@ -1259,7 +1259,7 @@
      case nsIAccessibleEvent::EVENT_TABLE_COLUMN_DELETE:
        {
          MAI_LOG_DEBUG(("\n\nReceived: EVENT_TABLE_COLUMN_DELETE\n"));
 -        nsCOMPtr<nsIAccessibleTableChangeEvent> tableEvent = do_QueryInterface(aEvent);
 +        nsIAccessibleTableChangeEvent* tableEvent = do_QueryInterface(aEvent);
          NS_ENSURE_TRUE(tableEvent, NS_ERROR_FAILURE);
  
          PRInt32 colIndex, numCols;
-@@ -1310,7 +1310,7 @@ nsAccessibleWrap::FireAccessibleEvent(ns
+@@ -1310,7 +1310,7 @@
        {
          MAI_LOG_DEBUG(("\n\nReceived: EVENT_WINDOW_ACTIVATED\n"));
          nsDocAccessibleWrap *accDocWrap =
 -          static_cast<nsDocAccessibleWrap *>(accessible.get());
 +          static_cast<nsDocAccessibleWrap *>(accessible);
          accDocWrap->mActivated = PR_TRUE;
          guint id = g_signal_lookup ("activate", MAI_TYPE_ATK_OBJECT);
          g_signal_emit(atkObj, id, 0);
-@@ -1320,7 +1320,7 @@ nsAccessibleWrap::FireAccessibleEvent(ns
+@@ -1320,7 +1320,7 @@
        {
          MAI_LOG_DEBUG(("\n\nReceived: EVENT_WINDOW_DEACTIVATED\n"));
          nsDocAccessibleWrap *accDocWrap =
 -          static_cast<nsDocAccessibleWrap *>(accessible.get());
 +          static_cast<nsDocAccessibleWrap *>(accessible);
          accDocWrap->mActivated = PR_FALSE;
          guint id = g_signal_lookup ("deactivate", MAI_TYPE_ATK_OBJECT);
          g_signal_emit(atkObj, id, 0);
-@@ -1367,7 +1367,7 @@ nsAccessibleWrap::FireAtkStateChangeEven
+@@ -1367,7 +1367,7 @@
  {
      MAI_LOG_DEBUG(("\n\nReceived: EVENT_STATE_CHANGE\n"));
  
 -    nsCOMPtr<nsIAccessibleStateChangeEvent> event =
 +    nsIAccessibleStateChangeEvent* event =
          do_QueryInterface(aEvent);
      NS_ENSURE_TRUE(event, NS_ERROR_FAILURE);
  
-@@ -1409,7 +1409,7 @@ nsAccessibleWrap::FireAtkTextChangedEven
+@@ -1409,7 +1409,7 @@
  {
      MAI_LOG_DEBUG(("\n\nReceived: EVENT_TEXT_REMOVED/INSERTED\n"));
  
 -    nsCOMPtr<nsIAccessibleTextChangeEvent> event =
 +    nsIAccessibleTextChangeEvent* event =
          do_QueryInterface(aEvent);
      NS_ENSURE_TRUE(event, NS_ERROR_FAILURE);
  
-diff --git a/accessible/src/atk/nsAppRootAccessible.cpp b/accessible/src/atk/nsAppRootAccessible.cpp
---- a/accessible/src/atk/nsAppRootAccessible.cpp
-+++ b/accessible/src/atk/nsAppRootAccessible.cpp
-@@ -435,7 +435,7 @@ AtkObject *
+diff -r 332906b0e686 accessible/src/atk/nsAppRootAccessible.cpp
+--- a/accessible/src/atk/nsAppRootAccessible.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/atk/nsAppRootAccessible.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -435,7 +435,7 @@
  AtkObject *
  mai_util_get_root(void)
  {
 -    nsRefPtr<nsApplicationAccessibleWrap> root =
 +    nsApplicationAccessibleWrap* root =
          nsAccessNode::GetApplicationAccessible();
  
      if (root)
-@@ -541,7 +541,7 @@ nsApplicationAccessibleWrap::Init()
+@@ -541,7 +541,7 @@
      } else {
          //check gconf-2 setting
          nsresult rv;
 -        nsCOMPtr<nsIPrefBranch> sysPrefService =
 +        nsIPrefBranch* sysPrefService =
              do_GetService(sSysPrefService, &rv);
          if (NS_SUCCEEDED(rv) && sysPrefService) {
              sysPrefService->GetBoolPref(sAccessibilityKey, &isGnomeATEnabled);
-@@ -665,7 +665,7 @@ nsApplicationAccessibleWrap::RemoveRootA
+@@ -665,7 +665,7 @@
      nsresult rv = NS_ERROR_FAILURE;
  
      // we must use weak ref to get the index
 -    nsCOMPtr<nsIWeakReference> weakPtr = do_GetWeakReference(aRootAccWrap);
 +    nsIWeakReference* weakPtr = do_GetWeakReference(aRootAccWrap);
      rv = mChildren->IndexOf(0, weakPtr, &index);
  
      AtkObject *atkAccessible = nsAccessibleWrap::GetAtkObject(aRootAccWrap);
-diff --git a/accessible/src/atk/nsMaiHyperlink.cpp b/accessible/src/atk/nsMaiHyperlink.cpp
---- a/accessible/src/atk/nsMaiHyperlink.cpp
-+++ b/accessible/src/atk/nsMaiHyperlink.cpp
-@@ -144,7 +144,7 @@ MaiHyperlink::GetAtkHyperlink(void)
+diff -r 332906b0e686 accessible/src/atk/nsMaiHyperlink.cpp
+--- a/accessible/src/atk/nsMaiHyperlink.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/atk/nsMaiHyperlink.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -144,7 +144,7 @@
      if (mMaiAtkHyperlink)
          return mMaiAtkHyperlink;
  
 -    nsCOMPtr<nsIAccessibleHyperLink> accessIf(do_QueryInterface(mHyperlink));
 +    nsIAccessibleHyperLink* accessIf(do_QueryInterface(mHyperlink));
      if (!accessIf)
          return nsnull;
  
-@@ -219,8 +219,8 @@ getUriCB(AtkHyperlink *aLink, gint aLink
+@@ -219,8 +219,8 @@
  
      MaiAtkHyperlink *maiAtkHyperlink = MAI_ATK_HYPERLINK(aLink);
  
 -    nsCOMPtr<nsIURI> uri;
 -    nsresult rv = accHyperlink->GetURI(aLinkIndex,getter_AddRefs(uri));
 +    nsIURI* uri = nsnull;
 +    nsresult rv = accHyperlink->GetURI(aLinkIndex,&uri);
      if (NS_FAILED(rv) || !uri)
          return nsnull;
      nsCAutoString cautoStr;
-@@ -235,8 +235,8 @@ getObjectCB(AtkHyperlink *aLink, gint aL
+@@ -235,8 +235,8 @@
      nsIAccessibleHyperLink *accHyperlink = get_accessible_hyperlink(aLink);
      NS_ENSURE_TRUE(accHyperlink, nsnull);
  
 -    nsCOMPtr<nsIAccessible> accObj;
 -    accHyperlink->GetAnchor(aLinkIndex, getter_AddRefs(accObj));
 +    nsIAccessible* accObj = nsnull;
 +    accHyperlink->GetAnchor(aLinkIndex, &accObj);
      NS_ENSURE_TRUE(accObj, nsnull);
  
      AtkObject *atkObj = nsAccessibleWrap::GetAtkObject(accObj);
-diff --git a/accessible/src/atk/nsMaiInterfaceAction.cpp b/accessible/src/atk/nsMaiInterfaceAction.cpp
---- a/accessible/src/atk/nsMaiInterfaceAction.cpp
-+++ b/accessible/src/atk/nsMaiInterfaceAction.cpp
-@@ -119,8 +119,8 @@ getKeyBindingCB(AtkAction *aAction, gint
+diff -r 332906b0e686 accessible/src/atk/nsMaiInterfaceAction.cpp
+--- a/accessible/src/atk/nsMaiInterfaceAction.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/atk/nsMaiInterfaceAction.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -119,8 +119,8 @@
      nsresult rv = accWrap->GetKeyboardShortcut(accessKey);
  
      if (NS_SUCCEEDED(rv) && !accessKey.IsEmpty()) {
 -        nsCOMPtr<nsIAccessible> parentAccessible;
 -        accWrap->GetParent(getter_AddRefs(parentAccessible));
 +        nsIAccessible* parentAccessible = nsnull;
 +        accWrap->GetParent(&parentAccessible);
          if (parentAccessible) {
              PRUint32 role;
              parentAccessible->GetRole(&role);
-@@ -135,7 +135,7 @@ getKeyBindingCB(AtkAction *aAction, gint
+@@ -135,7 +135,7 @@
              else if ((role == ATK_ROLE_MENU) || (role == ATK_ROLE_MENU_ITEM)) {
                  //it is submenu, change from "s" to "s;<Alt>f:s"
                  nsAutoString allKey = accessKey;
 -                nsCOMPtr<nsIAccessible> grandParentAcc = parentAccessible;
 +                nsIAccessible* grandParentAcc = parentAccessible;
  
                  while ((grandParentAcc) && (role != ATK_ROLE_MENU_BAR)) {
                      nsAutoString grandParentKey;
-@@ -147,8 +147,8 @@ getKeyBindingCB(AtkAction *aAction, gint
+@@ -147,8 +147,8 @@
                          allKey = rightChar + NS_LITERAL_STRING(":") + allKey;
                      }
  
 -                    nsCOMPtr<nsIAccessible> tempAcc = grandParentAcc;
 -                    tempAcc->GetParent(getter_AddRefs(grandParentAcc));
 +                    nsIAccessible* tempAcc = grandParentAcc;
 +                    tempAcc->GetParent(&grandParentAcc);
                      if (grandParentAcc)
                          grandParentAcc->GetRole(&role);
                  }
-@@ -168,8 +168,8 @@ getKeyBindingCB(AtkAction *aAction, gint
+@@ -168,8 +168,8 @@
  
      //get shortcut
      nsAutoString subShortcut;
 -    nsCOMPtr<nsIDOMDOMStringList> keyBindings;
 -    rv = accWrap->GetKeyBindings(aActionIndex, getter_AddRefs(keyBindings));
 +    nsIDOMDOMStringList* keyBindings = nsnull;
 +    rv = accWrap->GetKeyBindings(aActionIndex, &keyBindings);
  
      if (NS_SUCCEEDED(rv) && keyBindings) {
          PRUint32 length = 0;
-diff --git a/accessible/src/atk/nsMaiInterfaceComponent.cpp b/accessible/src/atk/nsMaiInterfaceComponent.cpp
---- a/accessible/src/atk/nsMaiInterfaceComponent.cpp
-+++ b/accessible/src/atk/nsMaiInterfaceComponent.cpp
-@@ -74,15 +74,15 @@ refAccessibleAtPointCB(AtkComponent *aCo
+diff -r 332906b0e686 accessible/src/atk/nsMaiInterfaceComponent.cpp
+--- a/accessible/src/atk/nsMaiInterfaceComponent.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/atk/nsMaiInterfaceComponent.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -74,15 +74,15 @@
  
      // nsIAccessible getChildAtPoint (x,y) is in screen pixels.
      if (aCoordType == ATK_XY_WINDOW) {
 -        nsCOMPtr<nsIDOMNode> domNode;
 -        accWrap->GetDOMNode(getter_AddRefs(domNode));
 +        nsIDOMNode* domNode = nsnull;
 +        accWrap->GetDOMNode(&domNode);
          nsIntPoint winCoords = nsAccUtils::GetScreenCoordsForWindow(domNode);
@@ -475,188 +475,188 @@ diff --git a/accessible/src/atk/nsMaiInt
  
 -    nsCOMPtr<nsIAccessible> pointAcc;
 -    accWrap->GetChildAtPoint(aAccX, aAccY, getter_AddRefs(pointAcc));
 +    nsIAccessible* pointAcc = nsnull;
 +    accWrap->GetChildAtPoint(aAccX, aAccY, &pointAcc);
      if (!pointAcc) {
          return nsnull;
      }
-@@ -115,8 +115,8 @@ getExtentsCB(AtkComponent *aComponent,
+@@ -115,8 +115,8 @@
      if (NS_FAILED(rv))
          return;
      if (aCoordType == ATK_XY_WINDOW) {
 -        nsCOMPtr<nsIDOMNode> domNode;
 -        accWrap->GetDOMNode(getter_AddRefs(domNode));
 +        nsIDOMNode* domNode = nsnull;
 +        accWrap->GetDOMNode(&domNode);
          nsIntPoint winCoords = nsAccUtils::GetScreenCoordsForWindow(domNode);
          nsAccX -= winCoords.x;
          nsAccY -= winCoords.y;
-diff --git a/accessible/src/atk/nsMaiInterfaceDocument.cpp b/accessible/src/atk/nsMaiInterfaceDocument.cpp
---- a/accessible/src/atk/nsMaiInterfaceDocument.cpp
-+++ b/accessible/src/atk/nsMaiInterfaceDocument.cpp
-@@ -70,9 +70,9 @@ getDocumentLocaleCB(AtkDocument *aDocume
+diff -r 332906b0e686 accessible/src/atk/nsMaiInterfaceDocument.cpp
+--- a/accessible/src/atk/nsMaiInterfaceDocument.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/atk/nsMaiInterfaceDocument.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -70,9 +70,9 @@
      if (!accWrap)
          return nsnull;
  
 -    nsCOMPtr<nsIAccessNode> docAccessNode;
 +    nsIAccessNode* docAccessNode = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessNode),
 -                            getter_AddRefs(docAccessNode));
 +                            (void**)&docAccessNode);
      NS_ENSURE_TRUE(docAccessNode, nsnull);
  
      nsAutoString locale;
-@@ -90,9 +90,9 @@ getDocumentTypeCB(AtkDocument *aDocument
+@@ -90,9 +90,9 @@
      if (!accWrap)
          return nsnull;
  
 -    nsCOMPtr<nsIAccessibleDocument> accDocument;
 +    nsIAccessibleDocument* accDocument = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleDocument),
 -                            getter_AddRefs(accDocument));
 +                            (void**)&accDocument);
      NS_ENSURE_TRUE(accDocument, nsnull);
  
      nsAutoString mimeType;
-@@ -118,9 +118,9 @@ getDocumentAttributesCB(AtkDocument *aDo
+@@ -118,9 +118,9 @@
      if (!accWrap)
          return nsnull;
  
 -    nsCOMPtr<nsIAccessibleDocument> accDocument;
 +    nsIAccessibleDocument* accDocument = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleDocument),
 -                            getter_AddRefs(accDocument));
 +                            (void**)&accDocument);
      NS_ENSURE_TRUE(accDocument, nsnull);
  
      // according to atkobject.h, AtkAttributeSet is a GSList
-@@ -153,9 +153,9 @@ getDocumentAttributeValueCB(AtkDocument 
+@@ -153,9 +153,9 @@
      if (!accWrap)
          return nsnull;
  
 -    nsCOMPtr<nsIAccessibleDocument> accDocument;
 +    nsIAccessibleDocument* accDocument = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleDocument),
 -                            getter_AddRefs(accDocument));
 +                            (void**)&accDocument);
      NS_ENSURE_TRUE(accDocument, nsnull);
  
      nsresult rv;
-diff --git a/accessible/src/atk/nsMaiInterfaceEditableText.cpp b/accessible/src/atk/nsMaiInterfaceEditableText.cpp
---- a/accessible/src/atk/nsMaiInterfaceEditableText.cpp
-+++ b/accessible/src/atk/nsMaiInterfaceEditableText.cpp
-@@ -68,12 +68,12 @@ setRunAttributesCB(AtkEditableText *aTex
+diff -r 332906b0e686 accessible/src/atk/nsMaiInterfaceEditableText.cpp
+--- a/accessible/src/atk/nsMaiInterfaceEditableText.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/atk/nsMaiInterfaceEditableText.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -68,12 +68,12 @@
      if (!accWrap)
          return FALSE;
  
 -    nsCOMPtr<nsIAccessibleEditableText> accText;
 +    nsIAccessibleEditableText* accText = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleEditableText),
 -                            getter_AddRefs(accText));
 +                            (void**)&accText);
      NS_ENSURE_TRUE(accText, FALSE);
  
 -    nsCOMPtr<nsISupports> attrSet;
 +    nsISupports* attrSet = nsnull;
      /* how to insert attributes into nsISupports ??? */
  
      nsresult rv = accText->SetAttributes(aStartOffset, aEndOffset,
-@@ -88,9 +88,9 @@ setTextContentsCB(AtkEditableText *aText
+@@ -88,9 +88,9 @@
      if (!accWrap)
          return;
  
 -    nsCOMPtr<nsIAccessibleEditableText> accText;
 +    nsIAccessibleEditableText* accText = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleEditableText),
 -                            getter_AddRefs(accText));
 +                            (void**)&accText);
      if (!accText)
          return;
  
-@@ -108,9 +108,9 @@ insertTextCB(AtkEditableText *aText,
+@@ -108,9 +108,9 @@
      if (!accWrap)
          return;
  
 -    nsCOMPtr<nsIAccessibleEditableText> accText;
 +    nsIAccessibleEditableText* accText = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleEditableText),
 -                            getter_AddRefs(accText));
 +                            (void**)&accText);
      if (!accText)
          return;
  
-@@ -135,9 +135,9 @@ copyTextCB(AtkEditableText *aText, gint 
+@@ -135,9 +135,9 @@
      if (!accWrap)
          return;
  
 -    nsCOMPtr<nsIAccessibleEditableText> accText;
 +    nsIAccessibleEditableText* accText = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleEditableText),
 -                            getter_AddRefs(accText));
 +                            (void**)&accText);
      if (!accText)
          return;
  
-@@ -153,9 +153,9 @@ cutTextCB(AtkEditableText *aText, gint a
+@@ -153,9 +153,9 @@
      if (!accWrap)
          return;
  
 -    nsCOMPtr<nsIAccessibleEditableText> accText;
 +    nsIAccessibleEditableText* accText = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleEditableText),
 -                            getter_AddRefs(accText));
 +                            (void**)&accText);
      if (!accText)
          return;
      MAI_LOG_DEBUG(("EditableText: cutTextCB, aStartPos=%d, aEndPos=%d",
-@@ -170,9 +170,9 @@ deleteTextCB(AtkEditableText *aText, gin
+@@ -170,9 +170,9 @@
      if (!accWrap)
          return;
  
 -    nsCOMPtr<nsIAccessibleEditableText> accText;
 +    nsIAccessibleEditableText* accText = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleEditableText),
 -                            getter_AddRefs(accText));
 +                            (void**)&accText);
      if (!accText)
          return;
  
-@@ -188,9 +188,9 @@ pasteTextCB(AtkEditableText *aText, gint
+@@ -188,9 +188,9 @@
      if (!accWrap)
          return;
  
 -    nsCOMPtr<nsIAccessibleEditableText> accText;
 +    nsIAccessibleEditableText* accText = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleEditableText),
 -                            getter_AddRefs(accText));
 +                            (void**)&accText);
      if (!accText)
          return;
  
-diff --git a/accessible/src/atk/nsMaiInterfaceHyperlinkImpl.cpp b/accessible/src/atk/nsMaiInterfaceHyperlinkImpl.cpp
---- a/accessible/src/atk/nsMaiInterfaceHyperlinkImpl.cpp
-+++ b/accessible/src/atk/nsMaiInterfaceHyperlinkImpl.cpp
-@@ -56,9 +56,9 @@ getHyperlinkCB(AtkHyperlinkImpl *aImpl)
+diff -r 332906b0e686 accessible/src/atk/nsMaiInterfaceHyperlinkImpl.cpp
+--- a/accessible/src/atk/nsMaiInterfaceHyperlinkImpl.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/atk/nsMaiInterfaceHyperlinkImpl.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -56,9 +56,9 @@
      if (!accWrap)
          return nsnull;
  
 -    nsCOMPtr<nsIAccessibleHyperLink> accHyperlink;
 +    nsIAccessibleHyperLink* accHyperlink = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleHyperLink),
 -                            getter_AddRefs(accHyperlink));
 +                            (void**)&accHyperlink);
      NS_ENSURE_TRUE(accHyperlink, nsnull);
      
      MaiHyperlink *maiHyperlink = accWrap->GetMaiHyperlink();
-diff --git a/accessible/src/atk/nsMaiInterfaceHypertext.cpp b/accessible/src/atk/nsMaiInterfaceHypertext.cpp
---- a/accessible/src/atk/nsMaiInterfaceHypertext.cpp
-+++ b/accessible/src/atk/nsMaiInterfaceHypertext.cpp
-@@ -59,17 +59,17 @@ getLinkCB(AtkHypertext *aText, gint aLin
+diff -r 332906b0e686 accessible/src/atk/nsMaiInterfaceHypertext.cpp
+--- a/accessible/src/atk/nsMaiInterfaceHypertext.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/atk/nsMaiInterfaceHypertext.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -59,17 +59,17 @@
      if (!accWrap)
          return nsnull;
  
 -    nsCOMPtr<nsIAccessibleHyperText> hyperText;
 +    nsIAccessibleHyperText* hyperText = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleHyperText),
 -                            getter_AddRefs(hyperText));
 +                            (void**)&hyperText);
@@ -669,95 +669,95 @@ diff --git a/accessible/src/atk/nsMaiInt
      if (NS_FAILED(rv) || !hyperLink)
          return nsnull;
  
 -    nsCOMPtr<nsIAccessible> hyperLinkAcc(do_QueryInterface(hyperLink));
 +    nsIAccessible* hyperLinkAcc(do_QueryInterface(hyperLink));
      AtkObject *hyperLinkAtkObj = nsAccessibleWrap::GetAtkObject(hyperLinkAcc);
      nsAccessibleWrap *accChild = GetAccessibleWrap(hyperLinkAtkObj);
      NS_ENSURE_TRUE(accChild, nsnull);
-@@ -86,9 +86,9 @@ getLinkCountCB(AtkHypertext *aText)
+@@ -86,9 +86,9 @@
      if (!accWrap)
          return -1;
  
 -    nsCOMPtr<nsIAccessibleHyperText> hyperText;
 +    nsIAccessibleHyperText* hyperText = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleHyperText),
 -                            getter_AddRefs(hyperText));
 +                            (void**)&hyperText);
      NS_ENSURE_TRUE(hyperText, -1);
  
      PRInt32 count = -1;
-@@ -105,9 +105,9 @@ getLinkIndexCB(AtkHypertext *aText, gint
+@@ -105,9 +105,9 @@
      if (!accWrap)
          return -1;
  
 -    nsCOMPtr<nsIAccessibleHyperText> hyperText;
 +    nsIAccessibleHyperText* hyperText = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleHyperText),
 -                            getter_AddRefs(hyperText));
 +                            (void**)&hyperText);
      NS_ENSURE_TRUE(hyperText, -1);
  
      PRInt32 index = -1;
-diff --git a/accessible/src/atk/nsMaiInterfaceImage.cpp b/accessible/src/atk/nsMaiInterfaceImage.cpp
---- a/accessible/src/atk/nsMaiInterfaceImage.cpp
-+++ b/accessible/src/atk/nsMaiInterfaceImage.cpp
-@@ -62,9 +62,9 @@ getImagePositionCB(AtkImage *aImage, gin
+diff -r 332906b0e686 accessible/src/atk/nsMaiInterfaceImage.cpp
+--- a/accessible/src/atk/nsMaiInterfaceImage.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/atk/nsMaiInterfaceImage.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -62,9 +62,9 @@
      if (!accWrap) 
        return;
  
 -    nsCOMPtr<nsIAccessibleImage> image;
 +    nsIAccessibleImage* image = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleImage),
 -                            getter_AddRefs(image));
 +                            (void**)&image);
      if (!image)
        return;
  
-@@ -89,9 +89,9 @@ getImageSizeCB(AtkImage *aImage, gint *a
+@@ -89,9 +89,9 @@
      if (!accWrap) 
        return;
  
 -    nsCOMPtr<nsIAccessibleImage> image;
 +    nsIAccessibleImage* image = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleImage),
 -                            getter_AddRefs(image));
 +                            (void**)&image);
      if (!image)
        return;
  
-diff --git a/accessible/src/atk/nsMaiInterfaceSelection.cpp b/accessible/src/atk/nsMaiInterfaceSelection.cpp
---- a/accessible/src/atk/nsMaiInterfaceSelection.cpp
-+++ b/accessible/src/atk/nsMaiInterfaceSelection.cpp
-@@ -63,9 +63,9 @@ addSelectionCB(AtkSelection *aSelection,
+diff -r 332906b0e686 accessible/src/atk/nsMaiInterfaceSelection.cpp
+--- a/accessible/src/atk/nsMaiInterfaceSelection.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/atk/nsMaiInterfaceSelection.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -63,9 +63,9 @@
      if (!accWrap)
          return FALSE;
  
 -    nsCOMPtr<nsIAccessibleSelectable> accSelection;
 +    nsIAccessibleSelectable* accSelection = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleSelectable),
 -                            getter_AddRefs(accSelection));
 +                            (void**)&accSelection);
      NS_ENSURE_TRUE(accSelection, FALSE);
  
      return NS_SUCCEEDED(accSelection->AddChildToSelection(i));
-@@ -78,9 +78,9 @@ clearSelectionCB(AtkSelection *aSelectio
+@@ -78,9 +78,9 @@
      if (!accWrap)
          return FALSE;
  
 -    nsCOMPtr<nsIAccessibleSelectable> accSelection;
 +    nsIAccessibleSelectable* accSelection = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleSelectable),
 -                            getter_AddRefs(accSelection));
 +                            (void**)&accSelection);
      NS_ENSURE_TRUE(accSelection, FALSE);
  
      return NS_SUCCEEDED(accSelection->ClearSelection());
-@@ -93,13 +93,13 @@ refSelectionCB(AtkSelection *aSelection,
+@@ -93,13 +93,13 @@
      if (!accWrap)
          return nsnull;
  
 -    nsCOMPtr<nsIAccessibleSelectable> accSelection;
 +    nsIAccessibleSelectable* accSelection = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleSelectable),
 -                            getter_AddRefs(accSelection));
 +                            (void**)&accSelection);
@@ -765,68 +765,68 @@ diff --git a/accessible/src/atk/nsMaiInt
  
 -    nsCOMPtr<nsIAccessible> accSelect;
 -    accSelection->RefSelection(i, getter_AddRefs(accSelect));
 +    nsIAccessible* accSelect = nsnull;
 +    accSelection->RefSelection(i, &accSelect);
      if (!accSelect) {
          return nsnull;
      }
-@@ -118,9 +118,9 @@ getSelectionCountCB(AtkSelection *aSelec
+@@ -118,9 +118,9 @@
      if (!accWrap)
          return -1;
  
 -    nsCOMPtr<nsIAccessibleSelectable> accSelection;
 +    nsIAccessibleSelectable* accSelection = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleSelectable),
 -                            getter_AddRefs(accSelection));
 +                            (void**)&accSelection);
      NS_ENSURE_TRUE(accSelection, -1);
  
      PRInt32 num = 0;
-@@ -135,9 +135,9 @@ isChildSelectedCB(AtkSelection *aSelecti
+@@ -135,9 +135,9 @@
      if (!accWrap)
          return FALSE;
  
 -    nsCOMPtr<nsIAccessibleSelectable> accSelection;
 +    nsIAccessibleSelectable* accSelection = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleSelectable),
 -                            getter_AddRefs(accSelection));
 +                            (void**)&accSelection);
      NS_ENSURE_TRUE(accSelection, FALSE);
  
      PRBool result = FALSE;
-@@ -152,9 +152,9 @@ removeSelectionCB(AtkSelection *aSelecti
+@@ -152,9 +152,9 @@
      if (!accWrap)
          return FALSE;
  
 -    nsCOMPtr<nsIAccessibleSelectable> accSelection;
 +    nsIAccessibleSelectable* accSelection = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleSelectable),
 -                            getter_AddRefs(accSelection));
 +                            (void**)&accSelection);
      NS_ENSURE_TRUE(accSelection, FALSE);
  
      nsresult rv = accSelection->RemoveChildFromSelection(i);
-@@ -168,9 +168,9 @@ selectAllSelectionCB(AtkSelection *aSele
+@@ -168,9 +168,9 @@
      if (!accWrap)
          return FALSE;
  
 -    nsCOMPtr<nsIAccessibleSelectable> accSelection;
 +    nsIAccessibleSelectable* accSelection = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleSelectable),
 -                            getter_AddRefs(accSelection));
 +                            (void**)&accSelection);
      NS_ENSURE_TRUE(accSelection, FALSE);
  
      PRBool result = FALSE;
-diff --git a/accessible/src/atk/nsMaiInterfaceTable.cpp b/accessible/src/atk/nsMaiInterfaceTable.cpp
---- a/accessible/src/atk/nsMaiInterfaceTable.cpp
-+++ b/accessible/src/atk/nsMaiInterfaceTable.cpp
-@@ -75,13 +75,13 @@ refAtCB(AtkTable *aTable, gint aRow, gin
+diff -r 332906b0e686 accessible/src/atk/nsMaiInterfaceTable.cpp
+--- a/accessible/src/atk/nsMaiInterfaceTable.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/atk/nsMaiInterfaceTable.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -75,13 +75,13 @@
      if (!accWrap)
          return nsnull;
  
 -    nsCOMPtr<nsIAccessibleTable> accTable;
 +    nsIAccessibleTable* accTable = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
 -                            getter_AddRefs(accTable));
 +                            (void**)&accTable);
@@ -834,101 +834,101 @@ diff --git a/accessible/src/atk/nsMaiInt
  
 -    nsCOMPtr<nsIAccessible> cell;
 -    nsresult rv = accTable->CellRefAt(aRow, aColumn,getter_AddRefs(cell));
 +    nsIAccessible* cell = nsnull;
 +    nsresult rv = accTable->CellRefAt(aRow, aColumn,&cell);
      if (NS_FAILED(rv) || !cell)
          return nsnull;
  
-@@ -99,9 +99,9 @@ getIndexAtCB(AtkTable *aTable, gint aRow
+@@ -99,9 +99,9 @@
      if (!accWrap)
          return -1;
  
 -    nsCOMPtr<nsIAccessibleTable> accTable;
 +    nsIAccessibleTable* accTable = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
 -                            getter_AddRefs(accTable));
 +                            (void**)&accTable);
      NS_ENSURE_TRUE(accTable, -1);
  
      PRInt32 index;
-@@ -118,9 +118,9 @@ getColumnAtIndexCB(AtkTable *aTable, gin
+@@ -118,9 +118,9 @@
      if (!accWrap)
          return -1;
  
 -    nsCOMPtr<nsIAccessibleTable> accTable;
 +    nsIAccessibleTable* accTable = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
 -                            getter_AddRefs(accTable));
 +                            (void**)&accTable);
      NS_ENSURE_TRUE(accTable, -1);
  
      PRInt32 col;
-@@ -137,9 +137,9 @@ getRowAtIndexCB(AtkTable *aTable, gint a
+@@ -137,9 +137,9 @@
      if (!accWrap)
          return -1;
  
 -    nsCOMPtr<nsIAccessibleTable> accTable;
 +    nsIAccessibleTable* accTable = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
 -                            getter_AddRefs(accTable));
 +                            (void**)&accTable);
      NS_ENSURE_TRUE(accTable, -1);
  
      PRInt32 row;
-@@ -156,9 +156,9 @@ getColumnCountCB(AtkTable *aTable)
+@@ -156,9 +156,9 @@
      if (!accWrap)
          return -1;
  
 -    nsCOMPtr<nsIAccessibleTable> accTable;
 +    nsIAccessibleTable* accTable = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
 -                            getter_AddRefs(accTable));
 +                            (void**)&accTable);
      NS_ENSURE_TRUE(accTable, -1);
  
      PRInt32 count;
-@@ -175,9 +175,9 @@ getRowCountCB(AtkTable *aTable)
+@@ -175,9 +175,9 @@
      if (!accWrap)
          return -1;
  
 -    nsCOMPtr<nsIAccessibleTable> accTable;
 +    nsIAccessibleTable* accTable = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
 -                            getter_AddRefs(accTable));
 +                            (void**)&accTable);
      NS_ENSURE_TRUE(accTable, -1);
  
      PRInt32 count;
-@@ -195,9 +195,9 @@ getColumnExtentAtCB(AtkTable *aTable,
+@@ -195,9 +195,9 @@
      if (!accWrap)
          return -1;
  
 -    nsCOMPtr<nsIAccessibleTable> accTable;
 +    nsIAccessibleTable* accTable = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
 -                            getter_AddRefs(accTable));
 +                            (void**)&accTable);
      NS_ENSURE_TRUE(accTable, -1);
  
      PRInt32 extent;
-@@ -215,9 +215,9 @@ getRowExtentAtCB(AtkTable *aTable,
+@@ -215,9 +215,9 @@
      if (!accWrap)
          return -1;
  
 -    nsCOMPtr<nsIAccessibleTable> accTable;
 +    nsIAccessibleTable* accTable = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
 -                            getter_AddRefs(accTable));
 +                            (void**)&accTable);
      NS_ENSURE_TRUE(accTable, -1);
  
      PRInt32 extent;
-@@ -234,13 +234,13 @@ getCaptionCB(AtkTable *aTable)
+@@ -234,13 +234,13 @@
      if (!accWrap)
          return nsnull;
  
 -    nsCOMPtr<nsIAccessibleTable> accTable;
 +    nsIAccessibleTable* accTable = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
 -                            getter_AddRefs(accTable));
 +                            (void**)&accTable);
@@ -936,29 +936,29 @@ diff --git a/accessible/src/atk/nsMaiInt
  
 -    nsCOMPtr<nsIAccessible> caption;
 -    nsresult rv = accTable->GetCaption(getter_AddRefs(caption));
 +    nsIAccessible* caption = nsnull;
 +    nsresult rv = accTable->GetCaption(&caption);
      if (NS_FAILED(rv) || !caption)
          return nsnull;
  
-@@ -254,9 +254,9 @@ getColumnDescriptionCB(AtkTable *aTable,
+@@ -254,9 +254,9 @@
      if (!accWrap)
          return nsnull;
  
 -    nsCOMPtr<nsIAccessibleTable> accTable;
 +    nsIAccessibleTable* accTable = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
 -                            getter_AddRefs(accTable));
 +                            (void**)&accTable);
      NS_ENSURE_TRUE(accTable, nsnull);
  
      nsAutoString autoStr;
-@@ -273,13 +273,13 @@ getColumnHeaderCB(AtkTable *aTable, gint
+@@ -273,13 +273,13 @@
      if (!accWrap)
          return nsnull;
  
 -    nsCOMPtr<nsIAccessibleTable> accTable;
 +    nsIAccessibleTable* accTable = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
 -                            getter_AddRefs(accTable));
 +                            (void**)&accTable);
@@ -966,40 +966,40 @@ diff --git a/accessible/src/atk/nsMaiInt
  
 -    nsCOMPtr<nsIAccessibleTable> header;
 -    nsresult rv = accTable->GetColumnHeader(getter_AddRefs(header));
 +    nsIAccessibleTable* header = nsnull;
 +    nsresult rv = accTable->GetColumnHeader(&header);
      NS_ENSURE_SUCCESS(rv, nsnull);
      NS_ENSURE_TRUE(header, nsnull);
  
-@@ -292,8 +292,8 @@ getColumnHeaderCB(AtkTable *aTable, gint
+@@ -292,8 +292,8 @@
      // 2. "GetColumnHeader" defined in nsIAccessibleTable returns
      // nsXULTreeColumnsAccessibleWrap, which exports nsIAccessibleTable and is
      // "ROLE_LIST".
 -    nsCOMPtr<nsIAccessible> accHeader;
 -    header->CellRefAt(0, aColumn, getter_AddRefs(accHeader));
 +    nsIAccessible* accHeader = nsnull;
 +    header->CellRefAt(0, aColumn, &accHeader);
      NS_ENSURE_TRUE(accHeader, nsnull);
  
      return nsAccessibleWrap::GetAtkObject(accHeader);
-@@ -306,9 +306,9 @@ getRowDescriptionCB(AtkTable *aTable, gi
+@@ -306,9 +306,9 @@
      if (!accWrap)
          return nsnull;
  
 -    nsCOMPtr<nsIAccessibleTable> accTable;
 +    nsIAccessibleTable* accTable = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
 -                            getter_AddRefs(accTable));
 +                            (void**)&accTable);
      NS_ENSURE_TRUE(accTable, nsnull);
  
      nsAutoString autoStr;
-@@ -325,16 +325,16 @@ getRowHeaderCB(AtkTable *aTable, gint aR
+@@ -325,16 +325,16 @@
      if (!accWrap)
          return nsnull;
  
 -    nsCOMPtr<nsIAccessibleTable> accTable;
 +    nsIAccessibleTable* accTable = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
 -                            getter_AddRefs(accTable));
 +                            (void**)&accTable);
@@ -1011,152 +1011,152 @@ diff --git a/accessible/src/atk/nsMaiInt
 +    nsresult rv = accTable->GetRowHeader(&header);
      NS_ENSURE_SUCCESS(rv, nsnull);
  
 -    nsCOMPtr<nsIAccessible> accHeader(do_QueryInterface(header));
 +    nsIAccessible* accHeader(do_QueryInterface(header));
      NS_ENSURE_TRUE(accHeader, nsnull);
  
      return nsAccessibleWrap::GetAtkObject(accHeader);
-@@ -357,9 +357,9 @@ getSelectedColumnsCB(AtkTable *aTable, g
+@@ -357,9 +357,9 @@
      if (!accWrap)
          return 0;
  
 -    nsCOMPtr<nsIAccessibleTable> accTable;
 +    nsIAccessibleTable* accTable = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
 -                            getter_AddRefs(accTable));
 +                            (void**)&accTable);
      NS_ENSURE_TRUE(accTable, 0);
  
      PRUint32 size = 0;
-@@ -392,9 +392,9 @@ getSelectedRowsCB(AtkTable *aTable, gint
+@@ -392,9 +392,9 @@
      if (!accWrap)
          return 0;
  
 -    nsCOMPtr<nsIAccessibleTable> accTable;
 +    nsIAccessibleTable* accTable = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
 -                            getter_AddRefs(accTable));
 +                            (void**)&accTable);
      NS_ENSURE_TRUE(accTable, 0);
  
      PRUint32 size = 0;
-@@ -427,9 +427,9 @@ isColumnSelectedCB(AtkTable *aTable, gin
+@@ -427,9 +427,9 @@
      if (!accWrap)
          return FALSE;
  
 -    nsCOMPtr<nsIAccessibleTable> accTable;
 +    nsIAccessibleTable* accTable = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
 -                            getter_AddRefs(accTable));
 +                            (void**)&accTable);
      NS_ENSURE_TRUE(accTable, FALSE);
  
      PRBool outValue;
-@@ -444,9 +444,9 @@ isRowSelectedCB(AtkTable *aTable, gint a
+@@ -444,9 +444,9 @@
      if (!accWrap)
          return FALSE;
  
 -    nsCOMPtr<nsIAccessibleTable> accTable;
 +    nsIAccessibleTable* accTable = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
 -                            getter_AddRefs(accTable));
 +                            (void**)&accTable);
      NS_ENSURE_TRUE(accTable, FALSE);
  
      PRBool outValue;
-@@ -461,9 +461,9 @@ isCellSelectedCB(AtkTable *aTable, gint 
+@@ -461,9 +461,9 @@
      if (!accWrap)
          return FALSE;
  
 -    nsCOMPtr<nsIAccessibleTable> accTable;
 +    nsIAccessibleTable* accTable = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleTable),
 -                            getter_AddRefs(accTable));
 +                            (void**)&accTable);
      NS_ENSURE_TRUE(accTable, FALSE);
  
      PRBool outValue;
-diff --git a/accessible/src/atk/nsMaiInterfaceText.cpp b/accessible/src/atk/nsMaiInterfaceText.cpp
---- a/accessible/src/atk/nsMaiInterfaceText.cpp
-+++ b/accessible/src/atk/nsMaiInterfaceText.cpp
-@@ -92,9 +92,9 @@ getTextCB(AtkText *aText, gint aStartOff
+diff -r 332906b0e686 accessible/src/atk/nsMaiInterfaceText.cpp
+--- a/accessible/src/atk/nsMaiInterfaceText.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/atk/nsMaiInterfaceText.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -92,9 +92,9 @@
      if (!accWrap)
          return nsnull;
  
 -    nsCOMPtr<nsIAccessibleText> accText;
 +    nsIAccessibleText* accText = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
 -                            getter_AddRefs(accText));
 +                            (void**)&accText);
      NS_ENSURE_TRUE(accText, nsnull);
  
      nsAutoString autoStr;
-@@ -117,9 +117,9 @@ getTextAfterOffsetCB(AtkText *aText, gin
+@@ -117,9 +117,9 @@
      if (!accWrap)
          return nsnull;
  
 -    nsCOMPtr<nsIAccessibleText> accText;
 +    nsIAccessibleText* accText = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
 -                            getter_AddRefs(accText));
 +                            (void**)&accText);
      NS_ENSURE_TRUE(accText, nsnull);
  
      nsAutoString autoStr;
-@@ -146,9 +146,9 @@ getTextAtOffsetCB(AtkText *aText, gint a
+@@ -146,9 +146,9 @@
      if (!accWrap)
          return nsnull;
  
 -    nsCOMPtr<nsIAccessibleText> accText;
 +    nsIAccessibleText* accText = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
 -                            getter_AddRefs(accText));
 +                            (void**)&accText);
      NS_ENSURE_TRUE(accText, nsnull);
  
      nsAutoString autoStr;
-@@ -173,9 +173,9 @@ getCharacterAtOffsetCB(AtkText *aText, g
+@@ -173,9 +173,9 @@
      if (!accWrap)
          return 0;
  
 -    nsCOMPtr<nsIAccessibleText> accText;
 +    nsIAccessibleText* accText = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
 -                            getter_AddRefs(accText));
 +                            (void**)&accText);
      NS_ENSURE_TRUE(accText, 0);
  
      /* PRUnichar is unsigned short in Mozilla */
-@@ -203,9 +203,9 @@ getTextBeforeOffsetCB(AtkText *aText, gi
+@@ -203,9 +203,9 @@
      if (!accWrap)
          return nsnull;
  
 -    nsCOMPtr<nsIAccessibleText> accText;
 +    nsIAccessibleText* accText = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
 -                            getter_AddRefs(accText));
 +                            (void**)&accText);
      NS_ENSURE_TRUE(accText, nsnull);
  
      nsAutoString autoStr;
-@@ -230,9 +230,9 @@ getCaretOffsetCB(AtkText *aText)
+@@ -230,9 +230,9 @@
      if (!accWrap)
          return 0;
  
 -    nsCOMPtr<nsIAccessibleText> accText;
 +    nsIAccessibleText* accText = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
 -                            getter_AddRefs(accText));
 +                            (void**)&accText);
      NS_ENSURE_TRUE(accText, 0);
  
      PRInt32 offset;
-@@ -249,16 +249,16 @@ getRunAttributesCB(AtkText *aText, gint 
+@@ -249,16 +249,16 @@
      if (!accWrap)
          return nsnull;
  
 -    nsCOMPtr<nsIAccessibleText> accText;
 +    nsIAccessibleText* accText = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
 -                            getter_AddRefs(accText));
 +                            (void**)&accText);
@@ -1167,313 +1167,313 @@ diff --git a/accessible/src/atk/nsMaiInt
      PRInt32 startOffset = 0, endOffset = 0;
      nsresult rv =
          accText->GetAttributeRange(aOffset, &startOffset, &endOffset,
 -                                   getter_AddRefs(accessibleWithAttrs));
 +                                   &accessibleWithAttrs);
      *aStartOffset = startOffset;
      *aEndOffset = endOffset;
      if (NS_FAILED(rv))
-@@ -284,9 +284,9 @@ getCharacterExtentsCB(AtkText *aText, gi
+@@ -284,9 +284,9 @@
      if(!accWrap || !aX || !aY || !aWidth || !aHeight)
          return;
  
 -    nsCOMPtr<nsIAccessibleText> accText;
 +    nsIAccessibleText* accText = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
 -                            getter_AddRefs(accText));
 +                            (void**)&accText);
      if (!accText)
          return;
  
-@@ -318,9 +318,9 @@ getRangeExtentsCB(AtkText *aText, gint a
+@@ -318,9 +318,9 @@
      if(!accWrap || !aRect)
          return;
  
 -    nsCOMPtr<nsIAccessibleText> accText;
 +    nsIAccessibleText* accText = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
 -                            getter_AddRefs(accText));
 +                            (void**)&accText);
      if (!accText)
          return;
  
-@@ -352,9 +352,9 @@ getCharacterCountCB(AtkText *aText)
+@@ -352,9 +352,9 @@
      if (!accWrap)
          return 0;
  
 -    nsCOMPtr<nsIAccessibleText> accText;
 +    nsIAccessibleText* accText = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
 -                            getter_AddRefs(accText));
 +                            (void**)&accText);
      NS_ENSURE_TRUE(accText, 0);
  
      PRInt32 count = 0;
-@@ -371,9 +371,9 @@ getOffsetAtPointCB(AtkText *aText,
+@@ -371,9 +371,9 @@
      if (!accWrap)
          return -1;
  
 -    nsCOMPtr<nsIAccessibleText> accText;
 +    nsIAccessibleText* accText = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
 -                            getter_AddRefs(accText));
 +                            (void**)&accText);
      NS_ENSURE_TRUE(accText, -1);
  
      PRInt32 offset = 0;
-@@ -394,9 +394,9 @@ getTextSelectionCountCB(AtkText *aText)
+@@ -394,9 +394,9 @@
      if (!accWrap)
          return nsnull;
  
 -    nsCOMPtr<nsIAccessibleText> accText;
 +    nsIAccessibleText* accText = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
 -                            getter_AddRefs(accText));
 +                            (void**)&accText);
      NS_ENSURE_TRUE(accText, nsnull);
  
      PRInt32 selectionCount;
-@@ -413,9 +413,9 @@ getTextSelectionCB(AtkText *aText, gint 
+@@ -413,9 +413,9 @@
      if (!accWrap)
          return nsnull;
  
 -    nsCOMPtr<nsIAccessibleText> accText;
 +    nsIAccessibleText* accText = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
 -                            getter_AddRefs(accText));
 +                            (void**)&accText);
      NS_ENSURE_TRUE(accText, nsnull);
  
      PRInt32 startOffset = 0, endOffset = 0;
-@@ -440,9 +440,9 @@ addTextSelectionCB(AtkText *aText,
+@@ -440,9 +440,9 @@
      if (!accWrap)
          return FALSE;
  
 -    nsCOMPtr<nsIAccessibleText> accText;
 +    nsIAccessibleText* accText = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
 -                            getter_AddRefs(accText));
 +                            (void**)&accText);
      NS_ENSURE_TRUE(accText, FALSE);
  
      nsresult rv = accText->AddSelection(aStartOffset, aEndOffset);
-@@ -458,9 +458,9 @@ removeTextSelectionCB(AtkText *aText,
+@@ -458,9 +458,9 @@
      if (!accWrap)
          return FALSE;
  
 -    nsCOMPtr<nsIAccessibleText> accText;
 +    nsIAccessibleText* accText = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
 -                            getter_AddRefs(accText));
 +                            (void**)&accText);
      NS_ENSURE_TRUE(accText, FALSE);
  
      nsresult rv = accText->RemoveSelection(aSelectionNum);
-@@ -476,9 +476,9 @@ setTextSelectionCB(AtkText *aText, gint 
+@@ -476,9 +476,9 @@
      if (!accWrap)
          return FALSE;
  
 -    nsCOMPtr<nsIAccessibleText> accText;
 +    nsIAccessibleText* accText = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
 -                            getter_AddRefs(accText));
 +                            (void**)&accText);
      NS_ENSURE_TRUE(accText, FALSE);
  
      nsresult rv = accText->SetSelectionBounds(aSelectionNum,
-@@ -493,9 +493,9 @@ setCaretOffsetCB(AtkText *aText, gint aO
+@@ -493,9 +493,9 @@
      if (!accWrap)
          return FALSE;
  
 -    nsCOMPtr<nsIAccessibleText> accText;
 +    nsIAccessibleText* accText = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleText),
 -                            getter_AddRefs(accText));
 +                            (void**)&accText);
      NS_ENSURE_TRUE(accText, FALSE);
  
      nsresult rv = accText->SetCaretOffset(aOffset);
-diff --git a/accessible/src/atk/nsMaiInterfaceValue.cpp b/accessible/src/atk/nsMaiInterfaceValue.cpp
---- a/accessible/src/atk/nsMaiInterfaceValue.cpp
-+++ b/accessible/src/atk/nsMaiInterfaceValue.cpp
-@@ -61,9 +61,9 @@ getCurrentValueCB(AtkValue *obj, GValue 
+diff -r 332906b0e686 accessible/src/atk/nsMaiInterfaceValue.cpp
+--- a/accessible/src/atk/nsMaiInterfaceValue.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/atk/nsMaiInterfaceValue.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -61,9 +61,9 @@
      if (!accWrap)
          return;
  
 -    nsCOMPtr<nsIAccessibleValue> accValue;
 +    nsIAccessibleValue* accValue = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleValue),
 -                            getter_AddRefs(accValue));
 +                            (void**)&accValue);
      if (!accValue)
          return;
  
-@@ -82,9 +82,9 @@ getMaximumValueCB(AtkValue *obj, GValue 
+@@ -82,9 +82,9 @@
      if (!accWrap)
          return;
  
 -    nsCOMPtr<nsIAccessibleValue> accValue;
 +    nsIAccessibleValue* accValue = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleValue),
 -                            getter_AddRefs(accValue));
 +                            (void**)&accValue);
      if (!accValue)
          return;
  
-@@ -103,9 +103,9 @@ getMinimumValueCB(AtkValue *obj, GValue 
+@@ -103,9 +103,9 @@
      if (!accWrap)
          return;
  
 -    nsCOMPtr<nsIAccessibleValue> accValue;
 +    nsIAccessibleValue* accValue = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleValue),
 -                            getter_AddRefs(accValue));
 +                            (void**)&accValue);
      if (!accValue)
          return;
  
-@@ -124,9 +124,9 @@ getMinimumIncrementCB(AtkValue *obj, GVa
+@@ -124,9 +124,9 @@
      if (!accWrap)
          return;
  
 -    nsCOMPtr<nsIAccessibleValue> accValue;
 +    nsIAccessibleValue* accValue = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleValue),
 -                            getter_AddRefs(accValue));
 +                            (void**)&accValue);
      if (!accValue)
          return;
  
-@@ -145,9 +145,9 @@ setCurrentValueCB(AtkValue *obj, const G
+@@ -145,9 +145,9 @@
      if (!accWrap)
          return FALSE;
  
 -    nsCOMPtr<nsIAccessibleValue> accValue;
 +    nsIAccessibleValue* accValue = nsnull;
      accWrap->QueryInterface(NS_GET_IID(nsIAccessibleValue),
 -                            getter_AddRefs(accValue));
 +                            (void**)&accValue);
      NS_ENSURE_TRUE(accValue, FALSE);
  
      double accDouble =g_value_get_double (value);
-diff --git a/accessible/src/atk/nsXULTreeAccessibleWrap.cpp b/accessible/src/atk/nsXULTreeAccessibleWrap.cpp
---- a/accessible/src/atk/nsXULTreeAccessibleWrap.cpp
-+++ b/accessible/src/atk/nsXULTreeAccessibleWrap.cpp
-@@ -92,7 +92,7 @@ NS_IMETHODIMP nsXULTreeAccessibleWrap::G
+diff -r 332906b0e686 accessible/src/atk/nsXULTreeAccessibleWrap.cpp
+--- a/accessible/src/atk/nsXULTreeAccessibleWrap.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/atk/nsXULTreeAccessibleWrap.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -92,7 +92,7 @@
    NS_ENSURE_ARG_POINTER(aColumnCount);
    *aColumnCount = 0;
  
 -  nsCOMPtr<nsITreeColumn> column;
 +  nsITreeColumn* column = nsnull;
    column = GetFirstVisibleColumn(mTree);
    if (!column)
      return NS_ERROR_FAILURE;
-@@ -108,11 +108,11 @@ NS_IMETHODIMP nsXULTreeAccessibleWrap::G
+@@ -108,11 +108,11 @@
  {
    nsresult rv = NS_OK;
  
 -  nsCOMPtr<nsIAccessible> acc;
 -  nsAccessible::GetFirstChild(getter_AddRefs(acc));
 +  nsIAccessible* acc = nsnull;
 +  nsAccessible::GetFirstChild(&acc);
    NS_ENSURE_TRUE(acc, NS_ERROR_FAILURE);
  
 -  nsCOMPtr<nsIAccessibleTable> accTable(do_QueryInterface(acc, &rv));
 +  nsIAccessibleTable* accTable(do_QueryInterface(acc, &rv));
    NS_ENSURE_SUCCESS(rv, rv);
  
    *aColumnHeader = accTable;
-@@ -211,12 +211,12 @@ NS_IMETHODIMP nsXULTreeAccessibleWrap::G
+@@ -211,12 +211,12 @@
    PRInt32 *outArray = (PRInt32 *)nsMemory::Alloc((*aNumRows) * sizeof(PRInt32));
    NS_ENSURE_TRUE(outArray, NS_ERROR_OUT_OF_MEMORY);
  
 -  nsCOMPtr<nsITreeView> view;
 -  rv = mTree->GetView(getter_AddRefs(view));
 +  nsITreeView* view = nsnull;
 +  rv = mTree->GetView(&view);
    NS_ENSURE_SUCCESS(rv, rv);
  
 -  nsCOMPtr<nsITreeSelection> selection;
 -  rv = view->GetSelection(getter_AddRefs(selection));
 +  nsITreeSelection* selection = nsnull;
 +  rv = view->GetSelection(&selection);
    NS_ENSURE_SUCCESS(rv, rv);
  
    PRInt32 rowCount;
-@@ -326,8 +326,8 @@ NS_IMETHODIMP nsXULTreeAccessibleWrap::G
+@@ -326,8 +326,8 @@
  
  NS_IMETHODIMP nsXULTreeAccessibleWrap::GetColumnDescription(PRInt32 aColumn, nsAString & _retval)
  {
 -  nsCOMPtr<nsIAccessibleTable> columnHeader;
 -  nsresult rv = GetColumnHeader(getter_AddRefs(columnHeader));
 +  nsIAccessibleTable* columnHeader = nsnull;
 +  nsresult rv = GetColumnHeader(&columnHeader);
    if (NS_SUCCEEDED(rv) && columnHeader) {
      return columnHeader->GetColumnDescription(aColumn, _retval);
    }
-@@ -366,12 +366,12 @@ NS_IMETHODIMP nsXULTreeAccessibleWrap::I
+@@ -366,12 +366,12 @@
  
    nsresult rv = NS_OK;
  
 -  nsCOMPtr<nsITreeView> view;
 -  rv = mTree->GetView(getter_AddRefs(view));
 +  nsITreeView* view = nsnull;
 +  rv = mTree->GetView(&view);
    NS_ENSURE_SUCCESS(rv, rv);
  
 -  nsCOMPtr<nsITreeSelection> selection;
 -  rv = view->GetSelection(getter_AddRefs(selection));
 +  nsITreeSelection* selection = nsnull;
 +  rv = view->GetSelection(&selection);
    NS_ENSURE_SUCCESS(rv, rv);
  
    return selection->IsSelected(aRow, _retval);
-@@ -413,8 +413,8 @@ NS_IMETHODIMP nsXULTreeAccessibleWrap::C
+@@ -413,8 +413,8 @@
    PRInt32 rowIndex;
    nsresult rv = GetRowAtIndex(aIndex, &rowIndex);
  
 -  nsCOMPtr<nsITreeSelection> selection;
 -  rv = mTreeView->GetSelection(getter_AddRefs(selection));
 +  nsITreeSelection* selection = nsnull;
 +  rv = mTreeView->GetSelection(&selection);
    NS_ASSERTION(selection, "Can't get selection from mTreeView");
  
    if (selection) {
-@@ -527,12 +527,12 @@ NS_IMETHODIMP nsXULTreeColumnsAccessible
+@@ -527,12 +527,12 @@
  
  NS_IMETHODIMP nsXULTreeColumnsAccessibleWrap::CellRefAt(PRInt32 aRow, PRInt32 aColumn, nsIAccessible **_retval)
  {
 -  nsCOMPtr<nsIAccessible> next, temp;
 -  GetFirstChild(getter_AddRefs(next));
 +  nsIAccessible* next = nsnull, *temp = nsnull;
 +  GetFirstChild(&next);
    NS_ENSURE_TRUE(next, NS_ERROR_FAILURE);
  
    for (PRInt32 col = 0; col < aColumn; col++) {
 -    next->GetNextSibling(getter_AddRefs(temp));
 +    next->GetNextSibling(&temp);
      NS_ENSURE_TRUE(temp, NS_ERROR_FAILURE);
  
      next = temp;
-@@ -586,8 +586,8 @@ NS_IMETHODIMP nsXULTreeColumnsAccessible
+@@ -586,8 +586,8 @@
  
  NS_IMETHODIMP nsXULTreeColumnsAccessibleWrap::GetColumnDescription(PRInt32 aColumn, nsAString & _retval)
  {
 -  nsCOMPtr<nsIAccessible> column;  
 -  nsresult rv = CellRefAt(0, aColumn, getter_AddRefs(column));
 +  nsIAccessible* column = nsnull;  
 +  nsresult rv = CellRefAt(0, aColumn, &column);
    if (NS_SUCCEEDED(rv) && column) {
      return column->GetName(_retval);
    }
-diff --git a/accessible/src/base/nsAccessNode.cpp b/accessible/src/base/nsAccessNode.cpp
---- a/accessible/src/base/nsAccessNode.cpp
-+++ b/accessible/src/base/nsAccessNode.cpp
-@@ -146,21 +146,21 @@ NS_IMETHODIMP nsAccessNode::Init()
+diff -r 332906b0e686 accessible/src/base/nsAccessNode.cpp
+--- a/accessible/src/base/nsAccessNode.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/base/nsAccessNode.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -146,21 +146,21 @@
  #ifdef DEBUG_A11Y
    NS_ASSERTION(!mIsInitialized, "Initialized twice!");
  #endif
 -  nsCOMPtr<nsIAccessibleDocument> docAccessible(GetDocAccessible());
 +  nsIAccessibleDocument* docAccessible(GetDocAccessible());
    if (!docAccessible) {
      // No doc accessible yet for this node's document. 
      // There was probably an accessible event fired before the 
@@ -1490,94 +1490,94 @@ diff --git a/accessible/src/base/nsAcces
 -          nsCOMPtr<nsIAccessible> accessible;
 +          nsIAccessible* accessible = nsnull;
            accService->GetAccessibleInShell(docNode, presShell,
 -                                           getter_AddRefs(accessible));
 +                                           &accessible);
            docAccessible = do_QueryInterface(accessible);
          }
        }
-@@ -173,7 +173,7 @@ NS_IMETHODIMP nsAccessNode::Init()
+@@ -173,7 +173,7 @@
  
    void* uniqueID;
    GetUniqueID(&uniqueID);
 -  nsCOMPtr<nsPIAccessibleDocument> privateDocAccessible =
 +  nsPIAccessibleDocument* privateDocAccessible =
      do_QueryInterface(docAccessible);
    NS_ASSERTION(privateDocAccessible, "No private docaccessible for docaccessible");
    privateDocAccessible->CacheAccessNode(uniqueID, this);
-@@ -181,12 +181,12 @@ NS_IMETHODIMP nsAccessNode::Init()
+@@ -181,12 +181,12 @@
    // Make sure an ancestor in real content is cached
    // so that nsDocAccessible::RefreshNodes() can find the anonymous subtree to release when
    // the root node goes away
 -  nsCOMPtr<nsIContent> content = do_QueryInterface(mDOMNode);
 +  nsIContent* content = do_QueryInterface(mDOMNode);
    if (content && (content->IsNativeAnonymous() ||
                    content->GetBindingParent())) {
      // Specific examples of where this is used: <input type="file"> and <xul:findbar>
 -    nsCOMPtr<nsIAccessible> parentAccessible;
 -    docAccessible->GetAccessibleInParentChain(mDOMNode, PR_TRUE, getter_AddRefs(parentAccessible));
 +    nsIAccessible* parentAccessible = nsnull;
 +    docAccessible->GetAccessibleInParentChain(mDOMNode, PR_TRUE, &parentAccessible);
      if (parentAccessible) {
        PRInt32 childCountUnused;
        parentAccessible->GetChildCount(&childCountUnused);
-@@ -218,13 +218,13 @@ NS_IMETHODIMP nsAccessNode::GetOwnerWind
+@@ -218,13 +218,13 @@
  NS_IMETHODIMP nsAccessNode::GetOwnerWindow(void **aWindow)
  {
    *aWindow = nsnull;
 -  nsCOMPtr<nsIAccessibleDocument> docAccessible(GetDocAccessible());
 +  nsIAccessibleDocument* docAccessible(GetDocAccessible());
    if (!docAccessible)
      return NS_ERROR_FAILURE; // This node or doc accessible is shut down
    return docAccessible->GetWindowHandle(aWindow);
  }
  
 -already_AddRefed<nsApplicationAccessibleWrap>
 +nsApplicationAccessibleWrap*
  nsAccessNode::GetApplicationAccessible()
  {
    if (!gIsAccessibilityActive) {
-@@ -259,7 +259,7 @@ void nsAccessNode::InitXPAccessibility()
+@@ -259,7 +259,7 @@
      return;
    }
  
 -  nsCOMPtr<nsIStringBundleService> stringBundleService =
 +  nsIStringBundleService* stringBundleService =
      do_GetService(NS_STRINGBUNDLE_CONTRACTID);
    if (stringBundleService) {
      // Static variables are released in ShutdownAllXPAccessibility();
-@@ -273,7 +273,7 @@ void nsAccessNode::InitXPAccessibility()
+@@ -273,7 +273,7 @@
  
    gGlobalDocAccessibleCache.Init(4);
  
 -  nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID));
 +  nsIPrefBranch* prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID));
    if (prefBranch) {
      prefBranch->GetBoolPref("accessibility.disablecache", &gIsCacheDisabled);
      prefBranch->GetBoolPref("browser.formfill.enable", &gIsFormFillEnabled);
-@@ -285,7 +285,7 @@ void nsAccessNode::InitXPAccessibility()
+@@ -285,7 +285,7 @@
  
  void nsAccessNode::NotifyA11yInitOrShutdown()
  {
 -  nsCOMPtr<nsIObserverService> obsService =
 +  nsIObserverService* obsService =
      do_GetService("@mozilla.org/observer-service;1");
    NS_ASSERTION(obsService, "No observer service to notify of a11y init/shutdown");
    if (obsService) {
-@@ -325,7 +325,7 @@ void nsAccessNode::ShutdownXPAccessibili
+@@ -325,7 +325,7 @@
    NotifyA11yInitOrShutdown();
  }
  
 -already_AddRefed<nsIPresShell> nsAccessNode::GetPresShell()
 +nsIPresShell* nsAccessNode::GetPresShell()
  {
    nsIPresShell *presShell = nsnull;
    if (mWeakShell)
-@@ -344,34 +344,34 @@ already_AddRefed<nsIPresShell> nsAccessN
+@@ -344,34 +344,34 @@
  
  nsPresContext* nsAccessNode::GetPresContext()
  {
 -  nsCOMPtr<nsIPresShell> presShell(GetPresShell());
 +  nsIPresShell* presShell(GetPresShell());
    if (!presShell) {
      return nsnull;
    }
@@ -1609,74 +1609,74 @@ diff --git a/accessible/src/base/nsAcces
      return nsnull;
    }
  
 -  nsCOMPtr<nsIAccessibleDocument> accDoc = GetDocAccessibleFor(root);
 +  nsIAccessibleDocument* accDoc = GetDocAccessibleFor(root);
    if (!accDoc) {
      return nsnull;
    }
-@@ -385,11 +385,11 @@ already_AddRefed<nsRootAccessible> nsAcc
+@@ -385,11 +385,11 @@
  
  nsIFrame* nsAccessNode::GetFrame()
  {
 -  nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mWeakShell));
 +  nsIPresShell* shell(do_QueryReferent(mWeakShell));
    if (!shell) 
      return nsnull;  
  
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
    return content ? shell->GetPrimaryFrameFor(content) : nsnull;
  }
  
-@@ -403,7 +403,7 @@ NS_IMETHODIMP
+@@ -403,7 +403,7 @@
  NS_IMETHODIMP
  nsAccessNode::GetNumChildren(PRInt32 *aNumChildren)
  {
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
  
    if (!content) {
      *aNumChildren = 0;
-@@ -419,7 +419,7 @@ NS_IMETHODIMP
+@@ -419,7 +419,7 @@
  NS_IMETHODIMP
  nsAccessNode::GetAccessibleDocument(nsIAccessibleDocument **aDocAccessible)
  {
 -  *aDocAccessible = GetDocAccessibleFor(mWeakShell).get();
 +  *aDocAccessible = GetDocAccessibleFor(mWeakShell);
    return NS_OK;
  }
  
-@@ -428,7 +428,7 @@ nsAccessNode::GetInnerHTML(nsAString& aI
+@@ -428,7 +428,7 @@
  {
    aInnerHTML.Truncate();
  
 -  nsCOMPtr<nsIDOMNSHTMLElement> domNSElement(do_QueryInterface(mDOMNode));
 +  nsIDOMNSHTMLElement* domNSElement(do_QueryInterface(mDOMNode));
    NS_ENSURE_TRUE(domNSElement, NS_ERROR_NULL_POINTER);
  
    return domNSElement->GetInnerHTML(aInnerHTML);
-@@ -440,13 +440,13 @@ nsAccessNode::ScrollTo(PRUint32 aScrollT
+@@ -440,13 +440,13 @@
    if (IsDefunct())
      return NS_ERROR_FAILURE;
  
 -  nsCOMPtr<nsIPresShell> shell(GetPresShell());
 +  nsIPresShell* shell(GetPresShell());
    NS_ENSURE_TRUE(shell, NS_ERROR_FAILURE);
  
    nsIFrame *frame = GetFrame();
    NS_ENSURE_TRUE(frame, NS_ERROR_FAILURE);
  
 -  nsCOMPtr<nsIContent> content = frame->GetContent();
 +  nsIContent* content = frame->GetContent();
    NS_ENSURE_TRUE(content, NS_ERROR_FAILURE);
  
    PRInt16 vPercent, hPercent;
-@@ -481,13 +481,13 @@ nsAccessNode::MakeAccessNode(nsIDOMNode 
+@@ -481,13 +481,13 @@
    nsIAccessibilityService *accService = GetAccService();
    NS_ENSURE_TRUE(accService, NS_ERROR_FAILURE);
  
 -  nsCOMPtr<nsIAccessNode> accessNode;
 -  accService->GetCachedAccessNode(aNode, mWeakShell, getter_AddRefs(accessNode));
 +  nsIAccessNode* accessNode = nsnull;
 +  accService->GetCachedAccessNode(aNode, mWeakShell, &accessNode);
  
@@ -1684,101 +1684,101 @@ diff --git a/accessible/src/base/nsAcces
 -    nsCOMPtr<nsIAccessible> accessible;
 +    nsIAccessible* accessible = nsnull;
      accService->GetAccessibleInWeakShell(aNode, mWeakShell,
 -                                         getter_AddRefs(accessible));
 +                                         &accessible);
  
      accessNode = do_QueryInterface(accessible);
    }
-@@ -515,8 +515,8 @@ nsAccessNode::GetFirstChildNode(nsIAcces
+@@ -515,8 +515,8 @@
    *aAccessNode = nsnull;
    NS_ENSURE_TRUE(mDOMNode, NS_ERROR_NULL_POINTER);
  
 -  nsCOMPtr<nsIDOMNode> domNode;
 -  mDOMNode->GetFirstChild(getter_AddRefs(domNode));
 +  nsIDOMNode* domNode = nsnull;
 +  mDOMNode->GetFirstChild(&domNode);
  
    return domNode ? MakeAccessNode(domNode, aAccessNode) : NS_OK;
  }
-@@ -528,8 +528,8 @@ nsAccessNode::GetLastChildNode(nsIAccess
+@@ -528,8 +528,8 @@
    *aAccessNode = nsnull;
    NS_ENSURE_TRUE(mDOMNode, NS_ERROR_NULL_POINTER);
  
 -  nsCOMPtr<nsIDOMNode> domNode;
 -  mDOMNode->GetLastChild(getter_AddRefs(domNode));
 +  nsIDOMNode* domNode = nsnull;
 +  mDOMNode->GetLastChild(&domNode);
  
    return domNode ? MakeAccessNode(domNode, aAccessNode) : NS_OK;
  }
-@@ -541,8 +541,8 @@ nsAccessNode::GetParentNode(nsIAccessNod
+@@ -541,8 +541,8 @@
    *aAccessNode = nsnull;
    NS_ENSURE_TRUE(mDOMNode, NS_ERROR_NULL_POINTER);
  
 -  nsCOMPtr<nsIDOMNode> domNode;
 -  mDOMNode->GetParentNode(getter_AddRefs(domNode));
 +  nsIDOMNode* domNode = nsnull;
 +  mDOMNode->GetParentNode(&domNode);
  
    return domNode ? MakeAccessNode(domNode, aAccessNode) : NS_OK;
  }
-@@ -554,8 +554,8 @@ nsAccessNode::GetPreviousSiblingNode(nsI
+@@ -554,8 +554,8 @@
    *aAccessNode = nsnull;
    NS_ENSURE_TRUE(mDOMNode, NS_ERROR_NULL_POINTER);
  
 -  nsCOMPtr<nsIDOMNode> domNode;
 -  mDOMNode->GetPreviousSibling(getter_AddRefs(domNode));
 +  nsIDOMNode* domNode = nsnull;
 +  mDOMNode->GetPreviousSibling(&domNode);
  
    return domNode ? MakeAccessNode(domNode, aAccessNode) : NS_OK;
  }
-@@ -567,8 +567,8 @@ nsAccessNode::GetNextSiblingNode(nsIAcce
+@@ -567,8 +567,8 @@
    *aAccessNode = nsnull;
    NS_ENSURE_TRUE(mDOMNode, NS_ERROR_NULL_POINTER);
  
 -  nsCOMPtr<nsIDOMNode> domNode;
 -  mDOMNode->GetNextSibling(getter_AddRefs(domNode));
 +  nsIDOMNode* domNode = nsnull;
 +  mDOMNode->GetNextSibling(&domNode);
  
    return domNode ? MakeAccessNode(domNode, aAccessNode) : NS_OK;
  }
-@@ -579,10 +579,10 @@ nsAccessNode::GetChildNodeAt(PRInt32 aCh
+@@ -579,10 +579,10 @@
    NS_ENSURE_ARG_POINTER(aAccessNode);
    *aAccessNode = nsnull;
  
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
    NS_ENSURE_TRUE(content, NS_ERROR_NULL_POINTER);
  
 -  nsCOMPtr<nsIDOMNode> domNode =
 +  nsIDOMNode* domNode =
      do_QueryInterface(content->GetChildAt(aChildNum));
  
    return domNode ? MakeAccessNode(domNode, aAccessNode) : NS_OK;
-@@ -591,12 +591,12 @@ NS_IMETHODIMP
+@@ -591,12 +591,12 @@
  NS_IMETHODIMP
  nsAccessNode::GetComputedStyleValue(const nsAString& aPseudoElt, const nsAString& aPropertyName, nsAString& aValue)
  {
 -  nsCOMPtr<nsIDOMElement> domElement(do_QueryInterface(mDOMNode));
 +  nsIDOMElement* domElement(do_QueryInterface(mDOMNode));
    if (!domElement) {
      return NS_ERROR_FAILURE;
    }
 -  nsCOMPtr<nsIDOMCSSStyleDeclaration> styleDecl;
 -  GetComputedStyleDeclaration(aPseudoElt, domElement, getter_AddRefs(styleDecl));
 +  nsIDOMCSSStyleDeclaration* styleDecl = nsnull;
 +  GetComputedStyleDeclaration(aPseudoElt, domElement, &styleDecl);
    NS_ENSURE_TRUE(styleDecl, NS_ERROR_FAILURE);
    
    return styleDecl->GetPropertyValue(aPropertyName, aValue);
-@@ -611,17 +611,17 @@ nsAccessNode::GetComputedStyleCSSValue(c
+@@ -611,17 +611,17 @@
  
    *aCSSValue = nsnull;
  
 -  nsCOMPtr<nsIDOMElement> domElement(do_QueryInterface(mDOMNode));
 +  nsIDOMElement* domElement(do_QueryInterface(mDOMNode));
    if (!domElement)
      return NS_ERROR_FAILURE;
  
@@ -1791,17 +1791,17 @@ diff --git a/accessible/src/base/nsAcces
  
 -  nsCOMPtr<nsIDOMCSSValue> cssValue;
 -  styleDecl->GetPropertyCSSValue(aPropertyName, getter_AddRefs(cssValue));
 +  nsIDOMCSSValue* cssValue = nsnull;
 +  styleDecl->GetPropertyCSSValue(aPropertyName, &cssValue);
    NS_ENSURE_TRUE(cssValue, NS_ERROR_FAILURE);
  
    return CallQueryInterface(cssValue, aCSSValue);
-@@ -633,28 +633,28 @@ void nsAccessNode::GetComputedStyleDecla
+@@ -633,28 +633,28 @@
  {
    *aCssDecl = nsnull;
    // Returns number of items in style declaration
 -  nsCOMPtr<nsIContent> content = do_QueryInterface(aElement);
 +  nsIContent* content = do_QueryInterface(aElement);
    if (!content) {
      return;
    }
@@ -1826,17 +1826,17 @@ diff --git a/accessible/src/base/nsAcces
  
  /***************** Hashtable of nsIAccessNode's *****************/
  
 -already_AddRefed<nsIAccessibleDocument>
 +nsIAccessibleDocument*
  nsAccessNode::GetDocAccessibleFor(nsIDocument *aDocument)
  {
    if (!aDocument) {
-@@ -662,19 +662,19 @@ nsAccessNode::GetDocAccessibleFor(nsIDoc
+@@ -662,19 +662,19 @@
    }
  
    nsIAccessibleDocument *docAccessible = nsnull;
 -  nsCOMPtr<nsIAccessNode> accessNode;
 +  nsIAccessNode* accessNode = nsnull;
    gGlobalDocAccessibleCache.Get(static_cast<void*>(aDocument),
 -                                getter_AddRefs(accessNode));
 +                                &accessNode);
@@ -1850,17 +1850,17 @@ diff --git a/accessible/src/base/nsAcces
 +nsIAccessibleDocument*
  nsAccessNode::GetDocAccessibleFor(nsIWeakReference *aWeakShell)
  {
 -  nsCOMPtr<nsIPresShell> presShell(do_QueryReferent(aWeakShell));
 +  nsIPresShell* presShell(do_QueryReferent(aWeakShell));
    if (!presShell) {
      return nsnull;
    }
-@@ -682,25 +682,25 @@ nsAccessNode::GetDocAccessibleFor(nsIWea
+@@ -682,25 +682,25 @@
    return nsAccessNode::GetDocAccessibleFor(presShell->GetDocument());
  }
  
 -already_AddRefed<nsIAccessibleDocument>
 +nsIAccessibleDocument*
  nsAccessNode::GetDocAccessibleFor(nsIDocShellTreeItem *aContainer,
                                    PRBool aCanCreate)
  {
@@ -1883,17 +1883,17 @@ diff --git a/accessible/src/base/nsAcces
  
 -  nsCOMPtr<nsIAccessible> accessible;
 -  GetAccService()->GetAccessibleFor(node, getter_AddRefs(accessible));
 +  nsIAccessible* accessible = nsnull;
 +  GetAccService()->GetAccessibleFor(node, &accessible);
    nsIAccessibleDocument *docAccessible = nsnull;
    if (accessible) {
      CallQueryInterface(accessible, &docAccessible);
-@@ -708,15 +708,15 @@ nsAccessNode::GetDocAccessibleFor(nsIDoc
+@@ -708,15 +708,15 @@
    return docAccessible;
  }
   
 -already_AddRefed<nsIAccessibleDocument>
 +nsIAccessibleDocument*
  nsAccessNode::GetDocAccessibleFor(nsIDOMNode *aNode)
  {
 -  nsCOMPtr<nsIPresShell> eventShell = GetPresShellFor(aNode);
@@ -1902,34 +1902,34 @@ diff --git a/accessible/src/base/nsAcces
      return GetDocAccessibleFor(eventShell->GetDocument());
    }
  
 -  nsCOMPtr<nsIDocument> doc(do_QueryInterface(aNode));
 +  nsIDocument* doc(do_QueryInterface(aNode));
    if (doc) {
      return GetDocAccessibleFor(doc);
    }
-@@ -724,12 +724,12 @@ nsAccessNode::GetDocAccessibleFor(nsIDOM
+@@ -724,12 +724,12 @@
    return nsnull;
  }
  
 -already_AddRefed<nsIPresShell>
 +nsIPresShell*
  nsAccessNode::GetPresShellFor(nsIDOMNode *aNode)
  {
 -  nsCOMPtr<nsIDOMDocument> domDocument;
 -  aNode->GetOwnerDocument(getter_AddRefs(domDocument));
 -  nsCOMPtr<nsIDocument> doc(do_QueryInterface(domDocument));
 +  nsIDOMDocument* domDocument = nsnull;
 +  aNode->GetOwnerDocument(&domDocument);
 +  nsIDocument* doc(do_QueryInterface(domDocument));
    if (!doc) {   // This is necessary when the node is the document node
      doc = do_QueryInterface(aNode);
    }
-@@ -741,20 +741,20 @@ nsAccessNode::GetPresShellFor(nsIDOMNode
+@@ -741,20 +741,20 @@
    return presShell;
  }
  
 -already_AddRefed<nsIDOMNode>
 +nsIDOMNode*
  nsAccessNode::GetDOMNodeForContainer(nsISupports *aContainer)
  {
    nsIDOMNode* node = nsnull;
@@ -1948,26 +1948,26 @@ diff --git a/accessible/src/base/nsAcces
 +      nsIDocument* doc = nsnull;
 +      docv->GetDocument(&doc);
        if (doc) {
 -        CallQueryInterface(doc.get(), &node);
 +        CallQueryInterface(doc, &node);
        }
      }
    }
-@@ -787,7 +787,7 @@ PLDHashOperator nsAccessNode::ClearCache
+@@ -787,7 +787,7 @@
  {
    NS_ASSERTION(aAccessNode, "Calling ClearCacheEntry with a NULL pointer!");
    if (aAccessNode) {
 -    nsCOMPtr<nsPIAccessNode> privateAccessNode(do_QueryInterface(aAccessNode));
 +    nsPIAccessNode* privateAccessNode(do_QueryInterface(aAccessNode));
      privateAccessNode->Shutdown();
    }
  
-@@ -800,14 +800,14 @@ nsAccessNode::ClearCache(nsAccessNodeHas
+@@ -800,14 +800,14 @@
    aCache.Enumerate(ClearCacheEntry, nsnull);
  }
  
 -already_AddRefed<nsIDOMNode> nsAccessNode::GetCurrentFocus()
 +nsIDOMNode* nsAccessNode::GetCurrentFocus()
  {
 -  nsCOMPtr<nsIPresShell> shell = GetPresShellFor(mDOMNode);
 +  nsIPresShell* shell = GetPresShellFor(mDOMNode);
@@ -1976,17 +1976,17 @@ diff --git a/accessible/src/base/nsAcces
 +  nsIDocument* doc = shell->GetDocument();
    NS_ENSURE_TRUE(doc, nsnull);
  
 -  nsCOMPtr<nsPIDOMWindow> privateDOMWindow(do_QueryInterface(doc->GetWindow()));
 +  nsPIDOMWindow* privateDOMWindow(do_QueryInterface(doc->GetWindow()));
    if (!privateDOMWindow) {
      return nsnull;
    }
-@@ -815,18 +815,18 @@ already_AddRefed<nsIDOMNode> nsAccessNod
+@@ -815,18 +815,18 @@
    if (!focusController) {
      return nsnull;
    }
 -  nsCOMPtr<nsIDOMElement> focusedElement;
 -  focusController->GetFocusedElement(getter_AddRefs(focusedElement));
 +  nsIDOMElement* focusedElement = nsnull;
 +  focusController->GetFocusedElement(&focusedElement);
    nsIDOMNode *focusedNode = nsnull;
@@ -2001,17 +2001,17 @@ diff --git a/accessible/src/base/nsAcces
      }
 -    nsCOMPtr<nsIDOMDocument> focusedDOMDocument;
 -    focusedWinInternal->GetDocument(getter_AddRefs(focusedDOMDocument));
 +    nsIDOMDocument* focusedDOMDocument = nsnull;
 +    focusedWinInternal->GetDocument(&focusedDOMDocument);
      if (!focusedDOMDocument) {
        return nsnull;
      }
-@@ -843,22 +843,22 @@ nsAccessNode::GetLanguage(nsAString& aLa
+@@ -843,22 +843,22 @@
  nsAccessNode::GetLanguage(nsAString& aLanguage)
  {
    aLanguage.Truncate();
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
    if (!content) {
      // For documents make sure we look for lang attribute on
      // document element
@@ -2031,29 +2031,29 @@ diff --git a/accessible/src/base/nsAcces
        if (!content) {
 -        nsCOMPtr<nsIDOMElement> docElement;
 -        domDoc->GetDocumentElement(getter_AddRefs(docElement));
 +        nsIDOMElement* docElement = nsnull;
 +        domDoc->GetDocumentElement(&docElement);
          content = do_QueryInterface(docElement);
        }
      }
-diff --git a/accessible/src/base/nsAccessNode.h b/accessible/src/base/nsAccessNode.h
---- a/accessible/src/base/nsAccessNode.h
-+++ b/accessible/src/base/nsAccessNode.h
-@@ -88,7 +88,7 @@ class nsAccessNode: public nsIAccessNode
+diff -r 332906b0e686 accessible/src/base/nsAccessNode.h
+--- a/accessible/src/base/nsAccessNode.h	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/base/nsAccessNode.h	Fri Jul 04 01:35:36 2008 -0700
+@@ -88,7 +88,7 @@
      /**
       * Return an application accessible.
       */
 -    static already_AddRefed<nsApplicationAccessibleWrap> GetApplicationAccessible();
 +    static nsApplicationAccessibleWrap* GetApplicationAccessible();
  
      // Static methods for handling per-document cache
      static void PutCacheEntry(nsAccessNodeHashtable& aCache,
-@@ -101,23 +101,23 @@ class nsAccessNode: public nsIAccessNode
+@@ -101,23 +101,23 @@
      HIDE_FROM_GARBURATOR(static PLDHashOperator PR_CALLBACK ClearCacheEntry(const void* aKey, nsCOMPtr<nsIAccessNode>& aAccessNode, void* aUserArg))
  
      // Static cache methods for global document cache
 -    static already_AddRefed<nsIAccessibleDocument> GetDocAccessibleFor(nsIDocument *aDocument);
 -    static already_AddRefed<nsIAccessibleDocument> GetDocAccessibleFor(nsIWeakReference *aWeakShell);
 -    static already_AddRefed<nsIAccessibleDocument> GetDocAccessibleFor(nsIDocShellTreeItem *aContainer, PRBool aCanCreate = PR_FALSE);
 -    static already_AddRefed<nsIAccessibleDocument> GetDocAccessibleFor(nsIDOMNode *aNode);
 +    static nsIAccessibleDocument* GetDocAccessibleFor(nsIDocument *aDocument);
@@ -2075,48 +2075,48 @@ diff --git a/accessible/src/base/nsAcces
  
      static nsIDOMNode *gLastFocusedNode;
      static nsIAccessibilityService* GetAccService();
 -    already_AddRefed<nsIDOMNode> GetCurrentFocus();
 +    nsIDOMNode* GetCurrentFocus();
  
      /**
       * Returns true when the accessible is defunct.
-@@ -126,9 +126,9 @@ class nsAccessNode: public nsIAccessNode
+@@ -126,9 +126,9 @@
  
  protected:
      nsresult MakeAccessNode(nsIDOMNode *aNode, nsIAccessNode **aAccessNode);
 -    already_AddRefed<nsIPresShell> GetPresShell();
 +    nsIPresShell* GetPresShell();
      nsPresContext* GetPresContext();
 -    already_AddRefed<nsIAccessibleDocument> GetDocAccessible();
 +    nsIAccessibleDocument* GetDocAccessible();
      void LastRelease();
  
      nsCOMPtr<nsIDOMNode> mDOMNode;
-diff --git a/accessible/src/base/nsAccessibilityService.cpp b/accessible/src/base/nsAccessibilityService.cpp
---- a/accessible/src/base/nsAccessibilityService.cpp
-+++ b/accessible/src/base/nsAccessibilityService.cpp
-@@ -119,13 +119,13 @@ nsAccessibilityService *nsAccessibilityS
+diff -r 332906b0e686 accessible/src/base/nsAccessibilityService.cpp
+--- a/accessible/src/base/nsAccessibilityService.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/base/nsAccessibilityService.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -119,13 +119,13 @@
  
  nsAccessibilityService::nsAccessibilityService()
  {
 -  nsCOMPtr<nsIObserverService> observerService = 
 +  nsIObserverService* observerService = 
      do_GetService("@mozilla.org/observer-service;1");
    if (!observerService)
      return;
  
    observerService->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, PR_FALSE);
 -  nsCOMPtr<nsIWebProgress> progress(do_GetService(NS_DOCUMENTLOADER_SERVICE_CONTRACTID));
 +  nsIWebProgress* progress(do_GetService(NS_DOCUMENTLOADER_SERVICE_CONTRACTID));
    if (progress) {
      progress->AddProgressListener(static_cast<nsIWebProgressListener*>(this),
                                    nsIWebProgress::NOTIFY_STATE_DOCUMENT |
-@@ -150,18 +150,18 @@ nsAccessibilityService::Observe(nsISuppo
+@@ -150,18 +150,18 @@
                           const PRUnichar *aData)
  {
    if (!nsCRT::strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID)) {
 -    nsCOMPtr<nsIObserverService> observerService = 
 +    nsIObserverService* observerService = 
        do_GetService("@mozilla.org/observer-service;1");
      if (observerService) {
        observerService->RemoveObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID);
@@ -2128,26 +2128,26 @@ diff --git a/accessible/src/base/nsAcces
      nsAccessNodeWrap::ShutdownAccessibility();
      // Cancel and release load timers
      while (mLoadTimers.Count() > 0 ) {
 -      nsCOMPtr<nsITimer> timer = mLoadTimers.ObjectAt(0);
 +      nsITimer* timer = mLoadTimers.ObjectAt(0);
        void *closure = nsnull;
        timer->GetClosure(&closure);
        if (closure) {
-@@ -193,7 +193,7 @@ NS_IMETHODIMP nsAccessibilityService::On
+@@ -193,7 +193,7 @@
    if (NS_FAILED(aStatus) && (aStateFlags & STATE_START))
      return NS_OK;
   
 -  nsCOMPtr<nsITimer> timer = do_CreateInstance("@mozilla.org/timer;1");
 +  nsITimer* timer = do_CreateInstance("@mozilla.org/timer;1");
    if (!timer)
      return NS_OK;
    mLoadTimers.AppendObject(timer);
-@@ -213,16 +213,16 @@ NS_IMETHODIMP nsAccessibilityService::On
+@@ -213,16 +213,16 @@
  
  NS_IMETHODIMP nsAccessibilityService::ProcessDocLoadEvent(nsITimer *aTimer, void *aClosure, PRUint32 aEventType)
  {
 -  nsCOMPtr<nsIDOMWindow> domWindow;
 +  nsIDOMWindow* domWindow = nsnull;
    nsIWebProgress *webProgress = static_cast<nsIWebProgress*>(aClosure);
 -  webProgress->GetDOMWindow(getter_AddRefs(domWindow));
 +  webProgress->GetDOMWindow(&domWindow);
@@ -2158,17 +2158,17 @@ diff --git a/accessible/src/base/nsAcces
    if (aEventType == nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_START) {
 -    nsCOMPtr<nsIWebNavigation> webNav(do_GetInterface(domWindow));
 -    nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(webNav));
 +    nsIWebNavigation* webNav(do_GetInterface(domWindow));
 +    nsIDocShell* docShell(do_QueryInterface(webNav));
      NS_ENSURE_STATE(docShell);
      PRUint32 loadType;
      docShell->GetLoadType(&loadType);
-@@ -234,14 +234,14 @@ NS_IMETHODIMP nsAccessibilityService::Pr
+@@ -234,14 +234,14 @@
      }
    }
        
 -  nsCOMPtr<nsIDOMDocument> domDoc;
 -  domWindow->GetDocument(getter_AddRefs(domDoc));
 -  nsCOMPtr<nsIDOMNode> docNode = do_QueryInterface(domDoc);
 +  nsIDOMDocument* domDoc = nsnull;
 +  domWindow->GetDocument(&domDoc);
@@ -2179,17 +2179,17 @@ diff --git a/accessible/src/base/nsAcces
 -  GetAccessibleFor(docNode, getter_AddRefs(accessible));
 -  nsCOMPtr<nsPIAccessibleDocument> privDocAccessible = do_QueryInterface(accessible);
 +  nsIAccessible* accessible = nsnull;
 +  GetAccessibleFor(docNode, &accessible);
 +  nsPIAccessibleDocument* privDocAccessible = do_QueryInterface(accessible);
    NS_ENSURE_STATE(privDocAccessible);
    privDocAccessible->FireDocLoadEvents(aEventType);
  
-@@ -287,19 +287,19 @@ NS_IMETHODIMP nsAccessibilityService::On
+@@ -287,19 +287,19 @@
    // If there is no accessible for the document, we will ignore
    // this and the anchor jump event will be fired via OnStateChange
    // and nsIAccessibleStates::STATE_STOP
 -  nsCOMPtr<nsIDOMWindow> domWindow;
 -  aWebProgress->GetDOMWindow(getter_AddRefs(domWindow));
 +  nsIDOMWindow* domWindow = nsnull;
 +  aWebProgress->GetDOMWindow(&domWindow);
    NS_ASSERTION(domWindow, "DOM Window for state change is null");
@@ -2206,17 +2206,17 @@ diff --git a/accessible/src/base/nsAcces
 -  nsCOMPtr<nsIAccessibleDocument> accessibleDoc =
 +  nsIAccessibleDocument* accessibleDoc =
      nsAccessNode::GetDocAccessibleFor(domDocRootNode);
 -  nsCOMPtr<nsPIAccessibleDocument> privateAccessibleDoc =
 +  nsPIAccessibleDocument* privateAccessibleDoc =
      do_QueryInterface(accessibleDoc);
    if (!privateAccessibleDoc) {
      return NS_OK;
-@@ -329,21 +329,21 @@ nsAccessibilityService::GetInfo(nsISuppo
+@@ -329,21 +329,21 @@
  {
    NS_ASSERTION(aFrame,"Error -- 1st argument (aFrame) is null!!");
    *aRealFrame = static_cast<nsIFrame*>(aFrame);
 -  nsCOMPtr<nsIContent> content = (*aRealFrame)->GetContent();
 -  nsCOMPtr<nsIDOMNode> node(do_QueryInterface(content));
 +  nsIContent* content = (*aRealFrame)->GetContent();
 +  nsIDOMNode* node(do_QueryInterface(content));
    if (!content || !node)
@@ -2232,50 +2232,50 @@ diff --git a/accessible/src/base/nsAcces
    NS_ASSERTION(document->GetPrimaryShell(),"Error no shells!");
  
    // do_GetWR only works into a |nsCOMPtr| :-(
 -  nsCOMPtr<nsIWeakReference> weakShell =
 +  nsIWeakReference* weakShell =
      do_GetWeakReference(document->GetPrimaryShell());
    NS_IF_ADDREF(*aShell = weakShell);
  
-@@ -353,9 +353,9 @@ nsresult
+@@ -353,9 +353,9 @@
  nsresult
  nsAccessibilityService::GetShellFromNode(nsIDOMNode *aNode, nsIWeakReference **aWeakShell)
  {
 -  nsCOMPtr<nsIDOMDocument> domDoc;
 -  aNode->GetOwnerDocument(getter_AddRefs(domDoc));
 -  nsCOMPtr<nsIDocument> doc(do_QueryInterface(domDoc));
 +  nsIDOMDocument* domDoc = nsnull;
 +  aNode->GetOwnerDocument(&domDoc);
 +  nsIDocument* doc(do_QueryInterface(domDoc));
    if (!doc)
      return NS_ERROR_INVALID_ARG;
  
-@@ -364,7 +364,7 @@ nsAccessibilityService::GetShellFromNode
+@@ -364,7 +364,7 @@
    if (!shell)
      return NS_ERROR_FAILURE;
  
 -  nsCOMPtr<nsIWeakReference> weakRef(do_GetWeakReference(shell));
 +  nsIWeakReference* weakRef(do_GetWeakReference(shell));
    
    *aWeakShell = weakRef;
    NS_IF_ADDREF(*aWeakShell);
-@@ -384,8 +384,8 @@ nsAccessibilityService::CreateOuterDocAc
+@@ -384,8 +384,8 @@
    
    *aOuterDocAccessible = nsnull;
  
 -  nsCOMPtr<nsIWeakReference> outerWeakShell;
 -  GetShellFromNode(aDOMNode, getter_AddRefs(outerWeakShell));
 +  nsIWeakReference* outerWeakShell = nsnull;
 +  GetShellFromNode(aDOMNode, &outerWeakShell);
    NS_ENSURE_TRUE(outerWeakShell, NS_ERROR_FAILURE);
  
    nsOuterDocAccessible *outerDocAccessible =
-@@ -404,27 +404,27 @@ nsAccessibilityService::CreateRootAccess
+@@ -404,27 +404,27 @@
  {
    *aRootAcc = nsnull;
  
 -  nsCOMPtr<nsIDOMNode> rootNode(do_QueryInterface(aDocument));
 +  nsIDOMNode* rootNode(do_QueryInterface(aDocument));
    NS_ENSURE_TRUE(rootNode, NS_ERROR_FAILURE);
  
    nsIPresShell *presShell = aShell;
@@ -2302,94 +2302,94 @@ diff --git a/accessible/src/base/nsAcces
 -    nsCOMPtr<nsIURI> uri;
 -    webNav->GetCurrentURI(getter_AddRefs(uri));
 +    nsIWebNavigation* webNav(do_GetInterface(docShell));
 +    nsIURI* uri = nsnull;
 +    webNav->GetCurrentURI(&uri);
      NS_ENSURE_STATE(uri);
      nsCAutoString url;
      uri->GetSpec(url);
-@@ -433,12 +433,12 @@ nsAccessibilityService::CreateRootAccess
+@@ -433,12 +433,12 @@
      }
    }
  
 -  nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem =
 +  nsIDocShellTreeItem* docShellTreeItem =
      do_QueryInterface(container);
    NS_ENSURE_TRUE(docShellTreeItem, NS_ERROR_FAILURE);
    
 -  nsCOMPtr<nsIDocShellTreeItem> parentTreeItem;
 -  docShellTreeItem->GetParent(getter_AddRefs(parentTreeItem));
 +  nsIDocShellTreeItem* parentTreeItem = nsnull;
 +  docShellTreeItem->GetParent(&parentTreeItem);
  
    if (parentTreeItem) {
      // We only create root accessibles for the true root, othewise create a
-@@ -451,10 +451,10 @@ nsAccessibilityService::CreateRootAccess
+@@ -451,10 +451,10 @@
    if (!*aRootAcc)
      return NS_ERROR_OUT_OF_MEMORY;
  
 -  nsCOMPtr<nsPIAccessNode> privateAccessNode(do_QueryInterface(*aRootAcc));
 +  nsPIAccessNode* privateAccessNode(do_QueryInterface(*aRootAcc));
    privateAccessNode->Init();
    nsRoleMapEntry *roleMapEntry = nsAccUtils::GetRoleMapEntry(rootNode);
 -  nsCOMPtr<nsPIAccessible> privateAccessible =
 +  nsPIAccessible* privateAccessible =
      do_QueryInterface(privateAccessNode);
    privateAccessible->SetRoleMapEntry(roleMapEntry);
  
-@@ -470,9 +470,9 @@ nsAccessibilityService::CreateHTML4Butto
+@@ -470,9 +470,9 @@
  nsAccessibilityService::CreateHTML4ButtonAccessible(nsISupports *aFrame, nsIAccessible **_retval)
  {
    nsIFrame* frame;
 -  nsCOMPtr<nsIDOMNode> node;
 -  nsCOMPtr<nsIWeakReference> weakShell;
 -  nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node));
 +  nsIDOMNode* node = nsnull;
 +  nsIWeakReference* weakShell = nsnull;
 +  nsresult rv = GetInfo(aFrame, &frame, &weakShell, &node);
    if (NS_FAILED(rv))
      return rv;
  
-@@ -488,9 +488,9 @@ nsAccessibilityService::CreateHTMLButton
+@@ -488,9 +488,9 @@
  nsAccessibilityService::CreateHTMLButtonAccessible(nsISupports *aFrame, nsIAccessible **_retval)
  {
    nsIFrame* frame;
 -  nsCOMPtr<nsIDOMNode> node;
 -  nsCOMPtr<nsIWeakReference> weakShell;
 -  nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node));
 +  nsIDOMNode* node = nsnull;
 +  nsIWeakReference* weakShell = nsnull;
 +  nsresult rv = GetInfo(aFrame, &frame, &weakShell, &node);
    if (NS_FAILED(rv))
      return rv;
  
-@@ -510,7 +510,7 @@ nsAccessibilityService::CreateHTMLAccess
+@@ -510,7 +510,7 @@
  {
    // This method assumes we're in an HTML namespace.
    *aAccessible = nsnull;
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(aNode));
 +  nsIContent* content(do_QueryInterface(aNode));
    nsIAtom *tag = content->Tag();
    if (tag == nsAccessibilityAtoms::legend) {
      *aAccessible = new nsHTMLLegendAccessible(aNode, aWeakShell);
-@@ -564,9 +564,9 @@ nsAccessibilityService::CreateHTMLLIAcce
+@@ -564,9 +564,9 @@
                                                 nsIAccessible **_retval)
  {
    nsIFrame* frame;
 -  nsCOMPtr<nsIDOMNode> node;
 -  nsCOMPtr<nsIWeakReference> weakShell;
 -  nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node));
 +  nsIDOMNode* node = nsnull;
 +  nsIWeakReference* weakShell = nsnull;
 +  nsresult rv = GetInfo(aFrame, &frame, &weakShell, &node);
    if (NS_FAILED(rv))
      return rv;
  
-@@ -582,13 +582,13 @@ nsAccessibilityService::CreateHyperTextA
+@@ -582,13 +582,13 @@
  nsAccessibilityService::CreateHyperTextAccessible(nsISupports *aFrame, nsIAccessible **aAccessible)
  {
    nsIFrame* frame;
 -  nsCOMPtr<nsIDOMNode> node;
 -  nsCOMPtr<nsIWeakReference> weakShell;
 -  nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node));
 +  nsIDOMNode* node = nsnull;
 +  nsIWeakReference* weakShell = nsnull;
@@ -2397,30 +2397,30 @@ diff --git a/accessible/src/base/nsAcces
    if (NS_FAILED(rv))
      return rv;
  
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(node));
 +  nsIContent* content(do_QueryInterface(node));
    NS_ENSURE_TRUE(content, NS_ERROR_FAILURE);
    
    if (nsAccUtils::HasListener(content, NS_LITERAL_STRING("click"))) {
-@@ -610,9 +610,9 @@ nsAccessibilityService::CreateHTMLCheckb
+@@ -610,9 +610,9 @@
  nsAccessibilityService::CreateHTMLCheckboxAccessible(nsISupports *aFrame, nsIAccessible **_retval)
  {
    nsIFrame* frame;
 -  nsCOMPtr<nsIDOMNode> node;
 -  nsCOMPtr<nsIWeakReference> weakShell;
 -  nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node));
 +  nsIDOMNode* node = nsnull;
 +  nsIWeakReference* weakShell = nsnull;
 +  nsresult rv = GetInfo(aFrame, &frame, &weakShell, &node);
    if (NS_FAILED(rv))
      return rv;
  
-@@ -639,14 +639,14 @@ nsAccessibilityService::CreateHTMLImageA
+@@ -639,14 +639,14 @@
  nsAccessibilityService::CreateHTMLImageAccessible(nsISupports *aFrame, nsIAccessible **_retval)
  {
    nsIFrame* frame;
 -  nsCOMPtr<nsIDOMNode> node;
 -  nsCOMPtr<nsIWeakReference> weakShell;
 -  nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node));
 +  nsIDOMNode* node = nsnull;
 +  nsIWeakReference* weakShell = nsnull;
@@ -2429,30 +2429,30 @@ diff --git a/accessible/src/base/nsAcces
      return rv;
  
    *_retval = nsnull;
 -  nsCOMPtr<nsIDOMElement> domElement(do_QueryInterface(node));
 +  nsIDOMElement* domElement(do_QueryInterface(node));
    if (domElement) {
        *_retval = new nsHTMLImageAccessibleWrap(node, weakShell);
    }
-@@ -668,9 +668,9 @@ nsAccessibilityService::CreateHTMLGroupb
+@@ -668,9 +668,9 @@
  nsAccessibilityService::CreateHTMLGroupboxAccessible(nsISupports *aFrame, nsIAccessible **_retval)
  {
    nsIFrame* frame;
 -  nsCOMPtr<nsIDOMNode> node;
 -  nsCOMPtr<nsIWeakReference> weakShell;
 -  nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node));
 +  nsIDOMNode* node = nsnull;
 +  nsIWeakReference* weakShell = nsnull;
 +  nsresult rv = GetInfo(aFrame, &frame, &weakShell, &node);
    if (NS_FAILED(rv))
      return rv;
  
-@@ -706,20 +706,20 @@ nsAccessibilityService::CreateHTMLObject
+@@ -706,20 +706,20 @@
  nsAccessibilityService::CreateHTMLObjectFrameAccessible(nsObjectFrame *aFrame,
                                                          nsIAccessible **aAccessible)
  {
 -  nsCOMPtr<nsIDOMNode> node;
 -  nsCOMPtr<nsIWeakReference> weakShell;
 +  nsIDOMNode* node = nsnull;
 +  nsIWeakReference* weakShell = nsnull;
    nsIFrame *frame;
@@ -2469,189 +2469,189 @@ diff --git a/accessible/src/base/nsAcces
 +  nsIDOMDocument* domDoc = nsnull;
 +  nsIDOMHTMLObjectElement* obj(do_QueryInterface(node));
    if (obj)
 -    obj->GetContentDocument(getter_AddRefs(domDoc));
 +    obj->GetContentDocument(&domDoc);
    else
      domDoc = do_QueryInterface(node);
    if (domDoc)
-@@ -755,9 +755,9 @@ nsAccessibilityService::CreateHTMLRadioB
+@@ -755,9 +755,9 @@
  nsAccessibilityService::CreateHTMLRadioButtonAccessible(nsISupports *aFrame, nsIAccessible **_retval)
  {
    nsIFrame* frame;
 -  nsCOMPtr<nsIDOMNode> node;
 -  nsCOMPtr<nsIWeakReference> weakShell;
 -  nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node));
 +  nsIDOMNode* node = nsnull;
 +  nsIWeakReference* weakShell = nsnull;
 +  nsresult rv = GetInfo(aFrame, &frame, &weakShell, &node);
    if (NS_FAILED(rv))
      return rv;
  
-@@ -787,9 +787,9 @@ nsAccessibilityService::CreateHTMLTableA
+@@ -787,9 +787,9 @@
  nsAccessibilityService::CreateHTMLTableAccessible(nsISupports *aFrame, nsIAccessible **_retval)
  {
    nsIFrame* frame;
 -  nsCOMPtr<nsIDOMNode> node;
 -  nsCOMPtr<nsIWeakReference> weakShell;
 -  nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node));
 +  nsIDOMNode* node = nsnull;
 +  nsIWeakReference* weakShell = nsnull;
 +  nsresult rv = GetInfo(aFrame, &frame, &weakShell, &node);
    if (NS_FAILED(rv))
      return rv;
  
-@@ -812,8 +812,8 @@ nsAccessibilityService::CreateHTMLTableH
+@@ -812,8 +812,8 @@
  
    nsresult rv = NS_OK;
  
 -  nsCOMPtr<nsIWeakReference> weakShell;
 -  rv = GetShellFromNode(aDOMNode, getter_AddRefs(weakShell));
 +  nsIWeakReference* weakShell = nsnull;
 +  rv = GetShellFromNode(aDOMNode, &weakShell);
    NS_ENSURE_SUCCESS(rv, rv);
  
    nsHTMLTableHeadAccessibleWrap* accTableHead =
-@@ -832,9 +832,9 @@ nsAccessibilityService::CreateHTMLTableC
+@@ -832,9 +832,9 @@
  nsAccessibilityService::CreateHTMLTableCellAccessible(nsISupports *aFrame, nsIAccessible **_retval)
  {
    nsIFrame* frame;
 -  nsCOMPtr<nsIDOMNode> node;
 -  nsCOMPtr<nsIWeakReference> weakShell;
 -  nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node));
 +  nsIDOMNode* node = nsnull;
 +  nsIWeakReference* weakShell = nsnull;
 +  nsresult rv = GetInfo(aFrame, &frame, &weakShell, &node);
    if (NS_FAILED(rv))
      return rv;
  
-@@ -852,9 +852,9 @@ nsAccessibilityService::CreateHTMLTextAc
+@@ -852,9 +852,9 @@
    *_retval = nsnull;
  
    nsIFrame* frame;
 -  nsCOMPtr<nsIDOMNode> node;
 -  nsCOMPtr<nsIWeakReference> weakShell;
 -  nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node));
 +  nsIDOMNode* node = nsnull;
 +  nsIWeakReference* weakShell = nsnull;
 +  nsresult rv = GetInfo(aFrame, &frame, &weakShell, &node);
    if (NS_FAILED(rv))
      return rv;
  
-@@ -871,9 +871,9 @@ nsAccessibilityService::CreateHTMLTextFi
+@@ -871,9 +871,9 @@
  nsAccessibilityService::CreateHTMLTextFieldAccessible(nsISupports *aFrame, nsIAccessible **_retval)
  {
    nsIFrame* frame;
 -  nsCOMPtr<nsIDOMNode> node;
 -  nsCOMPtr<nsIWeakReference> weakShell;
 -  nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node));
 +  nsIDOMNode* node = nsnull;
 +  nsIWeakReference* weakShell = nsnull;
 +  nsresult rv = GetInfo(aFrame, &frame, &weakShell, &node);
    if (NS_FAILED(rv))
      return rv;
  
-@@ -889,9 +889,9 @@ nsAccessibilityService::CreateHTMLLabelA
+@@ -889,9 +889,9 @@
  nsAccessibilityService::CreateHTMLLabelAccessible(nsISupports *aFrame, nsIAccessible **_retval)
  {
    nsIFrame* frame;
 -  nsCOMPtr<nsIDOMNode> node;
 -  nsCOMPtr<nsIWeakReference> weakShell;
 -  nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node));
 +  nsIDOMNode* node = nsnull;
 +  nsIWeakReference* weakShell = nsnull;
 +  nsresult rv = GetInfo(aFrame, &frame, &weakShell, &node);
    if (NS_FAILED(rv))
      return rv;
  
-@@ -907,9 +907,9 @@ nsAccessibilityService::CreateHTMLHRAcce
+@@ -907,9 +907,9 @@
  nsAccessibilityService::CreateHTMLHRAccessible(nsISupports *aFrame, nsIAccessible **_retval)
  {
    nsIFrame* frame;
 -  nsCOMPtr<nsIDOMNode> node;
 -  nsCOMPtr<nsIWeakReference> weakShell;
 -  nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node));
 +  nsIDOMNode* node = nsnull;
 +  nsIWeakReference* weakShell = nsnull;
 +  nsresult rv = GetInfo(aFrame, &frame, &weakShell, &node);
    if (NS_FAILED(rv))
      return rv;
  
-@@ -925,9 +925,9 @@ nsAccessibilityService::CreateHTMLBRAcce
+@@ -925,9 +925,9 @@
  nsAccessibilityService::CreateHTMLBRAccessible(nsISupports *aFrame, nsIAccessible **_retval)
  {
    nsIFrame* frame;
 -  nsCOMPtr<nsIDOMNode> node;
 -  nsCOMPtr<nsIWeakReference> weakShell;
 -  nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node));
 +  nsIDOMNode* node = nsnull;
 +  nsIWeakReference* weakShell = nsnull;
 +  nsresult rv = GetInfo(aFrame, &frame, &weakShell, &node);
    if (NS_FAILED(rv))
      return rv;
  
-@@ -943,9 +943,9 @@ nsAccessibilityService::CreateHTMLCaptio
+@@ -943,9 +943,9 @@
  nsAccessibilityService::CreateHTMLCaptionAccessible(nsISupports *aFrame, nsIAccessible **_retval)
  {
    nsIFrame* frame;
 -  nsCOMPtr<nsIDOMNode> node;
 -  nsCOMPtr<nsIWeakReference> weakShell;
 -  nsresult rv = GetInfo(aFrame, &frame, getter_AddRefs(weakShell), getter_AddRefs(node));
 +  nsIDOMNode* node = nsnull;
 +  nsIWeakReference* weakShell = nsnull;
 +  nsresult rv = GetInfo(aFrame, &frame, &weakShell, &node);
    if (NS_FAILED(rv))
      return rv;
  
-@@ -961,9 +961,9 @@ NS_IMETHODIMP nsAccessibilityService::Ge
+@@ -961,9 +961,9 @@
                                                            nsIWeakReference *aWeakShell,
                                                            nsIAccessible **aAccessible)
  {
 -  nsCOMPtr<nsIAccessNode> accessNode;
 -  nsresult rv = GetCachedAccessNode(aNode, aWeakShell, getter_AddRefs(accessNode));
 -  nsCOMPtr<nsIAccessible> accessible(do_QueryInterface(accessNode));
 +  nsIAccessNode* accessNode = nsnull;
 +  nsresult rv = GetCachedAccessNode(aNode, aWeakShell, &accessNode);
 +  nsIAccessible* accessible(do_QueryInterface(accessNode));
    NS_IF_ADDREF(*aAccessible = accessible);
    return rv;
  }
-@@ -972,7 +972,7 @@ NS_IMETHODIMP nsAccessibilityService::Ge
+@@ -972,7 +972,7 @@
                                                            nsIWeakReference *aWeakShell,
                                                            nsIAccessNode **aAccessNode)
  {
 -  nsCOMPtr<nsIAccessibleDocument> accessibleDoc =
 +  nsIAccessibleDocument* accessibleDoc =
      nsAccessNode::GetDocAccessibleFor(aWeakShell);
  
    if (!accessibleDoc) {
-@@ -1158,8 +1158,8 @@ nsAccessibilityService::GetAccessibleFor
+@@ -1158,8 +1158,8 @@
  
    // We use presentation shell #0 because we assume that is presentation of
    // given node window.
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(aNode));
 -  nsCOMPtr<nsIDocument> doc;
 +  nsIContent* content(do_QueryInterface(aNode));
 +  nsIDocument* doc = nsnull;
    if (content) {
      doc = content->GetDocument();
    }
-@@ -1182,8 +1182,8 @@ nsAccessibilityService::GetAttachedAcces
+@@ -1182,8 +1182,8 @@
  
    *aAccessible = nsnull;
  
 -  nsCOMPtr<nsIDOMNode> relevantNode;
 -  nsresult rv = GetRelevantContentNodeFor(aNode, getter_AddRefs(relevantNode));
 +  nsIDOMNode* relevantNode = nsnull;
 +  nsresult rv = GetRelevantContentNodeFor(aNode, &relevantNode);
    NS_ENSURE_SUCCESS(rv, rv);
  
    if (relevantNode != aNode)
-@@ -1202,13 +1202,13 @@ NS_IMETHODIMP nsAccessibilityService::Ge
+@@ -1202,13 +1202,13 @@
    NS_ENSURE_ARG(aNode);
    NS_ENSURE_ARG(aWin);
  
 -  nsCOMPtr<nsIWebNavigation> webNav(do_GetInterface(aWin));
 -  nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(webNav));
 +  nsIWebNavigation* webNav(do_GetInterface(aWin));
 +  nsIDocShell* docShell(do_QueryInterface(webNav));
    if (!docShell)
@@ -2659,72 +2659,72 @@ diff --git a/accessible/src/base/nsAcces
  
 -  nsCOMPtr<nsIPresShell> presShell;
 -  docShell->GetPresShell(getter_AddRefs(presShell));
 +  nsIPresShell* presShell = nsnull;
 +  docShell->GetPresShell(&presShell);
    return GetAccessibleInShell(aNode, presShell, aAccessible);
  }
  
-@@ -1222,7 +1222,7 @@ NS_IMETHODIMP nsAccessibilityService::Ge
+@@ -1222,7 +1222,7 @@
    NS_ENSURE_ARG(aNode);
    NS_ENSURE_ARG(aPresShell);
  
 -  nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(aPresShell));
 +  nsIWeakReference* weakShell(do_GetWeakReference(aPresShell));
    nsIFrame *outFrameUnused = NULL;
    PRBool isHiddenUnused = false;
    return GetAccessible(aNode, aPresShell, weakShell, 
-@@ -1239,7 +1239,7 @@ NS_IMETHODIMP nsAccessibilityService::Ge
+@@ -1239,7 +1239,7 @@
    NS_ENSURE_ARG(aNode);
    NS_ENSURE_ARG(aWeakShell);
  
 -  nsCOMPtr<nsIPresShell> presShell(do_QueryReferent(aWeakShell));
 +  nsIPresShell* presShell(do_QueryReferent(aWeakShell));
    nsIFrame *outFrameUnused = NULL;
    PRBool isHiddenUnused = false;
    return GetAccessible(aNode, presShell, aWeakShell, 
-@@ -1255,11 +1255,11 @@ nsresult nsAccessibilityService::InitAcc
+@@ -1255,11 +1255,11 @@
    }
    NS_ASSERTION(aAccessibleOut && !*aAccessibleOut, "Out param should already be cleared out");
  
 -  nsCOMPtr<nsPIAccessNode> privateAccessNode = do_QueryInterface(aAccessibleIn);
 +  nsPIAccessNode* privateAccessNode = do_QueryInterface(aAccessibleIn);
    NS_ASSERTION(privateAccessNode, "All accessibles must support nsPIAccessNode");
    nsresult rv = privateAccessNode->Init(); // Add to cache, etc.
    if (NS_SUCCEEDED(rv)) {
 -    nsCOMPtr<nsPIAccessible> privateAccessible =
 +    nsPIAccessible* privateAccessible =
        do_QueryInterface(privateAccessNode);
      privateAccessible->SetRoleMapEntry(aRoleMapEntry);
      NS_ADDREF(*aAccessibleOut = aAccessibleIn);
-@@ -1328,7 +1328,7 @@ NS_IMETHODIMP nsAccessibilityService::Ge
+@@ -1328,7 +1328,7 @@
    }
  #endif
  
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(aNode));
 +  nsIContent* content(do_QueryInterface(aNode));
    if (content && content->Tag() == nsAccessibilityAtoms::map) {
      // Don't walk into maps, they take up no space.
      // The nsHTMLAreaAccessible's they contain are attached as
-@@ -1339,10 +1339,10 @@ NS_IMETHODIMP nsAccessibilityService::Ge
+@@ -1339,10 +1339,10 @@
  
    // Check to see if we already have an accessible for this
    // node in the cache
 -  nsCOMPtr<nsIAccessNode> accessNode;
 -  GetCachedAccessNode(aNode, aWeakShell, getter_AddRefs(accessNode));
 +  nsIAccessNode* accessNode = nsnull;
 +  GetCachedAccessNode(aNode, aWeakShell, &accessNode);
  
 -  nsCOMPtr<nsIAccessible> newAcc;
 +  nsIAccessible* newAcc = nsnull;
    if (accessNode) {
      // Retrieved from cache
      // QI might not succeed if it's a node that's not accessible
-@@ -1353,21 +1353,21 @@ NS_IMETHODIMP nsAccessibilityService::Ge
+@@ -1353,21 +1353,21 @@
  
    // No cache entry, so we must create the accessible
    // Check to see if hidden first
 -  nsCOMPtr<nsIDocument> nodeIsDoc;
 +  nsIDocument* nodeIsDoc = nsnull;
    if (!content) {
      // This happens when we're on the document node, which will not QI to an
      // nsIContent.
@@ -2739,105 +2739,105 @@ diff --git a/accessible/src/base/nsAcces
        NS_ASSERTION(newAcc, "nsIAccessibleDocument is not an nsIAccessible");
      }
      else {
 -      CreateRootAccessible(aPresShell, nodeIsDoc, getter_AddRefs(newAcc)); // Does Init() for us
 +      CreateRootAccessible(aPresShell, nodeIsDoc, &newAcc); // Does Init() for us
        NS_WARN_IF_FALSE(newAcc, "No root/doc accessible created");
      }
  
-@@ -1416,10 +1416,10 @@ NS_IMETHODIMP nsAccessibilityService::Ge
+@@ -1416,10 +1416,10 @@
          // Check if frame is an image frame, and content is <area>
          nsIImageFrame *imageFrame;
          CallQueryInterface(frame, &imageFrame);
 -        nsCOMPtr<nsIDOMHTMLAreaElement> areaElmt = do_QueryInterface(content);
 +        nsIDOMHTMLAreaElement* areaElmt = do_QueryInterface(content);
          if (imageFrame && areaElmt) {
 -          nsCOMPtr<nsIAccessible> imageAcc;
 -          CreateHTMLImageAccessible(frame, getter_AddRefs(imageAcc));
 +          nsIAccessible* imageAcc = nsnull;
 +          CreateHTMLImageAccessible(frame, &imageAcc);
            if (imageAcc) {
              // cache children
              PRInt32 childCount;
-@@ -1457,7 +1457,7 @@ NS_IMETHODIMP nsAccessibilityService::Ge
+@@ -1457,7 +1457,7 @@
          return NS_OK;
        }
      }
 -    frame->GetAccessible(getter_AddRefs(newAcc));
 +    frame->GetAccessible(&newAcc);
      return InitAccessible(newAcc, aAccessible, nsnull);
    }
  
-@@ -1472,7 +1472,7 @@ NS_IMETHODIMP nsAccessibilityService::Ge
+@@ -1472,7 +1472,7 @@
  
    // Elements may implement nsIAccessibleProvider via XBL. This allows them to
    // say what kind of accessible to create.
 -  nsresult rv = GetAccessibleByType(aNode, getter_AddRefs(newAcc));
 +  nsresult rv = GetAccessibleByType(aNode, &newAcc);
    NS_ENSURE_SUCCESS(rv, rv);
    
    PRBool isHTML = content->IsNodeOfType(nsINode::eHTML);
-@@ -1505,9 +1505,9 @@ NS_IMETHODIMP nsAccessibilityService::Ge
+@@ -1505,9 +1505,9 @@
          if (!tableFrame)
            continue;
          if (tableFrame->GetType() == nsAccessibilityAtoms::tableOuterFrame) {
 -          nsCOMPtr<nsIDOMNode> tableNode(do_QueryInterface(tableContent));
 -          nsCOMPtr<nsIAccessible> tableAccessible;
 -          GetAccessibleInShell(tableNode, aPresShell, getter_AddRefs(tableAccessible));
 +          nsIDOMNode* tableNode(do_QueryInterface(tableContent));
 +          nsIAccessible* tableAccessible = nsnull;
 +          GetAccessibleInShell(tableNode, aPresShell, &tableAccessible);
            if (!tableAccessible && !content->IsFocusable()) {
  #ifdef DEBUG
              nsRoleMapEntry *tableRoleMapEntry = nsAccUtils::GetRoleMapEntry(tableNode);
-@@ -1545,7 +1545,7 @@ NS_IMETHODIMP nsAccessibilityService::Ge
+@@ -1545,7 +1545,7 @@
        // we do not call it if accessibles for table related content are
        // prevented above.
        rv = CreateHTMLAccessibleByMarkup(frame, aWeakShell, aNode,
 -                                        getter_AddRefs(newAcc));
 +                                        &newAcc);
        NS_ENSURE_SUCCESS(rv, rv);
  
        if (!newAcc) {
-@@ -1562,13 +1562,13 @@ NS_IMETHODIMP nsAccessibilityService::Ge
+@@ -1562,13 +1562,13 @@
            *aIsHidden = PR_TRUE;
            return NS_OK;
          }
 -        frame->GetAccessible(getter_AddRefs(newAcc)); // Try using frame to do it
 +        frame->GetAccessible(&newAcc); // Try using frame to do it
        }
      }
    }
  
    if (!newAcc) {
 -    GetAccessibleForDeckChildren(aNode, getter_AddRefs(newAcc));
 +    GetAccessibleForDeckChildren(aNode, &newAcc);
    }
  
    // If no accessible, see if we need to create a generic accessible because
-@@ -1585,7 +1585,7 @@ NS_IMETHODIMP nsAccessibilityService::Ge
+@@ -1585,7 +1585,7 @@
      // other accessibles can point to it, or so that it can hold a state, etc.
      if (isHTML) {
        // Interesting HTML container which may have selectable text and/or embedded objects
 -      CreateHyperTextAccessible(frame, getter_AddRefs(newAcc));
 +      CreateHyperTextAccessible(frame, &newAcc);
      }
      else {  // XUL, SVG, MathML etc.
        // Interesting generic non-HTML container
-@@ -1646,7 +1646,7 @@ nsAccessibilityService::GetRelevantConte
+@@ -1646,7 +1646,7 @@
    NS_ENSURE_ARG_POINTER(aRelevantNode);
  
    nsresult rv;
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(aNode));
 +  nsIContent* content(do_QueryInterface(aNode));
    if (content) {
      // Build stack of binding parents so we can walk it in reverse.
      nsIContent *bindingParent;
-@@ -1661,15 +1661,15 @@ nsAccessibilityService::GetRelevantConte
+@@ -1661,15 +1661,15 @@
      PRInt32 bindingsCount = bindingsStack.Count();
      for (PRInt32 index = bindingsCount - 1; index >= 0 ; index--) {
        bindingParent = bindingsStack[index];
 -      nsCOMPtr<nsIDOMNode> bindingNode(do_QueryInterface(bindingParent));
 +      nsIDOMNode* bindingNode(do_QueryInterface(bindingParent));
        if (bindingNode) {
          // Try to get an accessible by type since XBL widget can be accessible
          // only if it implements nsIAccessibleProvider interface.
@@ -2847,85 +2847,85 @@ diff --git a/accessible/src/base/nsAcces
 +        rv = GetAccessibleByType(bindingNode, &accessible);
  
          if (NS_SUCCEEDED(rv)) {
 -          nsCOMPtr<nsPIAccessible> paccessible(do_QueryInterface(accessible));
 +          nsPIAccessible* paccessible(do_QueryInterface(accessible));
            if (paccessible) {
              PRBool allowsAnonChildren = PR_FALSE;
              paccessible->GetAllowsAnonChildAccessibles(&allowsAnonChildren);
-@@ -1695,7 +1695,7 @@ nsresult nsAccessibilityService::GetAcce
+@@ -1695,7 +1695,7 @@
  
    *aAccessible = nsnull;
  
 -  nsCOMPtr<nsIAccessibleProvider> accessibleProvider(do_QueryInterface(aNode));
 +  nsIAccessibleProvider* accessibleProvider(do_QueryInterface(aNode));
    if (!accessibleProvider)
      return NS_OK;
  
-@@ -1706,8 +1706,8 @@ nsresult nsAccessibilityService::GetAcce
+@@ -1706,8 +1706,8 @@
    if (type == nsIAccessibleProvider::OuterDoc)
      return CreateOuterDocAccessible(aNode, aAccessible);
  
 -  nsCOMPtr<nsIWeakReference> weakShell;
 -  GetShellFromNode(aNode, getter_AddRefs(weakShell));
 +  nsIWeakReference* weakShell = nsnull;
 +  GetShellFromNode(aNode, &weakShell);
  
    switch (type)
    {
-@@ -1742,7 +1742,7 @@ nsresult nsAccessibilityService::GetAcce
+@@ -1742,7 +1742,7 @@
      case nsIAccessibleProvider::XULImage:
      {
        // Don't include nameless images in accessible tree
 -      nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(aNode));
 +      nsIDOMElement* elt(do_QueryInterface(aNode));
        if (!elt)
          return NS_ERROR_FAILURE;
  
-@@ -1787,7 +1787,7 @@ nsresult nsAccessibilityService::GetAcce
+@@ -1787,7 +1787,7 @@
        // XXX In the future we will should this for consistency across the nsIAccessible
        // implementations on each platform for a consistent scripting environment, but
        // then strip out redundant accessibles in the nsAccessibleWrap class for each platform.
 -      nsCOMPtr<nsIContent> content = do_QueryInterface(aNode);
 +      nsIContent* content = do_QueryInterface(aNode);
        if (content) {
          nsIContent *parent = content->GetParent();
          if (parent && parent->NodeInfo()->Equals(nsAccessibilityAtoms::menu, kNameSpaceID_XUL)) {
-@@ -1943,7 +1943,7 @@ NS_IMETHODIMP nsAccessibilityService::Ad
+@@ -1943,7 +1943,7 @@
    *aRootAccessible = static_cast<nsIAccessible*>(rootAccWrap);
    NS_ADDREF(*aRootAccessible);
  
 -  nsRefPtr<nsApplicationAccessibleWrap> appRoot =
 +  nsApplicationAccessibleWrap* appRoot =
      nsAccessNode::GetApplicationAccessible();
    NS_ENSURE_STATE(appRoot);
  
-@@ -1961,7 +1961,7 @@ NS_IMETHODIMP nsAccessibilityService::Re
+@@ -1961,7 +1961,7 @@
    void* atkAccessible;
    aRootAccessible->GetNativeInterface(&atkAccessible);
  
 -  nsRefPtr<nsApplicationAccessibleWrap> appRoot =
 +  nsApplicationAccessibleWrap* appRoot =
      nsAccessNode::GetApplicationAccessible();
    NS_ENSURE_STATE(appRoot);
  
-@@ -1987,9 +1987,9 @@ NS_IMETHODIMP nsAccessibilityService::In
+@@ -1987,9 +1987,9 @@
                 "Incorrect aEvent passed in");
  
    NS_ENSURE_ARG_POINTER(aShell);
 -  nsCOMPtr<nsIAccessibleDocument> accessibleDoc =
 +  nsIAccessibleDocument* accessibleDoc =
      nsAccessNode::GetDocAccessibleFor(aShell->GetDocument());
 -  nsCOMPtr<nsPIAccessibleDocument> privateAccessibleDoc =
 +  nsPIAccessibleDocument* privateAccessibleDoc =
      do_QueryInterface(accessibleDoc);
    if (!privateAccessibleDoc) {
      return NS_OK;
-@@ -2028,15 +2028,15 @@ nsresult
+@@ -2028,15 +2028,15 @@
  nsresult
  nsAccessibilityService::GetAccessibleForDeckChildren(nsIDOMNode *aNode, nsIAccessible** aAccessible)
  {
 -  nsCOMPtr<nsIWeakReference> weakShell;
 -  GetShellFromNode(aNode, getter_AddRefs(weakShell));
 +  nsIWeakReference* weakShell = nsnull;
 +  GetShellFromNode(aNode, &weakShell);
    NS_ENSURE_TRUE(weakShell, NS_ERROR_FAILURE);
@@ -2935,45 +2935,45 @@ diff --git a/accessible/src/base/nsAcces
    
    nsIFrame* frame = nsnull;
    nsIFrame* parentFrame = nsnull;
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(aNode));
 +  nsIContent* content(do_QueryInterface(aNode));
  
    if (content) {
      frame = shell->GetPrimaryFrameFor(content);
-@@ -2048,7 +2048,7 @@ nsAccessibilityService::GetAccessibleFor
+@@ -2048,7 +2048,7 @@
      if (parentFrame && parentFrame->GetType() == nsAccessibilityAtoms::deckFrame) {
        // If deck frame is for xul:tabpanels element then the given node has
        // tabpanel accessible.
 -      nsCOMPtr<nsIContent> parentContent = parentFrame->GetContent();
 +      nsIContent* parentContent = parentFrame->GetContent();
        if (parentContent->NodeInfo()->Equals(nsAccessibilityAtoms::tabpanels,
                                              kNameSpaceID_XUL)) {
          *aAccessible = new nsXULTabpanelAccessible(aNode, weakShell);
-diff --git a/accessible/src/base/nsAccessibilityUtils.cpp b/accessible/src/base/nsAccessibilityUtils.cpp
---- a/accessible/src/base/nsAccessibilityUtils.cpp
-+++ b/accessible/src/base/nsAccessibilityUtils.cpp
-@@ -170,12 +170,12 @@ nsAccUtils::SetAccAttrsForXULSelectContr
+diff -r 332906b0e686 accessible/src/base/nsAccessibilityUtils.cpp
+--- a/accessible/src/base/nsAccessibilityUtils.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/base/nsAccessibilityUtils.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -170,12 +170,12 @@
  nsAccUtils::SetAccAttrsForXULSelectControlItem(nsIDOMNode *aNode,
                                                 nsIPersistentProperties *aAttributes)
  {
 -  nsCOMPtr<nsIDOMXULSelectControlItemElement> item(do_QueryInterface(aNode));
 +  nsIDOMXULSelectControlItemElement* item(do_QueryInterface(aNode));
    if (!item)
      return;
  
 -  nsCOMPtr<nsIDOMXULSelectControlElement> control;
 -  item->GetControl(getter_AddRefs(control));
 +  nsIDOMXULSelectControlElement* control = nsnull;
 +  item->GetControl(&control);
    if (!control)
      return;
  
-@@ -187,13 +187,13 @@ nsAccUtils::SetAccAttrsForXULSelectContr
+@@ -187,13 +187,13 @@
  
    PRUint32 setSize = itemsCount, posInSet = indexOf;
    for (PRUint32 index = 0; index < itemsCount; index++) {
 -    nsCOMPtr<nsIDOMXULSelectControlItemElement> currItem;
 -    control->GetItemAtIndex(index, getter_AddRefs(currItem));
 -    nsCOMPtr<nsIDOMNode> currNode(do_QueryInterface(currItem));
 +    nsIDOMXULSelectControlItemElement* currItem = nsnull;
 +    control->GetItemAtIndex(index, &currItem);
@@ -2982,33 +2982,33 @@ diff --git a/accessible/src/base/nsAcces
 -    nsCOMPtr<nsIAccessible> itemAcc;
 +    nsIAccessible* itemAcc = nsnull;
      nsAccessNode::GetAccService()->GetAccessibleFor(currNode,
 -                                                    getter_AddRefs(itemAcc));
 +                                                    &itemAcc);
      if (!itemAcc ||
          nsAccessible::State(itemAcc) & nsIAccessibleStates::STATE_INVISIBLE) {
        setSize--;
-@@ -209,12 +209,12 @@ nsAccUtils::SetAccAttrsForXULContainerIt
+@@ -209,12 +209,12 @@
  nsAccUtils::SetAccAttrsForXULContainerItem(nsIDOMNode *aNode,
                                             nsIPersistentProperties *aAttributes)
  {
 -  nsCOMPtr<nsIDOMXULContainerItemElement> item(do_QueryInterface(aNode));
 +  nsIDOMXULContainerItemElement* item(do_QueryInterface(aNode));
    if (!item)
      return;
  
 -  nsCOMPtr<nsIDOMXULContainerElement> container;
 -  item->GetParentContainer(getter_AddRefs(container));
 +  nsIDOMXULContainerElement* container = nsnull;
 +  item->GetParentContainer(&container);
    if (!container)
      return;
  
-@@ -228,13 +228,13 @@ nsAccUtils::SetAccAttrsForXULContainerIt
+@@ -228,13 +228,13 @@
    
    PRUint32 setSize = itemsCount, posInSet = indexOf;
    for (PRUint32 index = 0; index < itemsCount; index++) {
 -    nsCOMPtr<nsIDOMXULElement> currItem;
 -    container->GetItemAtIndex(index, getter_AddRefs(currItem));
 -    nsCOMPtr<nsIDOMNode> currNode(do_QueryInterface(currItem));
 +    nsIDOMXULElement* currItem = nsnull;
 +    container->GetItemAtIndex(index, &currItem);
@@ -3017,68 +3017,68 @@ diff --git a/accessible/src/base/nsAcces
 -    nsCOMPtr<nsIAccessible> itemAcc;
 +    nsIAccessible* itemAcc = nsnull;
      nsAccessNode::GetAccService()->GetAccessibleFor(currNode,
 -                                                    getter_AddRefs(itemAcc));
 +                                                    &itemAcc);
      if (!itemAcc ||
          nsAccessible::State(itemAcc) & nsIAccessibleStates::STATE_INVISIBLE) {
        setSize--;
-@@ -248,9 +248,9 @@ nsAccUtils::SetAccAttrsForXULContainerIt
+@@ -248,9 +248,9 @@
    while (container) {
      level++;
  
 -    nsCOMPtr<nsIDOMXULContainerElement> parentContainer;
 -    container->GetParentContainer(getter_AddRefs(parentContainer));
 -    parentContainer.swap(container);
 +    nsIDOMXULContainerElement* parentContainer = nsnull;
 +    container->GetParentContainer(&parentContainer);
 +    swap(parentContainer, container);
    }
    
    SetAccGroupAttrs(aAttributes, level, posInSet + 1, setSize);
-@@ -260,8 +260,8 @@ nsAccUtils::HasListener(nsIContent *aCon
+@@ -260,8 +260,8 @@
  nsAccUtils::HasListener(nsIContent *aContent, const nsAString& aEventType)
  {
    NS_ENSURE_TRUE(aContent, PR_FALSE);
 -  nsCOMPtr<nsIEventListenerManager> listenerManager;
 -  aContent->GetListenerManager(PR_FALSE, getter_AddRefs(listenerManager));
 +  nsIEventListenerManager* listenerManager = nsnull;
 +  aContent->GetListenerManager(PR_FALSE, &listenerManager);
  
    return listenerManager && listenerManager->HasListenersFor(aEventType);  
  }
-@@ -278,11 +278,11 @@ nsAccUtils::GetAccessKeyFor(nsIContent *
+@@ -278,11 +278,11 @@
    if (!aContent->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::accesskey))
      return 0;
  
 -  nsCOMPtr<nsIDocument> doc = aContent->GetOwnerDoc();
 +  nsIDocument* doc = aContent->GetOwnerDoc();
    if (!doc)
      return 0;
  
 -  nsCOMPtr<nsIPresShell> presShell = doc->GetPrimaryShell();
 +  nsIPresShell* presShell = doc->GetPrimaryShell();
    if (!presShell)
      return 0;
  
-@@ -305,10 +305,10 @@ nsAccUtils::FireAccEvent(PRUint32 aEvent
+@@ -305,10 +305,10 @@
  {
    NS_ENSURE_ARG(aAccessible);
  
 -  nsCOMPtr<nsPIAccessible> pAccessible(do_QueryInterface(aAccessible));
 +  nsPIAccessible* pAccessible(do_QueryInterface(aAccessible));
    NS_ASSERTION(pAccessible, "Accessible doesn't implement nsPIAccessible");
  
 -  nsCOMPtr<nsIAccessibleEvent> event =
 +  nsIAccessibleEvent* event =
      new nsAccEvent(aEventType, aAccessible, aIsAsynch);
    NS_ENSURE_TRUE(event, NS_ERROR_OUT_OF_MEMORY);
  
-@@ -321,14 +321,14 @@ nsAccUtils::IsAncestorOf(nsIDOMNode *aPo
+@@ -321,14 +321,14 @@
  {
    NS_ENSURE_TRUE(aPossibleAncestorNode && aPossibleDescendantNode, PR_FALSE);
  
 -  nsCOMPtr<nsIDOMNode> loopNode = aPossibleDescendantNode;
 -  nsCOMPtr<nsIDOMNode> parentNode;
 -  while (NS_SUCCEEDED(loopNode->GetParentNode(getter_AddRefs(parentNode))) &&
 +  nsIDOMNode* loopNode = aPossibleDescendantNode;
 +  nsIDOMNode* parentNode = nsnull;
@@ -3087,17 +3087,17 @@ diff --git a/accessible/src/base/nsAcces
      if (parentNode == aPossibleAncestorNode) {
        return PR_TRUE;
      }
 -    loopNode.swap(parentNode);
 +    swap(loopNode, parentNode);
    }
    return PR_FALSE;
  }
-@@ -339,20 +339,20 @@ nsAccUtils::AreSiblings(nsIDOMNode *aDOM
+@@ -339,20 +339,20 @@
  {
    NS_ENSURE_TRUE(aDOMNode1 && aDOMNode2, PR_FALSE);
  
 -  nsCOMPtr<nsIDOMNode> parentNode1, parentNode2;
 -  if (NS_SUCCEEDED(aDOMNode1->GetParentNode(getter_AddRefs(parentNode1))) &&
 -      NS_SUCCEEDED(aDOMNode2->GetParentNode(getter_AddRefs(parentNode2))) &&
 +  nsIDOMNode* parentNode1 = nsnull, *parentNode2 = nsnull;
 +  if (NS_SUCCEEDED(aDOMNode1->GetParentNode(&parentNode1)) &&
@@ -3114,93 +3114,93 @@ diff --git a/accessible/src/base/nsAcces
  {
 -  nsCOMPtr<nsIAccessible> parentAccessible = aDescendant, testRoleAccessible;
 -  while (NS_SUCCEEDED(parentAccessible->GetParent(getter_AddRefs(testRoleAccessible))) &&
 +  nsIAccessible* parentAccessible = aDescendant, *testRoleAccessible = nsnull;
 +  while (NS_SUCCEEDED(parentAccessible->GetParent(&testRoleAccessible)) &&
           testRoleAccessible) {
      PRUint32 testRole;
      testRoleAccessible->GetFinalRole(&testRole);
-@@ -361,11 +361,11 @@ nsAccUtils::GetAncestorWithRole(nsIAcces
+@@ -361,11 +361,11 @@
        NS_ADDREF(returnAccessible);
        return returnAccessible;
      }
 -    nsCOMPtr<nsIAccessibleDocument> docAccessible = do_QueryInterface(testRoleAccessible);
 +    nsIAccessibleDocument* docAccessible = do_QueryInterface(testRoleAccessible);
      if (docAccessible) {
        break;
      }
 -    parentAccessible.swap(testRoleAccessible);
 +    swap(parentAccessible, testRoleAccessible);
    }
    return nsnull;
  }
-@@ -383,11 +383,11 @@ nsAccUtils::GetARIATreeItemParent(nsIAcc
+@@ -383,11 +383,11 @@
      PRInt32 success;
      level = levelStr.ToInteger(&success);
      if (level > 1 && NS_SUCCEEDED(success)) {
 -      nsCOMPtr<nsIAccessible> currentAccessible = aStartTreeItem, prevAccessible;
 +      nsIAccessible* currentAccessible = aStartTreeItem, *prevAccessible = nsnull;
        while (PR_TRUE) {
 -        currentAccessible->GetPreviousSibling(getter_AddRefs(prevAccessible));
 -        currentAccessible.swap(prevAccessible);
 -        nsCOMPtr<nsIAccessNode> accessNode = do_QueryInterface(currentAccessible);
 +        currentAccessible->GetPreviousSibling(&prevAccessible);
 +        swap(currentAccessible, prevAccessible);
 +        nsIAccessNode* accessNode = do_QueryInterface(currentAccessible);
          if (!accessNode) {
            break; // Reached top of tree, no higher level found
          }
-@@ -395,9 +395,9 @@ nsAccUtils::GetARIATreeItemParent(nsIAcc
+@@ -395,9 +395,9 @@
          currentAccessible->GetFinalRole(&role);
          if (role != nsIAccessibleRole::ROLE_OUTLINEITEM)
            continue;
 -        nsCOMPtr<nsIDOMNode> treeItemNode;
 -        accessNode->GetDOMNode(getter_AddRefs(treeItemNode));
 -        nsCOMPtr<nsIContent> treeItemContent = do_QueryInterface(treeItemNode);
 +        nsIDOMNode* treeItemNode = nsnull;
 +        accessNode->GetDOMNode(&treeItemNode);
 +        nsIContent* treeItemContent = do_QueryInterface(treeItemNode);
          if (treeItemContent &&
              treeItemContent->GetAttr(kNameSpaceID_None,
                                       nsAccessibilityAtoms::aria_level, levelStr)) {
-@@ -414,8 +414,8 @@ nsAccUtils::GetARIATreeItemParent(nsIAcc
+@@ -414,8 +414,8 @@
    // In this case the parent of the tree item will be a group and the
    // previous sibling of that should be the tree item parent.
    // Or, if the parent is something other than a tree we will return that.
 -  nsCOMPtr<nsIAccessible> parentAccessible;
 -  aStartTreeItem->GetParent(getter_AddRefs(parentAccessible));
 +  nsIAccessible* parentAccessible = nsnull;
 +  aStartTreeItem->GetParent(&parentAccessible);
    if (!parentAccessible)
      return;
    PRUint32 role;
-@@ -424,8 +424,8 @@ nsAccUtils::GetARIATreeItemParent(nsIAcc
+@@ -424,8 +424,8 @@
      NS_ADDREF(*aTreeItemParentResult = parentAccessible);
      return; // The container for the tree items
    }
 -  nsCOMPtr<nsIAccessible> prevAccessible;
 -  parentAccessible->GetPreviousSibling(getter_AddRefs(prevAccessible));
 +  nsIAccessible* prevAccessible = nsnull;
 +  parentAccessible->GetPreviousSibling(&prevAccessible);
    if (!prevAccessible)
      return;
    prevAccessible->GetFinalRole(&role);
-@@ -433,8 +433,8 @@ nsAccUtils::GetARIATreeItemParent(nsIAcc
+@@ -433,8 +433,8 @@
      // XXX Sometimes an empty text accessible is in the hierarchy here,
      // although the text does not appear to be rendered, GetRenderedText() says that it is
      // so we need to skip past it to find the true previous sibling
 -    nsCOMPtr<nsIAccessible> tempAccessible = prevAccessible;
 -    tempAccessible->GetPreviousSibling(getter_AddRefs(prevAccessible));
 +    nsIAccessible* tempAccessible = prevAccessible;
 +    tempAccessible->GetPreviousSibling(&prevAccessible);
      if (!prevAccessible)
        return;
      prevAccessible->GetFinalRole(&role);
-@@ -469,21 +469,21 @@ nsAccUtils::ScrollSubstringTo(nsIFrame *
+@@ -469,21 +469,21 @@
  
    nsPresContext *presContext = aFrame->PresContext();
  
 -  nsCOMPtr<nsIDOMRange> scrollToRange = do_CreateInstance(kRangeCID);
 +  nsIDOMRange* scrollToRange = do_CreateInstance(kRangeCID);
    NS_ENSURE_TRUE(scrollToRange, NS_ERROR_FAILURE);
  
 -  nsCOMPtr<nsISelectionController> selCon;
@@ -3218,17 +3218,17 @@ diff --git a/accessible/src/base/nsAcces
 -                       getter_AddRefs(selection1));
 +                       &selection1);
  
 -  nsCOMPtr<nsISelection2> selection(do_QueryInterface(selection1));
 +  nsISelection2* selection(do_QueryInterface(selection1));
    if (selection) {
      selection->RemoveAllRanges();
      selection->AddRange(scrollToRange);
-@@ -633,20 +633,20 @@ nsAccUtils::GetScreenCoordsForWindow(nsI
+@@ -633,20 +633,20 @@
  nsAccUtils::GetScreenCoordsForWindow(nsIDOMNode *aNode)
  {
    nsIntPoint coords(0, 0);
 -  nsCOMPtr<nsIDocShellTreeItem> treeItem(GetDocShellTreeItemFor(aNode));
 +  nsIDocShellTreeItem* treeItem(GetDocShellTreeItemFor(aNode));
    if (!treeItem)
      return coords;
  
@@ -3247,28 +3247,28 @@ diff --git a/accessible/src/base/nsAcces
 -  docView->GetDefaultView(getter_AddRefs(abstractView));
 -  nsCOMPtr<nsIDOMWindowInternal> windowInter(do_QueryInterface(abstractView));
 +  nsIDOMAbstractView* abstractView = nsnull;
 +  docView->GetDefaultView(&abstractView);
 +  nsIDOMWindowInternal* windowInter(do_QueryInterface(abstractView));
    if (!windowInter)
      return coords;
  
-@@ -658,8 +658,8 @@ nsIntPoint
+@@ -658,8 +658,8 @@
  nsIntPoint
  nsAccUtils::GetScreenCoordsForWindow(nsIAccessNode *aAccessNode)
  {
 -  nsCOMPtr<nsIDOMNode> DOMNode;
 -  aAccessNode->GetDOMNode(getter_AddRefs(DOMNode));
 +  nsIDOMNode* DOMNode = nsnull;
 +  aAccessNode->GetDOMNode(&DOMNode);
    if (DOMNode)
      return GetScreenCoordsForWindow(DOMNode);
  
-@@ -669,15 +669,15 @@ nsIntPoint
+@@ -669,15 +669,15 @@
  nsIntPoint
  nsAccUtils::GetScreenCoordsForParent(nsIAccessNode *aAccessNode)
  {
 -  nsCOMPtr<nsPIAccessNode> parent;
 -  nsCOMPtr<nsIAccessible> accessible(do_QueryInterface(aAccessNode));
 +  nsPIAccessNode* parent = nsnull;
 +  nsIAccessible* accessible(do_QueryInterface(aAccessNode));
    if (accessible) {
@@ -3280,17 +3280,17 @@ diff --git a/accessible/src/base/nsAcces
    } else {
 -    nsCOMPtr<nsIAccessNode> parentAccessNode;
 -    aAccessNode->GetParentNode(getter_AddRefs(parentAccessNode));
 +    nsIAccessNode* parentAccessNode = nsnull;
 +    aAccessNode->GetParentNode(&parentAccessNode);
      parent = do_QueryInterface(parentAccessNode);
    }
  
-@@ -692,22 +692,22 @@ nsAccUtils::GetScreenCoordsForParent(nsI
+@@ -692,22 +692,22 @@
    return nsIntPoint(parentRect.x, parentRect.y);
  }
  
 -already_AddRefed<nsIDocShellTreeItem>
 +nsIDocShellTreeItem*
  nsAccUtils::GetDocShellTreeItemFor(nsIDOMNode *aNode)
  {
    if (!aNode)
@@ -3308,26 +3308,26 @@ diff --git a/accessible/src/base/nsAcces
    NS_ASSERTION(doc, "No document for node passed in");
    NS_ENSURE_TRUE(doc, nsnull);
  
 -  nsCOMPtr<nsISupports> container = doc->GetContainer();
 +  nsISupports* container = doc->GetContainer();
    nsIDocShellTreeItem *docShellTreeItem = nsnull;
    if (container)
      CallQueryInterface(container, &docShellTreeItem);
-@@ -749,7 +749,7 @@ nsAccUtils::FindNeighbourPointingToNode(
+@@ -749,7 +749,7 @@
                                          nsIAtom *aTagName,
                                          PRUint32 aAncestorLevelsToSearch)
  {
 -  nsCOMPtr<nsIContent> binding;
 +  nsIContent* binding = nsnull;
    nsAutoString controlID;
    if (!nsAccUtils::GetID(aForNode, controlID)) {
      binding = aForNode->GetBindingParent();
-@@ -772,14 +772,14 @@ nsAccUtils::FindNeighbourPointingToNode(
+@@ -772,14 +772,14 @@
      if (aForNode == binding) {
        // When we reach the binding parent, make sure to check
        // all of its anonymous child subtrees
 -      nsCOMPtr<nsIDocument> doc = aForNode->GetCurrentDoc();
 -      nsCOMPtr<nsIDOMDocumentXBL> xblDoc(do_QueryInterface(doc));
 +      nsIDocument* doc = aForNode->GetCurrentDoc();
 +      nsIDOMDocumentXBL* xblDoc(do_QueryInterface(doc));
        if (!xblDoc)
@@ -3337,150 +3337,150 @@ diff --git a/accessible/src/base/nsAcces
 -      nsCOMPtr<nsIDOMElement> forElm(do_QueryInterface(aForNode));
 -      xblDoc->GetAnonymousNodes(forElm, getter_AddRefs(nodes));
 +      nsIDOMNodeList* nodes = nsnull;
 +      nsIDOMElement* forElm(do_QueryInterface(aForNode));
 +      xblDoc->GetAnonymousNodes(forElm, &nodes);
        if (!nodes)
          return nsnull;
  
-@@ -789,12 +789,12 @@ nsAccUtils::FindNeighbourPointingToNode(
+@@ -789,12 +789,12 @@
          return nsnull;
  
        for (PRUint32 index = 0; index < length && !labelContent; index++) {
 -        nsCOMPtr<nsIDOMNode> node;
 -        rv = nodes->Item(index, getter_AddRefs(node));
 +        nsIDOMNode* node = nsnull;
 +        rv = nodes->Item(index, &node);
          if (NS_FAILED(rv))
            return nsnull;
  
 -        nsCOMPtr<nsIContent> content = do_QueryInterface(node);
 +        nsIContent* content = do_QueryInterface(node);
          if (!content)
            return nsnull;
  
-diff --git a/accessible/src/base/nsAccessibilityUtils.h b/accessible/src/base/nsAccessibilityUtils.h
---- a/accessible/src/base/nsAccessibilityUtils.h
-+++ b/accessible/src/base/nsAccessibilityUtils.h
-@@ -161,7 +161,7 @@ public:
+diff -r 332906b0e686 accessible/src/base/nsAccessibilityUtils.h
+--- a/accessible/src/base/nsAccessibilityUtils.h	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/base/nsAccessibilityUtils.h	Fri Jul 04 01:35:36 2008 -0700
+@@ -161,7 +161,7 @@
      * @param aRole Role to find matching ancestor for
      * @return The ancestor accessible with the given role, or nsnull if no match is found
      */
 -   static already_AddRefed<nsIAccessible>
 +   static nsIAccessible*
       GetAncestorWithRole(nsIAccessible *aDescendant, PRUint32 aRole);
  
     /**
-@@ -283,7 +283,7 @@ public:
+@@ -283,7 +283,7 @@
    /**
     * Return document shell tree item for the given DOM node.
     */
 -  static already_AddRefed<nsIDocShellTreeItem>
 +  static nsIDocShellTreeItem*
      GetDocShellTreeItemFor(nsIDOMNode *aNode);
  
    /**
-diff --git a/accessible/src/base/nsAccessible.cpp b/accessible/src/base/nsAccessible.cpp
---- a/accessible/src/base/nsAccessible.cpp
-+++ b/accessible/src/base/nsAccessible.cpp
-@@ -202,7 +202,7 @@ nsresult nsAccessible::QueryInterface(RE
+diff -r 332906b0e686 accessible/src/base/nsAccessible.cpp
+--- a/accessible/src/base/nsAccessible.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/base/nsAccessible.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -202,7 +202,7 @@
    }
  
    if (aIID.Equals(NS_GET_IID(nsIAccessibleSelectable))) {
 -    nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +    nsIContent* content(do_QueryInterface(mDOMNode));
      if (!content) {
        return NS_ERROR_FAILURE; // This accessible has been shut down
      }
-@@ -231,8 +231,8 @@ nsresult nsAccessible::QueryInterface(RE
+@@ -231,8 +231,8 @@
    }                       
  
    if (aIID.Equals(NS_GET_IID(nsIAccessibleHyperLink))) {
 -    nsCOMPtr<nsIAccessible> parent(GetParent());
 -    nsCOMPtr<nsIAccessibleHyperText> hyperTextParent(do_QueryInterface(parent));
 +    nsIAccessible* parent(GetParent());
 +    nsIAccessibleHyperText* hyperTextParent(do_QueryInterface(parent));
      if (hyperTextParent) {
        *aInstancePtr = static_cast<nsIAccessibleHyperLink*>(this);
        NS_ADDREF_THIS();
-@@ -285,7 +285,7 @@ NS_IMETHODIMP nsAccessible::GetName(nsAS
+@@ -285,7 +285,7 @@
  NS_IMETHODIMP nsAccessible::GetName(nsAString& aName)
  {
    aName.Truncate();
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
    if (!content) {
      return NS_ERROR_FAILURE;  // Node shut down
    }
-@@ -311,7 +311,7 @@ NS_IMETHODIMP nsAccessible::GetDescripti
+@@ -311,7 +311,7 @@
    // 2. It has no DHTML describedby property
    // 3. it doesn't have an accName; or
    // 4. its title attribute already equals to its accName nsAutoString name; 
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
    if (!content) {
      return NS_ERROR_FAILURE;  // Node shut down
    }
-@@ -363,7 +363,7 @@ static PRInt32
+@@ -363,7 +363,7 @@
  static PRInt32
  GetAccessModifierMask(nsIContent* aContent)
  {
 -  nsCOMPtr<nsIPrefBranch> prefBranch =
 +  nsIPrefBranch* prefBranch =
      do_GetService(NS_PREFSERVICE_CONTRACTID);
    if (!prefBranch)
      return 0;
-@@ -382,13 +382,13 @@ GetAccessModifierMask(nsIContent* aConte
+@@ -382,13 +382,13 @@
    }
  
    // get the docShell to this DOMNode, return 0 on failure
 -  nsCOMPtr<nsIDocument> document = aContent->GetCurrentDoc();
 +  nsIDocument* document = aContent->GetCurrentDoc();
    if (!document)
      return 0;
 -  nsCOMPtr<nsISupports> container = document->GetContainer();
 +  nsISupports* container = document->GetContainer();
    if (!container)
      return 0;
 -  nsCOMPtr<nsIDocShellTreeItem> treeItem(do_QueryInterface(container));
 +  nsIDocShellTreeItem* treeItem(do_QueryInterface(container));
    if (!treeItem)
      return 0;
  
-@@ -414,7 +414,7 @@ nsAccessible::GetKeyboardShortcut(nsAStr
+@@ -414,7 +414,7 @@
  {
    aAccessKey.Truncate();
  
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
    if (!content)
      return NS_ERROR_FAILURE;
  
-@@ -422,8 +422,8 @@ nsAccessible::GetKeyboardShortcut(nsAStr
+@@ -422,8 +422,8 @@
    if (!key && content->IsNodeOfType(nsIContent::eELEMENT)) {
      // Copy access key from label node unless it is labeled
      // via an ancestor <label>, in which case that would be redundant
 -    nsCOMPtr<nsIContent> labelContent(GetLabelContent(content));
 -    nsCOMPtr<nsIDOMNode> labelNode = do_QueryInterface(labelContent);
 +    nsIContent* labelContent(GetLabelContent(content));
 +    nsIDOMNode* labelNode = do_QueryInterface(labelContent);
      if (labelNode && !nsAccUtils::IsAncestorOf(labelNode, mDOMNode))
        key = nsAccUtils::GetAccessKeyFor(labelContent);
    }
-@@ -464,7 +464,7 @@ NS_IMETHODIMP nsAccessible::SetParent(ns
+@@ -464,7 +464,7 @@
      // may be a dom node which wasn't previously accessible but now is.
      // The old parent's children now need to be invalidated, since 
      // it no longer owns the child, the new parent does
 -    nsCOMPtr<nsPIAccessible> privOldParent = do_QueryInterface(mParent);
 +    nsPIAccessible* privOldParent = do_QueryInterface(mParent);
      if (privOldParent) {
        privOldParent->InvalidateChildren();
      }
-@@ -494,19 +494,19 @@ nsIContent *nsAccessible::GetRoleContent
+@@ -494,19 +494,19 @@
    // For non-document accessibles, this is the associated content node.
    // For doc accessibles, use the <body>/<frameset> if it's HTML.
    // For any other doc accessible , this is the document element.
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(aDOMNode));
 +  nsIContent* content(do_QueryInterface(aDOMNode));
    if (!content) {
 -    nsCOMPtr<nsIDOMDocument> domDoc(do_QueryInterface(aDOMNode));
 +    nsIDOMDocument* domDoc(do_QueryInterface(aDOMNode));
@@ -3497,44 +3497,44 @@ diff --git a/accessible/src/base/nsAcces
        else {
 -        nsCOMPtr<nsIDOMElement> docElement;
 -        domDoc->GetDocumentElement(getter_AddRefs(docElement));
 +        nsIDOMElement* docElement = nsnull;
 +        domDoc->GetDocumentElement(&docElement);
          content = do_QueryInterface(docElement);
        }
      }
-@@ -522,7 +522,7 @@ NS_IMETHODIMP nsAccessible::Shutdown()
+@@ -522,7 +522,7 @@
    // sure none of it's children point to this parent
    InvalidateChildren();
    if (mParent) {
 -    nsCOMPtr<nsPIAccessible> privateParent(do_QueryInterface(mParent));
 +    nsPIAccessible* privateParent(do_QueryInterface(mParent));
      privateParent->InvalidateChildren();
      mParent = nsnull;
    }
-@@ -561,7 +561,7 @@ NS_IMETHODIMP nsAccessible::GetParent(ns
+@@ -561,7 +561,7 @@
      return rv;
    }
  
 -  nsCOMPtr<nsIAccessibleDocument> docAccessible(GetDocAccessible());
 +  nsIAccessibleDocument* docAccessible(GetDocAccessible());
    NS_ENSURE_TRUE(docAccessible, NS_ERROR_FAILURE);
  
    return docAccessible->GetAccessibleInParentChain(mDOMNode, PR_TRUE, aParent);
-@@ -598,7 +598,7 @@ NS_IMETHODIMP nsAccessible::GetNextSibli
+@@ -598,7 +598,7 @@
      return NS_ERROR_FAILURE;
    }
    if (!mParent) {
 -    nsCOMPtr<nsIAccessible> parent(GetParent());
 +    nsIAccessible* parent(GetParent());
      if (parent) {
        PRInt32 numChildren;
        parent->GetChildCount(&numChildren);  // Make sure we cache all of the children
-@@ -627,16 +627,16 @@ NS_IMETHODIMP nsAccessible::GetPreviousS
+@@ -627,16 +627,16 @@
      return NS_ERROR_FAILURE;
    }
  
 -  nsCOMPtr<nsIAccessible> parent;
 -  if (NS_FAILED(GetParent(getter_AddRefs(parent))) || !parent) {
 +  nsIAccessible* parent = nsnull;
 +  if (NS_FAILED(GetParent(&parent)) || !parent) {
      return NS_ERROR_FAILURE;
@@ -3546,63 +3546,63 @@ diff --git a/accessible/src/base/nsAcces
 +  parent->GetFirstChild(&testAccessible);
    while (testAccessible && this != testAccessible) {
      prevSibling = testAccessible;
 -    prevSibling->GetNextSibling(getter_AddRefs(testAccessible));
 +    prevSibling->GetNextSibling(&testAccessible);
    }
  
    if (!prevSibling) {
-@@ -657,10 +657,10 @@ NS_IMETHODIMP nsAccessible::GetFirstChil
+@@ -657,10 +657,10 @@
    GetChildCount(&numChildren);  // Make sure we cache all of the children
  
  #ifdef DEBUG
 -  nsCOMPtr<nsPIAccessible> firstChild(do_QueryInterface(mFirstChild));
 +  nsPIAccessible* firstChild(do_QueryInterface(mFirstChild));
    if (firstChild) {
 -    nsCOMPtr<nsIAccessible> realParent;
 -    firstChild->GetCachedParent(getter_AddRefs(realParent));
 +    nsIAccessible* realParent = nsnull;
 +    firstChild->GetCachedParent(&realParent);
      NS_ASSERTION(!realParent || realParent == this,
                   "Two accessibles have the same first child accessible.");
    }
-@@ -694,7 +694,7 @@ NS_IMETHODIMP nsAccessible::GetChildAt(P
+@@ -694,7 +694,7 @@
      aChildNum = numChildren - 1;
    }
  
 -  nsCOMPtr<nsIAccessible> current(mFirstChild), nextSibling;
 +  nsIAccessible* current(mFirstChild), *nextSibling = nsnull;
    PRInt32 index = 0;
  
    while (current) {
-@@ -702,7 +702,7 @@ NS_IMETHODIMP nsAccessible::GetChildAt(P
+@@ -702,7 +702,7 @@
      if (++index > aChildNum) {
        break;
      }
 -    nextSibling->GetNextSibling(getter_AddRefs(current));
 +    nextSibling->GetNextSibling(&current);
    }
  
    NS_IF_ADDREF(*aChild = nextSibling);
-@@ -714,11 +714,11 @@ NS_IMETHODIMP nsAccessible::GetChildren(
+@@ -714,11 +714,11 @@
  NS_IMETHODIMP nsAccessible::GetChildren(nsIArray **aOutChildren)
  {
    *aOutChildren = nsnull;
 -  nsCOMPtr<nsIMutableArray> children = do_CreateInstance(NS_ARRAY_CONTRACTID);
 +  nsIMutableArray* children = do_CreateInstance(NS_ARRAY_CONTRACTID);
    if (!children)
      return NS_ERROR_FAILURE;
  
 -  nsCOMPtr<nsIAccessible> curChild;
 +  nsIAccessible* curChild = nsnull;
    while (NextChild(curChild)) {
      children->AppendElement(curChild, PR_FALSE);
    }
-@@ -727,14 +727,14 @@ NS_IMETHODIMP nsAccessible::GetChildren(
+@@ -727,14 +727,14 @@
    return NS_OK;
  }
  
 -nsIAccessible *nsAccessible::NextChild(nsCOMPtr<nsIAccessible>& aAccessible)
 +nsIAccessible *nsAccessible::NextChild(nsIAccessible*& aAccessible)
  {
 -  nsCOMPtr<nsIAccessible> nextChild;
 +  nsIAccessible* nextChild = nsnull;
@@ -3611,26 +3611,26 @@ diff --git a/accessible/src/base/nsAcces
 +    GetFirstChild(&nextChild);
    }
    else {
 -    aAccessible->GetNextSibling(getter_AddRefs(nextChild));
 +    aAccessible->GetNextSibling(&nextChild);
    }
    return (aAccessible = nextChild);
  }
-@@ -757,7 +757,7 @@ void nsAccessible::CacheChildren()
+@@ -757,7 +757,7 @@
      // a text node, because text nodes aren't in the frame map.
      walker.mState.frame = GetFrame();
  
 -    nsCOMPtr<nsPIAccessible> privatePrevAccessible;
 +    nsPIAccessible* privatePrevAccessible = nsnull;
      PRInt32 childCount = 0;
      walker.GetFirstChild();
      SetFirstChild(walker.mState.accessible);
-@@ -795,14 +795,14 @@ NS_IMETHODIMP nsAccessible::GetIndexInPa
+@@ -795,14 +795,14 @@
      return NS_ERROR_FAILURE;
    }
  
 -  nsCOMPtr<nsIAccessible> parent;
 -  GetParent(getter_AddRefs(parent));
 +  nsIAccessible* parent = nsnull;
 +  GetParent(&parent);
    if (!parent) {
@@ -3639,59 +3639,59 @@ diff --git a/accessible/src/base/nsAcces
  
 -  nsCOMPtr<nsIAccessible> sibling;
 -  parent->GetFirstChild(getter_AddRefs(sibling));
 +  nsIAccessible* sibling = nsnull;
 +  parent->GetFirstChild(&sibling);
    if (!sibling) {
      return NS_ERROR_FAILURE;
    }
-@@ -815,8 +815,8 @@ NS_IMETHODIMP nsAccessible::GetIndexInPa
+@@ -815,8 +815,8 @@
        return NS_ERROR_FAILURE;
  
      ++*aIndexInParent;
 -    nsCOMPtr<nsIAccessible> tempAccessible;
 -    sibling->GetNextSibling(getter_AddRefs(tempAccessible));
 +    nsIAccessible* tempAccessible = nsnull;
 +    sibling->GetNextSibling(&tempAccessible);
      sibling = tempAccessible;
    }
  
-@@ -891,7 +891,7 @@ PRBool nsAccessible::IsVisible(PRBool *a
+@@ -891,7 +891,7 @@
  
    const PRUint16 kMinPixels  = 12;
     // Set up the variables we need, return false if we can't get at them all
 -  nsCOMPtr<nsIPresShell> shell(GetPresShell());
 +  nsIPresShell* shell(GetPresShell());
    if (!shell) 
      return PR_FALSE;
  
-@@ -976,9 +976,9 @@ PRBool nsAccessible::IsVisible(PRBool *a
+@@ -976,9 +976,9 @@
    // nsRectVisibility_kLeftOfViewport, 
    // nsRectVisibility_kRightOfViewport
    // This view says it is visible, but we need to check the parent view chain :(
 -  nsCOMPtr<nsIDOMDocument> domDoc;
 -  mDOMNode->GetOwnerDocument(getter_AddRefs(domDoc));
 -  nsCOMPtr<nsIDocument> doc(do_QueryInterface(domDoc));
 +  nsIDOMDocument* domDoc = nsnull;
 +  mDOMNode->GetOwnerDocument(&domDoc);
 +  nsIDocument* doc(do_QueryInterface(domDoc));
    if (!doc)  {
      return PR_FALSE;
    }
-@@ -1005,7 +1005,7 @@ nsAccessible::GetState(PRUint32 *aState,
+@@ -1005,7 +1005,7 @@
    if (aExtraState)
      *aExtraState = 0;
  
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
    if (!content) {
      return NS_OK;  // On document, this is not an error
    }
-@@ -1064,20 +1064,20 @@ nsAccessible::GetState(PRUint32 *aState,
+@@ -1064,20 +1064,20 @@
    /* readonly attribute boolean focusedChild; */
  NS_IMETHODIMP nsAccessible::GetFocusedChild(nsIAccessible **aFocusedChild) 
  { 
 -  nsCOMPtr<nsIAccessible> focusedChild;
 +  nsIAccessible* focusedChild = nsnull;
    if (gLastFocusedNode == mDOMNode) {
      focusedChild = this;
    }
@@ -3707,42 +3707,42 @@ diff --git a/accessible/src/base/nsAcces
      if (focusedChild) {
 -      nsCOMPtr<nsIAccessible> focusedParentAccessible;
 -      focusedChild->GetParent(getter_AddRefs(focusedParentAccessible));
 +      nsIAccessible* focusedParentAccessible = nsnull;
 +      focusedChild->GetParent(&focusedParentAccessible);
        if (focusedParentAccessible != this) {
          focusedChild = nsnull;
        }
-@@ -1102,7 +1102,7 @@ nsAccessible::GetChildAtPoint(PRInt32 aX
+@@ -1102,7 +1102,7 @@
  
    // If we can't find the point in a child, we will return the fallback answer:
    // we return |this| if the point is within it, otherwise nsnull
 -  nsCOMPtr<nsIAccessible> fallbackAnswer;
 +  nsIAccessible* fallbackAnswer = nsnull;
    PRInt32 x, y, width, height;
    GetBounds(&x, &y, &width, &height);
    if (aX >= x && aX < x + width &&
-@@ -1120,12 +1120,12 @@ nsAccessible::GetChildAtPoint(PRInt32 aX
+@@ -1120,12 +1120,12 @@
    // therefore accessible for containing block may be different from accessible
    // for DOM parent but GetFrameForPoint() should be called for containing block
    // to get an out of flow element.
 -  nsCOMPtr<nsIAccessibleDocument> accDocument;
 -  nsresult rv = GetAccessibleDocument(getter_AddRefs(accDocument));
 +  nsIAccessibleDocument* accDocument = nsnull;
 +  nsresult rv = GetAccessibleDocument(&accDocument);
    NS_ENSURE_SUCCESS(rv, rv);
    NS_ENSURE_TRUE(accDocument, NS_ERROR_FAILURE);
  
 -  nsCOMPtr<nsPIAccessNode> accessNodeDocument(do_QueryInterface(accDocument));
 +  nsPIAccessNode* accessNodeDocument(do_QueryInterface(accDocument));
    NS_ASSERTION(accessNodeDocument,
                 "nsIAccessibleDocument doesn't implement nsPIAccessNode");
  
-@@ -1138,31 +1138,31 @@ nsAccessible::GetChildAtPoint(PRInt32 aX
+@@ -1138,31 +1138,31 @@
    nsPoint offset(presContext->DevPixelsToAppUnits(aX - screenRect.x),
                   presContext->DevPixelsToAppUnits(aY - screenRect.y));
  
 -  nsCOMPtr<nsIPresShell> presShell = presContext->PresShell();
 +  nsIPresShell* presShell = presContext->PresShell();
    nsIFrame *foundFrame = presShell->GetFrameForPoint(frame, offset);
 -  nsCOMPtr<nsIContent> content;
 +  nsIContent* content = nsnull;
@@ -3773,56 +3773,56 @@ diff --git a/accessible/src/base/nsAcces
      // No accessible for the node with the point, so find the first
      // accessible in the DOM parent chain
      accDocument->GetAccessibleInParentChain(relevantNode, PR_TRUE,
 -                                            getter_AddRefs(accessible));
 +                                            &accessible);
      if (!accessible) {
        NS_IF_ADDREF(*aAccessible = fallbackAnswer);
        return NS_OK;
-@@ -1174,7 +1174,7 @@ nsAccessible::GetChildAtPoint(PRInt32 aX
+@@ -1174,7 +1174,7 @@
      // the are within this point.
      // This takes care of cases where layout won't walk into
      // things for us, such as image map areas and sub documents
 -    nsCOMPtr<nsIAccessible> child;
 +    nsIAccessible* child = nsnull;
      while (NextChild(child)) {
        PRInt32 childX, childY, childWidth, childHeight;
        child->GetBounds(&childX, &childY, &childWidth, &childHeight);
-@@ -1190,9 +1190,9 @@ nsAccessible::GetChildAtPoint(PRInt32 aX
+@@ -1190,9 +1190,9 @@
      // We are allowed to return |this| as the answer
    }
    else {
 -    nsCOMPtr<nsIAccessible> parent;
 +    nsIAccessible* parent = nsnull;
      while (PR_TRUE) {
 -      accessible->GetParent(getter_AddRefs(parent));
 +      accessible->GetParent(&parent);
        if (!parent) {
          // Reached the top of the hierarchy
          // these bounds were inside an accessible that is not a descendant of this one
-@@ -1204,7 +1204,7 @@ nsAccessible::GetChildAtPoint(PRInt32 aX
+@@ -1204,7 +1204,7 @@
          // child we want to return
          break;
        }
 -      accessible.swap(parent);
 +      swap(accessible, parent);
      }
    }
  
-@@ -1247,7 +1247,7 @@ void nsAccessible::GetBoundsRect(nsRect&
+@@ -1247,7 +1247,7 @@
    }
  
    nsIFrame *iterFrame = firstFrame;
 -  nsCOMPtr<nsIContent> firstContent(do_QueryInterface(mDOMNode));
 +  nsIContent* firstContent(do_QueryInterface(mDOMNode));
    nsIContent* iterContent = firstContent;
    PRInt32 depth = 0;
  
-@@ -1356,15 +1356,15 @@ nsIFrame* nsAccessible::GetBoundsFrame()
+@@ -1356,15 +1356,15 @@
    return GetFrame();
  }
  
 -already_AddRefed<nsIAccessible>
 +nsIAccessible*
  nsAccessible::GetMultiSelectFor(nsIDOMNode *aNode)
  {
    NS_ENSURE_TRUE(aNode, nsnull);
@@ -3832,218 +3832,218 @@ diff --git a/accessible/src/base/nsAcces
    NS_ENSURE_TRUE(accService, nsnull);
 -  nsCOMPtr<nsIAccessible> accessible;
 -  accService->GetAccessibleFor(aNode, getter_AddRefs(accessible));
 +  nsIAccessible* accessible = nsnull;
 +  accService->GetAccessibleFor(aNode, &accessible);
    if (!accessible) {
      return nsnull;
    }
-@@ -1377,7 +1377,7 @@ nsAccessible::GetMultiSelectFor(nsIDOMNo
+@@ -1377,7 +1377,7 @@
    PRUint32 containerRole;
    while (0 == (state & nsIAccessibleStates::STATE_MULTISELECTABLE)) {
      nsIAccessible *current = accessible;
 -    current->GetParent(getter_AddRefs(accessible));
 +    current->GetParent(&accessible);
      if (!accessible || (NS_SUCCEEDED(accessible->GetFinalRole(&containerRole)) &&
                          containerRole == nsIAccessibleRole::ROLE_PANE)) {
        return nsnull;
-@@ -1385,7 +1385,7 @@ nsAccessible::GetMultiSelectFor(nsIDOMNo
+@@ -1385,7 +1385,7 @@
      state = State(accessible);
    }
    nsIAccessible *returnAccessible = nsnull;
 -  accessible.swap(returnAccessible);
 +  swap(accessible, returnAccessible);
    return returnAccessible;
  }
  
-@@ -1399,11 +1399,11 @@ NS_IMETHODIMP nsAccessible::SetSelected(
+@@ -1399,11 +1399,11 @@
  
    PRUint32 state = State(this);
    if (state & nsIAccessibleStates::STATE_SELECTABLE) {
 -    nsCOMPtr<nsIAccessible> multiSelect = GetMultiSelectFor(mDOMNode);
 +    nsIAccessible* multiSelect = GetMultiSelectFor(mDOMNode);
      if (!multiSelect) {
        return aSelect ? TakeFocus() : NS_ERROR_FAILURE;
      }
 -    nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +    nsIContent* content(do_QueryInterface(mDOMNode));
      NS_ASSERTION(content, "Called for dead accessible");
  
      if (mRoleMapEntry) {
-@@ -1428,9 +1428,9 @@ NS_IMETHODIMP nsAccessible::TakeSelectio
+@@ -1428,9 +1428,9 @@
  
    PRUint32 state = State(this);
    if (state & nsIAccessibleStates::STATE_SELECTABLE) {
 -    nsCOMPtr<nsIAccessible> multiSelect = GetMultiSelectFor(mDOMNode);
 +    nsIAccessible* multiSelect = GetMultiSelectFor(mDOMNode);
      if (multiSelect) {
 -      nsCOMPtr<nsIAccessibleSelectable> selectable = do_QueryInterface(multiSelect);
 +      nsIAccessibleSelectable* selectable = do_QueryInterface(multiSelect);
        selectable->ClearSelection();
      }
      return SetSelected(PR_TRUE);
-@@ -1446,7 +1446,7 @@ nsAccessible::TakeFocus()
+@@ -1446,7 +1446,7 @@
    if (IsDefunct())
      return NS_ERROR_FAILURE;
  
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
  
    nsIFrame *frame = GetFrame();
    NS_ENSURE_STATE(frame);
-@@ -1459,13 +1459,13 @@ nsAccessible::TakeFocus()
+@@ -1459,13 +1459,13 @@
      nsAutoString id;
      if (content && nsAccUtils::GetID(content, id)) {
  
 -      nsCOMPtr<nsIContent> ancestorContent = content;
 +      nsIContent* ancestorContent = content;
        while ((ancestorContent = ancestorContent->GetParent()) &&
               !ancestorContent->HasAttr(kNameSpaceID_None,
                                         nsAccessibilityAtoms::aria_activedescendant));
  
        if (ancestorContent) {
 -        nsCOMPtr<nsIPresShell> presShell(do_QueryReferent(mWeakShell));
 +        nsIPresShell* presShell(do_QueryReferent(mWeakShell));
          if (presShell) {
            nsIFrame *frame = presShell->GetPrimaryFrameFor(ancestorContent);
            if (frame && frame->IsFocusable()) {
-@@ -1480,7 +1480,7 @@ nsAccessible::TakeFocus()
+@@ -1480,7 +1480,7 @@
      }
    }
  
 -  nsCOMPtr<nsIDOMNSHTMLElement> htmlElement(do_QueryInterface(content));
 +  nsIDOMNSHTMLElement* htmlElement(do_QueryInterface(content));
    if (htmlElement) {
      // HTML Elements also set the caret position
      // in order to affect tabbing order
-@@ -1509,8 +1509,8 @@ nsresult nsAccessible::AppendNameFromAcc
+@@ -1509,8 +1509,8 @@
  {
    nsAutoString textEquivalent, value;
  
 -  nsCOMPtr<nsIDOMNode> domNode(do_QueryInterface(aContent));
 -  nsCOMPtr<nsIAccessible> accessible;
 +  nsIDOMNode* domNode(do_QueryInterface(aContent));
 +  nsIAccessible* accessible = nsnull;
    if (domNode == mDOMNode) {
      accessible = this;
      if (!aFromValue) {
-@@ -1519,10 +1519,10 @@ nsresult nsAccessible::AppendNameFromAcc
+@@ -1519,10 +1519,10 @@
      }
    }
    else {
 -    nsCOMPtr<nsIAccessibilityService> accService =
 +    nsIAccessibilityService* accService =
        do_GetService("@mozilla.org/accessibilityService;1");
      NS_ENSURE_TRUE(accService, NS_ERROR_FAILURE);
 -    accService->GetAccessibleInWeakShell(domNode, mWeakShell, getter_AddRefs(accessible));
 +    accService->GetAccessibleInWeakShell(domNode, mWeakShell, &accessible);
    }
    if (accessible) {
      if (aFromValue) {
-@@ -1551,13 +1551,13 @@ nsresult nsAccessible::AppendFlatStringF
+@@ -1551,13 +1551,13 @@
    if (aContent->IsNodeOfType(nsINode::eTEXT)) {
      // If it's a text node, append the text
      PRBool isHTMLBlock = PR_FALSE;
 -    nsCOMPtr<nsIPresShell> shell = GetPresShell();
 +    nsIPresShell* shell = GetPresShell();
      if (!shell) {
        return NS_ERROR_FAILURE;  
      }
  
      nsIContent *parentContent = aContent->GetParent();
 -    nsCOMPtr<nsIContent> appendedSubtreeStart(do_QueryInterface(mDOMNode));
 +    nsIContent* appendedSubtreeStart(do_QueryInterface(mDOMNode));
      if (parentContent && parentContent != appendedSubtreeStart) {
        nsIFrame *frame = shell->GetPrimaryFrameFor(parentContent);
        if (frame) {
-@@ -1593,7 +1593,7 @@ nsresult nsAccessible::AppendFlatStringF
+@@ -1593,7 +1593,7 @@
    nsAutoString textEquivalent;
    if (!aContent->IsNodeOfType(nsINode::eHTML)) {
      if (aContent->IsNodeOfType(nsINode::eXUL)) {
 -      nsCOMPtr<nsIPresShell> shell = GetPresShell();
 +      nsIPresShell* shell = GetPresShell();
        if (!shell) {
          return NS_ERROR_FAILURE;  
        }
-@@ -1602,7 +1602,7 @@ nsresult nsAccessible::AppendFlatStringF
+@@ -1602,7 +1602,7 @@
          return NS_OK;
        }
  
 -      nsCOMPtr<nsIDOMXULLabeledControlElement> labeledEl(do_QueryInterface(aContent));
 +      nsIDOMXULLabeledControlElement* labeledEl(do_QueryInterface(aContent));
        if (labeledEl) {
          labeledEl->GetLabel(textEquivalent);
        }
-@@ -1622,7 +1622,7 @@ nsresult nsAccessible::AppendFlatStringF
+@@ -1622,7 +1622,7 @@
      return NS_OK; // Not HTML and not XUL -- we don't handle it yet
    }
  
 -  nsCOMPtr<nsIAtom> tag = aContent->Tag();
 +  nsIAtom* tag = aContent->Tag();
    if (tag == nsAccessibilityAtoms::img) {
      return AppendNameFromAccessibleFor(aContent, aFlatString);
    }
-@@ -1686,7 +1686,7 @@ nsresult nsAccessible::AppendFlatStringF
+@@ -1686,7 +1686,7 @@
    // Depth first search for all text nodes that are decendants of content node.
    // Append all the text into one flat string
    PRUint32 numChildren = 0;
 -  nsCOMPtr<nsIDOMXULSelectControlElement> selectControlEl(do_QueryInterface(aContent));
 +  nsIDOMXULSelectControlElement* selectControlEl(do_QueryInterface(aContent));
    if (!selectControlEl) {  // Don't walk children of elements with options, just get label directly
      numChildren = aContent->GetChildCount();
    }
-@@ -1750,7 +1750,7 @@ nsresult nsAccessible::GetTextFromRelati
+@@ -1750,7 +1750,7 @@
    // Get DHTML name from content subtree pointed to by ID attribute
    aName.Truncate();
    NS_ASSERTION(mDOMNode, "Called from shutdown accessible");
 -  nsCOMPtr<nsIContent> content = GetRoleContent(mDOMNode);
 +  nsIContent* content = GetRoleContent(mDOMNode);
    if (!content)
      return NS_OK;
  
-@@ -1760,7 +1760,7 @@ nsresult nsAccessible::GetTextFromRelati
+@@ -1760,7 +1760,7 @@
    }
    ids.CompressWhitespace(PR_TRUE, PR_TRUE);
  
 -  nsCOMPtr<nsIDOMDocument> domDoc = do_QueryInterface(content->GetOwnerDoc());
 +  nsIDOMDocument* domDoc = do_QueryInterface(content->GetOwnerDoc());
    NS_ENSURE_TRUE(domDoc, NS_ERROR_FAILURE);
    
    nsresult rv = NS_ERROR_FAILURE;
-@@ -1781,8 +1781,8 @@ nsresult nsAccessible::GetTextFromRelati
+@@ -1781,8 +1781,8 @@
      if (!aName.IsEmpty()) {
        aName += ' '; // Need whitespace between multiple labels or descriptions
      }
 -    nsCOMPtr<nsIDOMElement> labelElement;
 -    domDoc->GetElementById(id, getter_AddRefs(labelElement));
 +    nsIDOMElement* labelElement = nsnull;
 +    domDoc->GetElementById(id, &labelElement);
      content = do_QueryInterface(labelElement);
      if (!content) {
        return NS_OK;
-@@ -1804,7 +1804,7 @@ nsresult nsAccessible::GetTextFromRelati
+@@ -1804,7 +1804,7 @@
    */
  nsresult nsAccessible::GetHTMLName(nsAString& aLabel, PRBool aCanAggregateSubtree)
  {
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
    if (!content) {
      return NS_ERROR_FAILURE;   // Node shut down
    }
-@@ -1857,7 +1857,7 @@ nsresult nsAccessible::GetHTMLName(nsASt
+@@ -1857,7 +1857,7 @@
    */
  nsresult nsAccessible::GetXULName(nsAString& aLabel, PRBool aCanAggregateSubtree)
  {
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
    NS_ASSERTION(content, "No nsIContent for DOM node");
  
    // First check for label override via accessibility labelledby relationship
-@@ -1869,21 +1869,21 @@ nsresult nsAccessible::GetXULName(nsAStr
+@@ -1869,21 +1869,21 @@
    }
  
    // CASE #1 (via label attribute) -- great majority of the cases
 -  nsCOMPtr<nsIDOMXULLabeledControlElement> labeledEl(do_QueryInterface(mDOMNode));
 +  nsIDOMXULLabeledControlElement* labeledEl(do_QueryInterface(mDOMNode));
    if (labeledEl) {
      rv = labeledEl->GetLabel(label);
    }
@@ -4059,74 +4059,74 @@ diff --git a/accessible/src/base/nsAcces
        // Use label if this is not a select control element which 
        // uses label attribute to indicate which option is selected
        if (!select) {
 -        nsCOMPtr<nsIDOMXULElement> xulEl(do_QueryInterface(mDOMNode));
 +        nsIDOMXULElement* xulEl(do_QueryInterface(mDOMNode));
          if (xulEl) {
            rv = xulEl->GetAttribute(NS_LITERAL_STRING("label"), label);
          }
-@@ -1898,7 +1898,7 @@ nsresult nsAccessible::GetXULName(nsAStr
+@@ -1898,7 +1898,7 @@
        nsAccUtils::FindNeighbourPointingToNode(content, nsAccessibilityAtoms::control,
                                                nsAccessibilityAtoms::label);
  
 -    nsCOMPtr<nsIDOMXULLabelElement> xulLabel(do_QueryInterface(labelContent));
 +    nsIDOMXULLabelElement* xulLabel(do_QueryInterface(labelContent));
      // Check if label's value attribute is used
      if (xulLabel && NS_SUCCEEDED(xulLabel->GetValue(label)) && label.IsEmpty()) {
        // If no value attribute, a non-empty label must contain
-@@ -1943,11 +1943,11 @@ PRBool nsAccessible::IsNodeRelevant(nsID
+@@ -1943,11 +1943,11 @@
  {
    // Can this node be accessible and attached to
    // the document's accessible tree?
 -  nsCOMPtr<nsIAccessibilityService> accService =
 +  nsIAccessibilityService* accService =
      do_GetService("@mozilla.org/accessibilityService;1");
    NS_ENSURE_TRUE(accService, PR_FALSE);
 -  nsCOMPtr<nsIDOMNode> relevantNode;
 -  accService->GetRelevantContentNodeFor(aNode, getter_AddRefs(relevantNode));
 +  nsIDOMNode* relevantNode = nsnull;
 +  accService->GetRelevantContentNodeFor(aNode, &relevantNode);
    return aNode == relevantNode;
  }
  
-@@ -1958,7 +1958,7 @@ nsAccessible::FireToolkitEvent(PRUint32 
+@@ -1958,7 +1958,7 @@
    if (!mWeakShell)
      return NS_ERROR_FAILURE;
  
 -  nsCOMPtr<nsIAccessibleEvent> accEvent =
 +  nsIAccessibleEvent* accEvent =
      new nsAccEvent(aEvent, aTarget);
    NS_ENSURE_TRUE(accEvent, NS_ERROR_OUT_OF_MEMORY);
  
-@@ -1969,11 +1969,11 @@ nsAccessible::FireAccessibleEvent(nsIAcc
+@@ -1969,11 +1969,11 @@
  nsAccessible::FireAccessibleEvent(nsIAccessibleEvent *aEvent)
  {
    NS_ENSURE_ARG_POINTER(aEvent);
 -  nsCOMPtr<nsIDOMNode> eventNode;
 -  aEvent->GetDOMNode(getter_AddRefs(eventNode));
 +  nsIDOMNode* eventNode = nsnull;
 +  aEvent->GetDOMNode(&eventNode);
    NS_ENSURE_TRUE(IsNodeRelevant(eventNode), NS_ERROR_FAILURE);
  
 -  nsCOMPtr<nsIObserverService> obsService =
 +  nsIObserverService* obsService =
      do_GetService("@mozilla.org/observer-service;1");
    NS_ENSURE_TRUE(obsService, NS_ERROR_FAILURE);
  
-@@ -1991,7 +1991,7 @@ NS_IMETHODIMP nsAccessible::GetFinalRole
+@@ -1991,7 +1991,7 @@
      // These unfortunate exceptions don't fit into the ARIA table
      // This is where the nsIAccessible role depends on both the role and ARIA state
      if (*aRole == nsIAccessibleRole::ROLE_PUSHBUTTON) {
 -      nsCOMPtr<nsIContent> content = do_QueryInterface(mDOMNode);
 +      nsIContent* content = do_QueryInterface(mDOMNode);
        if (content) {
          if (content->HasAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_pressed)) {
            // For aria-pressed="false" or aria-pressed="true"
-@@ -2007,21 +2007,21 @@ NS_IMETHODIMP nsAccessible::GetFinalRole
+@@ -2007,21 +2007,21 @@
      }
      else if (*aRole == nsIAccessibleRole::ROLE_LISTBOX) {
        // A listbox inside of a combo box needs a special role because of ATK mapping to menu
 -      nsCOMPtr<nsIAccessible> possibleCombo;
 -      GetParent(getter_AddRefs(possibleCombo));
 +      nsIAccessible* possibleCombo = nsnull;
 +      GetParent(&possibleCombo);
        if (possibleCombo && Role(possibleCombo) == nsIAccessibleRole::ROLE_COMBOBOX) {
@@ -4143,41 +4143,41 @@ diff --git a/accessible/src/base/nsAcces
      else if (*aRole == nsIAccessibleRole::ROLE_OPTION) {
 -      nsCOMPtr<nsIAccessible> parent;
 -      GetParent(getter_AddRefs(parent));
 +      nsIAccessible* parent = nsnull;
 +      GetParent(&parent);
        if (parent && Role(parent) == nsIAccessibleRole::ROLE_COMBOBOX_LIST) {
          *aRole = nsIAccessibleRole::ROLE_COMBOBOX_OPTION;
        }
-@@ -2045,12 +2045,12 @@ nsAccessible::GetAttributes(nsIPersisten
+@@ -2045,12 +2045,12 @@
  {
    NS_ENSURE_ARG_POINTER(aAttributes);  // In/out param. Created if necessary.
    
 -  nsCOMPtr<nsIContent> content = GetRoleContent(mDOMNode);
 +  nsIContent* content = GetRoleContent(mDOMNode);
    if (!content) {
      return NS_ERROR_FAILURE;
    }
  
 -  nsCOMPtr<nsIPersistentProperties> attributes = *aAttributes;
 +  nsIPersistentProperties* attributes = *aAttributes;
    if (!attributes) {
      // Create only if an array wasn't already passed in
      attributes = do_CreateInstance(NS_PERSISTENTPROPERTIES_CONTRACTID);
-@@ -2074,7 +2074,7 @@ nsAccessible::GetAttributes(nsIPersisten
+@@ -2074,7 +2074,7 @@
      attributes->SetStringProperty(NS_LITERAL_CSTRING("xml-roles"),  xmlRoles, oldValueUnused);          
    }
  
 -  nsCOMPtr<nsIAccessibleValue> supportsValue = do_QueryInterface(static_cast<nsIAccessible*>(this));
 +  nsIAccessibleValue* supportsValue = do_QueryInterface(static_cast<nsIAccessible*>(this));
    if (supportsValue) {
      // We support values, so expose the string value as well, via the valuetext object attribute
      // We test for the value interface because we don't want to expose traditional get_accValue()
-@@ -2121,14 +2121,14 @@ nsAccessible::GetAttributes(nsIPersisten
+@@ -2121,14 +2121,14 @@
          role == nsIAccessibleRole::ROLE_RADIOBUTTON ||
          role == nsIAccessibleRole::ROLE_OUTLINEITEM) &&
          0 == (State(this) & nsIAccessibleStates::STATE_INVISIBLE)) {
 -      nsCOMPtr<nsIAccessible> parent = GetParent();
 +      nsIAccessible* parent = GetParent();
        NS_ENSURE_TRUE(parent, NS_ERROR_FAILURE);
  
        PRInt32 positionInGroup = 0;
@@ -4185,54 +4185,54 @@ diff --git a/accessible/src/base/nsAcces
  
 -      nsCOMPtr<nsIAccessible> sibling, nextSibling;
 -      parent->GetFirstChild(getter_AddRefs(sibling));
 +      nsIAccessible* sibling = nsnull, *nextSibling = nsnull;
 +      parent->GetFirstChild(&sibling);
        NS_ENSURE_TRUE(sibling, NS_ERROR_FAILURE);
  
        PRBool foundCurrent = PR_FALSE;
-@@ -2144,14 +2144,14 @@ nsAccessible::GetAttributes(nsIPersisten
+@@ -2144,14 +2144,14 @@
                foundCurrent = PR_TRUE;
            }
          }
 -        sibling->GetNextSibling(getter_AddRefs(nextSibling));
 +        sibling->GetNextSibling(&nextSibling);
          sibling = nextSibling;
        }
  
        PRInt32 groupLevel = 0;
        if (role == nsIAccessibleRole::ROLE_OUTLINEITEM) {
          groupLevel = 1;
 -        nsCOMPtr<nsIAccessible> nextParent;
 +        nsIAccessible* nextParent = nsnull;
          while (parent) {
            parent->GetFinalRole(&role);
  
-@@ -2160,8 +2160,8 @@ nsAccessible::GetAttributes(nsIPersisten
+@@ -2160,8 +2160,8 @@
            if (role == nsIAccessibleRole::ROLE_GROUPING)
              ++ groupLevel;
  
 -          parent->GetParent(getter_AddRefs(nextParent));
 -          parent.swap(nextParent);
 +          parent->GetParent(&nextParent);
 +          swap(parent, nextParent);
          }
        }
  
-@@ -2198,7 +2198,7 @@ nsAccessible::GetAttributesInternal(nsIP
+@@ -2198,7 +2198,7 @@
    // Attributes set by this method will not be used to override attributes on a sub-document accessible
    // when there is a <frame>/<iframe> element that spawned the sub-document
    nsIContent *content = GetRoleContent(mDOMNode);
 -  nsCOMPtr<nsIDOMElement> element(do_QueryInterface(content));
 +  nsIDOMElement* element(do_QueryInterface(content));
    NS_ENSURE_TRUE(element, NS_ERROR_UNEXPECTED);
  
    nsAutoString tagName;
-@@ -2223,18 +2223,18 @@ nsAccessible::GetAttributesInternal(nsIP
+@@ -2223,18 +2223,18 @@
    //   The inner nodes can be used to override live region behavior on more general outer nodes
    // However, nodes in outer documents override nodes in inner documents:
    //   Outer doc author may want to override properties on a widget they used in an iframe
 -  nsCOMPtr<nsIDOMNode> startNode = mDOMNode;
 +  nsIDOMNode* startNode = mDOMNode;
    nsIContent *startContent = content;
    while (PR_TRUE) {
      NS_ENSURE_STATE(startContent);
@@ -4244,28 +4244,28 @@ diff --git a/accessible/src/base/nsAcces
      NS_ENSURE_STATE(topContent);
      nsAccUtils::GetLiveContainerAttributes(aAttributes, startContent, topContent);
      // Allow ARIA live region markup from outer documents to override
 -    nsCOMPtr<nsISupports> container = doc->GetContainer();
 +    nsISupports* container = doc->GetContainer();
      nsIDocShellTreeItem *docShellTreeItem = nsnull;
      if (container)
        CallQueryInterface(container, &docShellTreeItem);
-@@ -2273,8 +2273,8 @@ nsAccessible::GroupPosition(PRInt32 *aGr
+@@ -2273,8 +2273,8 @@
    *aSimilarItemsInGroup = 0;
    *aPositionInGroup = 0;
  
 -  nsCOMPtr<nsIPersistentProperties> attributes;
 -  nsresult rv = GetAttributes(getter_AddRefs(attributes));
 +  nsIPersistentProperties* attributes = nsnull;
 +  nsresult rv = GetAttributes(&attributes);
    NS_ENSURE_SUCCESS(rv, rv);
    if (!attributes) {
      return NS_ERROR_FAILURE;
-@@ -2337,15 +2337,15 @@ nsAccessible::GetFinalState(PRUint32 *aS
+@@ -2337,15 +2337,15 @@
      } else {
        // Expose 'selected' state on ARIA tab if the focus is on internal element
        // of related tabpanel.
 -      nsCOMPtr<nsIAccessible> tabPanel;
 +      nsIAccessible* tabPanel = nsnull;
        rv = GetAccessibleRelated(nsIAccessibleRelation::RELATION_LABEL_FOR,
 -                                getter_AddRefs(tabPanel));
 +                                &tabPanel);
@@ -4276,124 +4276,124 @@ diff --git a/accessible/src/base/nsAcces
 -        nsCOMPtr<nsIDOMNode> tabPanelNode;
 -        tabPanelAccessNode->GetDOMNode(getter_AddRefs(tabPanelNode));
 +        nsIAccessNode* tabPanelAccessNode(do_QueryInterface(tabPanel));
 +        nsIDOMNode* tabPanelNode = nsnull;
 +        tabPanelAccessNode->GetDOMNode(&tabPanelNode);
          NS_ENSURE_STATE(tabPanelNode);
  
          if (nsAccUtils::IsAncestorOf(tabPanelNode, gLastFocusedNode))
-@@ -2382,7 +2382,7 @@ nsAccessible::GetFinalState(PRUint32 *aS
+@@ -2382,7 +2382,7 @@
      // pointing at it, we mark it as ACTIVE even if it's not currently focused.
      // This allows screen reader virtual buffer modes to know which descendant
      // is the current one that would get focus if the user navigates to the container widget.
 -    nsCOMPtr<nsIContent> content = do_QueryInterface(mDOMNode);
 +    nsIContent* content = do_QueryInterface(mDOMNode);
      nsAutoString id;
      if (content && nsAccUtils::GetID(content, id)) {
        nsIContent *ancestorContent = content;
-@@ -2405,7 +2405,7 @@ nsAccessible::GetFinalState(PRUint32 *aS
+@@ -2405,7 +2405,7 @@
    if (role == nsIAccessibleRole::ROLE_ENTRY ||
        role == nsIAccessibleRole::ROLE_COMBOBOX) {
  
 -    nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +    nsIContent* content(do_QueryInterface(mDOMNode));
      NS_ENSURE_STATE(content);
  
      nsAutoString autocomplete;
-@@ -2509,7 +2509,7 @@ nsAccessible::GetValue(nsAString& aValue
+@@ -2509,7 +2509,7 @@
    if (IsDefunct())
      return NS_ERROR_FAILURE;
  
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
    if (!content)
      return NS_OK;
  
-@@ -2530,7 +2530,7 @@ nsAccessible::GetValue(nsAString& aValue
+@@ -2530,7 +2530,7 @@
  
    // Check if it's an simple xlink.
    if (nsAccUtils::IsXLink(content)) {
 -    nsCOMPtr<nsIPresShell> presShell(do_QueryReferent(mWeakShell));
 +    nsIPresShell* presShell(do_QueryReferent(mWeakShell));
      if (presShell)
        return presShell->GetLinkLocation(mDOMNode, aValue);
    }
-@@ -2590,7 +2590,7 @@ nsAccessible::SetCurrentValue(double aVa
+@@ -2590,7 +2590,7 @@
    if (NS_SUCCEEDED(GetMaximumValue(&maxValue)) && aValue > maxValue)
      return NS_ERROR_INVALID_ARG;
  
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
    NS_ENSURE_STATE(content);
  
    nsAutoString newValue;
-@@ -2642,7 +2642,7 @@ NS_IMETHODIMP nsAccessible::GetRole(PRUi
+@@ -2642,7 +2642,7 @@
    if (IsDefunct())
      return NS_ERROR_FAILURE;
  
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
    if (nsAccUtils::IsXLink(content))
      *aRole = nsIAccessibleRole::ROLE_LINK;
  
-@@ -2660,7 +2660,7 @@ nsAccessible::GetNumActions(PRUint8 *aNu
+@@ -2660,7 +2660,7 @@
      return NS_ERROR_FAILURE;
  
    // Check if it's an simple xlink.
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
    if (nsAccUtils::IsXLink(content)) {
      *aNumActions = 1;
      return NS_OK;
-@@ -2689,7 +2689,7 @@ nsAccessible::GetActionName(PRUint8 aInd
+@@ -2689,7 +2689,7 @@
      return NS_ERROR_FAILURE;
  
    // Check if it's simple xlink.
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
    if (nsAccUtils::IsXLink(content)) {
      aName.AssignLiteral("jump");
      return NS_OK;
-@@ -2732,7 +2732,7 @@ nsAccessible::DoAction(PRUint8 aIndex)
+@@ -2732,7 +2732,7 @@
    PRBool doAction = PR_FALSE;
  
    // Check if it's simple xlink.
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
    if (nsAccUtils::IsXLink(content))
      doAction = PR_TRUE;
  
-@@ -2778,14 +2778,14 @@ NS_IMETHODIMP nsAccessible::GetAccessibl
+@@ -2778,14 +2778,14 @@
  
  nsIDOMNode* nsAccessible::GetAtomicRegion()
  {
 -  nsCOMPtr<nsIContent> content = GetRoleContent(mDOMNode);
 +  nsIContent* content = GetRoleContent(mDOMNode);
    nsIContent *loopContent = content;
    nsAutoString atomic;
    while (loopContent && !loopContent->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::aria_atomic, atomic)) {
      loopContent = loopContent->GetParent();
    }
  
 -  nsCOMPtr<nsIDOMNode> atomicRegion;
 +  nsIDOMNode* atomicRegion = nsnull;
    if (atomic.EqualsLiteral("true")) {
      atomicRegion = do_QueryInterface(loopContent);
    }
-@@ -2806,7 +2806,7 @@ NS_IMETHODIMP nsAccessible::GetAccessibl
+@@ -2806,7 +2806,7 @@
      return NS_ERROR_FAILURE;  // Node already shut down
    }
  
 -  nsCOMPtr<nsIDOMNode> relatedNode;
 +  nsIDOMNode* relatedNode = nsnull;
    nsAutoString relatedID;
  
    // Search for the related DOM node according to the specified "relation type"
-@@ -2907,47 +2907,47 @@ NS_IMETHODIMP nsAccessible::GetAccessibl
+@@ -2907,47 +2907,47 @@
      {
        if (content->IsNodeOfType(nsINode::eHTML)) {
          // HTML form controls implements nsIFormControl interface.
 -        nsCOMPtr<nsIFormControl> control(do_QueryInterface(content));
 +        nsIFormControl* control(do_QueryInterface(content));
          if (control) {
 -          nsCOMPtr<nsIDOMHTMLFormElement> htmlform;
 -          control->GetForm(getter_AddRefs(htmlform));
@@ -4447,17 +4447,17 @@ diff --git a/accessible/src/base/nsAcces
                  xblDoc->GetAnonymousElementByAttribute(rootEl,
                                                        NS_LITERAL_STRING("default"),
                                                        NS_LITERAL_STRING("true"),
 -                                                      getter_AddRefs(possibleButtonEl));
 +                                                      &possibleButtonEl);
                  buttonEl = do_QueryInterface(possibleButtonEl);
                }
              }
-@@ -2968,17 +2968,17 @@ NS_IMETHODIMP nsAccessible::GetAccessibl
+@@ -2968,17 +2968,17 @@
  
    if (!relatedID.IsEmpty()) {
      // In some cases we need to get the relatedNode from an ID-style attribute
 -    nsCOMPtr<nsIDOMDocument> domDoc;
 -    mDOMNode->GetOwnerDocument(getter_AddRefs(domDoc));
 +    nsIDOMDocument* domDoc = nsnull;
 +    mDOMNode->GetOwnerDocument(&domDoc);
      NS_ENSURE_TRUE(domDoc, NS_ERROR_FAILURE);
@@ -4470,28 +4470,28 @@ diff --git a/accessible/src/base/nsAcces
  
    // Return the corresponding accessible if the related DOM node is found
    if (relatedNode) {
 -    nsCOMPtr<nsIAccessibilityService> accService = GetAccService();
 +    nsIAccessibilityService* accService = GetAccService();
      NS_ENSURE_TRUE(accService, NS_ERROR_FAILURE);
      accService->GetAccessibleInWeakShell(relatedNode, mWeakShell, aRelated);
    }
-@@ -2991,8 +2991,8 @@ nsAccessible::GetRelationsCount(PRUint32
+@@ -2991,8 +2991,8 @@
    NS_ENSURE_ARG_POINTER(aCount);
    *aCount = 0;
  
 -  nsCOMPtr<nsIArray> relations;
 -  nsresult rv = GetRelations(getter_AddRefs(relations));
 +  nsIArray* relations = nsnull;
 +  nsresult rv = GetRelations(&relations);
    NS_ENSURE_SUCCESS(rv, rv);
  
    return relations->GetLength(aCount);
-@@ -3004,13 +3004,13 @@ nsAccessible::GetRelation(PRUint32 aInde
+@@ -3004,13 +3004,13 @@
    NS_ENSURE_ARG_POINTER(aRelation);
    *aRelation = nsnull;
  
 -  nsCOMPtr<nsIArray> relations;
 -  nsresult rv = GetRelations(getter_AddRefs(relations));
 +  nsIArray* relations = nsnull;
 +  nsresult rv = GetRelations(&relations);
    NS_ENSURE_SUCCESS(rv, rv);
@@ -4499,17 +4499,17 @@ diff --git a/accessible/src/base/nsAcces
 -  nsCOMPtr<nsIAccessibleRelation> relation;
 +  nsIAccessibleRelation* relation = nsnull;
    rv = relations->QueryElementAt(aIndex, NS_GET_IID(nsIAccessibleRelation),
 -                                 getter_AddRefs(relation));
 +                                 (void**)&relation);
  
    // nsIArray::QueryElementAt() returns NS_ERROR_ILLEGAL_VALUE on invalid index.
    if (rv == NS_ERROR_ILLEGAL_VALUE)
-@@ -3027,17 +3027,17 @@ nsAccessible::GetRelations(nsIArray **aR
+@@ -3027,17 +3027,17 @@
  {
    NS_ENSURE_ARG_POINTER(aRelations);
  
 -  nsCOMPtr<nsIMutableArray> relations = do_CreateInstance(NS_ARRAY_CONTRACTID);
 +  nsIMutableArray* relations = do_CreateInstance(NS_ARRAY_CONTRACTID);
    NS_ENSURE_TRUE(relations, NS_ERROR_OUT_OF_MEMORY);
  
    for (PRUint32 relType = nsIAccessibleRelation::RELATION_FIRST;
@@ -4521,53 +4521,53 @@ diff --git a/accessible/src/base/nsAcces
 +    GetAccessibleRelated(relType, &accessible);
  
      if (accessible) {
 -      nsCOMPtr<nsIAccessibleRelation> relation =
 +      nsIAccessibleRelation* relation =
          new nsAccessibleRelationWrap(relType, accessible);
        NS_ENSURE_TRUE(relation, NS_ERROR_OUT_OF_MEMORY);
  
-@@ -3068,7 +3068,7 @@ void nsAccessible::DoCommandCallback(nsI
+@@ -3068,7 +3068,7 @@
    NS_RELEASE(gDoCommandTimer);
  
    nsIContent *content = reinterpret_cast<nsIContent*>(aClosure);
 -  nsCOMPtr<nsIDOMXULElement> xulElement(do_QueryInterface(content));
 +  nsIDOMXULElement* xulElement(do_QueryInterface(content));
    if (xulElement) {
      xulElement->Click();
    }
-@@ -3077,7 +3077,7 @@ void nsAccessible::DoCommandCallback(nsI
+@@ -3077,7 +3077,7 @@
      if (!doc) {
        return;
      }
 -    nsCOMPtr<nsIPresShell> presShell = doc->GetPrimaryShell();
 +    nsIPresShell* presShell = doc->GetPrimaryShell();
      nsPIDOMWindow *outerWindow = doc->GetWindow();
      if (presShell && outerWindow) {
        nsAutoPopupStatePusher popupStatePusher(outerWindow, openAllowed);
-@@ -3110,7 +3110,7 @@ void nsAccessible::DoCommandCallback(nsI
+@@ -3110,7 +3110,7 @@
   */
  nsresult nsAccessible::DoCommand(nsIContent *aContent)
  {
 -  nsCOMPtr<nsIContent> content = aContent;
 +  nsIContent* content = aContent;
    if (!content) {
      content = do_QueryInterface(mDOMNode);
    }
-@@ -3120,7 +3120,7 @@ nsresult nsAccessible::DoCommand(nsICont
+@@ -3120,7 +3120,7 @@
      return NS_ERROR_FAILURE;
    }
  
 -  nsCOMPtr<nsITimer> timer = do_CreateInstance("@mozilla.org/timer;1");
 +  nsITimer* timer = do_CreateInstance("@mozilla.org/timer;1");
    if (!timer) {
      return NS_ERROR_OUT_OF_MEMORY;
    } 
-@@ -3131,35 +3131,35 @@ nsresult nsAccessible::DoCommand(nsICont
+@@ -3131,35 +3131,35 @@
                                                 nsITimer::TYPE_ONE_SHOT);
  }
  
 -already_AddRefed<nsIAccessible>
 +nsIAccessible*
  nsAccessible::GetNextWithState(nsIAccessible *aStart, PRUint32 matchState)
  {
    // Return the next descendant that matches one of the states in matchState
@@ -4600,117 +4600,117 @@ diff --git a/accessible/src/base/nsAcces
    }
  
    nsIAccessible *returnAccessible = nsnull;
 -  current.swap(returnAccessible);
 +  swap(current, returnAccessible);
  
    return returnAccessible;
  }
-@@ -3169,11 +3169,11 @@ NS_IMETHODIMP nsAccessible::GetSelectedC
+@@ -3169,11 +3169,11 @@
  {
    *aSelectedAccessibles = nsnull;
  
 -  nsCOMPtr<nsIMutableArray> selectedAccessibles =
 +  nsIMutableArray* selectedAccessibles =
      do_CreateInstance(NS_ARRAY_CONTRACTID);
    NS_ENSURE_STATE(selectedAccessibles);
  
 -  nsCOMPtr<nsIAccessible> selected = this;
 +  nsIAccessible* selected = this;
    while ((selected = GetNextWithState(selected, nsIAccessibleStates::STATE_SELECTED)) != nsnull) {
      selectedAccessibles->AppendElement(selected, PR_FALSE);
    }
-@@ -3195,7 +3195,7 @@ NS_IMETHODIMP nsAccessible::RefSelection
+@@ -3195,7 +3195,7 @@
    if (aIndex < 0) {
      return NS_ERROR_FAILURE;
    }
 -  nsCOMPtr<nsIAccessible> selected = this;
 +  nsIAccessible* selected = this;
    PRInt32 count = 0;
    while (count ++ <= aIndex) {
      selected = GetNextWithState(selected, nsIAccessibleStates::STATE_SELECTED);
-@@ -3210,7 +3210,7 @@ NS_IMETHODIMP nsAccessible::GetSelection
+@@ -3210,7 +3210,7 @@
  NS_IMETHODIMP nsAccessible::GetSelectionCount(PRInt32 *aSelectionCount)
  {
    *aSelectionCount = 0;
 -  nsCOMPtr<nsIAccessible> selected = this;
 +  nsIAccessible* selected = this;
    while ((selected = GetNextWithState(selected, nsIAccessibleStates::STATE_SELECTED)) != nsnull) {
      ++ *aSelectionCount;
    }
-@@ -3226,8 +3226,8 @@ NS_IMETHODIMP nsAccessible::AddChildToSe
+@@ -3226,8 +3226,8 @@
  
    NS_ENSURE_TRUE(aIndex >= 0, NS_ERROR_FAILURE);
  
 -  nsCOMPtr<nsIAccessible> child;
 -  GetChildAt(aIndex, getter_AddRefs(child));
 +  nsIAccessible* child = nsnull;
 +  GetChildAt(aIndex, &child);
  
    PRUint32 state = State(child);
    if (!(state & nsIAccessibleStates::STATE_SELECTABLE)) {
-@@ -3245,8 +3245,8 @@ NS_IMETHODIMP nsAccessible::RemoveChildF
+@@ -3245,8 +3245,8 @@
  
    NS_ENSURE_TRUE(aIndex >= 0, NS_ERROR_FAILURE);
  
 -  nsCOMPtr<nsIAccessible> child;
 -  GetChildAt(aIndex, getter_AddRefs(child));
 +  nsIAccessible* child = nsnull;
 +  GetChildAt(aIndex, &child);
  
    PRUint32 state = State(child);
    if (!(state & nsIAccessibleStates::STATE_SELECTED)) {
-@@ -3265,8 +3265,8 @@ NS_IMETHODIMP nsAccessible::IsChildSelec
+@@ -3265,8 +3265,8 @@
    *aIsSelected = PR_FALSE;
    NS_ENSURE_TRUE(aIndex >= 0, NS_ERROR_FAILURE);
  
 -  nsCOMPtr<nsIAccessible> child;
 -  GetChildAt(aIndex, getter_AddRefs(child));
 +  nsIAccessible* child = nsnull;
 +  GetChildAt(aIndex, &child);
  
    PRUint32 state = State(child);
    if (state & nsIAccessibleStates::STATE_SELECTED) {
-@@ -3277,7 +3277,7 @@ NS_IMETHODIMP nsAccessible::IsChildSelec
+@@ -3277,7 +3277,7 @@
  
  NS_IMETHODIMP nsAccessible::ClearSelection()
  {
 -  nsCOMPtr<nsIAccessible> selected = this;
 +  nsIAccessible* selected = this;
    while ((selected = GetNextWithState(selected, nsIAccessibleStates::STATE_SELECTED)) != nsnull) {
      selected->SetSelected(PR_FALSE);
    }
-@@ -3286,7 +3286,7 @@ NS_IMETHODIMP nsAccessible::ClearSelecti
+@@ -3286,7 +3286,7 @@
  
  NS_IMETHODIMP nsAccessible::SelectAllSelection(PRBool *_retval)
  {
 -  nsCOMPtr<nsIAccessible> selectable = this;
 +  nsIAccessible* selectable = this;
    while ((selectable = GetNextWithState(selectable, nsIAccessibleStates::STATE_SELECTED)) != nsnull) {
      selectable->SetSelected(PR_TRUE);
    }
-@@ -3337,13 +3337,13 @@ nsAccessible::GetURI(PRInt32 aIndex, nsI
+@@ -3337,13 +3337,13 @@
      return NS_ERROR_INVALID_ARG;
  
    // Check if it's simple xlink.
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
    if (nsAccUtils::IsXLink(content)) {
      nsAutoString href;
      content->GetAttr(kNameSpaceID_XLink, nsAccessibilityAtoms::href, href);
  
 -    nsCOMPtr<nsIURI> baseURI = content->GetBaseURI();
 -    nsCOMPtr<nsIDocument> document = content->GetOwnerDoc();
 +    nsIURI* baseURI = content->GetBaseURI();
 +    nsIDocument* document = content->GetOwnerDoc();
      return NS_NewURI(aURI, href,
                       document ? document->GetDocumentCharacterSet().get() : nsnull,
                       baseURI);
-@@ -3394,14 +3394,14 @@ nsresult nsAccessible::GetLinkOffset(PRI
+@@ -3394,14 +3394,14 @@
  nsresult nsAccessible::GetLinkOffset(PRInt32* aStartOffset, PRInt32* aEndOffset)
  {
    *aStartOffset = *aEndOffset = 0;
 -  nsCOMPtr<nsIAccessible> parent(GetParent());
 +  nsIAccessible* parent(GetParent());
    if (!parent) {
      return NS_ERROR_FAILURE;
    }
@@ -4718,46 +4718,46 @@ diff --git a/accessible/src/base/nsAcces
 -  nsCOMPtr<nsIAccessible> accessible, nextSibling;
 +  nsIAccessible* accessible = nsnull, *nextSibling = nsnull;
    PRInt32 characterCount = 0;
 -  parent->GetFirstChild(getter_AddRefs(accessible));
 +  parent->GetFirstChild(&accessible);
  
    while (accessible) {
      if (IsText(accessible)) {
-@@ -3415,8 +3415,8 @@ nsresult nsAccessible::GetLinkOffset(PRI
+@@ -3415,8 +3415,8 @@
      else {
        ++ characterCount;
      }
 -    accessible->GetNextSibling(getter_AddRefs(nextSibling));
 -    accessible.swap(nextSibling);
 +    accessible->GetNextSibling(&nextSibling);
 +    swap(accessible, nextSibling);
    }
  
    return NS_ERROR_FAILURE;
-@@ -3427,7 +3427,7 @@ PRInt32 nsAccessible::TextLength(nsIAcce
+@@ -3427,7 +3427,7 @@
    if (!IsText(aAccessible))
      return 1;
  
 -  nsCOMPtr<nsPIAccessNode> pAccNode(do_QueryInterface(aAccessible));
 +  nsPIAccessNode* pAccNode(do_QueryInterface(aAccessible));
    NS_ASSERTION(pAccNode, "QI to nsPIAccessNode failed");
  
    nsIFrame *frame = pAccNode->GetFrame();
-@@ -3445,7 +3445,7 @@ PRInt32 nsAccessible::TextLength(nsIAcce
+@@ -3445,7 +3445,7 @@
    // They don't have their own frame.
    // XXX In the future, list bullets may have frame and anon content, so 
    // we should be able to remove this at that point
 -  nsCOMPtr<nsPIAccessible> pAcc(do_QueryInterface(aAccessible));
 +  nsPIAccessible* pAcc(do_QueryInterface(aAccessible));
    NS_ASSERTION(pAcc, "QI to nsPIAccessible failed");
  
    nsAutoString text;
-@@ -3459,16 +3459,16 @@ nsAccessible::AppendTextTo(nsAString& aT
+@@ -3459,16 +3459,16 @@
    return NS_OK;
  }
  
 -already_AddRefed<nsIAccessible>
 +nsIAccessible*
  nsAccessible::GetFirstAvailableAccessible(nsIDOMNode *aStartNode, PRBool aRequireLeaf)
  {
    nsIAccessibilityService *accService = GetAccService();
@@ -4769,17 +4769,17 @@ diff --git a/accessible/src/base/nsAcces
 +  nsIDOMNode* currentNode(aStartNode);
  
    while (currentNode) {
 -    accService->GetAccessibleInWeakShell(currentNode, mWeakShell, getter_AddRefs(accessible)); // AddRef'd
 +    accService->GetAccessibleInWeakShell(currentNode, mWeakShell, &accessible); // AddRef'd
      if (accessible && (!aRequireLeaf || IsLeaf(accessible))) {
        nsIAccessible *retAccessible = accessible;
        NS_ADDREF(retAccessible);
-@@ -3477,18 +3477,18 @@ nsAccessible::GetFirstAvailableAccessibl
+@@ -3477,18 +3477,18 @@
      if (!walker) {
        // Instantiate walker lazily since we won't need it in 90% of the cases
        // where the first DOM node we're given provides an accessible
 -      nsCOMPtr<nsIDOMDocument> document;
 -      currentNode->GetOwnerDocument(getter_AddRefs(document));
 -      nsCOMPtr<nsIDOMDocumentTraversal> trav = do_QueryInterface(document);
 +      nsIDOMDocument* document = nsnull;
 +      currentNode->GetOwnerDocument(&document);
@@ -4793,88 +4793,88 @@ diff --git a/accessible/src/base/nsAcces
        walker->SetCurrentNode(currentNode);
      }
  
 -    walker->NextNode(getter_AddRefs(currentNode));
 +    walker->NextNode(&currentNode);
    }
  
    return nsnull;
-@@ -3544,7 +3544,7 @@ nsAccessible::GetAttrValue(nsIAtom *aPro
+@@ -3544,7 +3544,7 @@
   if (!mRoleMapEntry || mRoleMapEntry->valueRule == eNoValue)
      return NS_OK_NO_ARIA_VALUE;
  
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
    NS_ENSURE_STATE(content);
  
    PRInt32 result = NS_OK;
-diff --git a/accessible/src/base/nsAccessible.h b/accessible/src/base/nsAccessible.h
---- a/accessible/src/base/nsAccessible.h
-+++ b/accessible/src/base/nsAccessible.h
-@@ -147,7 +147,7 @@ public:
+diff -r 332906b0e686 accessible/src/base/nsAccessible.h
+--- a/accessible/src/base/nsAccessible.h	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/base/nsAccessible.h	Fri Jul 04 01:35:36 2008 -0700
+@@ -147,7 +147,7 @@
     */
    static PRBool MustPrune(nsIAccessible *aAccessible);
    
 -  already_AddRefed<nsIAccessible> GetParent() {
 +  nsIAccessible* GetParent() {
      nsIAccessible *parent = nsnull;
      GetParent(&parent);
      return parent;
-@@ -204,9 +204,9 @@ protected:
+@@ -204,9 +204,9 @@
    
    // nsCOMPtr<>& is useful here, because getter_AddRefs() nulls the comptr's value, and NextChild
    // depends on the passed-in comptr being null or already set to a child (finding the next sibling).
 -  nsIAccessible *NextChild(nsCOMPtr<nsIAccessible>& aAccessible);
 +  nsIAccessible *NextChild(nsIAccessible*& aAccessible);
      
 -  already_AddRefed<nsIAccessible> GetNextWithState(nsIAccessible *aStart, PRUint32 matchState);
 +  nsIAccessible* GetNextWithState(nsIAccessible *aStart, PRUint32 matchState);
  
    /**
     * Return an accessible for the given DOM node, or if that node isn't accessible, return the
-@@ -215,10 +215,10 @@ protected:
+@@ -215,10 +215,10 @@
     * @param aRequireLeaf, only accept leaf accessible nodes
     * @return the resulting accessible
     */   
 -  already_AddRefed<nsIAccessible> GetFirstAvailableAccessible(nsIDOMNode *aStartNode, PRBool aRequireLeaf = PR_FALSE);
 +  nsIAccessible* GetFirstAvailableAccessible(nsIDOMNode *aStartNode, PRBool aRequireLeaf = PR_FALSE);
  
    // Selection helpers
 -  static already_AddRefed<nsIAccessible> GetMultiSelectFor(nsIDOMNode *aNode);
 +  static nsIAccessible* GetMultiSelectFor(nsIDOMNode *aNode);
  
    // Hyperlink helpers
    virtual nsresult GetLinkOffset(PRInt32* aStartOffset, PRInt32* aEndOffset);
-diff --git a/accessible/src/base/nsAccessibleEventData.cpp b/accessible/src/base/nsAccessibleEventData.cpp
---- a/accessible/src/base/nsAccessibleEventData.cpp
-+++ b/accessible/src/base/nsAccessibleEventData.cpp
-@@ -88,8 +88,8 @@ void nsAccEvent::GetLastEventAttributes(
+diff -r 332906b0e686 accessible/src/base/nsAccessibleEventData.cpp
+--- a/accessible/src/base/nsAccessibleEventData.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/base/nsAccessibleEventData.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -88,8 +88,8 @@
  
  void nsAccEvent::CaptureIsFromUserInput(PRBool aIsAsynch)
  {
 -  nsCOMPtr<nsIDOMNode> eventNode;
 -  GetDOMNode(getter_AddRefs(eventNode));
 +  nsIDOMNode* eventNode = nsnull;
 +  GetDOMNode(&eventNode);
    if (!eventNode) {
      NS_NOTREACHED("There should always be a DOM node for an event");
      return;
-@@ -124,8 +124,8 @@ void nsAccEvent::PrepareForEvent(nsIAcce
+@@ -124,8 +124,8 @@
                                   PRBool aForceIsFromUserInput)
  {
    gLastEventFromUserInput = aForceIsFromUserInput;
 -  nsCOMPtr<nsIDOMNode> eventNode;
 -  aEvent->GetDOMNode(getter_AddRefs(eventNode));
 +  nsIDOMNode* eventNode = nsnull;
 +  aEvent->GetDOMNode(&eventNode);
    if (!gLastEventFromUserInput) {  // Caller is not forcing user input flag
      aEvent->GetIsFromUserInput(&gLastEventFromUserInput);
      if (!gLastEventFromUserInput) {
-@@ -152,18 +152,18 @@ void nsAccEvent::PrepareForEvent(nsIDOMN
+@@ -152,18 +152,18 @@
      return;
    }
  
 -  nsCOMPtr<nsIDOMDocument> domDoc;
 -  aEventNode->GetOwnerDocument(getter_AddRefs(domDoc));
 +  nsIDOMDocument* domDoc = nsnull;
 +  aEventNode->GetOwnerDocument(&domDoc);
    if (!domDoc) {  // IF the node is a document itself
@@ -4887,57 +4887,57 @@ diff --git a/accessible/src/base/nsAcces
      return;
    }
  
 -  nsCOMPtr<nsIPresShell> presShell = doc->GetPrimaryShell();
 +  nsIPresShell* presShell = doc->GetPrimaryShell();
    if (!presShell) {
      NS_NOTREACHED("Threre should always be an pres shell for an event");
      return;
-@@ -205,7 +205,7 @@ nsAccEvent::GetDOMNode(nsIDOMNode **aDOM
+@@ -205,7 +205,7 @@
    *aDOMNode = nsnull;
  
    if (!mDOMNode) {
 -    nsCOMPtr<nsIAccessNode> accessNode(do_QueryInterface(mAccessible));
 +    nsIAccessNode* accessNode(do_QueryInterface(mAccessible));
      NS_ENSURE_TRUE(accessNode, NS_ERROR_FAILURE);
      accessNode->GetDOMNode(getter_AddRefs(mDOMNode));
    }
-@@ -222,11 +222,11 @@ nsAccEvent::GetAccessibleDocument(nsIAcc
+@@ -222,11 +222,11 @@
  
    if (!mDocAccessible) {
      if (!mAccessible) {
 -      nsCOMPtr<nsIAccessible> accessible;
 -      GetAccessible(getter_AddRefs(accessible));
 +      nsIAccessible* accessible = nsnull;
 +      GetAccessible(&accessible);
      }
  
 -    nsCOMPtr<nsIAccessNode> accessNode(do_QueryInterface(mAccessible));
 +    nsIAccessNode* accessNode(do_QueryInterface(mAccessible));
      NS_ENSURE_TRUE(accessNode, NS_ERROR_FAILURE);
      accessNode->GetAccessibleDocument(getter_AddRefs(mDocAccessible));
    }
-@@ -235,13 +235,13 @@ nsAccEvent::GetAccessibleDocument(nsIAcc
+@@ -235,13 +235,13 @@
    return NS_OK;
  }
  
 -already_AddRefed<nsIAccessible>
 +nsIAccessible*
  nsAccEvent::GetAccessibleByNode()
  {
    if (!mDOMNode)
      return nsnull;
  
 -  nsCOMPtr<nsIAccessibilityService> accService = 
 +  nsIAccessibilityService* accService = 
      do_GetService("@mozilla.org/accessibilityService;1");
    if (!accService)
      return nsnull;
-@@ -256,20 +256,20 @@ nsAccEvent::GetAccessibleByNode()
+@@ -256,20 +256,20 @@
    nsAutoString localName;
    mDOMNode->GetLocalName(localName);
    if (localName.EqualsLiteral("tree")) {
 -    nsCOMPtr<nsIDOMXULMultiSelectControlElement> multiSelect =
 +    nsIDOMXULMultiSelectControlElement* multiSelect =
        do_QueryInterface(mDOMNode);
      if (multiSelect) {
        PRInt32 treeIndex = -1;
@@ -4952,157 +4952,157 @@ diff --git a/accessible/src/base/nsAcces
              NS_FAILED(treeCache->GetCachedTreeitemAccessible(
                        treeIndex,
                        nsnull,
 -                      getter_AddRefs(treeItemAccessible))) ||
 +                      &treeItemAccessible)) ||
                        !treeItemAccessible) {
            return nsnull;
          }
-@@ -288,12 +288,12 @@ nsAccEvent::ApplyEventRules(nsCOMArray<n
+@@ -288,12 +288,12 @@
  {
    PRUint32 numQueuedEvents = aEventsToFire.Count();
    for (PRInt32 tail = numQueuedEvents - 1; tail >= 0; tail --) {
 -    nsRefPtr<nsAccEvent> tailEvent = GetAccEventPtr(aEventsToFire[tail]);
 +    nsAccEvent* tailEvent = GetAccEventPtr(aEventsToFire[tail]);
      switch(tailEvent->mEventRule) {
        case nsAccEvent::eCoalesceFromSameSubtree:
        {
          for (PRInt32 index = 0; index < tail; index ++) {
 -          nsRefPtr<nsAccEvent> thisEvent = GetAccEventPtr(aEventsToFire[index]);
 +          nsAccEvent* thisEvent = GetAccEventPtr(aEventsToFire[index]);
            if (thisEvent->mEventType != tailEvent->mEventType)
              continue; // Different type
  
-@@ -342,7 +342,7 @@ nsAccEvent::ApplyEventRules(nsCOMArray<n
+@@ -342,7 +342,7 @@
        {
          // Check for repeat events.
          for (PRInt32 index = 0; index < tail; index ++) {
 -          nsRefPtr<nsAccEvent> accEvent = GetAccEventPtr(aEventsToFire[index]);
 +          nsAccEvent* accEvent = GetAccEventPtr(aEventsToFire[index]);
            if (accEvent->mEventType == tailEvent->mEventType &&
                accEvent->mEventRule == tailEvent->mEventRule &&
                accEvent->mDOMNode == tailEvent->mDOMNode) {
-@@ -362,7 +362,7 @@ nsAccEvent::ApplyToSiblings(nsCOMArray<n
+@@ -362,7 +362,7 @@
                               EEventRule aEventRule)
  {
    for (PRUint32 index = aStart; index < aEnd; index ++) {
 -    nsRefPtr<nsAccEvent> accEvent = GetAccEventPtr(aEventsToFire[index]);
 +    nsAccEvent* accEvent = GetAccEventPtr(aEventsToFire[index]);
      if (accEvent->mEventType == aEventType &&
          accEvent->mEventRule != nsAccEvent::eDoNotEmit &&
          nsAccUtils::AreSiblings(accEvent->mDOMNode, aDOMNode)) {
-@@ -402,7 +402,7 @@ nsAccStateChangeEvent::
+@@ -402,7 +402,7 @@
    // Use GetAccessibleByNode() because we do not want to store an accessible
    // since it leads to problems with delayed events in the case when
    // an accessible gets reorder event before delayed event is processed.
 -  nsCOMPtr<nsIAccessible> accessible(GetAccessibleByNode());
 +  nsIAccessible* accessible(GetAccessibleByNode());
    if (accessible) {
      PRUint32 state = 0, extraState = 0;
      accessible->GetFinalState(&state, mIsExtraState ? &extraState : nsnull);
-@@ -445,7 +445,7 @@ nsAccTextChangeEvent::
+@@ -445,7 +445,7 @@
               aAccessible, aIsAsynch),
    mStart(aStart), mLength(aLength), mIsInserted(aIsInserted)
  {
 -  nsCOMPtr<nsIAccessibleText> textAccessible = do_QueryInterface(aAccessible);
 +  nsIAccessibleText* textAccessible = do_QueryInterface(aAccessible);
    NS_ASSERTION(textAccessible, "Should not be firing test change event for non-text accessible!!!");
    if (textAccessible) {
      textAccessible->GetText(aStart, aStart + aLength, mModifiedText);
-diff --git a/accessible/src/base/nsAccessibleEventData.h b/accessible/src/base/nsAccessibleEventData.h
---- a/accessible/src/base/nsAccessibleEventData.h
-+++ b/accessible/src/base/nsAccessibleEventData.h
-@@ -100,7 +100,7 @@ public:
+diff -r 332906b0e686 accessible/src/base/nsAccessibleEventData.h
+--- a/accessible/src/base/nsAccessibleEventData.h	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/base/nsAccessibleEventData.h	Fri Jul 04 01:35:36 2008 -0700
+@@ -100,7 +100,7 @@
                                       nsIPersistentProperties *aAttributes);
  
  protected:
 -  already_AddRefed<nsIAccessible> GetAccessibleByNode();
 +  nsIAccessible* GetAccessibleByNode();
  
    void CaptureIsFromUserInput(PRBool aIsAsynch);
    PRBool mIsFromUserInput;
-@@ -122,7 +122,7 @@ public:
+@@ -122,7 +122,7 @@
      return eventType;
    }
    static EEventRule EventRule(nsIAccessibleEvent *aAccEvent) {
 -    nsRefPtr<nsAccEvent> accEvent = GetAccEventPtr(aAccEvent);
 +    nsAccEvent* accEvent = GetAccEventPtr(aAccEvent);
      return accEvent->mEventRule;
    }
    static PRBool IsFromUserInput(nsIAccessibleEvent *aAccEvent) {
-@@ -164,7 +164,7 @@ public:
+@@ -164,7 +164,7 @@
    static void ApplyEventRules(nsCOMArray<nsIAccessibleEvent> &aEventsToFire);
  
  private:
 -  static already_AddRefed<nsAccEvent> GetAccEventPtr(nsIAccessibleEvent *aAccEvent) {
 +  static nsAccEvent* GetAccEventPtr(nsIAccessibleEvent *aAccEvent) {
      nsAccEvent* accEvent = nsnull;
      aAccEvent->QueryInterface(NS_GET_IID(nsAccEvent), (void**)&accEvent);
      return accEvent;
-diff --git a/accessible/src/base/nsAccessibleRelation.cpp b/accessible/src/base/nsAccessibleRelation.cpp
---- a/accessible/src/base/nsAccessibleRelation.cpp
-+++ b/accessible/src/base/nsAccessibleRelation.cpp
-@@ -86,7 +86,7 @@ nsAccessibleRelation::GetTargets(nsIArra
+diff -r 332906b0e686 accessible/src/base/nsAccessibleRelation.cpp
+--- a/accessible/src/base/nsAccessibleRelation.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/base/nsAccessibleRelation.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -86,7 +86,7 @@
  {
    NS_ENSURE_ARG_POINTER(aRelations);
  
 -  nsCOMPtr<nsIMutableArray> relations = do_CreateInstance(NS_ARRAY_CONTRACTID);
 +  nsIMutableArray* relations = do_CreateInstance(NS_ARRAY_CONTRACTID);
    NS_ENSURE_TRUE(relations, NS_ERROR_OUT_OF_MEMORY);
  
    relations->AppendElement(mTarget, PR_FALSE);
-diff --git a/accessible/src/base/nsAccessibleTreeWalker.cpp b/accessible/src/base/nsAccessibleTreeWalker.cpp
---- a/accessible/src/base/nsAccessibleTreeWalker.cpp
-+++ b/accessible/src/base/nsAccessibleTreeWalker.cpp
-@@ -71,7 +71,7 @@ nsAccessibleTreeWalker::~nsAccessibleTre
+diff -r 332906b0e686 accessible/src/base/nsAccessibleTreeWalker.cpp
+--- a/accessible/src/base/nsAccessibleTreeWalker.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/base/nsAccessibleTreeWalker.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -71,7 +71,7 @@
  
  void nsAccessibleTreeWalker::GetKids(nsIDOMNode *aParentNode)
  {
 -  nsCOMPtr<nsIContent> parentContent(do_QueryInterface(aParentNode));
 +  nsIContent* parentContent(do_QueryInterface(aParentNode));
    if (!parentContent || !parentContent->IsNodeOfType(nsINode::eHTML)) {
      mState.frame = nsnull;  // Don't walk frames in non-HTML content, just walk the DOM.
    }
-@@ -209,7 +209,7 @@ NS_IMETHODIMP nsAccessibleTreeWalker::Ge
+@@ -209,7 +209,7 @@
      return NS_ERROR_FAILURE;
    }
  
 -  nsCOMPtr<nsIDOMNode> parent(mState.domNode);
 +  nsIDOMNode* parent(mState.domNode);
    GetKids(parent); // Side effects change our state (mState)
  
    // Recursive loop: depth first search for first accessible child
-@@ -282,7 +282,7 @@ PRBool nsAccessibleTreeWalker::GetAccess
+@@ -282,7 +282,7 @@
    }
  
    mState.accessible = nsnull;
 -  nsCOMPtr<nsIPresShell> presShell(do_QueryReferent(mWeakShell));
 +  nsIPresShell* presShell(do_QueryReferent(mWeakShell));
  
    mAccService->GetAccessible(mState.domNode, presShell, mWeakShell,
                               &mState.frame, &mState.isHidden,
-diff --git a/accessible/src/base/nsAccessibleTreeWalker.h b/accessible/src/base/nsAccessibleTreeWalker.h
---- a/accessible/src/base/nsAccessibleTreeWalker.h
-+++ b/accessible/src/base/nsAccessibleTreeWalker.h
-@@ -90,8 +90,8 @@ protected:
+diff -r 332906b0e686 accessible/src/base/nsAccessibleTreeWalker.h
+--- a/accessible/src/base/nsAccessibleTreeWalker.h	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/base/nsAccessibleTreeWalker.h	Fri Jul 04 01:35:36 2008 -0700
+@@ -90,8 +90,8 @@
    void UpdateFrame(PRBool aTryFirstChild);
    void GetNextDOMNode();
  
 -  nsCOMPtr<nsIWeakReference> mWeakShell;
 -  nsCOMPtr<nsIAccessibilityService> mAccService;
 +  nsIWeakReference* mWeakShell;
 +  nsIAccessibilityService* mAccService;
    PRBool mWalkAnonContent;
  };
  
-diff --git a/accessible/src/base/nsApplicationAccessible.cpp b/accessible/src/base/nsApplicationAccessible.cpp
---- a/accessible/src/base/nsApplicationAccessible.cpp
-+++ b/accessible/src/base/nsApplicationAccessible.cpp
-@@ -68,15 +68,15 @@ NS_IMETHODIMP
+diff -r 332906b0e686 accessible/src/base/nsApplicationAccessible.cpp
+--- a/accessible/src/base/nsApplicationAccessible.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/base/nsApplicationAccessible.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -68,15 +68,15 @@
  NS_IMETHODIMP
  nsApplicationAccessible::GetName(nsAString& aName)
  {
 -  nsCOMPtr<nsIStringBundleService> bundleService =
 +  nsIStringBundleService* bundleService =
      do_GetService(NS_STRINGBUNDLE_CONTRACTID);
  
    NS_ASSERTION(bundleService, "String bundle service must be present!");
@@ -5111,34 +5111,34 @@ diff --git a/accessible/src/base/nsAppli
 -  nsCOMPtr<nsIStringBundle> bundle;
 +  nsIStringBundle* bundle = nsnull;
    bundleService->CreateBundle("chrome://branding/locale/brand.properties",
 -                              getter_AddRefs(bundle));
 +                              &bundle);
  
    nsXPIDLString appName;
    if (bundle) {
-@@ -141,13 +141,13 @@ nsApplicationAccessible::GetChildAt(PRIn
+@@ -141,13 +141,13 @@
    if (aChildNum < 0)
      aChildNum = count - 1;
  
 -  nsCOMPtr<nsIWeakReference> childWeakRef;
 +  nsIWeakReference* childWeakRef = nsnull;
    rv = mChildren->QueryElementAt(aChildNum, NS_GET_IID(nsIWeakReference),
 -                                 getter_AddRefs(childWeakRef));
 +                                 (void**)&childWeakRef);
    NS_ENSURE_SUCCESS(rv, rv);
  
    if (childWeakRef) {
 -    nsCOMPtr<nsIAccessible> childAcc(do_QueryReferent(childWeakRef));
 +    nsIAccessible* childAcc(do_QueryReferent(childWeakRef));
      NS_IF_ADDREF(*aChild = childAcc);
    }
  
-@@ -191,16 +191,16 @@ nsApplicationAccessible::CacheChildren()
+@@ -191,16 +191,16 @@
  
    if (mAccChildCount == eChildCountUninitialized) {
      mAccChildCount = 0;// Prevent reentry
 -    nsCOMPtr<nsISimpleEnumerator> enumerator;
 -    mChildren->Enumerate(getter_AddRefs(enumerator));
 +    nsISimpleEnumerator* enumerator = nsnull;
 +    mChildren->Enumerate(&enumerator);
  
@@ -5151,151 +5151,151 @@ diff --git a/accessible/src/base/nsAppli
      PRBool hasMoreElements;
      while(NS_SUCCEEDED(enumerator->HasMoreElements(&hasMoreElements))
            && hasMoreElements) {
 -      enumerator->GetNext(getter_AddRefs(childWeakRef));
 +      enumerator->GetNext((nsISupports**)&childWeakRef);
        accessible = do_QueryReferent(childWeakRef);
        if (accessible) {
          if (previousAccessible)
-@@ -242,7 +242,7 @@ nsApplicationAccessible::RemoveRootAcces
+@@ -242,7 +242,7 @@
    PRUint32 index = 0;
  
    // we must use weak ref to get the index
 -  nsCOMPtr<nsIWeakReference> weakPtr = do_GetWeakReference(aRootAccessible);
 +  nsIWeakReference* weakPtr = do_GetWeakReference(aRootAccessible);
    nsresult rv = mChildren->IndexOf(0, weakPtr, &index);
    NS_ENSURE_SUCCESS(rv, rv);
  
-diff --git a/accessible/src/base/nsBaseWidgetAccessible.cpp b/accessible/src/base/nsBaseWidgetAccessible.cpp
---- a/accessible/src/base/nsBaseWidgetAccessible.cpp
-+++ b/accessible/src/base/nsBaseWidgetAccessible.cpp
-@@ -114,7 +114,7 @@ NS_IMETHODIMP
+diff -r 332906b0e686 accessible/src/base/nsBaseWidgetAccessible.cpp
+--- a/accessible/src/base/nsBaseWidgetAccessible.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/base/nsBaseWidgetAccessible.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -114,7 +114,7 @@
  NS_IMETHODIMP
  nsLinkableAccessible::TakeFocus()
  {
 -  nsCOMPtr<nsIAccessible> actionAcc = GetActionAccessible();
 +  nsIAccessible* actionAcc = GetActionAccessible();
    if (actionAcc)
      return actionAcc->TakeFocus();
  
-@@ -129,7 +129,7 @@ nsLinkableAccessible::GetState(PRUint32 
+@@ -129,7 +129,7 @@
  
    if (mIsLink) {
      *aState |= nsIAccessibleStates::STATE_LINKED;
 -    nsCOMPtr<nsIAccessible> actionAcc = GetActionAccessible();
 +    nsIAccessible* actionAcc = GetActionAccessible();
      if (actionAcc && (State(actionAcc) & nsIAccessibleStates::STATE_TRAVERSED))
        *aState |= nsIAccessibleStates::STATE_TRAVERSED;
    }
-@@ -147,7 +147,7 @@ nsLinkableAccessible::GetValue(nsAString
+@@ -147,7 +147,7 @@
      return NS_OK;
  
    if (mIsLink) {
 -    nsCOMPtr<nsIAccessible> actionAcc = GetActionAccessible();
 +    nsIAccessible* actionAcc = GetActionAccessible();
      if (actionAcc)
        return actionAcc->GetValue(aValue);
    }
-@@ -188,7 +188,7 @@ NS_IMETHODIMP
+@@ -188,7 +188,7 @@
  NS_IMETHODIMP
  nsLinkableAccessible::DoAction(PRUint8 aIndex)
  {
 -  nsCOMPtr<nsIAccessible> actionAcc = GetActionAccessible();
 +  nsIAccessible* actionAcc = GetActionAccessible();
    if (actionAcc)
      return actionAcc->DoAction(aIndex);
  
-@@ -200,7 +200,7 @@ nsLinkableAccessible::GetKeyboardShortcu
+@@ -200,7 +200,7 @@
  {
    aKeyboardShortcut.Truncate();
  
 -  nsCOMPtr<nsIAccessible> actionAcc = GetActionAccessible();
 +  nsIAccessible* actionAcc = GetActionAccessible();
    if (actionAcc)
      return actionAcc->GetKeyboardShortcut(aKeyboardShortcut);
  
-@@ -214,9 +214,9 @@ nsLinkableAccessible::GetURI(PRInt32 aIn
+@@ -214,9 +214,9 @@
  nsLinkableAccessible::GetURI(PRInt32 aIndex, nsIURI **aURI)
  {
    if (mIsLink) {
 -    nsCOMPtr<nsIAccessible> actionAcc = GetActionAccessible();
 +    nsIAccessible* actionAcc = GetActionAccessible();
      if (actionAcc) {
 -      nsCOMPtr<nsIAccessibleHyperLink> hyperLinkAcc =
 +      nsIAccessibleHyperLink* hyperLinkAcc =
          do_QueryInterface(actionAcc);
        NS_ASSERTION(hyperLinkAcc,
                     "nsIAccessibleHyperLink isn't implemented.");
-@@ -252,7 +252,7 @@ void
+@@ -252,7 +252,7 @@
  void
  nsLinkableAccessible::CacheActionContent()
  {
 -  nsCOMPtr<nsIContent> walkUpContent(do_QueryInterface(mDOMNode));
 +  nsIContent* walkUpContent(do_QueryInterface(mDOMNode));
    PRBool isOnclick = nsAccUtils::HasListener(walkUpContent,
                                               NS_LITERAL_STRING("click"));
  
-@@ -266,11 +266,11 @@ nsLinkableAccessible::CacheActionContent
+@@ -266,11 +266,11 @@
      isOnclick = nsAccUtils::HasListener(walkUpContent,
                                          NS_LITERAL_STRING("click"));
    
 -    nsCOMPtr<nsIDOMNode> walkUpNode(do_QueryInterface(walkUpContent));
 +    nsIDOMNode* walkUpNode(do_QueryInterface(walkUpContent));
  
 -    nsCOMPtr<nsIAccessible> walkUpAcc;
 +    nsIAccessible* walkUpAcc = nsnull;
      GetAccService()->GetAccessibleInWeakShell(walkUpNode, mWeakShell,
 -                                              getter_AddRefs(walkUpAcc));
 +                                              &walkUpAcc);
  
      if (walkUpAcc && Role(walkUpAcc) == nsIAccessibleRole::ROLE_LINK &&
          (State(walkUpAcc) & nsIAccessibleStates::STATE_LINKED)) {
-@@ -287,14 +287,14 @@ nsLinkableAccessible::CacheActionContent
+@@ -287,14 +287,14 @@
    }
  }
  
 -already_AddRefed<nsIAccessible>
 +nsIAccessible*
  nsLinkableAccessible::GetActionAccessible()
  {
    // Return accessible for the action content if it's different from node of
    // this accessible. If the action accessible is not null then it is used to
    // redirect methods calls otherwise we use method implementation from the
    // base class.
 -  nsCOMPtr<nsIDOMNode> actionNode(do_QueryInterface(mActionContent));
 +  nsIDOMNode* actionNode(do_QueryInterface(mActionContent));
    if (!actionNode || mDOMNode == actionNode)
      return nsnull;
  
-diff --git a/accessible/src/base/nsBaseWidgetAccessible.h b/accessible/src/base/nsBaseWidgetAccessible.h
---- a/accessible/src/base/nsBaseWidgetAccessible.h
-+++ b/accessible/src/base/nsBaseWidgetAccessible.h
-@@ -101,7 +101,7 @@ protected:
+diff -r 332906b0e686 accessible/src/base/nsBaseWidgetAccessible.h
+--- a/accessible/src/base/nsBaseWidgetAccessible.h	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/base/nsBaseWidgetAccessible.h	Fri Jul 04 01:35:36 2008 -0700
+@@ -101,7 +101,7 @@
    /**
     * Return an accessible for cached action node.
     */
 -  already_AddRefed<nsIAccessible> GetActionAccessible();
 +  nsIAccessible* GetActionAccessible();
  
    /**
     * Cache action node.
-diff --git a/accessible/src/base/nsCaretAccessible.cpp b/accessible/src/base/nsCaretAccessible.cpp
---- a/accessible/src/base/nsCaretAccessible.cpp
-+++ b/accessible/src/base/nsCaretAccessible.cpp
-@@ -81,7 +81,7 @@ nsresult nsCaretAccessible::ClearControl
+diff -r 332906b0e686 accessible/src/base/nsCaretAccessible.cpp
+--- a/accessible/src/base/nsCaretAccessible.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/base/nsCaretAccessible.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -81,7 +81,7 @@
    mCurrentControl = nsnull;
    mCurrentControlSelection = nsnull;
  
 -  nsCOMPtr<nsISelectionPrivate> selPrivate(do_QueryReferent(mCurrentControlSelection));
 +  nsISelectionPrivate* selPrivate(do_QueryReferent(mCurrentControlSelection));
    if (!selPrivate) {
      return NS_OK;
    }
-@@ -100,15 +100,15 @@ nsresult nsCaretAccessible::SetControlSe
+@@ -100,15 +100,15 @@
  
    // When focus moves such that the caret is part of a new frame selection
    // this removes the old selection listener and attaches a new one for the current focus
 -  nsCOMPtr<nsIPresShell> presShell = 
 +  nsIPresShell* presShell = 
      mRootAccessible->GetPresShellFor(aCurrentNode);
    if (!presShell)
      return NS_ERROR_FAILURE;
@@ -5304,17 +5304,17 @@ diff --git a/accessible/src/base/nsCaret
 +  nsIDocument* doc = presShell->GetDocument();
    NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE);
  
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(aCurrentNode));
 +  nsIContent* content(do_QueryInterface(aCurrentNode));
    // The control selection listener is only for form controls, not for the document
    // When there is no document, the content will be null
    if (!content) {
-@@ -121,14 +121,14 @@ nsresult nsCaretAccessible::SetControlSe
+@@ -121,14 +121,14 @@
    nsPresContext *presContext = presShell->GetPresContext();
    NS_ENSURE_TRUE(presContext, NS_ERROR_FAILURE);
  
 -  nsCOMPtr<nsISelectionController> selCon;
 -  frame->GetSelectionController(presContext, getter_AddRefs(selCon));
 +  nsISelectionController* selCon = nsnull;
 +  frame->GetSelectionController(presContext, &selCon);
    NS_ENSURE_TRUE(selCon, NS_ERROR_FAILURE);
@@ -5324,51 +5324,51 @@ diff --git a/accessible/src/base/nsCaret
 +  nsISelection* domSel = nsnull;
 +  selCon->GetSelection(nsISelectionController::SELECTION_NORMAL, &domSel);
  
 -  nsCOMPtr<nsISelectionPrivate> selPrivate(do_QueryInterface(domSel));
 +  nsISelectionPrivate* selPrivate(do_QueryInterface(domSel));
    NS_ENSURE_TRUE(selPrivate, NS_ERROR_FAILURE);
  
    mCurrentControlSelection = do_GetWeakReference(domSel);
-@@ -140,12 +140,12 @@ nsCaretAccessible::AddDocSelectionListen
+@@ -140,12 +140,12 @@
  {
    NS_ENSURE_TRUE(mRootAccessible, NS_ERROR_FAILURE);
  
 -  nsCOMPtr<nsISelectionController> selCon = do_QueryInterface(aShell);
 +  nsISelectionController* selCon = do_QueryInterface(aShell);
    NS_ENSURE_TRUE(selCon, NS_ERROR_FAILURE);
  
 -  nsCOMPtr<nsISelection> domSel;
 -  selCon->GetSelection(nsISelectionController::SELECTION_NORMAL, getter_AddRefs(domSel));
 -  nsCOMPtr<nsISelectionPrivate> selPrivate = do_QueryInterface(domSel);
 +  nsISelection* domSel = nsnull;
 +  selCon->GetSelection(nsISelectionController::SELECTION_NORMAL, &domSel);
 +  nsISelectionPrivate* selPrivate = do_QueryInterface(domSel);
    NS_ENSURE_TRUE(selPrivate, NS_ERROR_FAILURE);
  
    return selPrivate->AddSelectionListener(this);
-@@ -154,12 +154,12 @@ nsresult
+@@ -154,12 +154,12 @@
  nsresult
  nsCaretAccessible::RemoveDocSelectionListener(nsIPresShell *aShell)
  {
 -  nsCOMPtr<nsISelectionController> selCon = do_QueryInterface(aShell);
 +  nsISelectionController* selCon = do_QueryInterface(aShell);
    NS_ENSURE_TRUE(selCon, NS_ERROR_FAILURE);
  
 -  nsCOMPtr<nsISelection> domSel;
 -  selCon->GetSelection(nsISelectionController::SELECTION_NORMAL, getter_AddRefs(domSel));
 -  nsCOMPtr<nsISelectionPrivate> selPrivate = do_QueryInterface(domSel);
 +  nsISelection* domSel = nsnull;
 +  selCon->GetSelection(nsISelectionController::SELECTION_NORMAL, &domSel);
 +  nsISelectionPrivate* selPrivate = do_QueryInterface(domSel);
    NS_ENSURE_TRUE(selPrivate, NS_ERROR_FAILURE);
  
    return selPrivate->RemoveSelectionListener(this);
-@@ -171,26 +171,26 @@ NS_IMETHODIMP nsCaretAccessible::NotifyS
+@@ -171,26 +171,26 @@
  
    mLastUsedSelection = do_GetWeakReference(aSel);
  
 -  nsCOMPtr<nsIDocument> doc = do_QueryInterface(aDoc);
 +  nsIDocument* doc = do_QueryInterface(aDoc);
    NS_ENSURE_TRUE(doc, NS_OK);
    nsIPresShell *presShell = doc->GetPrimaryShell();
    NS_ENSURE_TRUE(presShell, NS_OK);
@@ -5391,17 +5391,17 @@ diff --git a/accessible/src/base/nsCaret
 -  nsCOMPtr<nsIAccessibleDocument> docAccessible =
 +  nsIAccessibleDocument* docAccessible =
      nsAccessNode::GetDocAccessibleFor(focusNode);
 -  nsCOMPtr<nsIAccessible> accessibleForDoc =
 +  nsIAccessible* accessibleForDoc =
      do_QueryInterface(docAccessible);
    if (!accessibleForDoc) {
      return NS_OK;
-@@ -201,27 +201,27 @@ NS_IMETHODIMP nsCaretAccessible::NotifyS
+@@ -201,27 +201,27 @@
      return NS_OK;  // Don't fire caret moves until doc loaded
    }
  
 -  nsCOMPtr<nsIDOMNode> nodeWithCaret = focusNode;
 +  nsIDOMNode* nodeWithCaret = focusNode;
  
 -  nsCOMPtr<nsIAccessibleText> textAcc;
 +  nsIAccessibleText* textAcc = nsnull;
@@ -5428,26 +5428,26 @@ diff --git a/accessible/src/base/nsCaret
 -    focusNode->GetParentNode(getter_AddRefs(parentNode));
 -    focusNode.swap(parentNode);
 +    nsIDOMNode* parentNode = nsnull;
 +    focusNode->GetParentNode(&parentNode);
 +    swap(focusNode, parentNode);
    }
    NS_ASSERTION(textAcc, "No nsIAccessibleText for caret move event!"); // No nsIAccessibleText for caret move event!
    NS_ENSURE_TRUE(textAcc, NS_ERROR_FAILURE);
-@@ -240,7 +240,7 @@ NS_IMETHODIMP nsCaretAccessible::NotifyS
+@@ -240,7 +240,7 @@
    mLastCaretOffset = caretOffset;
    mLastTextAccessible = textAcc;
  
 -  nsCOMPtr<nsIAccessibleCaretMoveEvent> event =
 +  nsIAccessibleCaretMoveEvent* event =
      new nsAccCaretMoveEvent(focusNode);
    NS_ENSURE_TRUE(event, NS_ERROR_OUT_OF_MEMORY);
  
-@@ -259,23 +259,23 @@ nsCaretAccessible::GetCaretRect(nsIWidge
+@@ -259,23 +259,23 @@
      return caretRect;    // Return empty rect
    }
  
 -  nsCOMPtr<nsIAccessNode> lastAccessNode(do_QueryInterface(mLastTextAccessible));
 +  nsIAccessNode* lastAccessNode(do_QueryInterface(mLastTextAccessible));
    NS_ENSURE_TRUE(lastAccessNode, caretRect);
  
 -  nsCOMPtr<nsIDOMNode> lastNodeWithCaret;
@@ -5468,165 +5468,165 @@ diff --git a/accessible/src/base/nsCaret
  
    PRBool isCollapsed;
    nsIView *view;
 -  nsCOMPtr<nsISelection> caretSelection(do_QueryReferent(mLastUsedSelection));
 +  nsISelection* caretSelection(do_QueryReferent(mLastUsedSelection));
    NS_ENSURE_TRUE(caretSelection, caretRect);
    
    caret->GetCaretCoordinates(nsICaret::eRenderingViewCoordinates, caretSelection,
-diff --git a/accessible/src/base/nsDocAccessible.cpp b/accessible/src/base/nsDocAccessible.cpp
---- a/accessible/src/base/nsDocAccessible.cpp
-+++ b/accessible/src/base/nsDocAccessible.cpp
-@@ -97,7 +97,7 @@ nsDocAccessible::nsDocAccessible(nsIDOMN
+diff -r 332906b0e686 accessible/src/base/nsDocAccessible.cpp
+--- a/accessible/src/base/nsDocAccessible.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/base/nsDocAccessible.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -97,7 +97,7 @@
    // there can be 2 nsDocAccessible's for the content area, although for 2 different
    // pres shells.
  
 -  nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mWeakShell));
 +  nsIPresShell* shell(do_QueryReferent(mWeakShell));
    if (shell) {
      // Find mDocument
      mDocument = shell->GetDocument();
-@@ -105,8 +105,8 @@ nsDocAccessible::nsDocAccessible(nsIDOMN
+@@ -105,8 +105,8 @@
      // Find mWnd
      nsIViewManager* vm = shell->GetViewManager();
      if (vm) {
 -      nsCOMPtr<nsIWidget> widget;
 -      vm->GetWidget(getter_AddRefs(widget));
 +      nsIWidget* widget = nsnull;
 +      vm->GetWidget(&widget);
        if (widget) {
          mWnd = widget->GetNativeData(NS_NATIVE_WINDOW);
        }
-@@ -116,9 +116,9 @@ nsDocAccessible::nsDocAccessible(nsIDOMN
+@@ -116,9 +116,9 @@
    // XXX aaronl should we use an algorithm for the initial cache size?
    mAccessNodeCache.Init(kDefaultCacheSize);
  
 -  nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem =
 +  nsIDocShellTreeItem* docShellTreeItem =
      nsAccUtils::GetDocShellTreeItemFor(mDOMNode);
 -  nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(docShellTreeItem);
 +  nsIDocShell* docShell = do_QueryInterface(docShellTreeItem);
    if (docShell) {
      PRUint32 busyFlags;
      docShell->GetBusyFlags(&busyFlags);
-@@ -173,11 +173,11 @@ NS_IMETHODIMP nsDocAccessible::GetRole(P
+@@ -173,11 +173,11 @@
  {
    *aRole = nsIAccessibleRole::ROLE_PANE; // Fall back
  
 -  nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem =
 +  nsIDocShellTreeItem* docShellTreeItem =
      nsAccUtils::GetDocShellTreeItemFor(mDOMNode);
    if (docShellTreeItem) {
 -    nsCOMPtr<nsIDocShellTreeItem> sameTypeRoot;
 -    docShellTreeItem->GetSameTypeRootTreeItem(getter_AddRefs(sameTypeRoot));
 +    nsIDocShellTreeItem* sameTypeRoot = nsnull;
 +    docShellTreeItem->GetSameTypeRootTreeItem(&sameTypeRoot);
      PRInt32 itemType;
      docShellTreeItem->GetItemType(&itemType);
      if (sameTypeRoot == docShellTreeItem) {
-@@ -187,7 +187,7 @@ NS_IMETHODIMP nsDocAccessible::GetRole(P
+@@ -187,7 +187,7 @@
        }
        else if (itemType == nsIDocShellTreeItem::typeContent) {
  #ifdef MOZ_XUL
 -        nsCOMPtr<nsIXULDocument> xulDoc(do_QueryInterface(mDocument));
 +        nsIXULDocument* xulDoc(do_QueryInterface(mDocument));
          if (xulDoc) {
            *aRole = nsIAccessibleRole::ROLE_APPLICATION;
          } else {
-@@ -216,7 +216,7 @@ NS_IMETHODIMP nsDocAccessible::SetRoleMa
+@@ -216,7 +216,7 @@
    nsIDocument *parentDoc = mDocument->GetParentDocument();
    NS_ENSURE_TRUE(parentDoc, NS_ERROR_FAILURE);
    nsIContent *ownerContent = parentDoc->FindContentForSubDocument(mDocument);
 -  nsCOMPtr<nsIDOMNode> ownerNode(do_QueryInterface(ownerContent));
 +  nsIDOMNode* ownerNode(do_QueryInterface(ownerContent));
    if (ownerNode) {
      nsRoleMapEntry *roleMapEntry = nsAccUtils::GetRoleMapEntry(ownerNode);
      if (roleMapEntry)
-@@ -250,7 +250,7 @@ nsDocAccessible::GetState(PRUint32 *aSta
+@@ -250,7 +250,7 @@
      return NS_OK;
  
  #ifdef MOZ_XUL
 -  nsCOMPtr<nsIXULDocument> xulDoc(do_QueryInterface(mDocument));
 +  nsIXULDocument* xulDoc(do_QueryInterface(mDocument));
    if (!xulDoc)
  #endif
    {
-@@ -281,8 +281,8 @@ nsDocAccessible::GetState(PRUint32 *aSta
+@@ -281,8 +281,8 @@
                 nsIAccessibleStates::STATE_OFFSCREEN;
    }
  
 -  nsCOMPtr<nsIEditor> editor;
 -  GetAssociatedEditor(getter_AddRefs(editor));
 +  nsIEditor* editor = nsnull;
 +  GetAssociatedEditor(&editor);
    if (!editor) {
      *aState |= nsIAccessibleStates::STATE_READONLY;
    }
-@@ -301,7 +301,7 @@ nsDocAccessible::GetARIAState(PRUint32 *
+@@ -301,7 +301,7 @@
    nsresult rv = nsAccessible::GetARIAState(aState);
    NS_ENSURE_SUCCESS(rv, rv);
  
 -  nsCOMPtr<nsPIAccessible> privateParentAccessible = do_QueryInterface(mParent);
 +  nsPIAccessible* privateParentAccessible = do_QueryInterface(mParent);
    if (privateParentAccessible)  // Allow iframe/frame etc. to have final state override via ARIA
      return privateParentAccessible->GetARIAState(aState);
  
-@@ -327,7 +327,7 @@ NS_IMETHODIMP nsDocAccessible::GetFocuse
+@@ -327,7 +327,7 @@
  
    // Return an accessible for the current global focus, which does not have to
    // be contained within the current document.
 -  nsCOMPtr<nsIAccessibilityService> accService =
 +  nsIAccessibilityService* accService =
      do_GetService("@mozilla.org/accessibilityService;1");
    return accService->GetAccessibleFor(gLastFocusedNode, aFocusedChild);
  }
-@@ -341,12 +341,12 @@ NS_IMETHODIMP nsDocAccessible::TakeFocus
+@@ -341,12 +341,12 @@
      return NS_ERROR_FAILURE; // Not focusable
    }
  
 -  nsCOMPtr<nsIDocShellTreeItem> treeItem =
 +  nsIDocShellTreeItem* treeItem =
      nsAccUtils::GetDocShellTreeItemFor(mDOMNode);
 -  nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(treeItem);
 +  nsIDocShell* docShell = do_QueryInterface(treeItem);
    NS_ENSURE_TRUE(docShell, NS_ERROR_FAILURE);
  
 -  nsCOMPtr<nsIPresShell> shell(GetPresShell());
 +  nsIPresShell* shell(GetPresShell());
    if (!shell) {
      NS_WARNING("Was not shutdown properly via InvalidateCacheSubtree()");
      return NS_ERROR_FAILURE;
-@@ -369,12 +369,12 @@ NS_IMETHODIMP nsDocAccessible::GetURL(ns
+@@ -369,12 +369,12 @@
    if (!mDocument) {
      return NS_ERROR_FAILURE; // Document has been shut down
    }
 -  nsCOMPtr<nsISupports> container = mDocument->GetContainer();
 -  nsCOMPtr<nsIWebNavigation> webNav(do_GetInterface(container));
 +  nsISupports* container = mDocument->GetContainer();
 +  nsIWebNavigation* webNav(do_GetInterface(container));
    nsCAutoString theURL;
    if (webNav) {
 -    nsCOMPtr<nsIURI> pURI;
 -    webNav->GetCurrentURI(getter_AddRefs(pURI));
 +    nsIURI* pURI = nsnull;
 +    webNav->GetCurrentURI(&pURI);
      if (pURI)
        pURI->GetSpec(theURL);
    }
-@@ -394,7 +394,7 @@ NS_IMETHODIMP nsDocAccessible::GetTitle(
+@@ -394,7 +394,7 @@
  
  NS_IMETHODIMP nsDocAccessible::GetMimeType(nsAString& aMimeType)
  {
 -  nsCOMPtr<nsIDOMNSDocument> domnsDocument(do_QueryInterface(mDocument));
 +  nsIDOMNSDocument* domnsDocument(do_QueryInterface(mDocument));
    if (domnsDocument) {
      return domnsDocument->GetContentType(aMimeType);
    }
-@@ -403,17 +403,17 @@ NS_IMETHODIMP nsDocAccessible::GetMimeTy
+@@ -403,17 +403,17 @@
  
  NS_IMETHODIMP nsDocAccessible::GetDocType(nsAString& aDocType)
  {
 -  nsCOMPtr<nsIDOMDocument> domDoc(do_QueryInterface(mDocument));
 -  nsCOMPtr<nsIDOMDocumentType> docType;
 +  nsIDOMDocument* domDoc(do_QueryInterface(mDocument));
 +  nsIDOMDocumentType* docType = nsnull;
  
@@ -5638,35 +5638,35 @@ diff --git a/accessible/src/base/nsDocAc
      return NS_OK;
    } else
  #endif
 -  if (domDoc && NS_SUCCEEDED(domDoc->GetDoctype(getter_AddRefs(docType))) && docType) {
 +  if (domDoc && NS_SUCCEEDED(domDoc->GetDoctype(&docType)) && docType) {
      return docType->GetPublicId(aDocType);
    }
  
-@@ -423,7 +423,7 @@ NS_IMETHODIMP nsDocAccessible::GetNameSp
+@@ -423,7 +423,7 @@
  NS_IMETHODIMP nsDocAccessible::GetNameSpaceURIForID(PRInt16 aNameSpaceID, nsAString& aNameSpaceURI)
  {
    if (mDocument) {
 -    nsCOMPtr<nsINameSpaceManager> nameSpaceManager =
 +    nsINameSpaceManager* nameSpaceManager =
          do_GetService(NS_NAMESPACEMANAGER_CONTRACTID);
      if (nameSpaceManager)
        return nameSpaceManager->GetNameSpaceURI(aNameSpaceID, aNameSpaceURI);
-@@ -453,7 +453,7 @@ NS_IMETHODIMP nsDocAccessible::GetWindow
+@@ -453,7 +453,7 @@
  
  NS_IMETHODIMP nsDocAccessible::GetDocument(nsIDOMDocument **aDOMDoc)
  {
 -  nsCOMPtr<nsIDOMDocument> domDoc(do_QueryInterface(mDocument));
 +  nsIDOMDocument* domDoc(do_QueryInterface(mDocument));
    *aDOMDoc = domDoc;
  
    if (domDoc) {
-@@ -475,13 +475,13 @@ NS_IMETHODIMP nsDocAccessible::GetAssoci
+@@ -475,13 +475,13 @@
      return NS_OK; // Document not editable
    }
  
 -  nsCOMPtr<nsISupports> container = mDocument->GetContainer();
 -  nsCOMPtr<nsIEditingSession> editingSession(do_GetInterface(container));
 +  nsISupports* container = mDocument->GetContainer();
 +  nsIEditingSession* editingSession(do_GetInterface(container));
    if (!editingSession)
@@ -5674,58 +5674,58 @@ diff --git a/accessible/src/base/nsDocAc
  
 -  nsCOMPtr<nsIEditor> editor;
 -  editingSession->GetEditorForWindow(mDocument->GetWindow(), getter_AddRefs(editor));
 +  nsIEditor* editor = nsnull;
 +  editingSession->GetEditorForWindow(mDocument->GetWindow(), &editor);
    if (!editor) {
      return NS_OK;
    }
-@@ -530,9 +530,9 @@ NS_IMETHODIMP nsDocAccessible::GetParent
+@@ -530,9 +530,9 @@
      nsIDocument *parentDoc = mDocument->GetParentDocument();
      NS_ENSURE_TRUE(parentDoc, NS_ERROR_FAILURE);
      nsIContent *ownerContent = parentDoc->FindContentForSubDocument(mDocument);
 -    nsCOMPtr<nsIDOMNode> ownerNode(do_QueryInterface(ownerContent));
 +    nsIDOMNode* ownerNode(do_QueryInterface(ownerContent));
      if (ownerNode) {
 -      nsCOMPtr<nsIAccessibilityService> accService =
 +      nsIAccessibilityService* accService =
          do_GetService("@mozilla.org/accessibilityService;1");
        if (accService) {
          // XXX aaronl: ideally we would traverse the presshell chain
-@@ -553,8 +553,8 @@ NS_IMETHODIMP nsDocAccessible::Init()
+@@ -553,8 +553,8 @@
  
    AddEventListeners();
  
 -  nsCOMPtr<nsIAccessible> parentAccessible;  // Ensure outer doc mParent accessible
 -  GetParent(getter_AddRefs(parentAccessible));
 +  nsIAccessible* parentAccessible = nsnull;  // Ensure outer doc mParent accessible
 +  GetParent(&parentAccessible);
  
    return nsHyperTextAccessibleWrap::Init();
  }
-@@ -565,7 +565,7 @@ NS_IMETHODIMP nsDocAccessible::Shutdown(
+@@ -565,7 +565,7 @@
      return NS_OK;  // Already shutdown
    }
  
 -  nsCOMPtr<nsIDocShellTreeItem> treeItem =
 +  nsIDocShellTreeItem* treeItem =
      nsAccUtils::GetDocShellTreeItemFor(mDOMNode);
    ShutdownChildDocuments(treeItem);
  
-@@ -575,7 +575,7 @@ NS_IMETHODIMP nsDocAccessible::Shutdown(
+@@ -575,7 +575,7 @@
  
    ClearCache(mAccessNodeCache);
  
 -  nsCOMPtr<nsIDocument> kungFuDeathGripDoc = mDocument;
 +  nsIDocument* kungFuDeathGripDoc = mDocument;
    mDocument = nsnull;
  
    nsHyperTextAccessibleWrap::Shutdown();
-@@ -606,20 +606,20 @@ NS_IMETHODIMP nsDocAccessible::Shutdown(
+@@ -606,20 +606,20 @@
  
  void nsDocAccessible::ShutdownChildDocuments(nsIDocShellTreeItem *aStart)
  {
 -  nsCOMPtr<nsIDocShellTreeNode> treeNode(do_QueryInterface(aStart));
 +  nsIDocShellTreeNode* treeNode(do_QueryInterface(aStart));
    if (treeNode) {
      PRInt32 subDocuments;
      treeNode->GetChildCount(&subDocuments);
@@ -5741,41 +5741,41 @@ diff --git a/accessible/src/base/nsDocAc
 -      nsCOMPtr<nsIAccessibleDocument> docAccessible =
 +      nsIAccessibleDocument* docAccessible =
          GetDocAccessibleFor(treeItemChild);
 -      nsCOMPtr<nsPIAccessNode> accessNode = do_QueryInterface(docAccessible);
 +      nsPIAccessNode* accessNode = do_QueryInterface(docAccessible);
        if (accessNode) {
          accessNode->Shutdown();
        }
-@@ -629,7 +629,7 @@ void nsDocAccessible::ShutdownChildDocum
+@@ -629,7 +629,7 @@
  
  nsIFrame* nsDocAccessible::GetFrame()
  {
 -  nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mWeakShell));
 +  nsIPresShell* shell(do_QueryReferent(mWeakShell));
  
    nsIFrame* root = nsnull;
    if (shell)
-@@ -687,11 +687,11 @@ nsresult nsDocAccessible::AddEventListen
+@@ -687,11 +687,11 @@
    // 1) Set up scroll position listener
    // 2) Check for editor and listen for changes to editor
  
 -  nsCOMPtr<nsIPresShell> presShell(GetPresShell());
 +  nsIPresShell* presShell(GetPresShell());
    NS_ENSURE_TRUE(presShell, NS_ERROR_FAILURE);
  
 -  nsCOMPtr<nsISupports> container = mDocument->GetContainer();
 -  nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem(do_QueryInterface(container));
 +  nsISupports* container = mDocument->GetContainer();
 +  nsIDocShellTreeItem* docShellTreeItem(do_QueryInterface(container));
    NS_ENSURE_TRUE(docShellTreeItem, NS_ERROR_FAILURE);
  
    // Make sure we're a content docshell
-@@ -703,20 +703,20 @@ nsresult nsDocAccessible::AddEventListen
+@@ -703,20 +703,20 @@
  
    if (isContent) {
      // We're not an editor yet, but we might become one
 -    nsCOMPtr<nsICommandManager> commandManager = do_GetInterface(docShellTreeItem);
 +    nsICommandManager* commandManager = do_GetInterface(docShellTreeItem);
      if (commandManager) {
        commandManager->AddCommandObserver(this, "obs_documentCreated");
      }
@@ -5792,17 +5792,17 @@ diff --git a/accessible/src/base/nsDocAc
 -    nsRefPtr<nsRootAccessible> rootAccessible = GetRootAccessible(); // Then get it as ref ptr
 +    nsRootAccessible* rootAccessible = GetRootAccessible(); // Then get it as ref ptr
      NS_ENSURE_TRUE(rootAccessible, NS_ERROR_FAILURE);
 -    nsRefPtr<nsCaretAccessible> caretAccessible = rootAccessible->GetCaretAccessible();
 +    nsCaretAccessible* caretAccessible = rootAccessible->GetCaretAccessible();
      if (caretAccessible) {
        caretAccessible->AddDocSelectionListener(presShell);
      }
-@@ -742,24 +742,24 @@ nsresult nsDocAccessible::RemoveEventLis
+@@ -742,24 +742,24 @@
      NS_RELEASE_THIS(); // Kung fu death grip
    }
  
 -  nsRefPtr<nsRootAccessible> rootAccessible(GetRootAccessible());
 +  nsRootAccessible* rootAccessible(GetRootAccessible());
    if (rootAccessible) {
 -    nsRefPtr<nsCaretAccessible> caretAccessible = rootAccessible->GetCaretAccessible();
 +    nsCaretAccessible* caretAccessible = rootAccessible->GetCaretAccessible();
@@ -5823,34 +5823,34 @@ diff --git a/accessible/src/base/nsDocAc
    PRInt32 itemType;
    docShellTreeItem->GetItemType(&itemType);
    if (itemType == nsIDocShellTreeItem::typeContent) {
 -    nsCOMPtr<nsICommandManager> commandManager = do_GetInterface(docShellTreeItem);
 +    nsICommandManager* commandManager = do_GetInterface(docShellTreeItem);
      if (commandManager) {
        commandManager->RemoveCommandObserver(this, "obs_documentCreated");
      }
-@@ -773,12 +773,12 @@ NS_IMETHODIMP nsDocAccessible::FireAncho
+@@ -773,12 +773,12 @@
    if (!mIsContentLoaded || !mDocument) {
      return NS_OK;
    }
 -  nsCOMPtr<nsISupports> container = mDocument->GetContainer();
 -  nsCOMPtr<nsIWebNavigation> webNav(do_GetInterface(container));
 +  nsISupports* container = mDocument->GetContainer();
 +  nsIWebNavigation* webNav(do_GetInterface(container));
    nsCAutoString theURL;
    if (webNav) {
 -    nsCOMPtr<nsIURI> pURI;
 -    webNav->GetCurrentURI(getter_AddRefs(pURI));
 +    nsIURI* pURI = nsnull;
 +    webNav->GetCurrentURI(&pURI);
      if (pURI) {
        pURI->GetSpec(theURL);
      }
-@@ -821,19 +821,19 @@ NS_IMETHODIMP nsDocAccessible::FireDocLo
+@@ -821,19 +821,19 @@
      mIsLoadCompleteFired = PR_TRUE;
    }
  
 -  nsCOMPtr<nsIDocShellTreeItem> treeItem =
 +  nsIDocShellTreeItem* treeItem =
      nsAccUtils::GetDocShellTreeItemFor(mDOMNode);
    if (!treeItem) {
      return NS_OK;
@@ -5865,17 +5865,17 @@ diff --git a/accessible/src/base/nsDocAc
      AddScrollListener();
 -    nsCOMPtr<nsIAccessible> parent(nsAccessible::GetParent());
 -    nsCOMPtr<nsPIAccessible> privateAccessible(do_QueryInterface(parent));
 +    nsIAccessible* parent(nsAccessible::GetParent());
 +    nsPIAccessible* privateAccessible(do_QueryInterface(parent));
      if (privateAccessible) {
        // Make the parent forget about the old document as a child
        privateAccessible->InvalidateChildren();
-@@ -845,13 +845,13 @@ NS_IMETHODIMP nsDocAccessible::FireDocLo
+@@ -845,13 +845,13 @@
      }
      // Fire STATE_CHANGE event for doc load finish if focus is in same doc tree
      if (gLastFocusedNode) {
 -      nsCOMPtr<nsIDocShellTreeItem> focusedTreeItem =
 +      nsIDocShellTreeItem* focusedTreeItem =
          nsAccUtils::GetDocShellTreeItemFor(gLastFocusedNode);
        if (focusedTreeItem) {
 -        nsCOMPtr<nsIDocShellTreeItem> sameTypeRootOfFocus;
@@ -5883,238 +5883,238 @@ diff --git a/accessible/src/base/nsDocAc
 +        nsIDocShellTreeItem* sameTypeRootOfFocus = nsnull;
 +        focusedTreeItem->GetSameTypeRootTreeItem(&sameTypeRootOfFocus);
          if (sameTypeRoot == sameTypeRootOfFocus) {
 -          nsCOMPtr<nsIAccessibleStateChangeEvent> accEvent =
 +          nsIAccessibleStateChangeEvent* accEvent =
              new nsAccStateChangeEvent(this, nsIAccessibleStates::STATE_BUSY, PR_FALSE, PR_FALSE);
            FireAccessibleEvent(accEvent);
            FireAnchorJumpEvent();
-@@ -865,7 +865,7 @@ NS_IMETHODIMP nsDocAccessible::FireDocLo
+@@ -865,7 +865,7 @@
      if (!isFinished) {
        // Fire state change event to set STATE_BUSY when document is loading. For
        // example, Window-Eyes expects to get it.
 -      nsCOMPtr<nsIAccessibleStateChangeEvent> accEvent =
 +      nsIAccessibleStateChangeEvent* accEvent =
          new nsAccStateChangeEvent(this, nsIAccessibleStates::STATE_BUSY,
                                    PR_FALSE, PR_TRUE);
        FireAccessibleEvent(accEvent);
-@@ -899,7 +899,7 @@ void nsDocAccessible::ScrollTimerCallbac
+@@ -899,7 +899,7 @@
  
  void nsDocAccessible::AddScrollListener()
  {
 -  nsCOMPtr<nsIPresShell> presShell(do_QueryReferent(mWeakShell));
 +  nsIPresShell* presShell(do_QueryReferent(mWeakShell));
  
    nsIViewManager* vm = nsnull;
    if (presShell)
-@@ -915,7 +915,7 @@ void nsDocAccessible::AddScrollListener(
+@@ -915,7 +915,7 @@
  
  void nsDocAccessible::RemoveScrollListener()
  {
 -  nsCOMPtr<nsIPresShell> presShell(do_QueryReferent(mWeakShell));
 +  nsIPresShell* presShell(do_QueryReferent(mWeakShell));
  
    nsIViewManager* vm = nsnull;
    if (presShell)
-@@ -960,7 +960,7 @@ NS_IMETHODIMP nsDocAccessible::Observe(n
+@@ -960,7 +960,7 @@
  {
    if (!nsCRT::strcmp(aTopic,"obs_documentCreated")) {    
      // State editable will now be set, readonly is now clear
 -    nsCOMPtr<nsIAccessibleStateChangeEvent> event =
 +    nsIAccessibleStateChangeEvent* event =
        new nsAccStateChangeEvent(this, nsIAccessibleStates::EXT_STATE_EDITABLE,
                                  PR_TRUE, PR_TRUE);
      FireAccessibleEvent(event);
-@@ -984,10 +984,10 @@ nsDocAccessible::AttributeChanged(nsIDoc
+@@ -984,10 +984,10 @@
    AttributeChangedImpl(aContent, aNameSpaceID, aAttribute);
  
    // If it was the focused node, cache the new state
 -  nsCOMPtr<nsIDOMNode> targetNode = do_QueryInterface(aContent);
 +  nsIDOMNode* targetNode = do_QueryInterface(aContent);
    if (targetNode == gLastFocusedNode) {
 -    nsCOMPtr<nsIAccessible> focusedAccessible;
 -    GetAccService()->GetAccessibleFor(targetNode, getter_AddRefs(focusedAccessible));
 +    nsIAccessible* focusedAccessible = nsnull;
 +    GetAccService()->GetAccessibleFor(targetNode, &focusedAccessible);
      if (focusedAccessible) {
        gLastFocusedAccessiblesState = State(focusedAccessible);
      }
-@@ -1008,8 +1008,8 @@ nsDocAccessible::AttributeChangedImpl(ns
+@@ -1008,8 +1008,8 @@
    // Otherwise it may just be a state change, for example an object changing
    // its visibility
  
 -  nsCOMPtr<nsISupports> container = mDocument->GetContainer();
 -  nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(container);
 +  nsISupports* container = mDocument->GetContainer();
 +  nsIDocShell* docShell = do_QueryInterface(container);
    if (!docShell) {
      return;
    }
-@@ -1020,12 +1020,12 @@ nsDocAccessible::AttributeChangedImpl(ns
+@@ -1020,12 +1020,12 @@
      return; // Still loading, ignore setting of initial attributes
    }
  
 -  nsCOMPtr<nsIPresShell> shell = GetPresShell();
 +  nsIPresShell* shell = GetPresShell();
    if (!shell) {
      return; // Document has been shut down
    }
  
 -  nsCOMPtr<nsIDOMNode> targetNode(do_QueryInterface(aContent));
 +  nsIDOMNode* targetNode(do_QueryInterface(aContent));
    NS_ASSERTION(targetNode, "No node for attr modified");
    if (!targetNode || !IsNodeRelevant(targetNode)) {
      return;
-@@ -1045,12 +1045,12 @@ nsDocAccessible::AttributeChangedImpl(ns
+@@ -1045,12 +1045,12 @@
      // disabled really is going to mean the same thing in any namespace.
      // We use the attribute instead of the disabled state bit because
      // ARIA's aria-disabled does not affect the disabled state bit
 -    nsCOMPtr<nsIAccessibleStateChangeEvent> enabledChangeEvent =
 +    nsIAccessibleStateChangeEvent* enabledChangeEvent =
        new nsAccStateChangeEvent(targetNode,
                                  nsIAccessibleStates::EXT_STATE_ENABLED,
                                  PR_TRUE);
      FireDelayedAccessibleEvent(enabledChangeEvent);
 -    nsCOMPtr<nsIAccessibleStateChangeEvent> sensitiveChangeEvent =
 +    nsIAccessibleStateChangeEvent* sensitiveChangeEvent =
        new nsAccStateChangeEvent(targetNode,
                                  nsIAccessibleStates::EXT_STATE_SENSITIVE,
                                  PR_TRUE);
-@@ -1089,7 +1089,7 @@ nsDocAccessible::AttributeChangedImpl(ns
+@@ -1089,7 +1089,7 @@
    if (aAttribute == nsAccessibilityAtoms::selected ||
        aAttribute == nsAccessibilityAtoms::aria_selected) {
      // ARIA or XUL selection
 -    nsCOMPtr<nsIAccessible> multiSelect = GetMultiSelectFor(targetNode);
 +    nsIAccessible* multiSelect = GetMultiSelectFor(targetNode);
      // Multi selects use selection_add and selection_remove
      // Single select widgets just mirror event_selection for
      // whatever gets event_focus, which is done in
-@@ -1098,10 +1098,10 @@ nsDocAccessible::AttributeChangedImpl(ns
+@@ -1098,10 +1098,10 @@
      if (multiSelect) {
        // Need to find the right event to use here, SELECTION_WITHIN would
        // seem right but we had started using it for something else
 -      nsCOMPtr<nsIAccessNode> multiSelectAccessNode =
 +      nsIAccessNode* multiSelectAccessNode =
          do_QueryInterface(multiSelect);
 -      nsCOMPtr<nsIDOMNode> multiSelectDOMNode;
 -      multiSelectAccessNode->GetDOMNode(getter_AddRefs(multiSelectDOMNode));
 +      nsIDOMNode* multiSelectDOMNode = nsnull;
 +      multiSelectAccessNode->GetDOMNode(&multiSelectDOMNode);
        NS_ASSERTION(multiSelectDOMNode, "A new accessible without a DOM node!");
        FireDelayedToolkitEvent(nsIAccessibleEvent::EVENT_SELECTION_WITHIN,
                                multiSelectDOMNode,
-@@ -1122,7 +1122,7 @@ nsDocAccessible::AttributeChangedImpl(ns
+@@ -1122,7 +1122,7 @@
    }
  
    if (aAttribute == nsAccessibilityAtoms::contenteditable) {
 -    nsCOMPtr<nsIAccessibleStateChangeEvent> editableChangeEvent =
 +    nsIAccessibleStateChangeEvent* editableChangeEvent =
        new nsAccStateChangeEvent(targetNode,
                                  nsIAccessibleStates::EXT_STATE_EDITABLE,
                                  PR_TRUE);
-@@ -1134,12 +1134,12 @@ void
+@@ -1134,12 +1134,12 @@
  void
  nsDocAccessible::ARIAAttributeChanged(nsIContent* aContent, nsIAtom* aAttribute)
  {
 -  nsCOMPtr<nsIDOMNode> targetNode(do_QueryInterface(aContent));
 +  nsIDOMNode* targetNode(do_QueryInterface(aContent));
    if (!targetNode)
      return;
  
    if (aAttribute == nsAccessibilityAtoms::aria_required) {
 -    nsCOMPtr<nsIAccessibleStateChangeEvent> event =
 +    nsIAccessibleStateChangeEvent* event =
        new nsAccStateChangeEvent(targetNode,
                                  nsIAccessibleStates::STATE_REQUIRED,
                                  PR_FALSE);
-@@ -1148,7 +1148,7 @@ nsDocAccessible::ARIAAttributeChanged(ns
+@@ -1148,7 +1148,7 @@
    }
  
    if (aAttribute == nsAccessibilityAtoms::aria_invalid) {
 -    nsCOMPtr<nsIAccessibleStateChangeEvent> event =
 +    nsIAccessibleStateChangeEvent* event =
        new nsAccStateChangeEvent(targetNode,
                                  nsIAccessibleStates::STATE_INVALID,
                                  PR_FALSE);
-@@ -1159,9 +1159,9 @@ nsDocAccessible::ARIAAttributeChanged(ns
+@@ -1159,9 +1159,9 @@
    if (aAttribute == nsAccessibilityAtoms::aria_activedescendant) {
      // The activedescendant universal property redirects accessible focus events
      // to the element with the id that activedescendant points to
 -    nsCOMPtr<nsIDOMNode> currentFocus = GetCurrentFocus();
 +    nsIDOMNode* currentFocus = GetCurrentFocus();
      if (SameCOMIdentity(GetRoleContent(currentFocus), targetNode)) {
 -      nsRefPtr<nsRootAccessible> rootAcc = GetRootAccessible();
 +      nsRootAccessible* rootAcc = GetRootAccessible();
        if (rootAcc)
          rootAcc->FireAccessibleFocusEvent(nsnull, currentFocus, nsnull, PR_TRUE);
      }
-@@ -1182,7 +1182,7 @@ nsDocAccessible::ARIAAttributeChanged(ns
+@@ -1182,7 +1182,7 @@
      const PRUint32 kState = (aAttribute == nsAccessibilityAtoms::aria_checked) ?
                              nsIAccessibleStates::STATE_CHECKED : 
                              nsIAccessibleStates::STATE_PRESSED;
 -    nsCOMPtr<nsIAccessibleStateChangeEvent> event =
 +    nsIAccessibleStateChangeEvent* event =
        new nsAccStateChangeEvent(targetNode, kState, PR_FALSE);
      FireDelayedAccessibleEvent(event);
      if (targetNode == gLastFocusedNode) {
-@@ -1190,13 +1190,13 @@ nsDocAccessible::ARIAAttributeChanged(ns
+@@ -1190,13 +1190,13 @@
        // otherwise we would need access to the old attribute value in this listener.
        // This is because we don't know if the previous value of aria-checked or aria-pressed was "mixed"
        // without caching that info.
 -      nsCOMPtr<nsIAccessible> accessible;
 -      event->GetAccessible(getter_AddRefs(accessible));
 +      nsIAccessible* accessible = nsnull;
 +      event->GetAccessible(&accessible);
        if (accessible) {
          PRBool wasMixed = (gLastFocusedAccessiblesState & nsIAccessibleStates::STATE_MIXED) != 0;
          PRBool isMixed  = (State(accessible) & nsIAccessibleStates::STATE_MIXED) != 0;
          if (wasMixed != isMixed) {
 -          nsCOMPtr<nsIAccessibleStateChangeEvent> event =
 +          nsIAccessibleStateChangeEvent* event =
              new nsAccStateChangeEvent(targetNode,
                                        nsIAccessibleStates::STATE_MIXED,
                                        PR_FALSE, isMixed);
-@@ -1208,7 +1208,7 @@ nsDocAccessible::ARIAAttributeChanged(ns
+@@ -1208,7 +1208,7 @@
    }
  
    if (aAttribute == nsAccessibilityAtoms::aria_expanded) {
 -    nsCOMPtr<nsIAccessibleStateChangeEvent> event =
 +    nsIAccessibleStateChangeEvent* event =
        new nsAccStateChangeEvent(targetNode,
                                  nsIAccessibleStates::STATE_EXPANDED,
                                  PR_FALSE);
-@@ -1217,7 +1217,7 @@ nsDocAccessible::ARIAAttributeChanged(ns
+@@ -1217,7 +1217,7 @@
    }
  
    if (aAttribute == nsAccessibilityAtoms::aria_readonly) {
 -    nsCOMPtr<nsIAccessibleStateChangeEvent> event =
 +    nsIAccessibleStateChangeEvent* event =
        new nsAccStateChangeEvent(targetNode,
                                  nsIAccessibleStates::STATE_READONLY,
                                  PR_FALSE);
-@@ -1252,7 +1252,7 @@ void nsDocAccessible::ContentAppended(ns
+@@ -1252,7 +1252,7 @@
  
    PRUint32 childCount = aContainer->GetChildCount();
    for (PRUint32 index = aNewIndexInContainer; index < childCount; index ++) {
 -    nsCOMPtr<nsIContent> child(aContainer->GetChildAt(index));
 +    nsIContent* child(aContainer->GetChildAt(index));
      // InvalidateCacheSubtree will not fire the EVENT_SHOW for the new node
      // unless an accessible can be created for the passed in node, which it
      // can't do unless the node is visible. The right thing happens there so
-@@ -1322,7 +1322,7 @@ nsDocAccessible::FireValueChangeForTextF
+@@ -1322,7 +1322,7 @@
      return;
  
    // Dependent value change event for text changes in textfields
 -  nsCOMPtr<nsIAccessibleEvent> valueChangeEvent =
 +  nsIAccessibleEvent* valueChangeEvent =
      new nsAccEvent(nsIAccessibleEvent::EVENT_VALUE_CHANGE, aPossibleTextFieldAccessible,
                     PR_FALSE, nsAccEvent::eRemoveDupes);
    FireDelayedAccessibleEvent(valueChangeEvent );
-@@ -1337,18 +1337,18 @@ nsDocAccessible::FireTextChangeEventForT
+@@ -1337,18 +1337,18 @@
      return;
    }
  
 -  nsCOMPtr<nsIDOMNode> node(do_QueryInterface(aContent));
 +  nsIDOMNode* node(do_QueryInterface(aContent));
    if (!node)
      return;
  
@@ -6128,35 +6128,35 @@ diff --git a/accessible/src/base/nsDocAc
 -  nsRefPtr<nsHyperTextAccessible> textAccessible;
 +  nsHyperTextAccessible* textAccessible = nsnull;
    rv = accessible->QueryInterface(NS_GET_IID(nsHyperTextAccessible),
 -                                  getter_AddRefs(textAccessible));
 +                                  (void**)&textAccessible);
    if (NS_FAILED(rv) || !textAccessible)
      return;
  
-@@ -1364,7 +1364,7 @@ nsDocAccessible::FireTextChangeEventForT
+@@ -1364,7 +1364,7 @@
      aInfo->mChangeEnd - start; // text has been removed
  
    if (length > 0) {
 -    nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mWeakShell));
 +    nsIPresShell* shell(do_QueryReferent(mWeakShell));
      if (!shell)
        return;
  
-@@ -1383,7 +1383,7 @@ nsDocAccessible::FireTextChangeEventForT
+@@ -1383,7 +1383,7 @@
      if (NS_FAILED(rv))
        return;
  
 -    nsCOMPtr<nsIAccessibleTextChangeEvent> event =
 +    nsIAccessibleTextChangeEvent* event =
        new nsAccTextChangeEvent(accessible, offset,
                                 renderedEndOffset - renderedStartOffset,
                                 aIsInserted, PR_FALSE);
-@@ -1393,25 +1393,25 @@ nsDocAccessible::FireTextChangeEventForT
+@@ -1393,25 +1393,25 @@
    }
  }
  
 -already_AddRefed<nsIAccessibleTextChangeEvent>
 +nsIAccessibleTextChangeEvent*
  nsDocAccessible::CreateTextChangeEventForNode(nsIAccessible *aContainerAccessible,
                                                nsIDOMNode *aChangeNode,
                                                nsIAccessible *aAccessibleForChangeNode,
@@ -6177,17 +6177,17 @@ diff --git a/accessible/src/base/nsDocAc
 -  nsCOMPtr<nsIAccessible> changeAccessible;
 +  nsIAccessible* changeAccessible = nsnull;
    nsresult rv = textAccessible->DOMPointToHypertextOffset(aChangeNode, -1, &offset,
 -                                                          getter_AddRefs(changeAccessible));
 +                                                          &changeAccessible);
    NS_ENSURE_SUCCESS(rv, nsnull);
  
    if (!aAccessibleForChangeNode) {
-@@ -1423,21 +1423,21 @@ nsDocAccessible::CreateTextChangeEventFo
+@@ -1423,21 +1423,21 @@
      if (!changeAccessible) {
        return nsnull; // No descendant content that represents any text in the hypertext parent
      }
 -    nsCOMPtr<nsIAccessible> child = changeAccessible;
 +    nsIAccessible* child = changeAccessible;
      while (PR_TRUE) {
 -      nsCOMPtr<nsIAccessNode> childAccessNode =
 +      nsIAccessNode* childAccessNode =
@@ -6205,37 +6205,37 @@ diff --git a/accessible/src/base/nsDocAc
        if (!changeAccessible) {
          break;
        }
 -      child.swap(changeAccessible);
 +      swap(child, changeAccessible);
      }
    }
    else {
-@@ -1446,8 +1446,8 @@ nsDocAccessible::CreateTextChangeEventFo
+@@ -1446,8 +1446,8 @@
      length = TextLength(aAccessibleForChangeNode);
      if (Role(aAccessibleForChangeNode) == nsIAccessibleRole::ROLE_WHITESPACE) {  // newline
        // Don't fire event for the first html:br in an editor.
 -      nsCOMPtr<nsIEditor> editor;
 -      textAccessible->GetAssociatedEditor(getter_AddRefs(editor));
 +      nsIEditor* editor = nsnull;
 +      textAccessible->GetAssociatedEditor(&editor);
        if (editor) {
          PRBool isEmpty = PR_FALSE;
          editor->GetDocumentIsEmpty(&isEmpty);
-@@ -1474,7 +1474,7 @@ nsresult nsDocAccessible::FireDelayedToo
+@@ -1474,7 +1474,7 @@
                                                    nsAccEvent::EEventRule aAllowDupes,
                                                    PRBool aIsAsynch)
  {
 -  nsCOMPtr<nsIAccessibleEvent> event =
 +  nsIAccessibleEvent* event =
      new nsAccEvent(aEvent, aDOMNode, aIsAsynch, aAllowDupes);
    NS_ENSURE_TRUE(event, NS_ERROR_OUT_OF_MEMORY);
  
-@@ -1510,23 +1510,23 @@ NS_IMETHODIMP nsDocAccessible::FlushPend
+@@ -1510,23 +1510,23 @@
    mInFlushPendingEvents = PR_TRUE;
    PRUint32 length = mEventsToFire.Count();
    NS_ASSERTION(length, "How did we get here without events to fire?");
 -  nsCOMPtr<nsIPresShell> presShell = GetPresShell();
 +  nsIPresShell* presShell = GetPresShell();
    if (!presShell)
      length = 0; // The doc is now shut down, don't fire events in it anymore
    else
@@ -6255,95 +6255,95 @@ diff --git a/accessible/src/base/nsDocAc
 -    accessibleEvent->GetDOMNode(getter_AddRefs(domNode));
 +    nsIAccessible* accessible = nsnull;
 +    accessibleEvent->GetAccessible(&accessible);
 +    nsIDOMNode* domNode = nsnull;
 +    accessibleEvent->GetDOMNode(&domNode);
      PRUint32 eventType = nsAccEvent::EventType(accessibleEvent);
      PRBool isFromUserInput = nsAccEvent::IsFromUserInput(accessibleEvent);
  
-@@ -1537,7 +1537,7 @@ NS_IMETHODIMP nsDocAccessible::FlushPend
+@@ -1537,7 +1537,7 @@
        // However, we only keep track of the old frame type for the focus, where it's very
        // important not to destroy and recreate the accessible for minor style changes,
        // such as a:focus { overflow: scroll; }
 -      nsCOMPtr<nsIContent> focusContent(do_QueryInterface(domNode));
 +      nsIContent* focusContent(do_QueryInterface(domNode));
        if (focusContent) {
          nsIFrame *focusFrame = presShell->GetRealPrimaryFrameFor(focusContent);
          nsIAtom *newFrameType =
-@@ -1556,12 +1556,12 @@ NS_IMETHODIMP nsDocAccessible::FlushPend
+@@ -1556,12 +1556,12 @@
  
      if (eventType == nsIAccessibleEvent::EVENT_DOM_CREATE || 
          eventType == nsIAccessibleEvent::EVENT_ASYNCH_SHOW) {
 -      nsCOMPtr<nsIAccessible> containerAccessible;
 +      nsIAccessible* containerAccessible = nsnull;
        if (eventType == nsIAccessibleEvent::EVENT_ASYNCH_SHOW) {
          if (accessible) {
            // For asynch show, delayed invalidatation of parent's children
 -          accessible->GetParent(getter_AddRefs(containerAccessible));
 -          nsCOMPtr<nsPIAccessible> privateContainerAccessible =
 +          accessible->GetParent(&containerAccessible);
 +          nsPIAccessible* privateContainerAccessible =
              do_QueryInterface(containerAccessible);
            if (privateContainerAccessible)
              privateContainerAccessible->InvalidateChildren();
-@@ -1580,12 +1580,12 @@ NS_IMETHODIMP nsDocAccessible::FlushPend
+@@ -1580,12 +1580,12 @@
        if (domNode && domNode != mDOMNode) {
          if (!containerAccessible) {
            GetAccessibleInParentChain(domNode, PR_TRUE,
 -                                     getter_AddRefs(containerAccessible));
 +                                     &containerAccessible);
            if (!containerAccessible)
              containerAccessible = this;
          }
  
 -        nsCOMPtr<nsIAccessibleTextChangeEvent> textChangeEvent =
 +        nsIAccessibleTextChangeEvent* textChangeEvent =
            CreateTextChangeEventForNode(containerAccessible, domNode, accessible, PR_TRUE, PR_TRUE);
          if (textChangeEvent) {
            nsAccEvent::PrepareForEvent(textChangeEvent, isFromUserInput);
-@@ -1603,7 +1603,7 @@ NS_IMETHODIMP nsDocAccessible::FlushPend
+@@ -1603,7 +1603,7 @@
  
      if (accessible) {
        if (eventType == nsIAccessibleEvent::EVENT_INTERNAL_LOAD) {
 -        nsCOMPtr<nsPIAccessibleDocument> docAccessible =
 +        nsPIAccessibleDocument* docAccessible =
            do_QueryInterface(accessible);
          NS_ASSERTION(docAccessible, "No doc accessible for doc load event");
          if (docAccessible) {
-@@ -1611,7 +1611,7 @@ NS_IMETHODIMP nsDocAccessible::FlushPend
+@@ -1611,7 +1611,7 @@
          }
        }
        else if (eventType == nsIAccessibleEvent::EVENT_TEXT_CARET_MOVED) {
 -        nsCOMPtr<nsIAccessibleText> accessibleText = do_QueryInterface(accessible);
 +        nsIAccessibleText* accessibleText = do_QueryInterface(accessible);
          PRInt32 caretOffset;
          if (accessibleText && NS_SUCCEEDED(accessibleText->GetCaretOffset(&caretOffset))) {
  #ifdef DEBUG_A11Y
-@@ -1626,7 +1626,7 @@ NS_IMETHODIMP nsDocAccessible::FlushPend
+@@ -1626,7 +1626,7 @@
            GetAccService()->GetAccessibleFor(gLastFocusedNode, getter_AddRefs(accForFocus));
            nsAccUtils::FireAccEvent(nsIAccessibleEvent::EVENT_ALERT, accForFocus);
  #endif
 -          nsCOMPtr<nsIAccessibleCaretMoveEvent> caretMoveEvent =
 +          nsIAccessibleCaretMoveEvent* caretMoveEvent =
              new nsAccCaretMoveEvent(accessible, caretOffset);
            if (!caretMoveEvent)
              break; // Out of memory, break out to release kung fu death grip
-@@ -1650,8 +1650,8 @@ NS_IMETHODIMP nsDocAccessible::FlushPend
+@@ -1650,8 +1650,8 @@
          if (eventType == nsIAccessibleEvent::EVENT_ASYNCH_HIDE ||
              eventType == nsIAccessibleEvent::EVENT_DOM_DESTROY) {
            // Shutdown nsIAccessNode's or nsIAccessibles for any DOM nodes in this subtree
 -          nsCOMPtr<nsIDOMNode> hidingNode;
 -          accessibleEvent->GetDOMNode(getter_AddRefs(hidingNode));
 +          nsIDOMNode* hidingNode = nsnull;
 +          accessibleEvent->GetDOMNode(&hidingNode);
            if (hidingNode) {
              RefreshNodes(hidingNode); // Will this bite us with asynch events
            }
-@@ -1682,17 +1682,17 @@ void nsDocAccessible::FlushEventsCallbac
+@@ -1682,17 +1682,17 @@
  
  void nsDocAccessible::InvalidateChildrenInSubtree(nsIDOMNode *aStartNode)
  {
 -  nsCOMPtr<nsIAccessNode> accessNode;
 -  GetCachedAccessNode(aStartNode, getter_AddRefs(accessNode));
 -  nsCOMPtr<nsPIAccessible> accessible(do_QueryInterface(accessNode));
 +  nsIAccessNode* accessNode = nsnull;
 +  GetCachedAccessNode(aStartNode, &accessNode);
@@ -6356,17 +6356,17 @@ diff --git a/accessible/src/base/nsDocAc
 +  nsINode* node = do_QueryInterface(aStartNode);
    PRInt32 index, numChildren = node->GetChildCount();
    for (index = 0; index < numChildren; index ++) {
 -    nsCOMPtr<nsIDOMNode> childNode = do_QueryInterface(node->GetChildAt(index));
 +    nsIDOMNode* childNode = do_QueryInterface(node->GetChildAt(index));
      if (childNode)
        InvalidateChildrenInSubtree(childNode);
    }
-@@ -1704,19 +1704,19 @@ void nsDocAccessible::RefreshNodes(nsIDO
+@@ -1704,19 +1704,19 @@
      return; // All we have is a doc accessible. There is nothing to invalidate, quit early
    }
  
 -  nsCOMPtr<nsIAccessNode> accessNode;
 -  GetCachedAccessNode(aStartNode, getter_AddRefs(accessNode));
 +  nsIAccessNode* accessNode = nsnull;
 +  GetCachedAccessNode(aStartNode, &accessNode);
  
@@ -6382,17 +6382,17 @@ diff --git a/accessible/src/base/nsDocAc
 -      accessNode->GetDOMNode(getter_AddRefs(domNode));
 -      nsCOMPtr<nsIDOMXULPopupElement> popup(do_QueryInterface(domNode));
 +      nsIDOMNode* domNode = nsnull;
 +      accessNode->GetDOMNode(&domNode);
 +      nsIDOMXULPopupElement* popup(do_QueryInterface(domNode));
        if (!popup) {
          // Popup elements already fire these via DOMMenuInactive
          // handling in nsRootAccessible::HandleEvent
-@@ -1724,28 +1724,28 @@ void nsDocAccessible::RefreshNodes(nsIDO
+@@ -1724,28 +1724,28 @@
                                   accessible);
        }
      }
 -    nsCOMPtr<nsPIAccessible> privateAccessible = do_QueryInterface(accessible);
 +    nsPIAccessible* privateAccessible = do_QueryInterface(accessible);
      NS_ASSERTION(privateAccessible, "No nsPIAccessible for nsIAccessible");
  
 -    nsCOMPtr<nsIAccessible> childAccessible;
@@ -6421,147 +6421,147 @@ diff --git a/accessible/src/base/nsDocAc
 -        childAccessNode->GetDOMNode(getter_AddRefs(possibleAnonNode));
 -        nsCOMPtr<nsIContent> iterContent = do_QueryInterface(possibleAnonNode);
 +                                 (void**)&childAccessNode);
 +        childAccessNode->GetDOMNode(&possibleAnonNode);
 +        nsIContent* iterContent = do_QueryInterface(possibleAnonNode);
          if (iterContent && (iterContent->IsNativeAnonymous() ||
                              iterContent->GetBindingParent())) {
            // GetBindingParent() check is a perf win -- make sure we don't
-@@ -1759,12 +1759,12 @@ void nsDocAccessible::RefreshNodes(nsIDO
+@@ -1759,12 +1759,12 @@
  
    // Shutdown ordinary content subtree as well -- there may be
    // access node children which are not full accessible objects
 -  nsCOMPtr<nsIDOMNode> nextNode, iterNode;
 -  aStartNode->GetFirstChild(getter_AddRefs(nextNode));
 +  nsIDOMNode* nextNode = nsnull, *iterNode = nsnull;
 +  aStartNode->GetFirstChild(&nextNode);
    while (nextNode) {
 -    nextNode.swap(iterNode);
 +    swap(nextNode, iterNode);
      RefreshNodes(iterNode);
 -    iterNode->GetNextSibling(getter_AddRefs(nextNode));
 +    iterNode->GetNextSibling(&nextNode);
    }
  
    if (!accessNode)
-@@ -1782,7 +1782,7 @@ void nsDocAccessible::RefreshNodes(nsIDO
+@@ -1782,7 +1782,7 @@
    // Shut down the actual accessible or access node
    void *uniqueID;
    accessNode->GetUniqueID(&uniqueID);
 -  nsCOMPtr<nsPIAccessNode> privateAccessNode(do_QueryInterface(accessNode));
 +  nsPIAccessNode* privateAccessNode(do_QueryInterface(accessNode));
    privateAccessNode->Shutdown();
  
    // Remove from hash table as well
-@@ -1818,9 +1818,9 @@ NS_IMETHODIMP nsDocAccessible::Invalidat
+@@ -1818,9 +1818,9 @@
    // Otherwise we might miss the nsAccessNode's that are not nsAccessible's.
  
    NS_ENSURE_TRUE(mDOMNode, NS_ERROR_FAILURE);
 -  nsCOMPtr<nsIDOMNode> childNode = aChild ? do_QueryInterface(aChild) : mDOMNode;
 +  nsIDOMNode* childNode = aChild ? do_QueryInterface(aChild) : mDOMNode;
  
 -  nsCOMPtr<nsIPresShell> presShell = GetPresShell();
 +  nsIPresShell* presShell = GetPresShell();
    NS_ENSURE_TRUE(presShell, NS_ERROR_FAILURE);
    
    if (!mIsContentLoaded) {
-@@ -1841,12 +1841,12 @@ NS_IMETHODIMP nsDocAccessible::Invalidat
+@@ -1841,12 +1841,12 @@
        // Changes during page load, but not caused by user input
        // Just invalidate accessible hierarchy and return,
        // otherwise the page load time slows down way too much
 -      nsCOMPtr<nsIAccessible> containerAccessible;
 -      GetAccessibleInParentChain(childNode, PR_FALSE, getter_AddRefs(containerAccessible));
 +      nsIAccessible* containerAccessible = nsnull;
 +      GetAccessibleInParentChain(childNode, PR_FALSE, &containerAccessible);
        if (!containerAccessible) {
          containerAccessible = this;
        }
 -      nsCOMPtr<nsPIAccessible> privateContainer = do_QueryInterface(containerAccessible);
 +      nsPIAccessible* privateContainer = do_QueryInterface(containerAccessible);
        return privateContainer->InvalidateChildren();
      }     
      // else: user input, so we must fall through and for full handling,
-@@ -1855,9 +1855,9 @@ NS_IMETHODIMP nsDocAccessible::Invalidat
+@@ -1855,9 +1855,9 @@
    }
  
    // Update last change state information
 -  nsCOMPtr<nsIAccessNode> childAccessNode;
 -  GetCachedAccessNode(childNode, getter_AddRefs(childAccessNode));
 -  nsCOMPtr<nsIAccessible> childAccessible = do_QueryInterface(childAccessNode);
 +  nsIAccessNode* childAccessNode = nsnull;
 +  GetCachedAccessNode(childNode, &childAccessNode);
 +  nsIAccessible* childAccessible = do_QueryInterface(childAccessNode);
  
  #ifdef DEBUG_A11Y
    nsAutoString localName;
-@@ -1883,8 +1883,8 @@ NS_IMETHODIMP nsDocAccessible::Invalidat
+@@ -1883,8 +1883,8 @@
    }
  #endif
  
 -  nsCOMPtr<nsIAccessible> containerAccessible;
 -  GetAccessibleInParentChain(childNode, PR_TRUE, getter_AddRefs(containerAccessible));
 +  nsIAccessible* containerAccessible = nsnull;
 +  GetAccessibleInParentChain(childNode, PR_TRUE, &containerAccessible);
    if (!containerAccessible) {
      containerAccessible = this;
    }
-@@ -1892,7 +1892,7 @@ NS_IMETHODIMP nsDocAccessible::Invalidat
+@@ -1892,7 +1892,7 @@
    if (!isShowing) {
      // Fire EVENT_ASYNCH_HIDE or EVENT_DOM_DESTROY
      if (isHiding) {
 -      nsCOMPtr<nsIContent> content(do_QueryInterface(childNode));
 +      nsIContent* content(do_QueryInterface(childNode));
        if (content) {
          nsIFrame *frame = presShell->GetPrimaryFrameFor(content);
          if (frame) {
-@@ -1922,7 +1922,7 @@ NS_IMETHODIMP nsDocAccessible::Invalidat
+@@ -1922,7 +1922,7 @@
        // XXX Collate events when a range is deleted
        // XXX We need a way to ignore SplitNode and JoinNode() when they
        // do not affect the text within the hypertext
 -      nsCOMPtr<nsIAccessibleTextChangeEvent> textChangeEvent =
 +      nsIAccessibleTextChangeEvent* textChangeEvent =
          CreateTextChangeEventForNode(containerAccessible, childNode, childAccessible,
                                       PR_FALSE, isAsynch);
        if (textChangeEvent) {
-@@ -1942,7 +1942,7 @@ NS_IMETHODIMP nsDocAccessible::Invalidat
+@@ -1942,7 +1942,7 @@
      if (!isAsynch) {
        // DOM already updated with new objects -- invalidate parent's children now
        // For asynch we must wait until layout updates before we invalidate the children
 -      nsCOMPtr<nsPIAccessible> privateContainerAccessible =
 +      nsPIAccessible* privateContainerAccessible =
          do_QueryInterface(containerAccessible);
        if (privateContainerAccessible) {
          privateContainerAccessible->InvalidateChildren();
-@@ -1972,13 +1972,13 @@ NS_IMETHODIMP nsDocAccessible::Invalidat
+@@ -1972,13 +1972,13 @@
      nsIContent *ancestor = aChild;
      while (PR_TRUE) {
        if (roleMapEntry && roleMapEntry->role == nsIAccessibleRole::ROLE_ALERT) {
 -        nsCOMPtr<nsIDOMNode> alertNode(do_QueryInterface(ancestor));
 +        nsIDOMNode* alertNode(do_QueryInterface(ancestor));
          FireDelayedToolkitEvent(nsIAccessibleEvent::EVENT_ALERT, alertNode,
                                  nsAccEvent::eRemoveDupes, isAsynch);
          break;
        }
        ancestor = ancestor->GetParent();
 -      nsCOMPtr<nsIDOMNode> ancestorNode = do_QueryInterface(ancestor);
 +      nsIDOMNode* ancestorNode = do_QueryInterface(ancestor);
        if (!ancestorNode) {
          break;
        }
-@@ -1993,7 +1993,7 @@ NS_IMETHODIMP nsDocAccessible::Invalidat
+@@ -1993,7 +1993,7 @@
      // This is only used by older MSAA clients. Newer ones should derive this
      // from SHOW and HIDE so that they don't fetch extra objects
      if (childAccessible) {
 -      nsCOMPtr<nsIAccessibleEvent> reorderEvent =
 +      nsIAccessibleEvent* reorderEvent =
          new nsAccEvent(nsIAccessibleEvent::EVENT_REORDER, containerAccessible,
                         isAsynch, nsAccEvent::eCoalesceFromSameSubtree);
        NS_ENSURE_TRUE(reorderEvent, NS_ERROR_OUT_OF_MEMORY);
-@@ -2011,14 +2011,14 @@ nsDocAccessible::GetAccessibleInParentCh
+@@ -2011,14 +2011,14 @@
  {
    // Find accessible in parent chain of DOM nodes, or return null
    *aAccessible = nsnull;
 -  nsCOMPtr<nsIDOMNode> currentNode(aNode), parentNode;
 -  nsCOMPtr<nsIAccessNode> accessNode;
 +  nsIDOMNode* currentNode(aNode), *parentNode = nsnull;
 +  nsIAccessNode* accessNode = nsnull;
  
@@ -6569,17 +6569,17 @@ diff --git a/accessible/src/base/nsDocAc
    NS_ENSURE_TRUE(accService, NS_ERROR_FAILURE);
  
    do {
 -    currentNode->GetParentNode(getter_AddRefs(parentNode));
 +    currentNode->GetParentNode(&parentNode);
      currentNode = parentNode;
      if (!currentNode) {
        NS_ADDREF_THIS();
-@@ -2026,16 +2026,16 @@ nsDocAccessible::GetAccessibleInParentCh
+@@ -2026,16 +2026,16 @@
        break;
      }
  
 -    nsCOMPtr<nsIDOMNode> relevantNode;
 -    if (NS_SUCCEEDED(accService->GetRelevantContentNodeFor(currentNode, getter_AddRefs(relevantNode))) && relevantNode) {
 +    nsIDOMNode* relevantNode = nsnull;
 +    if (NS_SUCCEEDED(accService->GetRelevantContentNodeFor(currentNode, &relevantNode)) && relevantNode) {
        currentNode = relevantNode;
@@ -6590,17 +6590,17 @@ diff --git a/accessible/src/base/nsDocAc
      else { // Only return cached accessibles, don't create anything
 -      nsCOMPtr<nsIAccessNode> accessNode;
 -      GetCachedAccessNode(currentNode, getter_AddRefs(accessNode)); // AddRefs
 +      nsIAccessNode* accessNode = nsnull;
 +      GetCachedAccessNode(currentNode, &accessNode); // AddRefs
        if (accessNode) {
          CallQueryInterface(accessNode, aAccessible); // AddRefs
        }
-@@ -2051,18 +2051,18 @@ nsDocAccessible::FireShowHideEvents(nsID
+@@ -2051,18 +2051,18 @@
  {
    NS_ENSURE_ARG(aDOMNode);
  
 -  nsCOMPtr<nsIAccessible> accessible;
 +  nsIAccessible* accessible = nsnull;
    if (!aAvoidOnThisNode) {
      if (aEventType == nsIAccessibleEvent::EVENT_ASYNCH_HIDE ||
          aEventType == nsIAccessibleEvent::EVENT_DOM_DESTROY) {
@@ -6613,54 +6613,54 @@ diff --git a/accessible/src/base/nsDocAc
      } else {
        // Allow creation of new accessibles for show events
        GetAccService()->GetAttachedAccessibleFor(aDOMNode,
 -                                                getter_AddRefs(accessible));
 +                                                &accessible);
      }
    }
  
-@@ -2072,7 +2072,7 @@ nsDocAccessible::FireShowHideEvents(nsID
+@@ -2072,7 +2072,7 @@
      PRBool isAsynch = aEventType == nsIAccessibleEvent::EVENT_ASYNCH_HIDE ||
                        aEventType == nsIAccessibleEvent::EVENT_ASYNCH_SHOW;
  
 -    nsCOMPtr<nsIAccessibleEvent> event =
 +    nsIAccessibleEvent* event =
        new nsAccEvent(aEventType, accessible, isAsynch,
                       nsAccEvent::eCoalesceFromSameSubtree);
      NS_ENSURE_TRUE(event, NS_ERROR_OUT_OF_MEMORY);
-@@ -2087,10 +2087,10 @@ nsDocAccessible::FireShowHideEvents(nsID
+@@ -2087,10 +2087,10 @@
  
    // Could not find accessible to show hide yet, so fire on any
    // accessible descendants in this subtree
 -  nsCOMPtr<nsINode> node(do_QueryInterface(aDOMNode));
 +  nsINode* node(do_QueryInterface(aDOMNode));
    PRUint32 count = node->GetChildCount();
    for (PRUint32 index = 0; index < count; index++) {
 -    nsCOMPtr<nsIDOMNode> childNode = do_QueryInterface(node->GetChildAt(index));
 +    nsIDOMNode* childNode = do_QueryInterface(node->GetChildAt(index));
      nsresult rv = FireShowHideEvents(childNode, PR_FALSE, aEventType,
                                       aDelay, aForceIsFromUserInput);
      NS_ENSURE_SUCCESS(rv, rv);
-diff --git a/accessible/src/base/nsDocAccessible.h b/accessible/src/base/nsDocAccessible.h
---- a/accessible/src/base/nsDocAccessible.h
-+++ b/accessible/src/base/nsDocAccessible.h
-@@ -183,7 +183,7 @@ class nsDocAccessible : public nsHyperTe
+diff -r 332906b0e686 accessible/src/base/nsDocAccessible.h
+--- a/accessible/src/base/nsDocAccessible.h	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/base/nsDocAccessible.h	Fri Jul 04 01:35:36 2008 -0700
+@@ -183,7 +183,7 @@
       * @param aAccessibleForChangeNode, the accessible for that node, or nsnull if none exists
       * @param aIsInserting, is aChangeNode being created or shown (vs. removed or hidden)
       */
 -    already_AddRefed<nsIAccessibleTextChangeEvent>
 +    nsIAccessibleTextChangeEvent*
      CreateTextChangeEventForNode(nsIAccessible *aContainerAccessible,
                                   nsIDOMNode *aChangeNode,
                                   nsIAccessible *aAccessibleForNode,
-diff --git a/accessible/src/base/nsOuterDocAccessible.cpp b/accessible/src/base/nsOuterDocAccessible.cpp
---- a/accessible/src/base/nsOuterDocAccessible.cpp
-+++ b/accessible/src/base/nsOuterDocAccessible.cpp
-@@ -105,25 +105,25 @@ void nsOuterDocAccessible::CacheChildren
+diff -r 332906b0e686 accessible/src/base/nsOuterDocAccessible.cpp
+--- a/accessible/src/base/nsOuterDocAccessible.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/base/nsOuterDocAccessible.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -105,25 +105,25 @@
    // The outer node is a something like a <browser>, <frame>, <iframe>, <page> or
    // <editor> tag, whereas the inner node corresponds to the inner document root.
  
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
    NS_ASSERTION(content, "No nsIContent for <browser>/<iframe>/<editor> dom node");
  
 -  nsCOMPtr<nsIDocument> outerDoc = content->GetDocument();
@@ -6683,20 +6683,20 @@ diff --git a/accessible/src/base/nsOuter
      do_GetService("@mozilla.org/accessibilityService;1");
 -  accService->GetAccessibleFor(innerNode, getter_AddRefs(innerAccessible));
 -  nsCOMPtr<nsPIAccessible> privateInnerAccessible = 
 +  accService->GetAccessibleFor(innerNode, &innerAccessible);
 +  nsPIAccessible* privateInnerAccessible = 
      do_QueryInterface(innerAccessible);
    if (!privateInnerAccessible) {
      return;
-diff --git a/accessible/src/base/nsRootAccessible.cpp b/accessible/src/base/nsRootAccessible.cpp
---- a/accessible/src/base/nsRootAccessible.cpp
-+++ b/accessible/src/base/nsRootAccessible.cpp
-@@ -132,14 +132,14 @@ NS_IMETHODIMP nsRootAccessible::GetName(
+diff -r 332906b0e686 accessible/src/base/nsRootAccessible.cpp
+--- a/accessible/src/base/nsRootAccessible.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/base/nsRootAccessible.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -132,14 +132,14 @@
      }
    }
  
 -  nsCOMPtr<nsIDocShellTreeItem> docShellAsItem =
 +  nsIDocShellTreeItem* docShellAsItem =
      nsAccUtils::GetDocShellTreeItemFor(mDOMNode);
    NS_ENSURE_TRUE(docShellAsItem, NS_ERROR_FAILURE);
  
@@ -6705,35 +6705,35 @@ diff --git a/accessible/src/base/nsRootA
 +  nsIDocShellTreeOwner* treeOwner = nsnull;
 +  docShellAsItem->GetTreeOwner(&treeOwner);
  
 -  nsCOMPtr<nsIBaseWindow> baseWindow(do_QueryInterface(treeOwner));
 +  nsIBaseWindow* baseWindow(do_QueryInterface(treeOwner));
    if (baseWindow) {
      nsXPIDLString title;
      baseWindow->GetTitle(getter_Copies(title));
-@@ -156,7 +156,7 @@ NS_IMETHODIMP nsRootAccessible::GetParen
+@@ -156,7 +156,7 @@
    NS_ENSURE_ARG_POINTER(aParent);
    *aParent = nsnull;
  
 -  nsRefPtr<nsApplicationAccessibleWrap> root = GetApplicationAccessible();
 +  nsApplicationAccessibleWrap* root = GetApplicationAccessible();
    NS_IF_ADDREF(*aParent = root);
  
    return NS_OK;
-@@ -172,7 +172,7 @@ NS_IMETHODIMP nsRootAccessible::GetRole(
+@@ -172,7 +172,7 @@
    // If it's a <dialog> or <wizard>, use nsIAccessibleRole::ROLE_DIALOG instead
    nsIContent *rootContent = mDocument->GetRootContent();
    if (rootContent) {
 -    nsCOMPtr<nsIDOMElement> rootElement(do_QueryInterface(rootContent));
 +    nsIDOMElement* rootElement(do_QueryInterface(rootContent));
      if (rootElement) {
        nsAutoString name;
        rootElement->GetLocalName(name);
-@@ -192,13 +192,13 @@ PRUint32 nsRootAccessible::GetChromeFlag
+@@ -192,13 +192,13 @@
    // Return the flag set for the top level window as defined 
    // by nsIWebBrowserChrome::CHROME_WINDOW_[FLAGNAME]
    // Not simple: nsIXULWindow is not just a QI from nsIDOMWindow
 -  nsCOMPtr<nsIDocShellTreeItem> treeItem =
 +  nsIDocShellTreeItem* treeItem =
      nsAccUtils::GetDocShellTreeItemFor(mDOMNode);
    NS_ENSURE_TRUE(treeItem, 0);
 -  nsCOMPtr<nsIDocShellTreeOwner> treeOwner;
@@ -6741,30 +6741,30 @@ diff --git a/accessible/src/base/nsRootA
 +  nsIDocShellTreeOwner* treeOwner = nsnull;
 +  treeItem->GetTreeOwner(&treeOwner);
    NS_ENSURE_TRUE(treeOwner, 0);
 -  nsCOMPtr<nsIXULWindow> xulWin(do_GetInterface(treeOwner));
 +  nsIXULWindow* xulWin(do_GetInterface(treeOwner));
    if (!xulWin) {
      return 0;
    }
-@@ -232,9 +232,9 @@ nsRootAccessible::GetState(PRUint32 *aSt
+@@ -232,9 +232,9 @@
    if (!aExtraState)
      return NS_OK;
  
 -  nsCOMPtr<nsIDOMWindow> domWin;
 -  GetWindow(getter_AddRefs(domWin));
 -  nsCOMPtr<nsPIDOMWindow> privateDOMWindow(do_QueryInterface(domWin));
 +  nsIDOMWindow* domWin = nsnull;
 +  GetWindow(&domWin);
 +  nsPIDOMWindow* privateDOMWindow(do_QueryInterface(domWin));
    if (privateDOMWindow) {
      nsIFocusController *focusController =
        privateDOMWindow->GetRootFocusController();
-@@ -258,15 +258,15 @@ void
+@@ -258,15 +258,15 @@
  void
  nsRootAccessible::GetChromeEventHandler(nsIDOMEventTarget **aChromeTarget)
  {
 -  nsCOMPtr<nsIDOMWindow> domWin;
 -  GetWindow(getter_AddRefs(domWin));
 -  nsCOMPtr<nsPIDOMWindow> privateDOMWindow(do_QueryInterface(domWin));
 -  nsCOMPtr<nsPIDOMEventTarget> chromeEventHandler;
 +  nsIDOMWindow* domWin = nsnull;
@@ -6775,106 +6775,106 @@ diff --git a/accessible/src/base/nsRootA
      chromeEventHandler = privateDOMWindow->GetChromeEventHandler();
    }
  
 -  nsCOMPtr<nsIDOMEventTarget> target(do_QueryInterface(chromeEventHandler));
 +  nsIDOMEventTarget* target(do_QueryInterface(chromeEventHandler));
  
    *aChromeTarget = target;
    NS_IF_ADDREF(*aChromeTarget);
-@@ -311,7 +311,7 @@ nsresult nsRootAccessible::AddEventListe
+@@ -311,7 +311,7 @@
    // receive untrusted events (synthetic events generated by untrusted code).
    // For example, XBL bindings implementations for elements that are hosted in
    // non chrome document fire untrusted events.
 -  nsCOMPtr<nsIDOMNSEventTarget> nstarget(do_QueryInterface(mDocument));
 +  nsIDOMNSEventTarget* nstarget(do_QueryInterface(mDocument));
  
    if (nstarget) {
      for (const char* const* e = docEvents,
-@@ -323,8 +323,8 @@ nsresult nsRootAccessible::AddEventListe
+@@ -323,8 +323,8 @@
      }
    }
  
 -  nsCOMPtr<nsIDOMEventTarget> target;
 -  GetChromeEventHandler(getter_AddRefs(target));
 +  nsIDOMEventTarget* target = nsnull;
 +  GetChromeEventHandler(&target);
    if (target) {
      target->AddEventListener(NS_LITERAL_STRING("pagehide"), this, PR_TRUE);
    }
-@@ -338,7 +338,7 @@ nsresult nsRootAccessible::AddEventListe
+@@ -338,7 +338,7 @@
  
  nsresult nsRootAccessible::RemoveEventListeners()
  {
 -  nsCOMPtr<nsIDOMEventTarget> target(do_QueryInterface(mDocument));
 +  nsIDOMEventTarget* target(do_QueryInterface(mDocument));
    if (target) { 
      for (const char* const* e = docEvents,
                     * const* e_end = docEvents + NS_ARRAY_LENGTH(docEvents);
-@@ -348,7 +348,7 @@ nsresult nsRootAccessible::RemoveEventLi
+@@ -348,7 +348,7 @@
      }
    }
  
 -  GetChromeEventHandler(getter_AddRefs(target));
 +  GetChromeEventHandler(&target);
    if (target) {
      target->RemoveEventListener(NS_LITERAL_STRING("pagehide"), this, PR_TRUE);
    }
-@@ -383,7 +383,7 @@ void nsRootAccessible::TryFireEarlyLoadE
+@@ -383,7 +383,7 @@
  
    // This also works for firing events for error pages
  
 -  nsCOMPtr<nsIDocShellTreeItem> treeItem =
 +  nsIDocShellTreeItem* treeItem =
      nsAccUtils::GetDocShellTreeItemFor(aDocNode);
    NS_ASSERTION(treeItem, "No docshelltreeitem for aDocNode");
    if (!treeItem) {
-@@ -397,7 +397,7 @@ void nsRootAccessible::TryFireEarlyLoadE
+@@ -397,7 +397,7 @@
  
    // The doc accessible should already be created as a result of the
    // OnStateChange() for the initiation of page loading
 -  nsCOMPtr<nsIDocShellTreeNode> treeNode(do_QueryInterface(treeItem));
 +  nsIDocShellTreeNode* treeNode(do_QueryInterface(treeItem));
    if (treeNode) {
      PRInt32 subDocuments;
      treeNode->GetChildCount(&subDocuments);
-@@ -405,8 +405,8 @@ void nsRootAccessible::TryFireEarlyLoadE
+@@ -405,8 +405,8 @@
        return;
      }
    }
 -  nsCOMPtr<nsIDocShellTreeItem> rootContentTreeItem;
 -  treeItem->GetSameTypeRootTreeItem(getter_AddRefs(rootContentTreeItem));
 +  nsIDocShellTreeItem* rootContentTreeItem = nsnull;
 +  treeItem->GetSameTypeRootTreeItem(&rootContentTreeItem);
    NS_ASSERTION(rootContentTreeItem, "No root content tree item");
    if (rootContentTreeItem == treeItem) {
      // No frames or iframes, so we can fire the doc load finished event early
-@@ -421,7 +421,7 @@ PRBool nsRootAccessible::FireAccessibleF
+@@ -421,7 +421,7 @@
                                                    PRBool aIsAsynch)
  {
    if (mCaretAccessible) {
 -    nsCOMPtr<nsIDOMNSEvent> nsevent(do_QueryInterface(aFocusEvent));
 +    nsIDOMNSEvent* nsevent(do_QueryInterface(aFocusEvent));
      if (nsevent) {
        // Use the originally focused node where the selection lives.
        // For example, use the anonymous HTML:input instead of the containing
-@@ -431,9 +431,9 @@ PRBool nsRootAccessible::FireAccessibleF
+@@ -431,9 +431,9 @@
        // This happens because when some bindings handle focus, they retarget
        // focus to the appropriate child inside of themselves, but DOM focus
        // stays outside on that binding parent.
 -      nsCOMPtr<nsIDOMEventTarget> domEventTarget;
 -      nsevent->GetOriginalTarget(getter_AddRefs(domEventTarget));
 -      nsCOMPtr<nsIDOMNode> realFocusedNode(do_QueryInterface(domEventTarget));
 +      nsIDOMEventTarget* domEventTarget = nsnull;
 +      nsevent->GetOriginalTarget(&domEventTarget);
 +      nsIDOMNode* realFocusedNode(do_QueryInterface(domEventTarget));
        if (!realFocusedNode) {
          // When FireCurrentFocusEvent() synthesizes a focus event,
          // the orignal target does not exist, so use the passed-in node
-@@ -447,22 +447,22 @@ PRBool nsRootAccessible::FireAccessibleF
+@@ -447,22 +447,22 @@
    }
  
    // Check for aria-activedescendant, which changes which element has focus
 -  nsCOMPtr<nsIDOMNode> finalFocusNode = aNode;
 -  nsCOMPtr<nsIAccessible> finalFocusAccessible = aAccessible;
 -  nsCOMPtr<nsIContent> finalFocusContent = GetRoleContent(finalFocusNode);
 +  nsIDOMNode* finalFocusNode = aNode;
 +  nsIAccessible* finalFocusAccessible = aAccessible;
@@ -6894,47 +6894,47 @@ diff --git a/accessible/src/base/nsRootA
        }
 -      nsCOMPtr<nsIDOMElement> relatedEl;
 -      domDoc->GetElementById(id, getter_AddRefs(relatedEl));
 +      nsIDOMElement* relatedEl = nsnull;
 +      domDoc->GetElementById(id, &relatedEl);
        finalFocusNode = do_QueryInterface(relatedEl);
        if (!finalFocusNode) {
          // If aria-activedescendant is set to nonextistant ID, then treat as focus
-@@ -479,7 +479,7 @@ PRBool nsRootAccessible::FireAccessibleF
+@@ -479,7 +479,7 @@
    }
  
    if (!finalFocusAccessible) {
 -    GetAccService()->GetAccessibleFor(finalFocusNode, getter_AddRefs(finalFocusAccessible));      
 +    GetAccService()->GetAccessibleFor(finalFocusNode, &finalFocusAccessible);      
      // For activedescendant, the ARIA spec does not require that the user agent
      // checks whether finalFocusNode is actually a descendant of the element with
      // the activedescendant attribute.
-@@ -495,9 +495,9 @@ PRBool nsRootAccessible::FireAccessibleF
+@@ -495,9 +495,9 @@
        PRUint32 naturalRole; // The natural role is the role that this type of element normally has
        finalFocusAccessible->GetRole(&naturalRole);
        if (role != naturalRole) { // Must be a DHTML menuitem
 -        nsCOMPtr<nsIAccessible> menuBarAccessible =
 +        nsIAccessible* menuBarAccessible =
            nsAccUtils::GetAncestorWithRole(finalFocusAccessible, nsIAccessibleRole::ROLE_MENUBAR);
 -        nsCOMPtr<nsIAccessNode> menuBarAccessNode = do_QueryInterface(menuBarAccessible);
 +        nsIAccessNode* menuBarAccessNode = do_QueryInterface(menuBarAccessible);
          if (menuBarAccessNode) {
            menuBarAccessNode->GetDOMNode(getter_AddRefs(mCurrentARIAMenubar));
            if (mCurrentARIAMenubar) {
-@@ -508,7 +508,7 @@ PRBool nsRootAccessible::FireAccessibleF
+@@ -508,7 +508,7 @@
      }
    }
    else if (mCurrentARIAMenubar) {
 -    nsCOMPtr<nsIAccessibleEvent> menuEndEvent =
 +    nsIAccessibleEvent* menuEndEvent =
        new nsAccEvent(nsIAccessibleEvent::EVENT_MENU_END, mCurrentARIAMenubar,
                       PR_FALSE, nsAccEvent::eAllowDupes);
      if (menuEndEvent) {
-@@ -521,18 +521,18 @@ PRBool nsRootAccessible::FireAccessibleF
+@@ -521,18 +521,18 @@
    gLastFocusedNode = finalFocusNode;
    NS_IF_ADDREF(gLastFocusedNode);
  
 -  nsCOMPtr<nsIContent> focusContent = do_QueryInterface(gLastFocusedNode);
 +  nsIContent* focusContent = do_QueryInterface(gLastFocusedNode);
    nsIFrame *focusFrame = nsnull;
    if (focusContent) {
 -    nsCOMPtr<nsIPresShell> shell = nsAccessNode::GetPresShellFor(gLastFocusedNode);
@@ -6947,17 +6947,17 @@ diff --git a/accessible/src/base/nsRootA
 +  nsIAccessibleDocument* docAccessible = do_QueryInterface(finalFocusAccessible);
    if (docAccessible) {
      // Doc is gaining focus, but actual focus may be on an element within document
 -    nsCOMPtr<nsIDOMNode> realFocusedNode = GetCurrentFocus();
 +    nsIDOMNode* realFocusedNode = GetCurrentFocus();
      if (realFocusedNode != aNode || realFocusedNode == mDOMNode) {
        // Suppress document focus, because real DOM focus will be fired next,
        // and that's what we care about
-@@ -551,24 +551,24 @@ return PR_FALSE;
+@@ -551,24 +551,24 @@
  
  void nsRootAccessible::FireCurrentFocusEvent()
  {
 -  nsCOMPtr<nsIDOMNode> focusedNode = GetCurrentFocus();
 +  nsIDOMNode* focusedNode = GetCurrentFocus();
    if (!focusedNode) {
      return; // No current focus
    }
@@ -6978,28 +6978,28 @@ diff --git a/accessible/src/base/nsRootA
 -        nsCOMPtr<nsIDOMNode> targetNode;
 +        nsIDOMNode* targetNode = nsnull;
          accService->GetRelevantContentNodeFor(focusedNode,
 -                                            getter_AddRefs(targetNode));
 +                                            &targetNode);
          if (targetNode) {
            HandleEventWithTarget(event, targetNode);
          }
-@@ -583,8 +583,8 @@ NS_IMETHODIMP nsRootAccessible::HandleEv
+@@ -583,8 +583,8 @@
  {
    // Turn DOM events in accessibility events
    // Get info about event and target
 -  nsCOMPtr<nsIDOMNode> targetNode;
 -  GetTargetNode(aEvent, getter_AddRefs(targetNode));
 +  nsIDOMNode* targetNode = nsnull;
 +  GetTargetNode(aEvent, &targetNode);
    if (!targetNode)
      return NS_ERROR_FAILURE;
    
-@@ -621,16 +621,16 @@ nsresult nsRootAccessible::HandleEventWi
+@@ -621,16 +621,16 @@
      // so that we don't destroy something still in use, like wizard page. 
      // And we only get cached document accessible to destroy, so that we don't
      // create it just to destroy it.
 -    nsCOMPtr<nsIDocument> doc(do_QueryInterface(aTargetNode));
 -    nsCOMPtr<nsIAccessibleDocument> accDoc = GetDocAccessibleFor(doc);
 -    nsCOMPtr<nsPIAccessNode> privateAcc = do_QueryInterface(accDoc);
 +    nsIDocument* doc(do_QueryInterface(aTargetNode));
 +    nsIAccessibleDocument* accDoc = GetDocAccessibleFor(doc);
@@ -7010,58 +7010,58 @@ diff --git a/accessible/src/base/nsRootA
      return NS_OK;
    }
  
 -  nsCOMPtr<nsIPresShell> eventShell = GetPresShellFor(aTargetNode);
 +  nsIPresShell* eventShell = GetPresShellFor(aTargetNode);
    if (!eventShell) {
      return NS_OK;
    }
-@@ -648,7 +648,7 @@ nsresult nsRootAccessible::HandleEventWi
+@@ -648,7 +648,7 @@
      if (!isTree)
        return NS_OK;
  
 -    nsCOMPtr<nsIContent> treeContent = do_QueryInterface(aTargetNode);
 +    nsIContent* treeContent = do_QueryInterface(aTargetNode);
      nsAccEvent::PrepareForEvent(aTargetNode, PR_TRUE);
      return accService->InvalidateSubtreeFor(eventShell, treeContent,
                                              nsIAccessibleEvent::EVENT_DOM_SIGNIFICANT_CHANGE);
-@@ -670,10 +670,10 @@ nsresult nsRootAccessible::HandleEventWi
+@@ -670,10 +670,10 @@
      FireCurrentFocusEvent();
    }
  
 -  nsCOMPtr<nsIAccessible> accessible;
 +  nsIAccessible* accessible = nsnull;
    accService->GetAccessibleInShell(aTargetNode, eventShell,
 -                                   getter_AddRefs(accessible));
 -  nsCOMPtr<nsPIAccessible> privAcc(do_QueryInterface(accessible));
 +                                   &accessible);
 +  nsPIAccessible* privAcc(do_QueryInterface(accessible));
    if (!privAcc)
      return NS_OK;
  
-@@ -695,7 +695,7 @@ nsresult nsRootAccessible::HandleEventWi
+@@ -695,7 +695,7 @@
      PRBool isEnabled = (state & (nsIAccessibleStates::STATE_CHECKED |
                          nsIAccessibleStates::STATE_SELECTED)) != 0;
  
 -    nsCOMPtr<nsIAccessibleStateChangeEvent> accEvent =
 +    nsIAccessibleStateChangeEvent* accEvent =
        new nsAccStateChangeEvent(accessible, nsIAccessibleStates::STATE_CHECKED,
                                  PR_FALSE, isEnabled);
      privAcc->FireAccessibleEvent(accEvent);
-@@ -711,7 +711,7 @@ nsresult nsRootAccessible::HandleEventWi
+@@ -711,7 +711,7 @@
  
      PRBool isEnabled = !!(state & nsIAccessibleStates::STATE_CHECKED);
  
 -    nsCOMPtr<nsIAccessibleStateChangeEvent> accEvent =
 +    nsIAccessibleStateChangeEvent* accEvent =
        new nsAccStateChangeEvent(accessible,
                                  nsIAccessibleStates::STATE_CHECKED,
                                  PR_FALSE, isEnabled);
-@@ -719,22 +719,22 @@ nsresult nsRootAccessible::HandleEventWi
+@@ -719,22 +719,22 @@
      return privAcc->FireAccessibleEvent(accEvent);
    }
  
 -  nsCOMPtr<nsIAccessible> treeItemAccessible;
 +  nsIAccessible* treeItemAccessible = nsnull;
  #ifdef MOZ_XUL
    // If it's a tree element, need the currently selected item
    if (isTree) {
@@ -7078,35 +7078,35 @@ diff --git a/accessible/src/base/nsRootA
              NS_FAILED(treeCache->GetCachedTreeitemAccessible(
                        treeIndex,
                        nsnull,
 -                      getter_AddRefs(treeItemAccessible))) ||
 +                      &treeItemAccessible)) ||
                        !treeItemAccessible) {
            return NS_ERROR_OUT_OF_MEMORY;
          }
-@@ -749,7 +749,7 @@ nsresult nsRootAccessible::HandleEventWi
+@@ -749,7 +749,7 @@
      PRUint32 state = State(accessible); // collapsed/expanded changed
      PRBool isEnabled = (state & nsIAccessibleStates::STATE_EXPANDED) != 0;
  
 -    nsCOMPtr<nsIAccessibleStateChangeEvent> accEvent =
 +    nsIAccessibleStateChangeEvent* accEvent =
        new nsAccStateChangeEvent(accessible, nsIAccessibleStates::STATE_EXPANDED,
                                  PR_FALSE, isEnabled);
      return FireAccessibleEvent(accEvent);
-@@ -758,7 +758,7 @@ nsresult nsRootAccessible::HandleEventWi
+@@ -758,7 +758,7 @@
    if (treeItemAccessible && eventType.EqualsLiteral("select")) {
      // If multiselect tree, we should fire selectionadd or selection removed
      if (gLastFocusedNode == aTargetNode) {
 -      nsCOMPtr<nsIDOMXULMultiSelectControlElement> multiSel =
 +      nsIDOMXULMultiSelectControlElement* multiSel =
          do_QueryInterface(aTargetNode);
        nsAutoString selType;
        multiSel->GetSelType(selType);
-@@ -794,19 +794,19 @@ nsresult nsRootAccessible::HandleEventWi
+@@ -794,19 +794,19 @@
      // Keep a reference to the target node. We might want to change
      // it to the individual radio button or selected item, and send
      // the focus event to that.
 -    nsCOMPtr<nsIDOMNode> focusedItem(aTargetNode);
 +    nsIDOMNode* focusedItem(aTargetNode);
  
      if (!treeItemAccessible) {
 -      nsCOMPtr<nsIDOMXULSelectControlElement> selectControl =
@@ -7121,35 +7121,35 @@ diff --git a/accessible/src/base/nsRootA
            // when the list is open, based on DOMMenuitemActive events
 -          nsCOMPtr<nsIDOMXULSelectControlItemElement> selectedItem;
 -          selectControl->GetSelectedItem(getter_AddRefs(selectedItem));
 +          nsIDOMXULSelectControlItemElement* selectedItem = nsnull;
 +          selectControl->GetSelectedItem(&selectedItem);
            if (selectedItem)
              focusedItem = do_QueryInterface(selectedItem);
  
-@@ -814,7 +814,7 @@ nsresult nsRootAccessible::HandleEventWi
+@@ -814,7 +814,7 @@
              return NS_OK;
  
            accService->GetAccessibleInShell(focusedItem, eventShell,
 -                                           getter_AddRefs(accessible));
 +                                           &accessible);
            if (!accessible)
              return NS_OK;
          }
-@@ -857,7 +857,7 @@ nsresult nsRootAccessible::HandleEventWi
+@@ -857,7 +857,7 @@
          return NS_OK; // Tree with nothing selected
        }
  #endif
 -      nsCOMPtr<nsPIAccessNode> menuAccessNode = do_QueryInterface(accessible);
 +      nsPIAccessNode* menuAccessNode = do_QueryInterface(accessible);
        NS_ENSURE_TRUE(menuAccessNode, NS_ERROR_FAILURE);
        nsIFrame* menuFrame = menuAccessNode->GetFrame();
        NS_ENSURE_TRUE(menuFrame, NS_ERROR_FAILURE);
-@@ -872,15 +872,15 @@ nsresult nsRootAccessible::HandleEventWi
+@@ -872,15 +872,15 @@
          // is active.
          return NS_OK;
        } else {
 -        nsCOMPtr<nsIAccessible> containerAccessible;
 -        accessible->GetParent(getter_AddRefs(containerAccessible));
 +        nsIAccessible* containerAccessible = nsnull;
 +        accessible->GetParent(&containerAccessible);
          NS_ENSURE_TRUE(containerAccessible, NS_ERROR_FAILURE);
@@ -7159,34 +7159,34 @@ diff --git a/accessible/src/base/nsRootA
          if (State(containerAccessible) & nsIAccessibleStates::STATE_COLLAPSED) {
 -          nsCOMPtr<nsIAccessible> containerParent;
 -          containerAccessible->GetParent(getter_AddRefs(containerParent));
 +          nsIAccessible* containerParent = nsnull;
 +          containerAccessible->GetParent(&containerParent);
            NS_ENSURE_TRUE(containerParent, NS_ERROR_FAILURE);
            if (Role(containerParent) != nsIAccessibleRole::ROLE_COMBOBOX) {
              return NS_OK;
-@@ -889,12 +889,12 @@ nsresult nsRootAccessible::HandleEventWi
+@@ -889,12 +889,12 @@
        }
      }
      if (!fireFocus) {
 -      nsCOMPtr<nsIDOMNode> realFocusedNode = GetCurrentFocus();
 -      nsCOMPtr<nsIContent> realFocusedContent = do_QueryInterface(realFocusedNode);
 -      nsCOMPtr<nsIContent> targetContent = do_QueryInterface(aTargetNode);
 +      nsIDOMNode* realFocusedNode = GetCurrentFocus();
 +      nsIContent* realFocusedContent = do_QueryInterface(realFocusedNode);
 +      nsIContent* targetContent = do_QueryInterface(aTargetNode);
        nsIContent *containerContent = targetContent;
        while (containerContent) {
 -        nsCOMPtr<nsIDOMXULPopupElement> popup = do_QueryInterface(containerContent);
 +        nsIDOMXULPopupElement* popup = do_QueryInterface(containerContent);
          if (popup || containerContent == realFocusedContent) { 
            // If we're inside the focus or a popup we can fire focus events
            // for the changed active item
-@@ -933,14 +933,14 @@ void nsRootAccessible::GetTargetNode(nsI
+@@ -933,14 +933,14 @@
  {
    *aTargetNode = nsnull;
  
 -  nsCOMPtr<nsIDOMNSEvent> nsevent(do_QueryInterface(aEvent));
 +  nsIDOMNSEvent* nsevent(do_QueryInterface(aEvent));
  
    if (!nsevent)
      return;
@@ -7195,56 +7195,56 @@ diff --git a/accessible/src/base/nsRootA
 -  nsevent->GetOriginalTarget(getter_AddRefs(domEventTarget));
 -  nsCOMPtr<nsIDOMNode> eventTarget(do_QueryInterface(domEventTarget));
 +  nsIDOMEventTarget* domEventTarget = nsnull;
 +  nsevent->GetOriginalTarget(&domEventTarget);
 +  nsIDOMNode* eventTarget(do_QueryInterface(domEventTarget));
    if (!eventTarget)
      return;
  
-@@ -968,7 +968,7 @@ nsRootAccessible::Init()
+@@ -968,7 +968,7 @@
    nsresult rv = nsDocAccessibleWrap::Init();
    NS_ENSURE_SUCCESS(rv, rv);
  
 -  nsRefPtr<nsApplicationAccessibleWrap> root = GetApplicationAccessible();
 +  nsApplicationAccessibleWrap* root = GetApplicationAccessible();
    NS_ENSURE_STATE(root);
  
    root->AddRootAccessible(this);
-@@ -982,7 +982,7 @@ NS_IMETHODIMP nsRootAccessible::Shutdown
+@@ -982,7 +982,7 @@
      return NS_OK;  // Already shutdown
    }
  
 -  nsRefPtr<nsApplicationAccessibleWrap> root = GetApplicationAccessible();
 +  nsApplicationAccessibleWrap* root = GetApplicationAccessible();
    NS_ENSURE_STATE(root);
  
    root->RemoveRootAccessible(this);
-@@ -997,7 +997,7 @@ NS_IMETHODIMP nsRootAccessible::Shutdown
+@@ -997,7 +997,7 @@
    return nsDocAccessibleWrap::Shutdown();
  }
  
 -already_AddRefed<nsIDocShellTreeItem>
 +nsIDocShellTreeItem*
  nsRootAccessible::GetContentDocShell(nsIDocShellTreeItem *aStart)
  {
    if (!aStart) {
-@@ -1007,9 +1007,9 @@ nsRootAccessible::GetContentDocShell(nsI
+@@ -1007,9 +1007,9 @@
    PRInt32 itemType;
    aStart->GetItemType(&itemType);
    if (itemType == nsIDocShellTreeItem::typeContent) {
 -    nsCOMPtr<nsIAccessibleDocument> accDoc =
 +    nsIAccessibleDocument* accDoc =
        GetDocAccessibleFor(aStart, PR_TRUE);
 -    nsCOMPtr<nsIAccessible> accessible = do_QueryInterface(accDoc);
 +    nsIAccessible* accessible = do_QueryInterface(accDoc);
      // If ancestor chain of accessibles is not completely visible,
      // don't use this one. This happens for example if it's inside
      // a background tab (tabbed browsing)
-@@ -1017,24 +1017,24 @@ nsRootAccessible::GetContentDocShell(nsI
+@@ -1017,24 +1017,24 @@
        if (State(accessible) & nsIAccessibleStates::STATE_INVISIBLE) {
          return nsnull;
        }
 -      nsCOMPtr<nsIAccessible> ancestor;
 -      accessible->GetParent(getter_AddRefs(ancestor));
 +      nsIAccessible* ancestor = nsnull;
 +      accessible->GetParent(&ancestor);
        if (ancestor == this) {
@@ -7265,42 +7265,42 @@ diff --git a/accessible/src/base/nsRootA
      for (PRInt32 count = 0; count < subDocuments; count ++) {
 -      nsCOMPtr<nsIDocShellTreeItem> treeItemChild, contentTreeItem;
 -      treeNode->GetChildAt(count, getter_AddRefs(treeItemChild));
 +      nsIDocShellTreeItem* treeItemChild = nsnull, *contentTreeItem = nsnull;
 +      treeNode->GetChildAt(count, &treeItemChild);
        NS_ENSURE_TRUE(treeItemChild, nsnull);
        contentTreeItem = GetContentDocShell(treeItemChild);
        if (contentTreeItem) {
-@@ -1055,12 +1055,12 @@ NS_IMETHODIMP nsRootAccessible::GetAcces
+@@ -1055,12 +1055,12 @@
      return nsDocAccessibleWrap::GetAccessibleRelated(aRelationType, aRelated);
    }
  
 -  nsCOMPtr<nsIDocShellTreeItem> treeItem =
 +  nsIDocShellTreeItem* treeItem =
      nsAccUtils::GetDocShellTreeItemFor(mDOMNode);
 -  nsCOMPtr<nsIDocShellTreeItem> contentTreeItem = GetContentDocShell(treeItem);
 +  nsIDocShellTreeItem* contentTreeItem = GetContentDocShell(treeItem);
    // there may be no content area, so we need a null check
    if (contentTreeItem) {
 -    nsCOMPtr<nsIAccessibleDocument> accDoc =
 +    nsIAccessibleDocument* accDoc =
        GetDocAccessibleFor(contentTreeItem, PR_TRUE);
      NS_ASSERTION(accDoc, "No EMBEDS document");
      if (accDoc) {
-@@ -1076,7 +1076,7 @@ NS_IMETHODIMP nsRootAccessible::FireDocL
+@@ -1076,7 +1076,7 @@
      return NS_OK;  // Document has been shut down
    }
  
 -  nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem =
 +  nsIDocShellTreeItem* docShellTreeItem =
      nsAccUtils::GetDocShellTreeItemFor(mDOMNode);
    NS_ASSERTION(docShellTreeItem, "No doc shell tree item for document");
    NS_ENSURE_TRUE(docShellTreeItem, NS_ERROR_FAILURE);
-@@ -1101,19 +1101,19 @@ nsRootAccessible::HandleTreeRowCountChan
+@@ -1101,19 +1101,19 @@
    if (!aTargetName.EqualsLiteral("tree"))
      return NS_OK;
  
 -  nsCOMPtr<nsIDOMDataContainerEvent> dataEvent(do_QueryInterface(aEvent));
 +  nsIDOMDataContainerEvent* dataEvent(do_QueryInterface(aEvent));
    if (!dataEvent)
      return NS_OK;
  
@@ -7315,26 +7315,26 @@ diff --git a/accessible/src/base/nsRootA
 -  nsCOMPtr<nsIVariant> countVariant;
 +  nsIVariant* countVariant = nsnull;
    dataEvent->GetData(NS_LITERAL_STRING("count"),
 -                     getter_AddRefs(countVariant));
 +                     &countVariant);
    if (!countVariant)
      return NS_OK;
  
-@@ -1121,7 +1121,7 @@ nsRootAccessible::HandleTreeRowCountChan
+@@ -1121,7 +1121,7 @@
    indexVariant->GetAsInt32(&index);
    countVariant->GetAsInt32(&count);
  
 -  nsCOMPtr<nsIAccessibleTreeCache> treeAccCache(do_QueryInterface(aAccessible));
 +  nsIAccessibleTreeCache* treeAccCache(do_QueryInterface(aAccessible));
    NS_ENSURE_STATE(treeAccCache);
  
    return treeAccCache->InvalidateCache(index, count);
-@@ -1135,37 +1135,37 @@ nsRootAccessible::HandleTreeInvalidatedE
+@@ -1135,37 +1135,37 @@
    if (!aTargetName.EqualsLiteral("tree"))
      return NS_OK;
  
 -  nsCOMPtr<nsIDOMDataContainerEvent> dataEvent(do_QueryInterface(aEvent));
 +  nsIDOMDataContainerEvent* dataEvent(do_QueryInterface(aEvent));
    if (!dataEvent)
      return NS_OK;
  
@@ -7372,100 +7372,100 @@ diff --git a/accessible/src/base/nsRootA
    if (endColVariant)
      endColVariant->GetAsInt32(&endCol);
  
 -  nsCOMPtr<nsIAccessibleTreeCache> treeAcc(do_QueryInterface(aAccessible));
 +  nsIAccessibleTreeCache* treeAcc(do_QueryInterface(aAccessible));
    NS_ENSURE_STATE(treeAcc);
  
    return treeAcc->TreeViewInvalidated(startRow, endRow, startCol, endCol);
-diff --git a/accessible/src/base/nsRootAccessible.h b/accessible/src/base/nsRootAccessible.h
---- a/accessible/src/base/nsRootAccessible.h
-+++ b/accessible/src/base/nsRootAccessible.h
-@@ -137,7 +137,7 @@ class nsRootAccessible : public nsDocAcc
+diff -r 332906b0e686 accessible/src/base/nsRootAccessible.h
+--- a/accessible/src/base/nsRootAccessible.h	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/base/nsRootAccessible.h	Fri Jul 04 01:35:36 2008 -0700
+@@ -137,7 +137,7 @@
  #ifdef MOZ_XUL
      PRUint32 GetChromeFlags();
  #endif
 -    already_AddRefed<nsIDocShellTreeItem>
 +    nsIDocShellTreeItem*
             GetContentDocShell(nsIDocShellTreeItem *aStart);
      nsRefPtr<nsCaretAccessible> mCaretAccessible;
      nsCOMPtr<nsIDOMNode> mCurrentARIAMenubar;
-diff --git a/accessible/src/html/nsHTMLAreaAccessible.cpp b/accessible/src/html/nsHTMLAreaAccessible.cpp
---- a/accessible/src/html/nsHTMLAreaAccessible.cpp
-+++ b/accessible/src/html/nsHTMLAreaAccessible.cpp
-@@ -74,7 +74,7 @@ nsHTMLAreaAccessible::GetName(nsAString 
+diff -r 332906b0e686 accessible/src/html/nsHTMLAreaAccessible.cpp
+--- a/accessible/src/html/nsHTMLAreaAccessible.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/html/nsHTMLAreaAccessible.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -74,7 +74,7 @@
        return NS_OK;
    }
  
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
    if (!content->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::alt,
                          aName) &&  
        !content->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::title,
-@@ -91,7 +91,7 @@ nsHTMLAreaAccessible::GetDescription(nsA
+@@ -91,7 +91,7 @@
    aDescription.Truncate();
  
    // Still to do - follow IE's standard here
 -  nsCOMPtr<nsIDOMHTMLAreaElement> area(do_QueryInterface(mDOMNode));
 +  nsIDOMHTMLAreaElement* area(do_QueryInterface(mDOMNode));
    if (area) 
      area->GetShape(aDescription);
  
-@@ -136,7 +136,7 @@ nsHTMLAreaAccessible::GetBounds(PRInt32 
+@@ -136,7 +136,7 @@
    nsPresContext *presContext = GetPresContext();
    NS_ENSURE_TRUE(presContext, NS_ERROR_FAILURE);
  
 -  nsCOMPtr<nsIContent> ourContent(do_QueryInterface(mDOMNode));
 +  nsIContent* ourContent(do_QueryInterface(mDOMNode));
    NS_ENSURE_TRUE(ourContent, NS_ERROR_FAILURE);
  
    nsIFrame *frame = GetFrame();
-@@ -145,8 +145,8 @@ nsHTMLAreaAccessible::GetBounds(PRInt32 
+@@ -145,8 +145,8 @@
    nsresult rv = frame->QueryInterface(NS_GET_IID(nsIImageFrame), (void**)&imageFrame);
    NS_ENSURE_SUCCESS(rv, rv);
  
 -  nsCOMPtr<nsIImageMap> map;
 -  imageFrame->GetImageMap(presContext, getter_AddRefs(map));
 +  nsIImageMap* map = nsnull;
 +  imageFrame->GetImageMap(presContext, &map);
    NS_ENSURE_TRUE(map, NS_ERROR_FAILURE);
  
    nsRect rect, orgRectPixels;
-diff --git a/accessible/src/html/nsHTMLFormControlAccessible.cpp b/accessible/src/html/nsHTMLFormControlAccessible.cpp
---- a/accessible/src/html/nsHTMLFormControlAccessible.cpp
-+++ b/accessible/src/html/nsHTMLFormControlAccessible.cpp
-@@ -113,7 +113,7 @@ nsHTMLCheckboxAccessible::GetState(PRUin
+diff -r 332906b0e686 accessible/src/html/nsHTMLFormControlAccessible.cpp
+--- a/accessible/src/html/nsHTMLFormControlAccessible.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/html/nsHTMLFormControlAccessible.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -113,7 +113,7 @@
  
    PRBool checked = PR_FALSE;   // Radio buttons and check boxes can be checked
  
 -  nsCOMPtr<nsIDOMHTMLInputElement> htmlCheckboxElement(do_QueryInterface(mDOMNode));
 +  nsIDOMHTMLInputElement* htmlCheckboxElement(do_QueryInterface(mDOMNode));
    if (htmlCheckboxElement)
      htmlCheckboxElement->GetChecked(&checked);
  
-@@ -142,7 +142,7 @@ nsHTMLRadioButtonAccessible::GetState(PR
+@@ -142,7 +142,7 @@
    
    PRBool checked = PR_FALSE;   // Radio buttons and check boxes can be checked
  
 -  nsCOMPtr<nsIDOMHTMLInputElement> htmlRadioElement(do_QueryInterface(mDOMNode));
 +  nsIDOMHTMLInputElement* htmlRadioElement(do_QueryInterface(mDOMNode));
    if (htmlRadioElement)
      htmlRadioElement->GetChecked(&checked);
  
-@@ -166,7 +166,7 @@ nsHTMLRadioButtonAccessible::GetAttribut
+@@ -166,7 +166,7 @@
    nsAutoString tagName;
    mDOMNode->GetLocalName(tagName);
  
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
    NS_ENSURE_STATE(content);
  
    nsAutoString type;
-@@ -174,18 +174,18 @@ nsHTMLRadioButtonAccessible::GetAttribut
+@@ -174,18 +174,18 @@
    nsAutoString name;
    content->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::name, name);
  
 -  nsCOMPtr<nsIDOMNodeList> inputs;
 +  nsIDOMNodeList* inputs = nsnull;
  
 -  nsCOMPtr<nsIDOMHTMLInputElement> radio(do_QueryInterface(mDOMNode));
 -  nsCOMPtr<nsIDOMHTMLFormElement> form;
@@ -7482,162 +7482,162 @@ diff --git a/accessible/src/html/nsHTMLF
 +    nsIDOMDocument* document = nsnull;
 +    mDOMNode->GetOwnerDocument(&document);
      if (document)
 -      document->GetElementsByTagNameNS(nsURI, tagName, getter_AddRefs(inputs));
 +      document->GetElementsByTagNameNS(nsURI, tagName, &inputs);
    }
  
    NS_ENSURE_TRUE(inputs, NS_OK);
-@@ -198,10 +198,10 @@ nsHTMLRadioButtonAccessible::GetAttribut
+@@ -198,10 +198,10 @@
    PRInt32 count = 0;
  
    for (PRUint32 index = 0; index < inputsCount; index++) {
 -    nsCOMPtr<nsIDOMNode> itemNode;
 -    inputs->Item(index, getter_AddRefs(itemNode));
 +    nsIDOMNode* itemNode = nsnull;
 +    inputs->Item(index, &itemNode);
  
 -    nsCOMPtr<nsIContent> item(do_QueryInterface(itemNode));
 +    nsIContent* item(do_QueryInterface(itemNode));
      if (item &&
          item->AttrValueIs(kNameSpaceID_None, nsAccessibilityAtoms::type,
                            type, eCaseMatters) &&
-@@ -258,7 +258,7 @@ nsHTMLButtonAccessible::GetState(PRUint3
+@@ -258,7 +258,7 @@
    if (!mDOMNode)
      return NS_OK;
  
 -  nsCOMPtr<nsIDOMElement> element(do_QueryInterface(mDOMNode));
 +  nsIDOMElement* element(do_QueryInterface(mDOMNode));
    NS_ENSURE_TRUE(element, NS_ERROR_FAILURE);
  
    nsAutoString buttonType;
-@@ -277,7 +277,7 @@ NS_IMETHODIMP nsHTMLButtonAccessible::Ge
+@@ -277,7 +277,7 @@
  
  NS_IMETHODIMP nsHTMLButtonAccessible::GetName(nsAString& aName)
  {
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
    if (!content) {
      return NS_ERROR_FAILURE; // Node shut down
    }
-@@ -361,7 +361,7 @@ nsHTML4ButtonAccessible::GetState(PRUint
+@@ -361,7 +361,7 @@
    if (!mDOMNode)
      return NS_OK;
  
 -  nsCOMPtr<nsIDOMElement> element(do_QueryInterface(mDOMNode));
 +  nsIDOMElement* element(do_QueryInterface(mDOMNode));
    NS_ASSERTION(element, "No element for button's dom node!");
  
    *aState |= nsIAccessibleStates::STATE_FOCUSABLE;
-@@ -386,7 +386,7 @@ NS_IMETHODIMP nsHTMLTextFieldAccessible:
+@@ -386,7 +386,7 @@
  NS_IMETHODIMP nsHTMLTextFieldAccessible::GetRole(PRUint32 *aRole)
  {
    *aRole = nsIAccessibleRole::ROLE_ENTRY;
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
    if (content &&
        content->AttrValueIs(kNameSpaceID_None, nsAccessibilityAtoms::type,
                             nsAccessibilityAtoms::password, eIgnoreCase)) {
-@@ -397,7 +397,7 @@ NS_IMETHODIMP nsHTMLTextFieldAccessible:
+@@ -397,7 +397,7 @@
  
  NS_IMETHODIMP nsHTMLTextFieldAccessible::GetName(nsAString& aName)
  {
 -  nsCOMPtr<nsIContent> content = do_QueryInterface(mDOMNode);
 +  nsIContent* content = do_QueryInterface(mDOMNode);
    if (!content) {
      return NS_ERROR_FAILURE;
    }
-@@ -410,8 +410,8 @@ NS_IMETHODIMP nsHTMLTextFieldAccessible:
+@@ -410,8 +410,8 @@
    // This means we're part of another control, so use parent accessible for name.
    // This ensures that a textbox inside of a XUL widget gets
    // an accessible name.
 -  nsCOMPtr<nsIAccessible> parent;
 -  rv = GetParent(getter_AddRefs(parent));
 +  nsIAccessible* parent = nsnull;
 +  rv = GetParent(&parent);
    return parent ? parent->GetName(aName) : rv;
  }
  
-@@ -422,12 +422,12 @@ NS_IMETHODIMP nsHTMLTextFieldAccessible:
+@@ -422,12 +422,12 @@
    if (state & nsIAccessibleStates::STATE_PROTECTED)    // Don't return password text!
      return NS_ERROR_FAILURE;
  
 -  nsCOMPtr<nsIDOMHTMLTextAreaElement> textArea(do_QueryInterface(mDOMNode));
 +  nsIDOMHTMLTextAreaElement* textArea(do_QueryInterface(mDOMNode));
    if (textArea) {
      return textArea->GetValue(_retval);
    }
    
 -  nsCOMPtr<nsIDOMHTMLInputElement> inputElement(do_QueryInterface(mDOMNode));
 +  nsIDOMHTMLInputElement* inputElement(do_QueryInterface(mDOMNode));
    if (inputElement) {
      return inputElement->GetValue(_retval);
    }
-@@ -444,7 +444,7 @@ nsHTMLTextFieldAccessible::GetState(PRUi
+@@ -444,7 +444,7 @@
      return NS_OK;
  
    // can be focusable, focused, protected. readonly, unavailable, selected
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
    NS_ASSERTION(content, "Should not have gotten here if upcalled GetExtState() succeeded");
  
    if (content->AttrValueIs(kNameSpaceID_None, nsAccessibilityAtoms::type,
-@@ -452,8 +452,8 @@ nsHTMLTextFieldAccessible::GetState(PRUi
+@@ -452,8 +452,8 @@
      *aState |= nsIAccessibleStates::STATE_PROTECTED;
    }
    else {
 -    nsCOMPtr<nsIAccessible> parent;
 -    GetParent(getter_AddRefs(parent));
 +    nsIAccessible* parent = nsnull;
 +    GetParent(&parent);
      if (parent && Role(parent) == nsIAccessibleRole::ROLE_AUTOCOMPLETE) {
        *aState |= nsIAccessibleStates::STATE_HASPOPUP;
      }
-@@ -466,7 +466,7 @@ nsHTMLTextFieldAccessible::GetState(PRUi
+@@ -466,7 +466,7 @@
    if (!aExtraState || !(*aExtraState & nsIAccessibleStates::EXT_STATE_EDITABLE))
      return NS_OK;
  
 -  nsCOMPtr<nsIDOMHTMLInputElement> htmlInput(do_QueryInterface(mDOMNode));
 +  nsIDOMHTMLInputElement* htmlInput(do_QueryInterface(mDOMNode));
    // Is it an <input> or a <textarea> ?
    if (htmlInput) {
      *aExtraState |= nsIAccessibleStates::EXT_STATE_SINGLE_LINE;
-@@ -475,7 +475,7 @@ nsHTMLTextFieldAccessible::GetState(PRUi
+@@ -475,7 +475,7 @@
      *aExtraState |= nsIAccessibleStates::EXT_STATE_MULTI_LINE;
    }
  
 -  nsCOMPtr<nsIContent> bindingContent = content->GetBindingParent();
 +  nsIContent* bindingContent = content->GetBindingParent();
    if (bindingContent &&
        bindingContent->NodeInfo()->Equals(nsAccessibilityAtoms::textbox,
                                           kNameSpaceID_XUL) &&
-@@ -497,9 +497,9 @@ nsHTMLTextFieldAccessible::GetState(PRUi
+@@ -497,9 +497,9 @@
                       autocomplete);
  
      if (!autocomplete.LowerCaseEqualsLiteral("off")) {
 -      nsCOMPtr<nsIDOMHTMLFormElement> form;
 -      htmlInput->GetForm(getter_AddRefs(form));
 -      nsCOMPtr<nsIContent> formContent(do_QueryInterface(form));
 +      nsIDOMHTMLFormElement* form = nsnull;
 +      htmlInput->GetForm(&form);
 +      nsIContent* formContent(do_QueryInterface(form));
        if (formContent) {
          formContent->GetAttr(kNameSpaceID_None,
                               nsAccessibilityAtoms::autocomplete, autocomplete);
-@@ -531,7 +531,7 @@ NS_IMETHODIMP nsHTMLTextFieldAccessible:
+@@ -531,7 +531,7 @@
  NS_IMETHODIMP nsHTMLTextFieldAccessible::DoAction(PRUint8 index)
  {
    if (index == 0) {
 -    nsCOMPtr<nsIDOMNSHTMLElement> element(do_QueryInterface(mDOMNode));
 +    nsIDOMNSHTMLElement* element(do_QueryInterface(mDOMNode));
      if ( element ) {
        return element->Focus();
      }
-@@ -543,17 +543,17 @@ NS_IMETHODIMP nsHTMLTextFieldAccessible:
+@@ -543,17 +543,17 @@
  NS_IMETHODIMP nsHTMLTextFieldAccessible::GetAssociatedEditor(nsIEditor **aEditor)
  {
    *aEditor = nsnull;
 -  nsCOMPtr<nsIDOMNSEditableElement> editableElt(do_QueryInterface(mDOMNode));
 +  nsIDOMNSEditableElement* editableElt(do_QueryInterface(mDOMNode));
    NS_ENSURE_TRUE(editableElt, NS_ERROR_FAILURE);
  
    // nsGenericHTMLElement::GetEditor has a security check.
@@ -7648,35 +7648,35 @@ diff --git a/accessible/src/html/nsHTMLF
      do_GetService("@mozilla.org/js/xpc/ContextStack;1");
    PRBool pushed = stack && NS_SUCCEEDED(stack->Push(nsnull));
  
 -  nsCOMPtr<nsIEditor> editor;
 +  nsIEditor* editor = nsnull;
    nsresult rv = editableElt->GetEditor(aEditor);
  
    if (pushed) {
-@@ -584,7 +584,7 @@ NS_IMETHODIMP nsHTMLGroupboxAccessible::
+@@ -584,7 +584,7 @@
  
  nsIContent* nsHTMLGroupboxAccessible::GetLegend()
  {
 -  nsCOMPtr<nsIContent> content = do_QueryInterface(mDOMNode);
 +  nsIContent* content = do_QueryInterface(mDOMNode);
    NS_ENSURE_TRUE(content, nsnull);
  
    nsresult count = 0;
-@@ -640,7 +640,7 @@ nsHTMLGroupboxAccessible::GetAccessibleR
+@@ -640,7 +640,7 @@
  
    if (aRelationType == nsIAccessibleRelation::RELATION_LABELLED_BY) {
      // No override for label, so use <legend> for this <fieldset>
 -    nsCOMPtr<nsIDOMNode> legendNode = do_QueryInterface(GetLegend());
 +    nsIDOMNode* legendNode = do_QueryInterface(GetLegend());
      if (legendNode) {
        GetAccService()->GetAccessibleInWeakShell(legendNode, mWeakShell, aRelated);
      }
-@@ -668,16 +668,16 @@ nsHTMLLegendAccessible::GetAccessibleRel
+@@ -668,16 +668,16 @@
  
    if (aRelationType == nsIAccessibleRelation::RELATION_LABEL_FOR) {
      // Look for groupbox parent
 -    nsCOMPtr<nsIContent> content = do_QueryInterface(mDOMNode);
 +    nsIContent* content = do_QueryInterface(mDOMNode);
      if (!content) {
        return NS_ERROR_FAILURE;  // Node already shut down
      }
@@ -7687,40 +7687,40 @@ diff --git a/accessible/src/html/nsHTMLF
 -      nsCOMPtr<nsIAccessible> testLabelAccessible;
 +      nsIAccessible* testLabelAccessible = nsnull;
        groupboxAccessible->GetAccessibleRelated(nsIAccessibleRelation::RELATION_LABELLED_BY,
 -                                               getter_AddRefs(testLabelAccessible));
 +                                               &testLabelAccessible);
        if (testLabelAccessible == this) {
          // We're the first child of the parent groupbox
          NS_ADDREF(*aRelated = groupboxAccessible);
-diff --git a/accessible/src/html/nsHTMLImageAccessible.cpp b/accessible/src/html/nsHTMLImageAccessible.cpp
---- a/accessible/src/html/nsHTMLImageAccessible.cpp
-+++ b/accessible/src/html/nsHTMLImageAccessible.cpp
-@@ -64,8 +64,8 @@ nsHTMLImageAccessible::nsHTMLImageAccess
+diff -r 332906b0e686 accessible/src/html/nsHTMLImageAccessible.cpp
+--- a/accessible/src/html/nsHTMLImageAccessible.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/html/nsHTMLImageAccessible.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -64,8 +64,8 @@
  nsHTMLImageAccessible::nsHTMLImageAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell):
  nsLinkableAccessible(aDOMNode, aShell), mAccessNodeCache(nsnull)
  { 
 -  nsCOMPtr<nsIDOMElement> element(do_QueryInterface(aDOMNode));
 -  nsCOMPtr<nsIPresShell> shell(do_QueryReferent(mWeakShell));
 +  nsIDOMElement* element(do_QueryInterface(aDOMNode));
 +  nsIPresShell* shell(do_QueryReferent(mWeakShell));
    if (!shell)
      return;
  
-@@ -73,7 +73,7 @@ nsLinkableAccessible(aDOMNode, aShell), 
+@@ -73,7 +73,7 @@
    nsAutoString mapElementName;
  
    if (doc && element) {
 -    nsCOMPtr<nsIHTMLDocument> htmlDoc(do_QueryInterface(doc));
 +    nsIHTMLDocument* htmlDoc(do_QueryInterface(doc));
      element->GetAttribute(NS_LITERAL_STRING("usemap"),mapElementName);
      if (htmlDoc && !mapElementName.IsEmpty()) {
        if (mapElementName.CharAt(0) == '#')
-@@ -105,16 +105,16 @@ nsHTMLImageAccessible::GetState(PRUint32
+@@ -105,16 +105,16 @@
    if (!mDOMNode)
      return NS_OK;
  
 -  nsCOMPtr<nsIImageLoadingContent> content(do_QueryInterface(mDOMNode));
 -  nsCOMPtr<imgIRequest> imageRequest;
 +  nsIImageLoadingContent* content(do_QueryInterface(mDOMNode));
 +  imgIRequest* imageRequest = nsnull;
  
@@ -7732,46 +7732,46 @@ diff --git a/accessible/src/html/nsHTMLI
 -  nsCOMPtr<imgIContainer> imgContainer;
 +  imgIContainer* imgContainer = nsnull;
    if (imageRequest)
 -    imageRequest->GetImage(getter_AddRefs(imgContainer));
 +    imageRequest->GetImage(&imgContainer);
  
    if (imgContainer) {
      PRUint32 numFrames;
-@@ -134,7 +134,7 @@ NS_IMETHODIMP nsHTMLImageAccessible::Get
+@@ -134,7 +134,7 @@
    if (IsDefunct())
      return NS_ERROR_FAILURE;
    
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
    NS_ASSERTION(content, "Image node always supports nsIContent");
      
    // No alt attribute means AT can repair if there is no accessible name
-@@ -182,7 +182,7 @@ void nsHTMLImageAccessible::CacheChildre
+@@ -182,7 +182,7 @@
    }
  
    mAccChildCount = 0;
 -  nsCOMPtr<nsIDOMHTMLCollection> mapAreas = GetAreaCollection();
 +  nsIDOMHTMLCollection* mapAreas = GetAreaCollection();
    if (!mapAreas)
      return;
  
-@@ -190,8 +190,8 @@ void nsHTMLImageAccessible::CacheChildre
+@@ -190,8 +190,8 @@
    mapAreas->GetLength(&numMapAreas);
    PRInt32 childCount = 0;
    
 -  nsCOMPtr<nsIAccessible> areaAccessible;
 -  nsCOMPtr<nsPIAccessible> privatePrevAccessible;
 +  nsIAccessible* areaAccessible = nsnull;
 +  nsPIAccessible* privatePrevAccessible = nsnull;
    while (childCount < (PRInt32)numMapAreas && 
           (areaAccessible = GetAreaAccessible(mapAreas, childCount)) != nsnull) {
      if (privatePrevAccessible) {
-@@ -214,21 +214,21 @@ NS_IMETHODIMP nsHTMLImageAccessible::DoA
+@@ -214,21 +214,21 @@
  {
    if (index == eAction_ShowLongDescription) {
      //get the long description uri and open in a new window
 -    nsCOMPtr<nsIDOMHTMLImageElement> element(do_QueryInterface(mDOMNode));
 +    nsIDOMHTMLImageElement* element(do_QueryInterface(mDOMNode));
      NS_ENSURE_TRUE(element, NS_ERROR_FAILURE);
      nsAutoString longDesc;
      nsresult rv = element->GetLongDesc(longDesc);
@@ -7791,17 +7791,17 @@ diff --git a/accessible/src/html/nsHTMLI
 -    nsCOMPtr<nsIDOMWindow> tmp;
 +    nsIDOMWindow* tmp = nsnull;
      return win->Open(longDesc, NS_LITERAL_STRING(""), NS_LITERAL_STRING(""),
 -                     getter_AddRefs(tmp));
 +                     &tmp);
    }
    return nsLinkableAccessible::DoAction(index);
  }
-@@ -255,16 +255,16 @@ nsHTMLImageAccessible::GetURI(PRInt32 aI
+@@ -255,16 +255,16 @@
    if (!mMapElement)
      return nsLinkableAccessible::GetURI(aIndex, aURI);
  
 -  nsCOMPtr<nsIDOMHTMLCollection> mapAreas = GetAreaCollection();
 +  nsIDOMHTMLCollection* mapAreas = GetAreaCollection();
    if (!mapAreas)
      return NS_OK;
    
@@ -7812,47 +7812,47 @@ diff --git a/accessible/src/html/nsHTMLI
    if (!domNode)
      return NS_ERROR_INVALID_ARG;
  
 -  nsCOMPtr<nsILink> link(do_QueryInterface(domNode));
 +  nsILink* link(do_QueryInterface(domNode));
    if (link)
      link->GetHrefURI(aURI);
  
-@@ -280,9 +280,9 @@ nsHTMLImageAccessible::GetAnchor(PRInt32
+@@ -280,9 +280,9 @@
    if (!mMapElement)
      return nsLinkableAccessible::GetAnchor(aIndex, aAccessible);
  
 -  nsCOMPtr<nsIDOMHTMLCollection> mapAreas = GetAreaCollection();
 +  nsIDOMHTMLCollection* mapAreas = GetAreaCollection();
    if (mapAreas) {
 -    nsCOMPtr<nsIAccessible> accessible;
 +    nsIAccessible* accessible = nsnull;
      accessible = GetAreaAccessible(mapAreas, aIndex);
      if (!accessible)
        return NS_ERROR_INVALID_ARG;
-@@ -344,7 +344,7 @@ nsHTMLImageAccessible::GetAttributesInte
+@@ -344,7 +344,7 @@
    nsresult rv = nsLinkableAccessible::GetAttributesInternal(aAttributes);
    NS_ENSURE_SUCCESS(rv, rv);
  
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
  
    nsAutoString src;
    content->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::src, src);
-@@ -354,7 +354,7 @@ nsHTMLImageAccessible::GetAttributesInte
+@@ -354,7 +354,7 @@
    return NS_OK;
  }
  
 -already_AddRefed<nsIDOMHTMLCollection>
 +nsIDOMHTMLCollection*
  nsHTMLImageAccessible::GetAreaCollection()
  {
    if (!mMapElement)
-@@ -368,28 +368,28 @@ nsHTMLImageAccessible::GetAreaCollection
+@@ -368,28 +368,28 @@
    return mapAreas;
  }
  
 -already_AddRefed<nsIAccessible>
 +nsIAccessible*
  nsHTMLImageAccessible::GetAreaAccessible(nsIDOMHTMLCollection *aAreaCollection,
                                           PRInt32 aAreaNum)
  {
@@ -7877,141 +7877,141 @@ diff --git a/accessible/src/html/nsHTMLI
      if (!accessNode)
        return nsnull;
      
 -    nsCOMPtr<nsPIAccessNode> privateAccessNode(do_QueryInterface(accessNode));
 +    nsPIAccessNode* privateAccessNode(do_QueryInterface(accessNode));
      NS_ASSERTION(privateAccessNode,
                   "Accessible doesn't implement nsPIAccessNode");
      
-diff --git a/accessible/src/html/nsHTMLImageAccessible.h b/accessible/src/html/nsHTMLImageAccessible.h
---- a/accessible/src/html/nsHTMLImageAccessible.h
-+++ b/accessible/src/html/nsHTMLImageAccessible.h
-@@ -84,8 +84,8 @@ protected:
+diff -r 332906b0e686 accessible/src/html/nsHTMLImageAccessible.h
+--- a/accessible/src/html/nsHTMLImageAccessible.h	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/html/nsHTMLImageAccessible.h	Fri Jul 04 01:35:36 2008 -0700
+@@ -84,8 +84,8 @@
    // nsAccessible
    virtual void CacheChildren();
  
 -  already_AddRefed<nsIDOMHTMLCollection> GetAreaCollection();
 -  already_AddRefed<nsIAccessible>
 +  nsIDOMHTMLCollection* GetAreaCollection();
 +  nsIAccessible*
      GetAreaAccessible(nsIDOMHTMLCollection* aAreaNodes, PRInt32 aAreaNum);
  
    // Reference on linked map element if any.
-diff --git a/accessible/src/html/nsHTMLLinkAccessible.cpp b/accessible/src/html/nsHTMLLinkAccessible.cpp
---- a/accessible/src/html/nsHTMLLinkAccessible.cpp
-+++ b/accessible/src/html/nsHTMLLinkAccessible.cpp
-@@ -65,7 +65,7 @@ nsHTMLLinkAccessible::GetName(nsAString&
+diff -r 332906b0e686 accessible/src/html/nsHTMLLinkAccessible.cpp
+--- a/accessible/src/html/nsHTMLLinkAccessible.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/html/nsHTMLLinkAccessible.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -65,7 +65,7 @@
    if (IsDefunct())
      return NS_ERROR_FAILURE;
  
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
    return AppendFlatStringFromSubtree(content, &aName);
  }
  
-@@ -88,7 +88,7 @@ nsHTMLLinkAccessible::GetState(PRUint32 
+@@ -88,7 +88,7 @@
  
    *aState  &= ~nsIAccessibleStates::STATE_READONLY;
  
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
    if (content && content->HasAttr(kNameSpaceID_None,
                                    nsAccessibilityAtoms::name)) {
      // This is how we indicate it is a named anchor
-@@ -97,7 +97,7 @@ nsHTMLLinkAccessible::GetState(PRUint32 
+@@ -97,7 +97,7 @@
      *aState |= nsIAccessibleStates::STATE_SELECTABLE;
    }
  
 -  nsCOMPtr<nsILink> link = do_QueryInterface(mDOMNode);
 +  nsILink* link = do_QueryInterface(mDOMNode);
    NS_ENSURE_STATE(link);
  
    nsLinkState linkState;
-@@ -126,7 +126,7 @@ nsHTMLLinkAccessible::GetValue(nsAString
+@@ -126,7 +126,7 @@
    if (!aValue.IsEmpty())
      return NS_OK;
    
 -  nsCOMPtr<nsIPresShell> presShell(do_QueryReferent(mWeakShell));
 +  nsIPresShell* presShell(do_QueryReferent(mWeakShell));
    if (mDOMNode && presShell)
      return presShell->GetLinkLocation(mDOMNode, aValue);
  
-@@ -164,7 +164,7 @@ nsHTMLLinkAccessible::DoAction(PRUint8 a
+@@ -164,7 +164,7 @@
    if (IsDefunct())
      return NS_ERROR_FAILURE;
  
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
    return DoCommand(content);
  }
  
-@@ -180,7 +180,7 @@ nsHTMLLinkAccessible::GetURI(PRInt32 aIn
+@@ -180,7 +180,7 @@
    if (aIndex != 0)
      return NS_ERROR_INVALID_ARG;
  
 -  nsCOMPtr<nsILink> link(do_QueryInterface(mDOMNode));
 +  nsILink* link(do_QueryInterface(mDOMNode));
    NS_ENSURE_STATE(link);
  
    return link->GetHrefURI(aURI);
-diff --git a/accessible/src/html/nsHTMLSelectAccessible.cpp b/accessible/src/html/nsHTMLSelectAccessible.cpp
---- a/accessible/src/html/nsHTMLSelectAccessible.cpp
-+++ b/accessible/src/html/nsHTMLSelectAccessible.cpp
-@@ -83,9 +83,9 @@ nsHTMLSelectableAccessible::iterator::it
+diff -r 332906b0e686 accessible/src/html/nsHTMLSelectAccessible.cpp
+--- a/accessible/src/html/nsHTMLSelectAccessible.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/html/nsHTMLSelectAccessible.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -83,9 +83,9 @@
    mLength = mIndex = 0;
    mSelCount = 0;
  
 -  nsCOMPtr<nsIDOMHTMLSelectElement> htmlSelect(do_QueryInterface(mParentSelect->mDOMNode));
 +  nsIDOMHTMLSelectElement* htmlSelect(do_QueryInterface(mParentSelect->mDOMNode));
    if (htmlSelect) {
 -    htmlSelect->GetOptions(getter_AddRefs(mOptions));
 +    htmlSelect->GetOptions(&mOptions);
      if (mOptions)
        mOptions->GetLength(&mLength);
    }
-@@ -94,9 +94,9 @@ PRBool nsHTMLSelectableAccessible::itera
+@@ -94,9 +94,9 @@
  PRBool nsHTMLSelectableAccessible::iterator::Advance() 
  {
    if (mIndex < mLength) {
 -    nsCOMPtr<nsIDOMNode> tempNode;
 +    nsIDOMNode* tempNode = nsnull;
      if (mOptions) {
 -      mOptions->Item(mIndex, getter_AddRefs(tempNode));
 +      mOptions->Item(mIndex, &tempNode);
        mOption = do_QueryInterface(tempNode);
      }
      mIndex++;
-@@ -121,13 +121,13 @@ void nsHTMLSelectableAccessible::iterato
+@@ -121,13 +121,13 @@
                                                                     nsPresContext *aContext)
  {
    PRBool isSelected = PR_FALSE;
 -  nsCOMPtr<nsIAccessible> tempAccess;
 +  nsIAccessible* tempAccess = nsnull;
  
    if (mOption) {
      mOption->GetSelected(&isSelected);
      if (isSelected) {
 -      nsCOMPtr<nsIDOMNode> optionNode(do_QueryInterface(mOption));
 -      aAccService->GetAccessibleInWeakShell(optionNode, mWeakShell, getter_AddRefs(tempAccess));
 +      nsIDOMNode* optionNode(do_QueryInterface(mOption));
 +      aAccService->GetAccessibleInWeakShell(optionNode, mWeakShell, &tempAccess);
      }
    }
  
-@@ -148,7 +148,7 @@ PRBool nsHTMLSelectableAccessible::itera
+@@ -148,7 +148,7 @@
      mOption->GetSelected(&isSelected);
      if (isSelected) {
        if (mSelCount == aIndex) {
 -        nsCOMPtr<nsIDOMNode> optionNode(do_QueryInterface(mOption));
 +        nsIDOMNode* optionNode(do_QueryInterface(mOption));
          aAccService->GetAccessibleInWeakShell(optionNode, mWeakShell, aAccessible);
          return PR_TRUE;
        }
-@@ -178,18 +178,18 @@ NS_IMETHODIMP nsHTMLSelectableAccessible
+@@ -178,18 +178,18 @@
  {
    *aSelState = PR_FALSE;
  
 -  nsCOMPtr<nsIDOMHTMLSelectElement> htmlSelect(do_QueryInterface(mDOMNode));
 +  nsIDOMHTMLSelectElement* htmlSelect(do_QueryInterface(mDOMNode));
    if (!htmlSelect)
      return NS_ERROR_FAILURE;
  
@@ -8026,49 +8026,49 @@ diff --git a/accessible/src/html/nsHTMLS
 -  options->Item(aIndex, getter_AddRefs(tempNode));
 -  nsCOMPtr<nsIDOMHTMLOptionElement> tempOption(do_QueryInterface(tempNode));
 +  nsIDOMNode* tempNode = nsnull;
 +  options->Item(aIndex, &tempNode);
 +  nsIDOMHTMLOptionElement* tempOption(do_QueryInterface(tempNode));
    if (!tempOption)
      return NS_ERROR_FAILURE;
  
-@@ -207,11 +207,11 @@ NS_IMETHODIMP nsHTMLSelectableAccessible
+@@ -207,11 +207,11 @@
  {
    *_retval = nsnull;
  
 -  nsCOMPtr<nsIAccessibilityService> accService(do_GetService("@mozilla.org/accessibilityService;1"));
 +  nsIAccessibilityService* accService(do_GetService("@mozilla.org/accessibilityService;1"));
    if (!accService)
      return NS_ERROR_FAILURE;
  
 -  nsCOMPtr<nsIMutableArray> selectedAccessibles =
 +  nsIMutableArray* selectedAccessibles =
      do_CreateInstance(NS_ARRAY_CONTRACTID);
    NS_ENSURE_STATE(selectedAccessibles);
    
-@@ -237,7 +237,7 @@ NS_IMETHODIMP nsHTMLSelectableAccessible
+@@ -237,7 +237,7 @@
  {
    *_retval = nsnull;
  
 -  nsCOMPtr<nsIAccessibilityService> accService(do_GetService("@mozilla.org/accessibilityService;1"));
 +  nsIAccessibilityService* accService(do_GetService("@mozilla.org/accessibilityService;1"));
    if (!accService)
      return NS_ERROR_FAILURE;
  
-@@ -294,7 +294,7 @@ NS_IMETHODIMP nsHTMLSelectableAccessible
+@@ -294,7 +294,7 @@
  {
    *_retval = PR_FALSE;
    
 -  nsCOMPtr<nsIDOMHTMLSelectElement> htmlSelect(do_QueryInterface(mDOMNode));
 +  nsIDOMHTMLSelectElement* htmlSelect(do_QueryInterface(mDOMNode));
    if (!htmlSelect)
      return NS_ERROR_FAILURE;
  
-@@ -333,14 +333,14 @@ nsHTMLSelectListAccessible::GetState(PRU
+@@ -333,14 +333,14 @@
    if (!mDOMNode)
      return NS_OK;
  
 -  nsCOMPtr<nsIDOMHTMLSelectElement> select (do_QueryInterface(mDOMNode));
 +  nsIDOMHTMLSelectElement* select (do_QueryInterface(mDOMNode));
    if (select) {
      if (*aState | nsIAccessibleStates::STATE_FOCUSED) {
        // Treat first focusable option node as actual focus, in order
@@ -8076,17 +8076,17 @@ diff --git a/accessible/src/html/nsHTMLS
 -      nsCOMPtr<nsIDOMNode> focusedOption;
 +      nsIDOMNode* focusedOption = nsnull;
        nsHTMLSelectOptionAccessible::GetFocusedOptionNode(mDOMNode, 
 -                                                         getter_AddRefs(focusedOption));
 +                                                         &focusedOption);
        if (focusedOption) { // Clear focused state since it is on option
          *aState &= ~nsIAccessibleStates::STATE_FOCUSED;
        }
-@@ -366,25 +366,25 @@ NS_IMETHODIMP nsHTMLSelectListAccessible
+@@ -366,25 +366,25 @@
    return NS_OK;
  }
  
 -already_AddRefed<nsIAccessible>
 +nsIAccessible*
  nsHTMLSelectListAccessible::AccessibleForOption(nsIAccessibilityService *aAccService,
                                                  nsIContent *aContent,
                                                  nsIAccessible *aLastGoodAccessible,
@@ -8108,26 +8108,26 @@ diff --git a/accessible/src/html/nsHTMLS
  
    ++ *aChildCount;
    privateAccessible->SetParent(this);
 -  nsCOMPtr<nsPIAccessible> privatePrevAccessible(do_QueryInterface(aLastGoodAccessible));
 +  nsPIAccessible* privatePrevAccessible(do_QueryInterface(aLastGoodAccessible));
    if (privatePrevAccessible) {
      privatePrevAccessible->SetNextSibling(accessible);
    }
-@@ -396,7 +396,7 @@ nsHTMLSelectListAccessible::AccessibleFo
+@@ -396,7 +396,7 @@
    return returnAccessible;
  }
  
 -already_AddRefed<nsIAccessible>
 +nsIAccessible*
  nsHTMLSelectListAccessible::CacheOptSiblings(nsIAccessibilityService *aAccService,
                                               nsIContent *aParentContent,
                                               nsIAccessible *aLastGoodAccessible,
-@@ -405,15 +405,15 @@ nsHTMLSelectListAccessible::CacheOptSibl
+@@ -405,15 +405,15 @@
    // Recursive helper for CacheChildren()
  
    PRUint32 numChildren = aParentContent->GetChildCount();
 -  nsCOMPtr<nsIAccessible> lastGoodAccessible(aLastGoodAccessible);
 -  nsCOMPtr<nsIAccessible> newAccessible;
 +  nsIAccessible* lastGoodAccessible(aLastGoodAccessible);
 +  nsIAccessible* newAccessible = nsnull;
  
@@ -8136,46 +8136,46 @@ diff --git a/accessible/src/html/nsHTMLS
      if (!childContent->IsNodeOfType(nsINode::eHTML)) {
        continue;
      }
 -    nsCOMPtr<nsIAtom> tag = childContent->Tag();
 +    nsIAtom* tag = childContent->Tag();
      if (tag == nsAccessibilityAtoms::option || tag == nsAccessibilityAtoms::optgroup) {
        newAccessible = AccessibleForOption(aAccService,
                                             childContent,
-@@ -432,7 +432,7 @@ nsHTMLSelectListAccessible::CacheOptSibl
+@@ -432,7 +432,7 @@
      }
    }
    if (lastGoodAccessible) {
 -    nsCOMPtr<nsPIAccessible> privateLastAcc =
 +    nsPIAccessible* privateLastAcc =
        do_QueryInterface(lastGoodAccessible);
      privateLastAcc->SetNextSibling(nsnull);
      NS_ADDREF(aLastGoodAccessible = lastGoodAccessible);
-@@ -451,8 +451,8 @@ void nsHTMLSelectListAccessible::CacheCh
+@@ -451,8 +451,8 @@
    // Cache the number of <optgroup> and <option> DOM decendents,
    // as well as the accessibles for them. Avoid whitespace text nodes.
  
 -  nsCOMPtr<nsIContent> selectContent(do_QueryInterface(mDOMNode));
 -  nsCOMPtr<nsIAccessibilityService> accService(do_GetService("@mozilla.org/accessibilityService;1"));
 +  nsIContent* selectContent(do_QueryInterface(mDOMNode));
 +  nsIAccessibilityService* accService(do_GetService("@mozilla.org/accessibilityService;1"));
    if (!selectContent || !accService) {
      mAccChildCount = eChildCountUninitialized;
      return;
-@@ -464,7 +464,7 @@ void nsHTMLSelectListAccessible::CacheCh
+@@ -464,7 +464,7 @@
  
    mAccChildCount = 0; // Avoid reentry
    PRInt32 childCount = 0;
 -  nsCOMPtr<nsIAccessible> lastGoodAccessible =
 +  nsIAccessible* lastGoodAccessible =
      CacheOptSiblings(accService, selectContent, nsnull, &childCount);
    mAccChildCount = childCount;
  }
-@@ -475,23 +475,23 @@ nsHTMLSelectOptionAccessible::nsHTMLSele
+@@ -475,23 +475,23 @@
  nsHTMLSelectOptionAccessible::nsHTMLSelectOptionAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell):
  nsHyperTextAccessibleWrap(aDOMNode, aShell)
  {
 -  nsCOMPtr<nsIAccessibilityService> accService(do_GetService("@mozilla.org/accessibilityService;1"));
 -  nsCOMPtr<nsIDOMNode> parentNode;
 -  aDOMNode->GetParentNode(getter_AddRefs(parentNode));
 -  nsCOMPtr<nsIAccessible> parentAccessible;
 +  nsIAccessibilityService* accService(do_GetService("@mozilla.org/accessibilityService;1"));
@@ -8196,54 +8196,54 @@ diff --git a/accessible/src/html/nsHTMLS
        if (role == nsIAccessibleRole::ROLE_COMBOBOX) {
 -        nsCOMPtr<nsIAccessible> comboAccessible(parentAccessible);
 -        comboAccessible->GetLastChild(getter_AddRefs(parentAccessible));
 +        nsIAccessible* comboAccessible(parentAccessible);
 +        comboAccessible->GetLastChild(&parentAccessible);
        }
      }
    }
-@@ -517,7 +517,7 @@ NS_IMETHODIMP nsHTMLSelectOptionAccessib
+@@ -517,7 +517,7 @@
  {
    // CASE #1 -- great majority of the cases
    // find the label attribute - this is what the W3C says we should use
 -  nsCOMPtr<nsIDOMElement> domElement(do_QueryInterface(mDOMNode));
 +  nsIDOMElement* domElement(do_QueryInterface(mDOMNode));
    if (!domElement)
      return NS_ERROR_FAILURE;
  
-@@ -528,11 +528,11 @@ NS_IMETHODIMP nsHTMLSelectOptionAccessib
+@@ -528,11 +528,11 @@
    
    // CASE #2 -- no label parameter, get the first child, 
    // use it if it is a text node
 -  nsCOMPtr<nsIDOMNode> child;
 -  mDOMNode->GetFirstChild(getter_AddRefs(child));
 +  nsIDOMNode* child = nsnull;
 +  mDOMNode->GetFirstChild(&child);
  
    if (child) {
 -    nsCOMPtr<nsIContent> text = do_QueryInterface(child);
 +    nsIContent* text = do_QueryInterface(child);
      if (text && text->IsNodeOfType(nsINode::eTEXT)) {
        nsAutoString txtValue;
        rv = AppendFlatStringFromContentNode(text, &txtValue);
-@@ -560,9 +560,9 @@ nsHTMLSelectOptionAccessible::GetAttribu
+@@ -560,9 +560,9 @@
    nsresult rv = nsHyperTextAccessibleWrap::GetAttributesInternal(aAttributes);
    NS_ENSURE_SUCCESS(rv, rv);
  
 -  nsCOMPtr<nsIDOMNode> parentNode;
 -  mDOMNode->GetParentNode(getter_AddRefs(parentNode));
 -  nsCOMPtr<nsIDOMElement> parentElement(do_QueryInterface(parentNode));
 +  nsIDOMNode* parentNode = nsnull;
 +  mDOMNode->GetParentNode(&parentNode);
 +  nsIDOMElement* parentElement(do_QueryInterface(parentNode));
    NS_ENSURE_TRUE(parentElement, NS_ERROR_FAILURE);
    nsAutoString parentTagName;
    parentNode->GetLocalName(parentTagName);
-@@ -574,14 +574,14 @@ nsHTMLSelectOptionAccessible::GetAttribu
+@@ -574,14 +574,14 @@
  
    nsAutoString tagName;
    mDOMNode->GetLocalName(tagName);  // Will be looking for similar DOM siblings
 -  nsCOMPtr<nsIDOMNodeList> siblings;
 -  parentElement->GetElementsByTagName(tagName, getter_AddRefs(siblings));
 +  nsIDOMNodeList* siblings = nsnull;
 +  parentElement->GetElementsByTagName(tagName, &siblings);
    PRInt32 posInSet = 0;
@@ -8252,74 +8252,74 @@ diff --git a/accessible/src/html/nsHTMLS
      siblings->GetLength(&setSize);
 -    nsCOMPtr<nsIDOMNode> itemNode;
 -    while (NS_SUCCEEDED(siblings->Item(posInSet ++, getter_AddRefs(itemNode))) &&
 +    nsIDOMNode* itemNode = nsnull;
 +    while (NS_SUCCEEDED(siblings->Item(posInSet ++, &itemNode)) &&
             itemNode != mDOMNode) {
        // Keep looping, to increment posInSet
      }
-@@ -595,9 +595,9 @@ nsIFrame* nsHTMLSelectOptionAccessible::
+@@ -595,9 +595,9 @@
  nsIFrame* nsHTMLSelectOptionAccessible::GetBoundsFrame()
  {
    PRUint32 state;
 -  nsCOMPtr<nsIContent> content = GetSelectState(&state);
 +  nsIContent* content = GetSelectState(&state);
    if (state & nsIAccessibleStates::STATE_COLLAPSED) {
 -    nsCOMPtr<nsIPresShell> presShell(GetPresShell());
 +    nsIPresShell* presShell(GetPresShell());
      if (!presShell) {
        return nsnull;
      }
-@@ -626,13 +626,13 @@ nsHTMLSelectOptionAccessible::GetState(P
+@@ -626,13 +626,13 @@
      return NS_OK;
  
    PRUint32 selectState, selectExtState;
 -  nsCOMPtr<nsIContent> selectContent = GetSelectState(&selectState,
 +  nsIContent* selectContent = GetSelectState(&selectState,
                                                        &selectExtState);
    if (selectState & nsIAccessibleStates::STATE_INVISIBLE) {
      return NS_OK;
    }
  
 -  nsCOMPtr<nsIDOMNode> selectNode = do_QueryInterface(selectContent); 
 +  nsIDOMNode* selectNode = do_QueryInterface(selectContent); 
    NS_ENSURE_TRUE(selectNode, NS_ERROR_FAILURE);
  
    // Is disabled?
-@@ -646,8 +646,8 @@ nsHTMLSelectOptionAccessible::GetState(P
+@@ -646,8 +646,8 @@
      // GetFocusedOptionNode() ensures that an option node is 
      // returned in this case, as long as some focusable option exists
      // in the listbox
 -    nsCOMPtr<nsIDOMNode> focusedOptionNode;
 -    GetFocusedOptionNode(selectNode, getter_AddRefs(focusedOptionNode));
 +    nsIDOMNode* focusedOptionNode = nsnull;
 +    GetFocusedOptionNode(selectNode, &focusedOptionNode);
      if (focusedOptionNode == mDOMNode) {
        *aState |= nsIAccessibleStates::STATE_FOCUSED;
      }
-@@ -655,7 +655,7 @@ nsHTMLSelectOptionAccessible::GetState(P
+@@ -655,7 +655,7 @@
  
    // Are we selected?
    PRBool isSelected = PR_FALSE;
 -  nsCOMPtr<nsIDOMHTMLOptionElement> option (do_QueryInterface(mDOMNode));
 +  nsIDOMHTMLOptionElement* option (do_QueryInterface(mDOMNode));
    if (option) {
      option->GetSelected(&isSelected);
      if ( isSelected ) 
-@@ -685,7 +685,7 @@ nsHTMLSelectOptionAccessible::GetState(P
+@@ -685,7 +685,7 @@
      // visibility implementation unless they get reimplemented in layout
      *aState &= ~nsIAccessibleStates::STATE_OFFSCREEN;
      // <select> is not collapsed: compare bounds to calculate STATE_OFFSCREEN
 -    nsCOMPtr<nsIAccessible> listAccessible = GetParent();
 +    nsIAccessible* listAccessible = GetParent();
      if (listAccessible) {
        PRInt32 optionX, optionY, optionWidth, optionHeight;
        PRInt32 listX, listY, listWidth, listHeight;
-@@ -719,17 +719,17 @@ NS_IMETHODIMP nsHTMLSelectOptionAccessib
+@@ -719,17 +719,17 @@
  NS_IMETHODIMP nsHTMLSelectOptionAccessible::DoAction(PRUint8 index)
  {
    if (index == eAction_Select) {   // default action
 -    nsCOMPtr<nsIDOMHTMLOptionElement> newHTMLOption(do_QueryInterface(mDOMNode));
 +    nsIDOMHTMLOptionElement* newHTMLOption(do_QueryInterface(mDOMNode));
      if (!newHTMLOption) 
        return NS_ERROR_FAILURE;
      // Clear old selection
@@ -8334,17 +8334,17 @@ diff --git a/accessible/src/html/nsHTMLS
 -    GetFocusedOptionNode(selectNode, getter_AddRefs(oldHTMLOptionNode));
 -    nsCOMPtr<nsIDOMHTMLOptionElement> oldHTMLOption(do_QueryInterface(oldHTMLOptionNode));
 +    accessNode->GetDOMNode(&selectNode);
 +    GetFocusedOptionNode(selectNode, &oldHTMLOptionNode);
 +    nsIDOMHTMLOptionElement* oldHTMLOption(do_QueryInterface(oldHTMLOptionNode));
      if (oldHTMLOption)
        oldHTMLOption->SetSelected(PR_FALSE);
      // Set new selection
-@@ -737,19 +737,19 @@ NS_IMETHODIMP nsHTMLSelectOptionAccessib
+@@ -737,19 +737,19 @@
  
      // If combo box, and open, close it
      // First, get the <select> widgets list control frame
 -    nsCOMPtr<nsIDOMNode> testSelectNode;
 -    nsCOMPtr<nsIDOMNode> thisNode(do_QueryInterface(mDOMNode));
 +    nsIDOMNode* testSelectNode = nsnull;
 +    nsIDOMNode* thisNode(do_QueryInterface(mDOMNode));
      do {
@@ -8361,58 +8361,58 @@ diff --git a/accessible/src/html/nsHTMLS
 -    nsCOMPtr<nsIContent> selectContent(do_QueryInterface(testSelectNode));
 -    nsCOMPtr<nsIDOMHTMLOptionElement> option(do_QueryInterface(mDOMNode));
 +    nsIPresShell* presShell(do_QueryReferent(mWeakShell));
 +    nsIContent* selectContent(do_QueryInterface(testSelectNode));
 +    nsIDOMHTMLOptionElement* option(do_QueryInterface(mDOMNode));
  
      if (!testSelectNode || !selectContent || !presShell || !option) 
        return NS_ERROR_FAILURE;
-@@ -787,8 +787,8 @@ nsresult nsHTMLSelectOptionAccessible::G
+@@ -787,8 +787,8 @@
    *aFocusedOptionNode = nsnull;
    NS_ASSERTION(aListNode, "Called GetFocusedOptionNode without a valid list node");
  
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(aListNode));
 -  nsCOMPtr<nsIDocument> document = content->GetDocument();
 +  nsIContent* content(do_QueryInterface(aListNode));
 +  nsIDocument* document = content->GetDocument();
    nsIPresShell *shell = nsnull;
    if (document)
      shell = document->GetPrimaryShell();
-@@ -802,11 +802,11 @@ nsresult nsHTMLSelectOptionAccessible::G
+@@ -802,11 +802,11 @@
    PRInt32 focusedOptionIndex = 0;
  
    // Get options
 -  nsCOMPtr<nsIDOMHTMLSelectElement> selectElement(do_QueryInterface(aListNode));
 +  nsIDOMHTMLSelectElement* selectElement(do_QueryInterface(aListNode));
    NS_ASSERTION(selectElement, "No select element where it should be");
  
 -  nsCOMPtr<nsIDOMHTMLOptionsCollection> options;
 -  nsresult rv = selectElement->GetOptions(getter_AddRefs(options));
 +  nsIDOMHTMLOptionsCollection* options = nsnull;
 +  nsresult rv = selectElement->GetOptions(&options);
    
    if (NS_SUCCEEDED(rv)) {
      nsIListControlFrame *listFrame = nsnull;
-@@ -818,11 +818,11 @@ nsresult nsHTMLSelectOptionAccessible::G
+@@ -818,11 +818,11 @@
        // the first selected item.
        focusedOptionIndex = listFrame->GetSelectedIndex();
        if (focusedOptionIndex == -1) {
 -        nsCOMPtr<nsIDOMNode> nextOption;
 +        nsIDOMNode* nextOption = nsnull;
          while (PR_TRUE) {
            ++ focusedOptionIndex;
 -          options->Item(focusedOptionIndex, getter_AddRefs(nextOption));
 -          nsCOMPtr<nsIDOMHTMLOptionElement> optionElement = do_QueryInterface(nextOption);
 +          options->Item(focusedOptionIndex, &nextOption);
 +          nsIDOMHTMLOptionElement* optionElement = do_QueryInterface(nextOption);
            if (!optionElement) {
              break;
            }
-@@ -853,19 +853,19 @@ void nsHTMLSelectOptionAccessible::Selec
+@@ -853,19 +853,19 @@
      return;
    }
  
 -  nsCOMPtr<nsIDOMNode> optionNode(do_QueryInterface(aPossibleOption));
 +  nsIDOMNode* optionNode(do_QueryInterface(aPossibleOption));
    NS_ASSERTION(optionNode, "No option node for nsIContent with option tag!");
  
 -  nsCOMPtr<nsIAccessible> multiSelect = GetMultiSelectFor(optionNode);
@@ -8428,17 +8428,17 @@ diff --git a/accessible/src/html/nsHTMLS
      do_GetService("@mozilla.org/accessibilityService;1");
 -  nsCOMPtr<nsIAccessible> optionAccessible;
 -  accService->GetAccessibleFor(optionNode, getter_AddRefs(optionAccessible));
 +  nsIAccessible* optionAccessible = nsnull;
 +  accService->GetAccessibleFor(optionNode, &optionAccessible);
    if (!optionAccessible) {
      return;
    }
-@@ -888,17 +888,17 @@ nsIContent* nsHTMLSelectOptionAccessible
+@@ -888,17 +888,17 @@
  nsIContent* nsHTMLSelectOptionAccessible::GetSelectState(PRUint32* aState,
                                                           PRUint32* aExtraState)
  {
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
    while (content && content->Tag() != nsAccessibilityAtoms::select) {
      content = content->GetParent();
    }
@@ -8451,17 +8451,17 @@ diff --git a/accessible/src/html/nsHTMLS
      if (accService) {
 -      nsCOMPtr<nsIAccessible> selAcc;
 -      accService->GetAccessibleFor(selectNode, getter_AddRefs(selAcc));
 +      nsIAccessible* selAcc = nsnull;
 +      accService->GetAccessibleFor(selectNode, &selAcc);
        if (selAcc) {
          selAcc->GetFinalState(aState, aExtraState);
          return content;
-@@ -1114,18 +1114,18 @@ NS_IMETHODIMP nsHTMLComboboxAccessible::
+@@ -1114,18 +1114,18 @@
      return NS_OK;
    }
    // Use description of currently focused option
 -  nsCOMPtr<nsIAccessible> optionAccessible = GetFocusedOptionAccessible();
 +  nsIAccessible* optionAccessible = GetFocusedOptionAccessible();
    return optionAccessible ? optionAccessible->GetDescription(aDescription) : NS_OK;
  }
  
@@ -8474,37 +8474,37 @@ diff --git a/accessible/src/html/nsHTMLS
    }
 -  nsCOMPtr<nsIDOMNode> focusedOptionNode;
 -  nsHTMLSelectOptionAccessible::GetFocusedOptionNode(mDOMNode, getter_AddRefs(focusedOptionNode));
 +  nsIDOMNode* focusedOptionNode = nsnull;
 +  nsHTMLSelectOptionAccessible::GetFocusedOptionNode(mDOMNode, &focusedOptionNode);
    nsIAccessibilityService *accService = GetAccService();
    if (!focusedOptionNode || !accService) {
      return nsnull;
-@@ -1145,7 +1145,7 @@ NS_IMETHODIMP nsHTMLComboboxAccessible::
+@@ -1145,7 +1145,7 @@
  NS_IMETHODIMP nsHTMLComboboxAccessible::GetValue(nsAString& aValue)
  {
    // Use label of currently focused option
 -  nsCOMPtr<nsIAccessible> optionAccessible = GetFocusedOptionAccessible();
 +  nsIAccessible* optionAccessible = GetFocusedOptionAccessible();
    NS_ENSURE_TRUE(optionAccessible, NS_ERROR_FAILURE);
    return optionAccessible->GetName(aValue);
  }
-@@ -1498,8 +1498,8 @@ void nsHTMLComboboxListAccessible::GetBo
+@@ -1498,8 +1498,8 @@
  {
    *aBoundingFrame = nsnull;
  
 -  nsCOMPtr<nsIAccessible> comboAccessible;
 -  GetParent(getter_AddRefs(comboAccessible));
 +  nsIAccessible* comboAccessible = nsnull;
 +  GetParent(&comboAccessible);
    if (!comboAccessible) {
      return;
    }
-@@ -1508,16 +1508,16 @@ void nsHTMLComboboxListAccessible::GetBo
+@@ -1508,16 +1508,16 @@
      return;
    }
     // get our first option
 -  nsCOMPtr<nsIDOMNode> child;
 -  mDOMNode->GetFirstChild(getter_AddRefs(child));
 +  nsIDOMNode* child = nsnull;
 +  mDOMNode->GetFirstChild(&child);
  
@@ -8515,106 +8515,106 @@ diff --git a/accessible/src/html/nsHTMLS
      return;
    }
  
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(child));
 +  nsIContent* content(do_QueryInterface(child));
    if (!content) {
      return;
    }
-diff --git a/accessible/src/html/nsHTMLSelectAccessible.h b/accessible/src/html/nsHTMLSelectAccessible.h
---- a/accessible/src/html/nsHTMLSelectAccessible.h
-+++ b/accessible/src/html/nsHTMLSelectAccessible.h
-@@ -96,9 +96,9 @@ protected:
+diff -r 332906b0e686 accessible/src/html/nsHTMLSelectAccessible.h
+--- a/accessible/src/html/nsHTMLSelectAccessible.h	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/html/nsHTMLSelectAccessible.h	Fri Jul 04 01:35:36 2008 -0700
+@@ -96,9 +96,9 @@
      PRUint32 mLength;
      PRUint32 mIndex;
      PRInt32 mSelCount;
 -    nsCOMPtr<nsIDOMHTMLOptionsCollection> mOptions;
 -    nsCOMPtr<nsIDOMHTMLOptionElement> mOption;
 -    nsCOMPtr<nsIWeakReference> mWeakShell;
 +    nsIDOMHTMLOptionsCollection* mOptions;
 +    nsIDOMHTMLOptionElement* mOption;
 +    nsIWeakReference* mWeakShell;
      nsHTMLSelectableAccessible *mParentSelect;
  
    public:
-@@ -133,12 +133,12 @@ public:
+@@ -133,12 +133,12 @@
    void CacheChildren();
  
  protected:
 -  already_AddRefed<nsIAccessible>
 +  nsIAccessible*
      AccessibleForOption(nsIAccessibilityService *aAccService,
                          nsIContent *aContent,
                          nsIAccessible *aLastGoodAccessible,
                          PRInt32 *aChildCount);
 -  already_AddRefed<nsIAccessible>
 +  nsIAccessible*
      CacheOptSiblings(nsIAccessibilityService *aAccService,
                       nsIContent *aParentContent,
                       nsIAccessible *aLastGoodAccessible,
-@@ -229,7 +229,7 @@ public:
+@@ -229,7 +229,7 @@
    NS_IMETHOD Shutdown();
  
  protected:
 -  already_AddRefed<nsIAccessible> GetFocusedOptionAccessible();
 +  nsIAccessible* GetFocusedOptionAccessible();
  
  private:
    nsRefPtr<nsHTMLComboboxListAccessible> mListAccessible;
-diff --git a/accessible/src/html/nsHTMLTableAccessible.cpp b/accessible/src/html/nsHTMLTableAccessible.cpp
---- a/accessible/src/html/nsHTMLTableAccessible.cpp
-+++ b/accessible/src/html/nsHTMLTableAccessible.cpp
-@@ -86,9 +86,9 @@ nsHTMLTableCellAccessible::GetAttributes
+diff -r 332906b0e686 accessible/src/html/nsHTMLTableAccessible.cpp
+--- a/accessible/src/html/nsHTMLTableAccessible.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/html/nsHTMLTableAccessible.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -86,9 +86,9 @@
    nsresult rv = nsHyperTextAccessibleWrap::GetAttributesInternal(aAttributes);
    NS_ENSURE_SUCCESS(rv, rv);
  
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
  
 -  nsCOMPtr<nsIPresShell> shell = GetPresShell();
 +  nsIPresShell* shell = GetPresShell();
    NS_ENSURE_STATE(shell);
    
    nsIFrame *frame = shell->GetPrimaryFrameFor(content);
-@@ -103,10 +103,10 @@ nsHTMLTableCellAccessible::GetAttributes
+@@ -103,10 +103,10 @@
    rv = cellLayout->GetCellIndexes(rowIdx, cellIdx);
    NS_ENSURE_SUCCESS(rv, rv);
  
 -  nsCOMPtr<nsIAccessible> childAcc(this);
 +  nsIAccessible* childAcc(this);
  
 -  nsCOMPtr<nsIAccessible> parentAcc;
 -  rv = childAcc->GetParent(getter_AddRefs(parentAcc));
 +  nsIAccessible* parentAcc = nsnull;
 +  rv = childAcc->GetParent(&parentAcc);
    NS_ENSURE_SUCCESS(rv, rv);
  
    while (parentAcc) {
-@@ -114,7 +114,7 @@ nsHTMLTableCellAccessible::GetAttributes
+@@ -114,7 +114,7 @@
        // Table accessible must implement nsIAccessibleTable interface but if
        // it isn't happen (for example because of ARIA usage) we shouldn't fail
        // on getting other attributes.
 -      nsCOMPtr<nsIAccessibleTable> tableAcc(do_QueryInterface(parentAcc));
 +      nsIAccessibleTable* tableAcc(do_QueryInterface(parentAcc));
        if (!tableAcc)
          return NS_OK;
  
-@@ -129,8 +129,8 @@ nsHTMLTableCellAccessible::GetAttributes
+@@ -129,8 +129,8 @@
        return NS_OK;
      }
  
 -    parentAcc.swap(childAcc);
 -    rv = childAcc->GetParent(getter_AddRefs(parentAcc));
 +    swap(parentAcc, childAcc);
 +    rv = childAcc->GetParent(&parentAcc);
      NS_ENSURE_SUCCESS(rv, rv);
    }
  
-@@ -157,24 +157,24 @@ void nsHTMLTableAccessible::CacheChildre
+@@ -157,24 +157,24 @@
    
    if (mAccChildCount == eChildCountUninitialized) {
      nsAccessible::CacheChildren();
 -    nsCOMPtr<nsIAccessible> captionAccessible;
 +    nsIAccessible* captionAccessible = nsnull;
      while (NextChild(captionAccessible)) {
        if (Role(captionAccessible) == nsIAccessibleRole::ROLE_CAPTION) {
 -        nsCOMPtr<nsIAccessible> captionParentAccessible;
@@ -8638,46 +8638,46 @@ diff --git a/accessible/src/html/nsHTMLT
 +          captionAccessible->GetNextSibling(&afterCaptionAccessible);
 +          nsPIAccessible* privateAcc = do_QueryInterface(beforeCaptionAccessible);
            privateAcc->SetNextSibling(afterCaptionAccessible);
 -          GetFirstChild(getter_AddRefs(afterCaptionAccessible));
 +          GetFirstChild(&afterCaptionAccessible);
            SetFirstChild(captionAccessible);
            privateAcc = do_QueryInterface(captionAccessible);
            privateAcc->SetNextSibling(afterCaptionAccessible);        
-@@ -210,7 +210,7 @@ NS_IMETHODIMP nsHTMLTableAccessible::Get
+@@ -210,7 +210,7 @@
  
    nsAccessible::GetName(aName);
    if (aName.IsEmpty()) {
 -    nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +    nsIContent* content(do_QueryInterface(mDOMNode));
      if (content) { 
        content->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::summary, aName);
      }
-@@ -268,8 +268,8 @@ NS_IMETHODIMP
+@@ -268,8 +268,8 @@
  NS_IMETHODIMP
  nsHTMLTableAccessible::GetCaption(nsIAccessible **aCaption)
  {
 -  nsCOMPtr<nsIAccessible> firstChild;
 -  GetFirstChild(getter_AddRefs(firstChild));
 +  nsIAccessible* firstChild = nsnull;
 +  GetFirstChild(&firstChild);
    if (firstChild && Role(firstChild) == nsIAccessibleRole::ROLE_CAPTION) {
      NS_ADDREF(*aCaption = firstChild);
    }
-@@ -279,7 +279,7 @@ NS_IMETHODIMP
+@@ -279,7 +279,7 @@
  NS_IMETHODIMP
  nsHTMLTableAccessible::GetSummary(nsAString &aSummary)
  {
 -  nsCOMPtr<nsIDOMHTMLTableElement> table(do_QueryInterface(mDOMNode));
 +  nsIDOMHTMLTableElement* table(do_QueryInterface(mDOMNode));
    NS_ENSURE_TRUE(table, NS_ERROR_FAILURE);
  
    return table->GetSummary(aSummary);
-@@ -301,36 +301,36 @@ nsHTMLTableAccessible::GetColumnHeader(n
+@@ -301,36 +301,36 @@
  {
    nsresult rv = NS_OK;
  
 -  nsCOMPtr<nsIDOMHTMLTableElement> table(do_QueryInterface(mDOMNode));
 +  nsIDOMHTMLTableElement* table(do_QueryInterface(mDOMNode));
    NS_ENSURE_TRUE(table, NS_ERROR_FAILURE);
  
 -  nsCOMPtr<nsIDOMHTMLTableSectionElement> section;
@@ -8714,76 +8714,76 @@ diff --git a/accessible/src/html/nsHTMLT
      NS_ENSURE_SUCCESS(rv, rv);
    }
  
 -  nsCOMPtr<nsIAccessibleTable> accTableHead(do_QueryInterface(accHead));
 +  nsIAccessibleTable* accTableHead(do_QueryInterface(accHead));
    NS_ENSURE_TRUE(accTableHead, NS_ERROR_FAILURE);
  
    *aColumnHeader = accTableHead;
-@@ -577,11 +577,11 @@ nsHTMLTableAccessible::CellRefAt(PRInt32
+@@ -577,11 +577,11 @@
  
    nsresult rv = NS_OK;
  
 -  nsCOMPtr<nsIDOMElement> cellElement;
 -  rv = GetCellAt(aRow, aColumn, *getter_AddRefs(cellElement));
 +  nsIDOMElement* cellElement = nsnull;
 +  rv = GetCellAt(aRow, aColumn, *&cellElement);
    NS_ENSURE_SUCCESS(rv, rv);
  
 -  nsCOMPtr<nsIAccessibilityService>
 +  nsIAccessibilityService*
      accService(do_GetService("@mozilla.org/accessibilityService;1"));
    NS_ENSURE_TRUE(accService, NS_ERROR_FAILURE);
  
-@@ -638,11 +638,11 @@ nsHTMLTableAccessible::GetColumnExtentAt
+@@ -638,11 +638,11 @@
  
    nsresult rv = NS_OK;
  
 -  nsCOMPtr<nsIDOMElement> domElement;
 -  rv = GetCellAt(aRow, aColumn, *getter_AddRefs(domElement));
 +  nsIDOMElement* domElement = nsnull;
 +  rv = GetCellAt(aRow, aColumn, *&domElement);
    NS_ENSURE_SUCCESS(rv, rv);
  
 -  nsCOMPtr<nsIDOMHTMLTableCellElement> cell(do_QueryInterface(domElement));
 +  nsIDOMHTMLTableCellElement* cell(do_QueryInterface(domElement));
    NS_ENSURE_TRUE(cell, NS_ERROR_FAILURE);
  
    return cell->GetColSpan(_retval);
-@@ -656,11 +656,11 @@ nsHTMLTableAccessible::GetRowExtentAt(PR
+@@ -656,11 +656,11 @@
  
    nsresult rv = NS_OK;
  
 -  nsCOMPtr<nsIDOMElement> domElement;
 -  rv = GetCellAt(aRow, aColumn, *getter_AddRefs(domElement));
 +  nsIDOMElement* domElement = nsnull;
 +  rv = GetCellAt(aRow, aColumn, *&domElement);
    NS_ENSURE_SUCCESS(rv, rv);
  
 -  nsCOMPtr<nsIDOMHTMLTableCellElement> cell(do_QueryInterface(domElement));
 +  nsIDOMHTMLTableCellElement* cell(do_QueryInterface(domElement));
    NS_ENSURE_TRUE(cell, NS_ERROR_FAILURE);
  
    return cell->GetRowSpan(_retval);
-@@ -740,11 +740,11 @@ nsHTMLTableAccessible::IsCellSelected(PR
+@@ -740,11 +740,11 @@
    nsresult rv = GetTableLayout(&tableLayout);
    NS_ENSURE_SUCCESS(rv, rv);
  
 -  nsCOMPtr<nsIDOMElement> domElement;
 +  nsIDOMElement* domElement = nsnull;
    PRInt32 startRowIndex = 0, startColIndex = 0,
            rowSpan, colSpan, actualRowSpan, actualColSpan;
  
 -  rv = tableLayout->GetCellDataAt(aRow, aColumn, *getter_AddRefs(domElement),
 +  rv = tableLayout->GetCellDataAt(aRow, aColumn, *&domElement,
                                    startRowIndex, startColIndex,
                                    rowSpan, colSpan,
                                    actualRowSpan, actualColSpan, *aIsSelected);
-@@ -804,20 +804,20 @@ nsHTMLTableAccessible::SelectRowOrColumn
+@@ -804,20 +804,20 @@
  {
    PRBool doSelectRow = (aTarget == nsISelectionPrivate::TABLESELECTION_ROW);
  
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
    if (!content)
      return NS_OK;
  
@@ -8799,31 +8799,31 @@ diff --git a/accessible/src/html/nsHTMLT
 -  nsCOMPtr<nsISelection> selection;
 +  nsISelection* selection = nsnull;
    selController->GetSelection(nsISelectionController::SELECTION_NORMAL,
 -                              getter_AddRefs(selection));
 +                              &selection);
    NS_ENSURE_STATE(selection);
  
    PRInt32 count = 0;
-@@ -825,11 +825,11 @@ nsHTMLTableAccessible::SelectRowOrColumn
+@@ -825,11 +825,11 @@
    NS_ENSURE_SUCCESS(rv, rv);
  
    for (PRInt32 index = 0; index < count; index++) {
 -    nsCOMPtr<nsIDOMElement> cellElm;
 +    nsIDOMElement* cellElm = nsnull;
      PRInt32 column = doSelectRow ? index : aIndex;
      PRInt32 row = doSelectRow ? aIndex : index;
  
 -    rv = GetCellAt(row, column, *getter_AddRefs(cellElm));
 +    rv = GetCellAt(row, column, *&cellElm);
      NS_ENSURE_SUCCESS(rv, rv);
  
      rv = SelectCell(selection, document, cellElm, aDoSelect);
-@@ -846,32 +846,32 @@ nsHTMLTableAccessible::SelectCell(nsISel
+@@ -846,32 +846,32 @@
                                    PRBool aDoSelect)
  {
    if (aDoSelect) {
 -    nsCOMPtr<nsIDOMDocumentRange> documentRange(do_QueryInterface(aDocument));
 +    nsIDOMDocumentRange* documentRange(do_QueryInterface(aDocument));
      NS_ENSURE_STATE(documentRange);
  
 -    nsCOMPtr<nsIDOMRange> range;
@@ -8854,17 +8854,17 @@ diff --git a/accessible/src/html/nsHTMLT
 +  nsIDOMNode* parent(do_QueryInterface(cellParent));
    NS_ENSURE_STATE(parent);
  
 -  nsCOMPtr<nsISelection2> selection2(do_QueryInterface(aSelection));
 +  nsISelection2* selection2(do_QueryInterface(aSelection));
    NS_ENSURE_STATE(selection2);
  
    nsCOMArray<nsIDOMRange> ranges;
-@@ -891,17 +891,17 @@ nsHTMLTableAccessible::GetTableNode(nsID
+@@ -891,17 +891,17 @@
  {
    nsresult rv = NS_OK;
  
 -  nsCOMPtr<nsIDOMHTMLTableElement> table(do_QueryInterface(mDOMNode));
 +  nsIDOMHTMLTableElement* table(do_QueryInterface(mDOMNode));
    if (table) {
      *_retval = table;
      NS_IF_ADDREF(*_retval);
@@ -8876,17 +8876,17 @@ diff --git a/accessible/src/html/nsHTMLT
    if (section) {
 -    nsCOMPtr<nsIDOMNode> parent;
 -    rv = section->GetParentNode(getter_AddRefs(parent));
 +    nsIDOMNode* parent = nsnull;
 +    rv = section->GetParentNode(&parent);
      NS_ENSURE_SUCCESS(rv, rv);
  
      *_retval = parent;
-@@ -917,14 +917,14 @@ nsHTMLTableAccessible::GetTableLayout(ns
+@@ -917,14 +917,14 @@
  {
    *aTableLayout = nsnull;
  
 -  nsCOMPtr<nsIDOMNode> tableNode;
 -  GetTableNode(getter_AddRefs(tableNode));
 -  nsCOMPtr<nsIContent> tableContent(do_QueryInterface(tableNode));
 +  nsIDOMNode* tableNode = nsnull;
 +  GetTableNode(&tableNode);
@@ -8895,17 +8895,17 @@ diff --git a/accessible/src/html/nsHTMLT
      return NS_ERROR_FAILURE; // Table shut down
    }
  
 -  nsCOMPtr<nsIPresShell> shell = GetPresShell();
 +  nsIPresShell* shell = GetPresShell();
    NS_ENSURE_TRUE(shell, NS_ERROR_FAILURE);
  
    nsIFrame *frame = shell->GetPrimaryFrameFor(tableContent);
-@@ -963,13 +963,13 @@ NS_IMETHODIMP nsHTMLTableAccessible::Get
+@@ -963,13 +963,13 @@
      return NS_OK;
    }
  
 -  nsCOMPtr<nsIAccessible> captionAccessible;
 -  GetCaption(getter_AddRefs(captionAccessible));
 -  nsCOMPtr<nsIAccessNode> captionAccessNode = do_QueryInterface(captionAccessible);
 +  nsIAccessible* captionAccessible = nsnull;
 +  GetCaption(&captionAccessible);
@@ -8915,17 +8915,17 @@ diff --git a/accessible/src/html/nsHTMLT
 -    captionAccessNode->GetDOMNode(getter_AddRefs(captionNode));
 -    nsCOMPtr<nsIContent> captionContent = do_QueryInterface(captionNode);
 +    nsIDOMNode* captionNode = nsnull;
 +    captionAccessNode->GetDOMNode(&captionNode);
 +    nsIContent* captionContent = do_QueryInterface(captionNode);
      if (captionContent) {
        AppendFlatStringFromSubtree(captionContent, &aDescription);
      }
-@@ -990,21 +990,21 @@ NS_IMETHODIMP nsHTMLTableAccessible::Get
+@@ -990,21 +990,21 @@
  
  PRBool nsHTMLTableAccessible::HasDescendant(char *aTagName, PRBool aAllowEmpty)
  {
 -  nsCOMPtr<nsIDOMElement> tableElt(do_QueryInterface(mDOMNode));
 +  nsIDOMElement* tableElt(do_QueryInterface(mDOMNode));
    NS_ENSURE_TRUE(tableElt, PR_FALSE);
  
 -  nsCOMPtr<nsIDOMNodeList> nodeList;
@@ -8942,41 +8942,41 @@ diff --git a/accessible/src/html/nsHTMLT
      // Make sure it's not the table itself
 -    nsCOMPtr<nsIDOMNode> foundItem;
 -    nodeList->Item(0, getter_AddRefs(foundItem));
 +    nsIDOMNode* foundItem = nsnull;
 +    nodeList->Item(0, &foundItem);
      if (foundItem == mDOMNode) {
        return PR_FALSE;
      }
-@@ -1012,7 +1012,7 @@ PRBool nsHTMLTableAccessible::HasDescend
+@@ -1012,7 +1012,7 @@
        // Make sure that the item we found has contents
        // and either has multiple children or the
        // found item is not a whitespace-only text node
 -      nsCOMPtr<nsIContent> foundItemContent = do_QueryInterface(foundItem);
 +      nsIContent* foundItemContent = do_QueryInterface(foundItem);
        if (!foundItemContent) {
          return PR_FALSE;
        }
-@@ -1051,12 +1051,12 @@ NS_IMETHODIMP nsHTMLTableAccessible::IsP
+@@ -1051,12 +1051,12 @@
  
    *aIsProbablyForLayout = PR_FALSE;
    
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
    if (!content) {
      return NS_ERROR_FAILURE; // Table shut down
    }
  
 -  nsCOMPtr<nsIAccessible> docAccessible = do_QueryInterface(nsCOMPtr<nsIAccessibleDocument>(GetDocAccessible()));
 +  nsIAccessible* docAccessible = do_QueryInterface((nsIAccessibleDocument*)(GetDocAccessible()));
    if (docAccessible) {
      PRUint32 state, extState;
      docAccessible->GetFinalState(&state, &extState);
-@@ -1105,13 +1105,13 @@ NS_IMETHODIMP nsHTMLTableAccessible::IsP
+@@ -1105,13 +1105,13 @@
    // Now we know there are 2-4 columns and 2 or more rows
    // Check to see if there are visible borders on the cells
    // XXX currently, we just check the first cell -- do we really need to do more?
 -  nsCOMPtr<nsIDOMElement> cellElement;
 -  nsresult rv = GetCellAt(0, 0, *getter_AddRefs(cellElement));
 +  nsIDOMElement* cellElement = nsnull;
 +  nsresult rv = GetCellAt(0, 0, *&cellElement);
    NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
@@ -8984,17 +8984,17 @@ diff --git a/accessible/src/html/nsHTMLT
 -  nsCOMPtr<nsIContent> cellContent(do_QueryInterface(cellElement));
 +  nsIContent* cellContent(do_QueryInterface(cellElement));
    NS_ENSURE_TRUE(cellContent, NS_ERROR_FAILURE);
 -  nsCOMPtr<nsIPresShell> shell(GetPresShell());
 +  nsIPresShell* shell(GetPresShell());
    nsIFrame *cellFrame = shell->GetPrimaryFrameFor(cellContent);
    if (!cellFrame) {
      return NS_OK;
-@@ -1128,19 +1128,19 @@ NS_IMETHODIMP nsHTMLTableAccessible::IsP
+@@ -1128,19 +1128,19 @@
  
    // Check for styled background color across the row
    // Alternating background color is a common way 
 -  nsCOMPtr<nsIDOMNodeList> nodeList;
 -  nsCOMPtr<nsIDOMElement> tableElt(do_QueryInterface(mDOMNode));    
 -  tableElt->GetElementsByTagName(NS_LITERAL_STRING("tr"), getter_AddRefs(nodeList));
 +  nsIDOMNodeList* nodeList = nsnull;
 +  nsIDOMElement* tableElt(do_QueryInterface(mDOMNode));    
@@ -9012,107 +9012,107 @@ diff --git a/accessible/src/html/nsHTMLT
 +    nsIDOMNode* rowNode = nsnull;
 +    nodeList->Item(rowCount, &rowNode);
 +    nsIDOMElement* rowElement = do_QueryInterface(rowNode);
 +    nsIDOMCSSStyleDeclaration* styleDecl = nsnull;
 +    GetComputedStyleDeclaration(EmptyString(), rowElement, &styleDecl);
      NS_ENSURE_TRUE(styleDecl, NS_ERROR_FAILURE);
      lastRowColor = color;
      styleDecl->GetPropertyValue(NS_LITERAL_STRING("background-color"), color);
-@@ -1165,8 +1165,8 @@ NS_IMETHODIMP nsHTMLTableAccessible::IsP
+@@ -1165,8 +1165,8 @@
      nsIFrame *tableFrame = GetFrame();
      NS_ENSURE_TRUE(tableFrame , NS_ERROR_FAILURE);
      nsSize tableSize  = tableFrame->GetSize();
 -    nsCOMPtr<nsIAccessibleDocument> docAccessible = GetDocAccessible();
 -    nsCOMPtr<nsPIAccessNode> docAccessNode(do_QueryInterface(docAccessible));
 +    nsIAccessibleDocument* docAccessible = GetDocAccessible();
 +    nsPIAccessNode* docAccessNode(do_QueryInterface(docAccessible));
      NS_ENSURE_TRUE(docAccessNode, NS_ERROR_FAILURE);
      nsIFrame *docFrame = docAccessNode->GetFrame();
      NS_ENSURE_TRUE(docFrame , NS_ERROR_FAILURE);
-@@ -1231,11 +1231,11 @@ nsHTMLTableHeadAccessible::GetRows(PRInt
+@@ -1231,11 +1231,11 @@
  {
    nsresult rv = NS_OK;
  
 -  nsCOMPtr<nsIDOMHTMLTableSectionElement> head(do_QueryInterface(mDOMNode));
 +  nsIDOMHTMLTableSectionElement* head(do_QueryInterface(mDOMNode));
    NS_ENSURE_TRUE(head, NS_ERROR_FAILURE);
  
 -  nsCOMPtr<nsIDOMHTMLCollection> rows;
 -  rv = head->GetRows(getter_AddRefs(rows));
 +  nsIDOMHTMLCollection* rows = nsnull;
 +  rv = head->GetRows(&rows);
    NS_ENSURE_SUCCESS(rv, rv);
  
    return rows->GetLength((PRUint32 *)aRows);
-diff --git a/accessible/src/html/nsHTMLTextAccessible.cpp b/accessible/src/html/nsHTMLTextAccessible.cpp
---- a/accessible/src/html/nsHTMLTextAccessible.cpp
-+++ b/accessible/src/html/nsHTMLTextAccessible.cpp
-@@ -80,8 +80,8 @@ nsHTMLTextAccessible::GetState(PRUint32 
+diff -r 332906b0e686 accessible/src/html/nsHTMLTextAccessible.cpp
+--- a/accessible/src/html/nsHTMLTextAccessible.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/html/nsHTMLTextAccessible.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -80,8 +80,8 @@
    if (!mDOMNode)
      return NS_OK;
  
 -  nsCOMPtr<nsIAccessible> docAccessible = 
 -    do_QueryInterface(nsCOMPtr<nsIAccessibleDocument>(GetDocAccessible()));
 +  nsIAccessible* docAccessible = 
 +    do_QueryInterface((nsIAccessibleDocument*)(GetDocAccessible()));
    if (docAccessible) {
       PRUint32 state, extState;
       docAccessible->GetFinalState(&state, &extState);
-@@ -161,7 +161,7 @@ NS_IMETHODIMP nsHTMLLabelAccessible::Get
+@@ -161,7 +161,7 @@
  NS_IMETHODIMP nsHTMLLabelAccessible::GetName(nsAString& aReturn)
  { 
    nsresult rv = NS_ERROR_FAILURE;
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
  
    nsAutoString name;
    if (content)
-@@ -221,7 +221,7 @@ nsHTMLLIAccessible::nsHTMLLIAccessible(n
+@@ -221,7 +221,7 @@
    if (!aBulletText.IsEmpty()) {
      mBulletAccessible = new nsHTMLListBulletAccessible(mDOMNode, mWeakShell, 
                                                         aBulletText);
 -    nsCOMPtr<nsPIAccessNode> bulletANode(mBulletAccessible);
 +    nsPIAccessNode* bulletANode(mBulletAccessible);
      if (bulletANode) {
        bulletANode->Init();
      }
-diff --git a/accessible/src/html/nsHyperTextAccessible.cpp b/accessible/src/html/nsHyperTextAccessible.cpp
---- a/accessible/src/html/nsHyperTextAccessible.cpp
-+++ b/accessible/src/html/nsHyperTextAccessible.cpp
-@@ -80,7 +80,7 @@ nsresult nsHyperTextAccessible::QueryInt
+diff -r 332906b0e686 accessible/src/html/nsHyperTextAccessible.cpp
+--- a/accessible/src/html/nsHyperTextAccessible.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/html/nsHyperTextAccessible.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -80,7 +80,7 @@
  {
    *aInstancePtr = nsnull;
  
 -  nsCOMPtr<nsIDOMXULDocument> xulDoc(do_QueryInterface(mDOMNode));
 +  nsIDOMXULDocument* xulDoc(do_QueryInterface(mDOMNode));
    if (mDOMNode && !xulDoc) {
      // We need XUL doc check for now because for now nsDocAccessible must
      // inherit from nsHyperTextAccessible in order for HTML document accessibles
-@@ -133,7 +133,7 @@ nsAccessibleWrap(aNode, aShell)
+@@ -133,7 +133,7 @@
  
  NS_IMETHODIMP nsHyperTextAccessible::GetRole(PRUint32 *aRole)
  {
 -  nsCOMPtr<nsIContent> content = do_QueryInterface(mDOMNode);
 +  nsIContent* content = do_QueryInterface(mDOMNode);
    if (!content) {
      return NS_ERROR_FAILURE;
    }
-@@ -175,8 +175,8 @@ nsHyperTextAccessible::GetState(PRUint32
+@@ -175,8 +175,8 @@
    if (!mDOMNode || !aExtraState)
      return NS_OK;
  
 -  nsCOMPtr<nsIEditor> editor;
 -  GetAssociatedEditor(getter_AddRefs(editor));
 +  nsIEditor* editor = nsnull;
 +  GetAssociatedEditor(&editor);
    if (editor) {
      PRUint32 flags;
      editor->GetFlags(&flags);
-@@ -210,21 +210,21 @@ void nsHyperTextAccessible::CacheChildre
+@@ -210,21 +210,21 @@
        nsAccessible::CacheChildren();
        return;
      }
 -    nsCOMPtr<nsIEditor> editor;
 -    GetAssociatedEditor(getter_AddRefs(editor));
 +    nsIEditor* editor = nsnull;
 +    GetAssociatedEditor(&editor);
      if (!editor) {
@@ -9130,133 +9130,133 @@ diff --git a/accessible/src/html/nsHyper
        return;
      }
      nsAccessibleTreeWalker walker(mWeakShell, editorRootDOMNode, PR_TRUE);
 -    nsCOMPtr<nsPIAccessible> privatePrevAccessible;
 +    nsPIAccessible* privatePrevAccessible = nsnull;
      PRInt32 childCount = 0;
      walker.GetFirstChild();
      SetFirstChild(walker.mState.accessible);
-@@ -266,11 +266,11 @@ nsIntRect nsHyperTextAccessible::GetBoun
+@@ -266,11 +266,11 @@
                                               &startContentOffsetInFrame, &frame);
    NS_ENSURE_SUCCESS(rv, screenRect);
  
 -  nsCOMPtr<nsIPresShell> shell = GetPresShell();
 +  nsIPresShell* shell = GetPresShell();
    NS_ENSURE_TRUE(shell, screenRect);
  
 -  nsCOMPtr<nsIRenderingContext> rc;
 -  shell->CreateRenderingContext(frame, getter_AddRefs(rc));
 +  nsIRenderingContext* rc = nsnull;
 +  shell->CreateRenderingContext(frame, &rc);
    NS_ENSURE_TRUE(rc, screenRect);
  
    const nsStyleFont *font = frame->GetStyleFont();
-@@ -371,7 +371,7 @@ nsHyperTextAccessible::GetPosAndText(PRI
+@@ -371,7 +371,7 @@
      *aEndAcc = nsnull;
  
    nsIntRect unionRect;
 -  nsCOMPtr<nsIAccessible> accessible, lastAccessible;
 +  nsIAccessible* accessible = nsnull, *lastAccessible = nsnull;
  
    gfxSkipChars skipChars;
    gfxSkipCharsIterator iter;
-@@ -380,7 +380,7 @@ nsHyperTextAccessible::GetPosAndText(PRI
+@@ -380,7 +380,7 @@
    // depending on what we need for out parameters
    while (NextChild(accessible)) {
      lastAccessible = accessible;
 -    nsCOMPtr<nsPIAccessNode> accessNode(do_QueryInterface(accessible));
 +    nsPIAccessNode* accessNode(do_QueryInterface(accessible));
      nsIFrame *frame = accessNode->GetFrame();
      if (!frame) {
        continue;
-@@ -440,7 +440,7 @@ nsHyperTextAccessible::GetPosAndText(PRI
+@@ -440,7 +440,7 @@
                *aText += '*'; // Show *'s only for password text
            }
            else {
 -            nsCOMPtr<nsPIAccessible> pAcc(do_QueryInterface(accessible));
 +            nsPIAccessible* pAcc(do_QueryInterface(accessible));
              pAcc->AppendTextTo(*aText, startOffset,
                                 substringEndOffset - startOffset);
            }
-@@ -536,7 +536,7 @@ NS_IMETHODIMP nsHyperTextAccessible::Get
+@@ -536,7 +536,7 @@
      return NS_ERROR_FAILURE;
    }
  
 -  nsCOMPtr<nsIAccessible> accessible;
 +  nsIAccessible* accessible = nsnull;
  
    while (NextChild(accessible)) {
      PRInt32 textLength = TextLength(accessible);
-@@ -585,7 +585,7 @@ nsresult nsHyperTextAccessible::DOMPoint
+@@ -585,7 +585,7 @@
    }
  
    PRUint32 addTextOffset = 0;
 -  nsCOMPtr<nsIDOMNode> findNode;
 +  nsIDOMNode* findNode = nsnull;
  
    unsigned short nodeType;
    aNode->GetNodeType(&nodeType);
-@@ -596,9 +596,9 @@ nsresult nsHyperTextAccessible::DOMPoint
+@@ -596,9 +596,9 @@
      // For text nodes, aNodeOffset comes in as a character offset
      // Text offset will be added at the end, if we find the offset in this hypertext
      // We want the "skipped" offset into the text (rendered text without the extra whitespace)
 -    nsCOMPtr<nsIContent> content = do_QueryInterface(aNode);
 +    nsIContent* content = do_QueryInterface(aNode);
      NS_ASSERTION(content, "No nsIContent for dom node");
 -    nsCOMPtr<nsIPresShell> presShell = GetPresShell();
 +    nsIPresShell* presShell = GetPresShell();
      NS_ENSURE_TRUE(presShell, NS_ERROR_FAILURE);
      nsIFrame *frame = presShell->GetPrimaryFrameFor(content);
      NS_ENSURE_TRUE(frame, NS_ERROR_FAILURE);
-@@ -609,7 +609,7 @@ nsresult nsHyperTextAccessible::DOMPoint
+@@ -609,7 +609,7 @@
    }
    else {
      // For non-text nodes, aNodeOffset comes in as a child node index
 -    nsCOMPtr<nsIContent> parentContent(do_QueryInterface(aNode));
 +    nsIContent* parentContent(do_QueryInterface(aNode));
      // Should not happen, but better to protect against crash if doc node is somehow passed in
      NS_ENSURE_TRUE(parentContent, NS_ERROR_FAILURE);
      // findNode could be null if aNodeOffset == # of child nodes, which means one of two things:
-@@ -631,9 +631,9 @@ nsresult nsHyperTextAccessible::DOMPoint
+@@ -631,9 +631,9 @@
  
    // Get accessible for this findNode, or if that node isn't accessible, use the
    // accessible for the next DOM node which has one (based on forward depth first search)
 -  nsCOMPtr<nsIAccessible> descendantAccessible;
 +  nsIAccessible* descendantAccessible = nsnull;
    if (findNode) {
 -    nsCOMPtr<nsIContent> findContent = do_QueryInterface(findNode);
 +    nsIContent* findContent = do_QueryInterface(findNode);
      if (findContent->IsNodeOfType(nsINode::eHTML) && 
          findContent->NodeInfo()->Equals(nsAccessibilityAtoms::br)) {
        nsIContent *parent = findContent->GetParent();
-@@ -647,10 +647,10 @@ nsresult nsHyperTextAccessible::DOMPoint
+@@ -647,10 +647,10 @@
      descendantAccessible = GetFirstAvailableAccessible(findNode);
    }
    // From the descendant, go up and get the immediate child of this hypertext
 -  nsCOMPtr<nsIAccessible> childAccessible;
 +  nsIAccessible* childAccessible = nsnull;
    while (descendantAccessible) {
 -    nsCOMPtr<nsIAccessible> parentAccessible;
 -    descendantAccessible->GetParent(getter_AddRefs(parentAccessible));
 +    nsIAccessible* parentAccessible = nsnull;
 +    descendantAccessible->GetParent(&parentAccessible);
      if (this == parentAccessible) {
        childAccessible = descendantAccessible;
        break;
-@@ -680,7 +680,7 @@ nsresult nsHyperTextAccessible::DOMPoint
+@@ -680,7 +680,7 @@
    // If childAccessible is null we will end up adding up the entire length of
    // the hypertext, which is good -- it just means our offset node
    // came after the last accessible child's node
 -  nsCOMPtr<nsIAccessible> accessible;
 +  nsIAccessible* accessible = nsnull;
    while (NextChild(accessible) && accessible != childAccessible) {
      PRInt32 textLength = TextLength(accessible);
      NS_ENSURE_TRUE(textLength >= 0, nsnull);
-@@ -718,24 +718,24 @@ nsHyperTextAccessible::HypertextOffsetsT
+@@ -718,24 +718,24 @@
    NS_ENSURE_ARG_POINTER(aEndOffset);
    *aEndOffset = -1;
  
 -  nsCOMPtr<nsIAccessible> startAcc, endAcc;
 +  nsIAccessible* startAcc = nsnull, *endAcc = nsnull;
    PRInt32 startOffset = aStartHTOffset, endOffset = aEndHTOffset;
    nsIFrame *startFrame = nsnull, *endFrame = nsnull;
  
@@ -9276,68 +9276,68 @@ diff --git a/accessible/src/html/nsHyper
  
    if (aStartHTOffset != aEndHTOffset) {
      rv = GetDOMPointByFrameOffset(endFrame, endOffset, endAcc,
 -                                  getter_AddRefs(endNode), &endOffset);
 +                                  &endNode, &endOffset);
      NS_ENSURE_SUCCESS(rv, rv);
    } else {
      endNode = startNode;
-@@ -776,7 +776,7 @@ nsHyperTextAccessible::GetRelativeOffset
+@@ -776,7 +776,7 @@
    nsresult rv;
    PRInt32 contentOffset = aFromOffset;
    if (IsText(aFromAccessible)) {
 -    nsCOMPtr<nsPIAccessNode> accessNode(do_QueryInterface(aFromAccessible));
 +    nsPIAccessNode* accessNode(do_QueryInterface(aFromAccessible));
      NS_ASSERTION(accessNode, "nsIAccessible doesn't support nsPIAccessNode");
  
      nsIFrame *frame = accessNode->GetFrame();
-@@ -808,12 +808,12 @@ nsHyperTextAccessible::GetRelativeOffset
+@@ -808,12 +808,12 @@
  
    // Turn the resulting node and offset into a hyperTextOffset
    PRInt32 hyperTextOffset;
 -  nsCOMPtr<nsIDOMNode> resultNode = do_QueryInterface(pos.mResultContent);
 +  nsIDOMNode* resultNode = do_QueryInterface(pos.mResultContent);
    NS_ENSURE_TRUE(resultNode, -1);
  
 -  nsCOMPtr<nsIAccessible> finalAccessible;
 +  nsIAccessible* finalAccessible = nsnull;
    rv = DOMPointToHypertextOffset(resultNode, pos.mContentOffset, &hyperTextOffset,
 -                                 getter_AddRefs(finalAccessible),
 +                                 &finalAccessible,
                                   aDirection == eDirNext);
    // If finalAccessible == nsnull, then DOMPointToHypertextOffset() searched through the hypertext
    // children without finding the node/offset position
-@@ -871,7 +871,7 @@ nsresult nsHyperTextAccessible::GetTextH
+@@ -871,7 +871,7 @@
    aText.Truncate();
    *aStartOffset = *aEndOffset = 0;
  
 -  nsCOMPtr<nsIPresShell> presShell = GetPresShell();
 +  nsIPresShell* presShell = GetPresShell();
    if (!presShell) {
      return NS_ERROR_FAILURE;
    }
-@@ -887,11 +887,11 @@ nsresult nsHyperTextAccessible::GetTextH
+@@ -887,11 +887,11 @@
        // or the start of a new line. Getting text at the line should provide the line with the visual caret,
        // otherwise screen readers will announce the wrong line as the user presses up or down arrow and land
        // at the end of a line.
 -      nsCOMPtr<nsISelection> domSel;
 -      nsresult rv = GetSelections(nsnull, getter_AddRefs(domSel));
 -      nsCOMPtr<nsISelectionPrivate> privateSelection(do_QueryInterface(domSel));
 -      nsCOMPtr<nsFrameSelection> frameSelection;
 -      rv = privateSelection->GetFrameSelection(getter_AddRefs(frameSelection));
 +      nsISelection* domSel = nsnull;
 +      nsresult rv = GetSelections(nsnull, &domSel);
 +      nsISelectionPrivate* privateSelection(do_QueryInterface(domSel));
 +      nsFrameSelection* frameSelection = nsnull;
 +      rv = privateSelection->GetFrameSelection(&frameSelection);
        NS_ENSURE_SUCCESS(rv, rv);
        if (frameSelection->GetHint() == nsFrameSelection::HINTLEFT) {
          -- aOffset;  // We are at the start of a line
-@@ -906,16 +906,16 @@ nsresult nsHyperTextAccessible::GetTextH
+@@ -906,16 +906,16 @@
    PRInt32 endOffset = startOffset;
  
    // Convert offsets to frame-relative
 -  nsCOMPtr<nsIAccessible> startAcc;
 +  nsIAccessible* startAcc = nsnull;
    nsIFrame *startFrame = GetPosAndText(startOffset, endOffset, nsnull, nsnull,
 -                                       nsnull, getter_AddRefs(startAcc));
 +                                       nsnull, &startAcc);
@@ -9347,17 +9347,17 @@ diff --git a/accessible/src/html/nsHyper
      GetCharacterCount(&textLength);
      if (aBoundaryType == BOUNDARY_LINE_START && aOffset > 0 && aOffset == textLength) {
        // Asking for start of line, while on last character
 -      nsCOMPtr<nsPIAccessNode> startAccessNode = do_QueryInterface(startAcc);
 +      nsPIAccessNode* startAccessNode = do_QueryInterface(startAcc);
        if (startAccessNode) {
          startFrame = startAccessNode->GetFrame();
        }
-@@ -1006,15 +1006,15 @@ nsresult nsHyperTextAccessible::GetTextH
+@@ -1006,15 +1006,15 @@
      // Careful, startOffset and endOffset are passed by reference to GetPosAndText() and changed
      // For BOUNDARY_LINE_END, make sure we start of this line
      startOffset = endOffset = finalStartOffset + (aBoundaryType == BOUNDARY_LINE_END);
 -    nsCOMPtr<nsIAccessible> endAcc;
 +    nsIAccessible* endAcc = nsnull;
      nsIFrame *endFrame = GetPosAndText(startOffset, endOffset, nsnull, nsnull,
 -                                       nsnull, getter_AddRefs(endAcc));
 +                                       nsnull, &endAcc);
@@ -9366,142 +9366,142 @@ diff --git a/accessible/src/html/nsHyper
        // since the caret cannot be in the static text. Start just after the static text.
        startOffset = endOffset = finalStartOffset + (aBoundaryType == BOUNDARY_LINE_END) + TextLength(endAcc);
        endFrame = GetPosAndText(startOffset, endOffset, nsnull, nsnull,
 -                               nsnull, getter_AddRefs(endAcc));
 +                               nsnull, &endAcc);
      }
      if (!endFrame) {
        return NS_ERROR_FAILURE;
-@@ -1082,7 +1082,7 @@ NS_IMETHODIMP nsHyperTextAccessible::Get
+@@ -1082,7 +1082,7 @@
      return NS_ERROR_FAILURE;
    }
  
 -  nsCOMPtr<nsIAccessible> accessible;
 +  nsIAccessible* accessible = nsnull;
    
    while (NextChild(accessible)) {
      PRInt32 length = TextLength(accessible);
-@@ -1108,7 +1108,7 @@ nsHyperTextAccessible::GetAttributesInte
+@@ -1108,7 +1108,7 @@
    nsresult rv = nsAccessibleWrap::GetAttributesInternal(aAttributes);
    NS_ENSURE_SUCCESS(rv, rv);
  
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(GetRoleContent(mDOMNode)));
 +  nsIContent* content(do_QueryInterface(GetRoleContent(mDOMNode)));
    NS_ENSURE_TRUE(content, NS_ERROR_UNEXPECTED);
    nsIAtom *tag = content->Tag();
  
-@@ -1197,7 +1197,7 @@ nsHyperTextAccessible::GetOffsetAtPoint(
+@@ -1197,7 +1197,7 @@
                                          PRUint32 aCoordType, PRInt32 *aOffset)
  {
    *aOffset = -1;
 -  nsCOMPtr<nsIPresShell> shell = GetPresShell();
 +  nsIPresShell* shell = GetPresShell();
    if (!shell) {
      return NS_ERROR_FAILURE;
    }
-@@ -1229,11 +1229,11 @@ nsHyperTextAccessible::GetOffsetAtPoint(
+@@ -1229,11 +1229,11 @@
  
    // We have an point in an accessible child of this, now we need to add up the
    // offsets before it to what we already have
 -  nsCOMPtr<nsIAccessible> accessible;
 +  nsIAccessible* accessible = nsnull;
    PRInt32 offset = 0;
  
    while (NextChild(accessible)) {
 -    nsCOMPtr<nsPIAccessNode> accessNode(do_QueryInterface(accessible));
 +    nsPIAccessNode* accessNode(do_QueryInterface(accessible));
      nsIFrame *primaryFrame = accessNode->GetFrame();
      NS_ENSURE_TRUE(primaryFrame, NS_ERROR_FAILURE);
  
-@@ -1280,7 +1280,7 @@ nsHyperTextAccessible::GetLinkCount(PRIn
+@@ -1280,7 +1280,7 @@
      return NS_ERROR_FAILURE;
    }
  
 -  nsCOMPtr<nsIAccessible> accessible;
 +  nsIAccessible* accessible = nsnull;
  
    while (NextChild(accessible)) {
      if (IsEmbeddedObject(accessible)) {
-@@ -1301,7 +1301,7 @@ nsHyperTextAccessible::GetLink(PRInt32 a
+@@ -1301,7 +1301,7 @@
      return NS_ERROR_FAILURE;
  
    PRInt32 linkIndex = aLinkIndex;
 -  nsCOMPtr<nsIAccessible> accessible;
 +  nsIAccessible* accessible = nsnull;
    while (NextChild(accessible)) {
      if (IsEmbeddedObject(accessible) && linkIndex-- == 0)
        return CallQueryInterface(accessible, aLink);
-@@ -1322,7 +1322,7 @@ nsHyperTextAccessible::GetLinkIndex(PRIn
+@@ -1322,7 +1322,7 @@
      return NS_ERROR_FAILURE;
    }
  
 -  nsCOMPtr<nsIAccessible> accessible;
 +  nsIAccessible* accessible = nsnull;
  
    while (NextChild(accessible) && characterCount <= aCharIndex) {
      PRUint32 role = Role(accessible);
-@@ -1367,9 +1367,9 @@ NS_IMETHODIMP nsHyperTextAccessible::Ins
+@@ -1367,9 +1367,9 @@
  NS_IMETHODIMP nsHyperTextAccessible::InsertText(const nsAString &aText, PRInt32 aPosition)
  {
    if (NS_SUCCEEDED(SetCaretOffset(aPosition))) {
 -    nsCOMPtr<nsIEditor> editor;
 -    GetAssociatedEditor(getter_AddRefs(editor));
 -    nsCOMPtr<nsIPlaintextEditor> peditor(do_QueryInterface(editor));
 +    nsIEditor* editor = nsnull;
 +    GetAssociatedEditor(&editor);
 +    nsIPlaintextEditor* peditor(do_QueryInterface(editor));
      return peditor ? peditor->InsertText(aText) : NS_ERROR_FAILURE;
    }
  
-@@ -1378,8 +1378,8 @@ NS_IMETHODIMP nsHyperTextAccessible::Ins
+@@ -1378,8 +1378,8 @@
  
  NS_IMETHODIMP nsHyperTextAccessible::CopyText(PRInt32 aStartPos, PRInt32 aEndPos)
  {
 -  nsCOMPtr<nsIEditor> editor;
 -  GetAssociatedEditor(getter_AddRefs(editor));
 +  nsIEditor* editor = nsnull;
 +  GetAssociatedEditor(&editor);
    if (editor && NS_SUCCEEDED(SetSelectionRange(aStartPos, aEndPos)))
      return editor->Copy();
  
-@@ -1388,8 +1388,8 @@ NS_IMETHODIMP nsHyperTextAccessible::Cop
+@@ -1388,8 +1388,8 @@
  
  NS_IMETHODIMP nsHyperTextAccessible::CutText(PRInt32 aStartPos, PRInt32 aEndPos)
  {
 -  nsCOMPtr<nsIEditor> editor;
 -  GetAssociatedEditor(getter_AddRefs(editor));
 +  nsIEditor* editor = nsnull;
 +  GetAssociatedEditor(&editor);
    if (editor && NS_SUCCEEDED(SetSelectionRange(aStartPos, aEndPos)))
      return editor->Cut();
  
-@@ -1398,8 +1398,8 @@ NS_IMETHODIMP nsHyperTextAccessible::Cut
+@@ -1398,8 +1398,8 @@
  
  NS_IMETHODIMP nsHyperTextAccessible::DeleteText(PRInt32 aStartPos, PRInt32 aEndPos)
  {
 -  nsCOMPtr<nsIEditor> editor;
 -  GetAssociatedEditor(getter_AddRefs(editor));
 +  nsIEditor* editor = nsnull;
 +  GetAssociatedEditor(&editor);
    if (editor && NS_SUCCEEDED(SetSelectionRange(aStartPos, aEndPos)))
      return editor->DeleteSelection(nsIEditor::eNone);
  
-@@ -1408,8 +1408,8 @@ NS_IMETHODIMP nsHyperTextAccessible::Del
+@@ -1408,8 +1408,8 @@
  
  NS_IMETHODIMP nsHyperTextAccessible::PasteText(PRInt32 aPosition)
  {
 -  nsCOMPtr<nsIEditor> editor;
 -  GetAssociatedEditor(getter_AddRefs(editor));
 +  nsIEditor* editor = nsnull;
 +  GetAssociatedEditor(&editor);
    if (editor && NS_SUCCEEDED(SetCaretOffset(aPosition)))
      return editor->Paste(nsIClipboard::kGlobalClipboard);
  
-@@ -1422,16 +1422,16 @@ nsHyperTextAccessible::GetAssociatedEdit
+@@ -1422,16 +1422,16 @@
    NS_ENSURE_ARG_POINTER(aEditor);
  
    *aEditor = nsnull;
 -  nsCOMPtr<nsIContent> content = do_QueryInterface(mDOMNode);
 +  nsIContent* content = do_QueryInterface(mDOMNode);
    NS_ENSURE_TRUE(content, NS_ERROR_FAILURE);
  
    if (!content->HasFlag(NODE_IS_EDITABLE)) {
@@ -9513,17 +9513,17 @@ diff --git a/accessible/src/html/nsHyper
 +    while (NS_SUCCEEDED(current->GetParent(&ancestor)) && ancestor) {
 +      nsHyperTextAccessible* ancestorTextAccessible = nsnull;
        ancestor->QueryInterface(NS_GET_IID(nsHyperTextAccessible),
 -                               getter_AddRefs(ancestorTextAccessible));
 +                               (void**)&ancestorTextAccessible);
        if (ancestorTextAccessible) {
          // Recursion will stop at container doc because it has its own impl
          // of GetAssociatedEditor()
-@@ -1442,19 +1442,19 @@ nsHyperTextAccessible::GetAssociatedEdit
+@@ -1442,19 +1442,19 @@
      return NS_OK;
    }
  
 -  nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem =
 +  nsIDocShellTreeItem* docShellTreeItem =
      nsAccUtils::GetDocShellTreeItemFor(mDOMNode);
 -  nsCOMPtr<nsIEditingSession> editingSession(do_GetInterface(docShellTreeItem));
 +  nsIEditingSession* editingSession(do_GetInterface(docShellTreeItem));
@@ -9538,17 +9538,17 @@ diff --git a/accessible/src/html/nsHyper
 +  nsIDocument* doc = shell->GetDocument();
    NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE);
  
 -  nsCOMPtr<nsIEditor> editor;
 +  nsIEditor* editor = nsnull;
    return editingSession->GetEditorForWindow(doc->GetWindow(), aEditor);
  }
  
-@@ -1470,16 +1470,16 @@ nsresult nsHyperTextAccessible::SetSelec
+@@ -1470,16 +1470,16 @@
  
    // If range 0 was successfully set, clear any additional selection 
    // ranges remaining from previous selection
 -  nsCOMPtr<nsISelection> domSel;
 -  nsCOMPtr<nsISelectionController> selCon;
 -  GetSelections(getter_AddRefs(selCon), getter_AddRefs(domSel));
 +  nsISelection* domSel = nsnull;
 +  nsISelectionController* selCon = nsnull;
@@ -9560,34 +9560,34 @@ diff --git a/accessible/src/html/nsHyper
      for (PRInt32 count = 0; count < numRanges - 1; count ++) {
 -      nsCOMPtr<nsIDOMRange> range;
 -      domSel->GetRangeAt(1, getter_AddRefs(range));
 +      nsIDOMRange* range = nsnull;
 +      domSel->GetRangeAt(1, &range);
        domSel->RemoveRange(range);
      }
    }
-@@ -1506,12 +1506,12 @@ NS_IMETHODIMP nsHyperTextAccessible::Get
+@@ -1506,12 +1506,12 @@
  {
    *aCaretOffset = 0;
  
 -  nsCOMPtr<nsISelection> domSel;
 -  nsresult rv = GetSelections(nsnull, getter_AddRefs(domSel));
 +  nsISelection* domSel = nsnull;
 +  nsresult rv = GetSelections(nsnull, &domSel);
    NS_ENSURE_SUCCESS(rv, rv);
  
 -  nsCOMPtr<nsIDOMNode> caretNode;
 -  rv = domSel->GetFocusNode(getter_AddRefs(caretNode));
 +  nsIDOMNode* caretNode = nsnull;
 +  rv = domSel->GetFocusNode(&caretNode);
    NS_ENSURE_SUCCESS(rv, rv);
  
    PRInt32 caretOffset;
-@@ -1524,17 +1524,17 @@ PRInt32 nsHyperTextAccessible::GetCaretL
+@@ -1524,17 +1524,17 @@
  {
    // Provide the line number for the caret, relative to the
    // currently focused node. Use a 1-based index
 -  nsCOMPtr<nsISelection> domSel;
 -  GetSelections(nsnull, getter_AddRefs(domSel));
 -  nsCOMPtr<nsISelectionPrivate> privateSelection(do_QueryInterface(domSel));
 +  nsISelection* domSel = nsnull;
 +  GetSelections(nsnull, &domSel);
@@ -9603,37 +9603,37 @@ diff --git a/accessible/src/html/nsHyper
 -  domSel->GetFocusNode(getter_AddRefs(caretNode));
 -  nsCOMPtr<nsIContent> caretContent = do_QueryInterface(caretNode);
 +  nsIDOMNode* caretNode = nsnull;
 +  domSel->GetFocusNode(&caretNode);
 +  nsIContent* caretContent = do_QueryInterface(caretNode);
    if (!caretContent || !nsAccUtils::IsAncestorOf(mDOMNode, caretNode)) {
      return -1;
    }
-@@ -1547,8 +1547,8 @@ PRInt32 nsHyperTextAccessible::GetCaretL
+@@ -1547,8 +1547,8 @@
    NS_ENSURE_TRUE(caretFrame, -1);
  
    PRInt32 lineNumber = 1;
 -  nsCOMPtr<nsILineIterator> lineIterForCaret;
 -  nsCOMPtr<nsIContent> hyperTextContent = do_QueryInterface(mDOMNode);
 +  nsILineIterator* lineIterForCaret = nsnull;
 +  nsIContent* hyperTextContent = do_QueryInterface(mDOMNode);
    while (caretFrame) {
      if (hyperTextContent == caretFrame->GetContent()) {
        return lineNumber; // Must be in a single line hyper text, there is no line iterator
-@@ -1560,7 +1560,7 @@ PRInt32 nsHyperTextAccessible::GetCaretL
+@@ -1560,7 +1560,7 @@
      // Add lines for the sibling frames before the caret
      nsIFrame *sibling = parentFrame->GetFirstChild(nsnull);
      while (sibling && sibling != caretFrame) {
 -      nsCOMPtr<nsILineIterator> lineIterForSibling = do_QueryInterface(sibling);
 +      nsILineIterator* lineIterForSibling = do_QueryInterface(sibling);
        if (lineIterForSibling) {
          PRInt32 addLines;
          // For the frames before that grab all the lines
-@@ -1605,28 +1605,28 @@ nsresult nsHyperTextAccessible::GetSelec
+@@ -1605,28 +1605,28 @@
      aRanges->Clear();
    }
    
 -  nsCOMPtr<nsISelection> domSel;
 -  nsCOMPtr<nsISelectionController> selCon;
 +  nsISelection* domSel = nsnull;
 +  nsISelectionController* selCon = nsnull;
  
@@ -9662,54 +9662,54 @@ diff --git a/accessible/src/html/nsHyper
  
 -    nsCOMPtr<nsIDOMElement> editorRoot;
 -    editor->GetRootElement(getter_AddRefs(editorRoot));
 +    nsIDOMElement* editorRoot = nsnull;
 +    editor->GetRootElement(&editorRoot);
      startNode = do_QueryInterface(editorRoot);
      NS_ENSURE_STATE(startNode);
    }
-@@ -1638,10 +1638,10 @@ nsresult nsHyperTextAccessible::GetSelec
+@@ -1638,10 +1638,10 @@
  
      // Get the selection and selection controller
      frame->GetSelectionController(GetPresContext(),
 -                                  getter_AddRefs(selCon));
 +                                  &selCon);
      NS_ENSURE_TRUE(selCon, NS_ERROR_FAILURE);
      selCon->GetSelection(nsISelectionController::SELECTION_NORMAL,
 -                         getter_AddRefs(domSel));
 +                         &domSel);
      NS_ENSURE_TRUE(domSel, NS_ERROR_FAILURE);
  
      startNode = mDOMNode;
-@@ -1654,11 +1654,11 @@ nsresult nsHyperTextAccessible::GetSelec
+@@ -1654,11 +1654,11 @@
      NS_ADDREF(*aDomSel = domSel);
    }
    if (aRanges) {
 -    nsCOMPtr<nsISelection2> selection2(do_QueryInterface(domSel));
 +    nsISelection2* selection2(do_QueryInterface(domSel));
      NS_ENSURE_TRUE(selection2, NS_ERROR_FAILURE);
  
 -    nsCOMPtr<nsIDOMNodeList> childNodes;
 -    nsresult rv = startNode->GetChildNodes(getter_AddRefs(childNodes));
 +    nsIDOMNodeList* childNodes = nsnull;
 +    nsresult rv = startNode->GetChildNodes(&childNodes);
      NS_ENSURE_SUCCESS(rv, rv);
      PRUint32 numChildren; 
      rv = childNodes->GetLength(&numChildren);
-@@ -1688,7 +1688,7 @@ nsresult nsHyperTextAccessible::GetSelec
+@@ -1688,7 +1688,7 @@
   */
  NS_IMETHODIMP nsHyperTextAccessible::GetSelectionCount(PRInt32 *aSelectionCount)
  {
 -  nsCOMPtr<nsISelection> domSel;
 +  nsISelection* domSel = nsnull;
    nsCOMArray<nsIDOMRange> ranges;
    nsresult rv = GetSelections(nsnull, nsnull, &ranges);
    NS_ENSURE_SUCCESS(rv, rv);
-@@ -1705,26 +1705,26 @@ NS_IMETHODIMP nsHyperTextAccessible::Get
+@@ -1705,26 +1705,26 @@
  {
    *aStartOffset = *aEndOffset = 0;
  
 -  nsCOMPtr<nsISelection> domSel;
 +  nsISelection* domSel = nsnull;
    nsCOMArray<nsIDOMRange> ranges;
 -  nsresult rv = GetSelections(nsnull, getter_AddRefs(domSel), &ranges);
 +  nsresult rv = GetSelections(nsnull, &domSel, &ranges);
@@ -9733,17 +9733,17 @@ diff --git a/accessible/src/html/nsHyper
    // Get end point
 -  nsCOMPtr<nsIDOMNode> endNode;
 -  range->GetEndContainer(getter_AddRefs(endNode));
 +  nsIDOMNode* endNode = nsnull;
 +  range->GetEndContainer(&endNode);
    PRInt32 endOffset;
    range->GetEndOffset(&endOffset);
  
-@@ -1735,14 +1735,14 @@ NS_IMETHODIMP nsHyperTextAccessible::Get
+@@ -1735,14 +1735,14 @@
    if (rangeCompareResult < 0) {
      // Make sure start is before end, by swapping offsets
      // This occurs when the user selects backwards in the text
 -    startNode.swap(endNode);
 +    swap(startNode, endNode);
      PRInt32 tempOffset = startOffset;
      startOffset = endOffset;
      endOffset = tempOffset;
@@ -9751,37 +9751,37 @@ diff --git a/accessible/src/html/nsHyper
  
 -  nsCOMPtr<nsIAccessible> startAccessible;
 -  rv = DOMPointToHypertextOffset(startNode, startOffset, aStartOffset, getter_AddRefs(startAccessible));
 +  nsIAccessible* startAccessible = nsnull;
 +  rv = DOMPointToHypertextOffset(startNode, startOffset, aStartOffset, &startAccessible);
    NS_ENSURE_SUCCESS(rv, rv);
    if (!startAccessible) {
      *aStartOffset = 0; // Could not find start point within this hypertext, so starts before
-@@ -1759,8 +1759,8 @@ nsHyperTextAccessible::SetSelectionBound
+@@ -1759,8 +1759,8 @@
                                            PRInt32 aStartOffset,
                                            PRInt32 aEndOffset)
  {
 -  nsCOMPtr<nsISelection> domSel;
 -  nsresult rv = GetSelections(nsnull, getter_AddRefs(domSel));
 +  nsISelection* domSel = nsnull;
 +  nsresult rv = GetSelections(nsnull, &domSel);
    NS_ENSURE_SUCCESS(rv, rv);
  
    // Caret is a collapsed selection
-@@ -1768,7 +1768,7 @@ nsHyperTextAccessible::SetSelectionBound
+@@ -1768,7 +1768,7 @@
  
    PRInt32 rangeCount;
    domSel->GetRangeCount(&rangeCount);
 -  nsCOMPtr<nsIDOMRange> range;
 +  nsIDOMRange* range = nsnull;
    if (aSelectionNum == rangeCount) { // Add a range
      range = do_CreateInstance(kRangeCID);
      NS_ENSURE_TRUE(range, NS_ERROR_OUT_OF_MEMORY);
-@@ -1777,16 +1777,16 @@ nsHyperTextAccessible::SetSelectionBound
+@@ -1777,16 +1777,16 @@
      return NS_ERROR_INVALID_ARG;
    }
    else {
 -    domSel->GetRangeAt(aSelectionNum, getter_AddRefs(range));
 +    domSel->GetRangeAt(aSelectionNum, &range);
      NS_ENSURE_TRUE(range, NS_ERROR_FAILURE);
    }
  
@@ -9792,81 +9792,81 @@ diff --git a/accessible/src/html/nsHyper
    rv = HypertextOffsetsToDOMRange(aStartOffset, aEndOffset,
 -                                  getter_AddRefs(startNode), &startOffset,
 -                                  getter_AddRefs(endNode), &endOffset);
 +                                  &startNode, &startOffset,
 +                                  &endNode, &endOffset);
    NS_ENSURE_SUCCESS(rv, rv);
  
    rv = range->SetStart(startNode, startOffset);
-@@ -1807,8 +1807,8 @@ nsHyperTextAccessible::SetSelectionBound
+@@ -1807,8 +1807,8 @@
   */
  NS_IMETHODIMP nsHyperTextAccessible::AddSelection(PRInt32 aStartOffset, PRInt32 aEndOffset)
  {
 -  nsCOMPtr<nsISelection> domSel;
 -  nsresult rv = GetSelections(nsnull, getter_AddRefs(domSel));
 +  nsISelection* domSel = nsnull;
 +  nsresult rv = GetSelections(nsnull, &domSel);
    NS_ENSURE_SUCCESS(rv, rv);
  
    PRInt32 rangeCount;
-@@ -1822,8 +1822,8 @@ NS_IMETHODIMP nsHyperTextAccessible::Add
+@@ -1822,8 +1822,8 @@
   */
  NS_IMETHODIMP nsHyperTextAccessible::RemoveSelection(PRInt32 aSelectionNum)
  {
 -  nsCOMPtr<nsISelection> domSel;
 -  nsresult rv = GetSelections(nsnull, getter_AddRefs(domSel));
 +  nsISelection* domSel = nsnull;
 +  nsresult rv = GetSelections(nsnull, &domSel);
    NS_ENSURE_SUCCESS(rv, rv);
  
    PRInt32 rangeCount;
-@@ -1831,8 +1831,8 @@ NS_IMETHODIMP nsHyperTextAccessible::Rem
+@@ -1831,8 +1831,8 @@
    if (aSelectionNum < 0 || aSelectionNum >= rangeCount)
      return NS_ERROR_INVALID_ARG;
  
 -  nsCOMPtr<nsIDOMRange> range;
 -  domSel->GetRangeAt(aSelectionNum, getter_AddRefs(range));
 +  nsIDOMRange* range = nsnull;
 +  domSel->GetRangeAt(aSelectionNum, &range);
    return domSel->RemoveRange(range);
  }
  
-@@ -1844,12 +1844,12 @@ nsHyperTextAccessible::ScrollSubstringTo
+@@ -1844,12 +1844,12 @@
                                           PRUint32 aScrollType)
  {
    PRInt32 startOffset, endOffset;
 -  nsCOMPtr<nsIDOMNode> startNode, endNode;
 +  nsIDOMNode* startNode = nsnull, *endNode = nsnull;
  
    nsresult rv = HypertextOffsetsToDOMRange(aStartIndex, aEndIndex,
 -                                           getter_AddRefs(startNode),
 +                                           &startNode,
                                             &startOffset,
 -                                           getter_AddRefs(endNode),
 +                                           &endNode,
                                             &endOffset);
    NS_ENSURE_SUCCESS(rv, rv);
  
-@@ -1877,11 +1877,11 @@ nsHyperTextAccessible::ScrollSubstringTo
+@@ -1877,11 +1877,11 @@
    NS_ENSURE_SUCCESS(rv, rv);
  
    PRInt32 startOffset, endOffset;
 -  nsCOMPtr<nsIDOMNode> startNode, endNode;
 +  nsIDOMNode* startNode = nsnull, *endNode = nsnull;
  
    rv = HypertextOffsetsToDOMRange(aStartIndex, aEndIndex,
 -                                  getter_AddRefs(startNode), &startOffset,
 -                                  getter_AddRefs(endNode), &endOffset);
 +                                  &startNode, &startOffset,
 +                                  &endNode, &endOffset);
    NS_ENSURE_SUCCESS(rv, rv);
  
    nsPresContext *presContext = frame->PresContext();
-@@ -1989,29 +1989,29 @@ nsHyperTextAccessible::GetDOMPointByFram
+@@ -1989,29 +1989,29 @@
  {
    NS_ENSURE_ARG(aAccessible);
  
 -  nsCOMPtr<nsIDOMNode> node;
 +  nsIDOMNode* node = nsnull;
  
    if (!aFrame) {
      // If the given frame is null then set offset after the DOM node of the
@@ -9894,75 +9894,75 @@ diff --git a/accessible/src/html/nsHyper
 +    nsIContent* content(aFrame->GetContent());
      NS_ENSURE_STATE(content);
  
 -    nsCOMPtr<nsIPresShell> shell(GetPresShell());
 +    nsIPresShell* shell(GetPresShell());
      NS_ENSURE_STATE(shell);
  
      nsIFrame *primaryFrame = shell->GetPrimaryFrameFor(content);
-@@ -2021,10 +2021,10 @@ nsHyperTextAccessible::GetDOMPointByFram
+@@ -2021,10 +2021,10 @@
      node = do_QueryInterface(content);
  
    } else {
 -    nsCOMPtr<nsIContent> content(aFrame->GetContent());
 +    nsIContent* content(aFrame->GetContent());
      NS_ENSURE_STATE(content);
  
 -    nsCOMPtr<nsIContent> parent(content->GetParent());
 +    nsIContent* parent(content->GetParent());
      NS_ENSURE_STATE(parent);
  
      *aNodeOffset = parent->IndexOf(content);
-diff --git a/accessible/src/xforms/nsXFormsAccessible.cpp b/accessible/src/xforms/nsXFormsAccessible.cpp
---- a/accessible/src/xforms/nsXFormsAccessible.cpp
-+++ b/accessible/src/xforms/nsXFormsAccessible.cpp
-@@ -76,8 +76,8 @@ nsXFormsAccessible::GetBoundChildElement
+diff -r 332906b0e686 accessible/src/xforms/nsXFormsAccessible.cpp
+--- a/accessible/src/xforms/nsXFormsAccessible.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/xforms/nsXFormsAccessible.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -76,8 +76,8 @@
    NS_ENSURE_TRUE(sXFormsService, NS_ERROR_FAILURE);
    NS_ENSURE_TRUE(mDOMNode, NS_ERROR_FAILURE);
  
 -  nsCOMPtr<nsIDOMNodeList> nodes;
 -  nsresult rv = mDOMNode->GetChildNodes(getter_AddRefs(nodes));
 +  nsIDOMNodeList* nodes = nsnull;
 +  nsresult rv = mDOMNode->GetChildNodes(&nodes);
    NS_ENSURE_SUCCESS(rv, rv);
  
    PRUint32 length;
-@@ -85,11 +85,11 @@ nsXFormsAccessible::GetBoundChildElement
+@@ -85,11 +85,11 @@
    NS_ENSURE_SUCCESS(rv, rv);
  
    for (PRUint32 index = 0; index < length; index++) {
 -    nsCOMPtr<nsIDOMNode> node;
 -    rv = nodes->Item(index, getter_AddRefs(node));
 +    nsIDOMNode* node = nsnull;
 +    rv = nodes->Item(index, &node);
      NS_ENSURE_SUCCESS(rv, rv);
  
 -    nsCOMPtr<nsIContent> content = do_QueryInterface(node);
 +    nsIContent* content = do_QueryInterface(node);
      NS_ENSURE_TRUE(content, NS_ERROR_FAILURE);
  
      if (content->NodeInfo()->Equals(aTagName) &&
-@@ -119,12 +119,12 @@ nsXFormsAccessible::CacheSelectChildren(
+@@ -119,12 +119,12 @@
    if (!accService)
      return;
  
 -  nsCOMPtr<nsIDOMNode> container(aContainerNode);
 +  nsIDOMNode* container(aContainerNode);
    if (!container)
      container = mDOMNode;
  
 -  nsCOMPtr<nsIDOMNodeList> children;
 -  sXFormsService->GetSelectChildrenFor(container, getter_AddRefs(children));
 +  nsIDOMNodeList* children = nsnull;
 +  sXFormsService->GetSelectChildrenFor(container, &children);
  
    if (!children)
      return;
-@@ -132,18 +132,18 @@ nsXFormsAccessible::CacheSelectChildren(
+@@ -132,18 +132,18 @@
    PRUint32 length = 0;
    children->GetLength(&length);
  
 -  nsCOMPtr<nsIAccessible> accessible;
 -  nsCOMPtr<nsPIAccessible> currAccessible;
 -  nsCOMPtr<nsPIAccessible> prevAccessible;
 +  nsIAccessible* accessible = nsnull;
 +  nsPIAccessible* currAccessible = nsnull;
@@ -9977,55 +9977,55 @@ diff --git a/accessible/src/xforms/nsXFo
      if (!child)
        continue;
  
 -    accService->GetAttachedAccessibleFor(child, getter_AddRefs(accessible));
 +    accService->GetAttachedAccessibleFor(child, &accessible);
      currAccessible = do_QueryInterface(accessible);
      if (!currAccessible)
        continue;
-@@ -155,7 +155,7 @@ nsXFormsAccessible::CacheSelectChildren(
+@@ -155,7 +155,7 @@
      if (prevAccessible) {
        prevAccessible->SetNextSibling(accessible);
      }
 -    currAccessible.swap(prevAccessible);
 +    swap(currAccessible, prevAccessible);
      childLength++;
    }
  
-@@ -334,8 +334,8 @@ nsXFormsEditableAccessible::GetState(PRU
+@@ -334,8 +334,8 @@
      }
    }
  
 -  nsCOMPtr<nsIEditor> editor;
 -  GetAssociatedEditor(getter_AddRefs(editor));
 +  nsIEditor* editor = nsnull;
 +  GetAssociatedEditor(&editor);
    NS_ENSURE_TRUE(editor, NS_ERROR_FAILURE);
    PRUint32 flags;
    editor->GetFlags(&flags);
-@@ -364,7 +364,7 @@ nsXFormsSelectableAccessible::
+@@ -364,7 +364,7 @@
    nsXFormsSelectableAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell) :
    nsXFormsEditableAccessible(aNode, aShell)
  {
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
    if (!content)
      return;
  
-@@ -379,7 +379,7 @@ nsXFormsSelectableAccessible::GetSelecte
+@@ -379,7 +379,7 @@
  
    *aAccessibles = nsnull;
  
 -  nsCOMPtr<nsIMutableArray> accessibles =
 +  nsIMutableArray* accessibles =
      do_CreateInstance(NS_ARRAY_CONTRACTID);
    NS_ENSURE_TRUE(accessibles, NS_ERROR_OUT_OF_MEMORY);
  
-@@ -389,16 +389,16 @@ nsXFormsSelectableAccessible::GetSelecte
+@@ -389,16 +389,16 @@
    nsresult rv;
  
    if (mIsSelect1Element) {
 -    nsCOMPtr<nsIDOMNode> item;
 +    nsIDOMNode* item = nsnull;
      rv = sXFormsService->GetSelectedItemForSelect1(mDOMNode,
 -                                                   getter_AddRefs(item));
 +                                                   &item);
@@ -10036,79 +10036,79 @@ diff --git a/accessible/src/xforms/nsXFo
  
 -    nsCOMPtr<nsIAccessible> accessible;
 -    accService->GetAccessibleFor(item, getter_AddRefs(accessible));
 +    nsIAccessible* accessible = nsnull;
 +    accService->GetAccessibleFor(item, &accessible);
      NS_ENSURE_TRUE(accessible, NS_ERROR_FAILURE);
  
      accessibles->AppendElement(accessible, PR_FALSE);
-@@ -406,9 +406,9 @@ nsXFormsSelectableAccessible::GetSelecte
+@@ -406,9 +406,9 @@
      return NS_OK;
    }
  
 -  nsCOMPtr<nsIDOMNodeList> items;
 +  nsIDOMNodeList* items = nsnull;
    rv = sXFormsService->GetSelectedItemsForSelect(mDOMNode,
 -                                                 getter_AddRefs(items));
 +                                                 &items);
    NS_ENSURE_SUCCESS(rv, rv);
  
    if (!items)
-@@ -420,12 +420,12 @@ nsXFormsSelectableAccessible::GetSelecte
+@@ -420,12 +420,12 @@
      return NS_OK;
  
    for (PRUint32 index = 0; index < length; index++) {
 -    nsCOMPtr<nsIDOMNode> item;
 -    items->Item(index, getter_AddRefs(item));
 +    nsIDOMNode* item = nsnull;
 +    items->Item(index, &item);
      NS_ENSURE_TRUE(item, NS_ERROR_FAILURE);
  
 -    nsCOMPtr<nsIAccessible> accessible;
 -    accService->GetAccessibleFor(item, getter_AddRefs(accessible));
 +    nsIAccessible* accessible = nsnull;
 +    accService->GetAccessibleFor(item, &accessible);
      NS_ENSURE_TRUE(accessible, NS_ERROR_FAILURE);
  
      accessibles->AppendElement(accessible, PR_FALSE);
-@@ -444,9 +444,9 @@ nsXFormsSelectableAccessible::GetSelecti
+@@ -444,9 +444,9 @@
  
    nsresult rv;
    if (mIsSelect1Element) {
 -    nsCOMPtr<nsIDOMNode> item;
 +    nsIDOMNode* item = nsnull;
      rv = sXFormsService->GetSelectedItemForSelect1(mDOMNode,
 -                                                   getter_AddRefs(item));
 +                                                   &item);
      NS_ENSURE_SUCCESS(rv, rv);
  
      if (item)
-@@ -455,9 +455,9 @@ nsXFormsSelectableAccessible::GetSelecti
+@@ -455,9 +455,9 @@
      return NS_OK;
    }
  
 -  nsCOMPtr<nsIDOMNodeList> items;
 +  nsIDOMNodeList* items = nsnull;
    rv = sXFormsService->GetSelectedItemsForSelect(mDOMNode,
 -                                                 getter_AddRefs(items));
 +                                                 &items);
    NS_ENSURE_SUCCESS(rv, rv);
  
    if (!items)
-@@ -474,7 +474,7 @@ NS_IMETHODIMP
+@@ -474,7 +474,7 @@
  NS_IMETHODIMP
  nsXFormsSelectableAccessible::AddChildToSelection(PRInt32 aIndex)
  {
 -  nsCOMPtr<nsIDOMNode> item = GetItemByIndex(&aIndex);
 +  nsIDOMNode* item = GetItemByIndex(&aIndex);
    if (!item)
      return NS_OK;
  
-@@ -487,15 +487,15 @@ NS_IMETHODIMP
+@@ -487,15 +487,15 @@
  NS_IMETHODIMP
  nsXFormsSelectableAccessible::RemoveChildFromSelection(PRInt32 aIndex)
  {
 -  nsCOMPtr<nsIDOMNode> item = GetItemByIndex(&aIndex);
 +  nsIDOMNode* item = GetItemByIndex(&aIndex);
    if (!item)
      return NS_OK;
  
@@ -10117,57 +10117,57 @@ diff --git a/accessible/src/xforms/nsXFo
 -    nsCOMPtr<nsIDOMNode> selitem;
 +    nsIDOMNode* selitem = nsnull;
      rv = sXFormsService->GetSelectedItemForSelect1(mDOMNode,
 -                                                   getter_AddRefs(selitem));
 +                                                   &selitem);
      NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
  
      if (selitem != item)
-@@ -521,9 +521,9 @@ nsXFormsSelectableAccessible::RefSelecti
+@@ -521,9 +521,9 @@
      if (aIndex != 0)
        return NS_OK;
  
 -    nsCOMPtr<nsIDOMNode> item;
 +    nsIDOMNode* item = nsnull;
      rv = sXFormsService->GetSelectedItemForSelect1(mDOMNode,
 -                                                   getter_AddRefs(item));
 +                                                   &item);
      NS_ENSURE_SUCCESS(rv, rv);
  
      if (item)
-@@ -531,9 +531,9 @@ nsXFormsSelectableAccessible::RefSelecti
+@@ -531,9 +531,9 @@
      return NS_OK;
    }
  
 -  nsCOMPtr<nsIDOMNodeList> items;
 +  nsIDOMNodeList* items = nsnull;
    rv = sXFormsService->GetSelectedItemsForSelect(mDOMNode,
 -                                                 getter_AddRefs(items));
 +                                                 &items);
    NS_ENSURE_SUCCESS(rv, rv);
  
    if (!items)
-@@ -544,11 +544,11 @@ nsXFormsSelectableAccessible::RefSelecti
+@@ -544,11 +544,11 @@
    if (aIndex < 0 || PRUint32(aIndex) >= length)
      return NS_OK;
  
 -  nsCOMPtr<nsIDOMNode> item;
 -  items->Item(aIndex, getter_AddRefs(item));
 +  nsIDOMNode* item = nsnull;
 +  items->Item(aIndex, &item);
  
 -  nsCOMPtr<nsIAccessible> accessible;
 -  return accService->GetAccessibleFor(item, getter_AddRefs(accessible));
 +  nsIAccessible* accessible = nsnull;
 +  return accService->GetAccessibleFor(item, &accessible);
  }
  
  NS_IMETHODIMP
-@@ -558,15 +558,15 @@ nsXFormsSelectableAccessible::IsChildSel
+@@ -558,15 +558,15 @@
    NS_ENSURE_ARG_POINTER(aIsSelected);
    *aIsSelected = PR_FALSE;
  
 -  nsCOMPtr<nsIDOMNode> item = GetItemByIndex(&aIndex);
 +  nsIDOMNode* item = GetItemByIndex(&aIndex);
    if (!item)
      return NS_OK;
  
@@ -10176,17 +10176,17 @@ diff --git a/accessible/src/xforms/nsXFo
 -    nsCOMPtr<nsIDOMNode> selitem;
 +    nsIDOMNode* selitem = nsnull;
      rv = sXFormsService->GetSelectedItemForSelect1(mDOMNode,
 -                                                   getter_AddRefs(selitem));
 +                                                   &selitem);
      NS_ENSURE_SUCCESS(rv, rv);
  
      if (selitem == item)
-@@ -600,33 +600,33 @@ nsXFormsSelectableAccessible::SelectAllS
+@@ -600,33 +600,33 @@
    return sXFormsService->SelectAllItemsForSelect(mDOMNode);
  }
  
 -already_AddRefed<nsIDOMNode>
 +nsIDOMNode*
  nsXFormsSelectableAccessible::GetItemByIndex(PRInt32 *aIndex,
                                               nsIAccessible *aAccessible)
  {
@@ -10221,30 +10221,30 @@ diff --git a/accessible/src/xforms/nsXFo
              }
              --*aIndex;
            } else if (nodeInfo->Equals(nsAccessibilityAtoms::choices)) {
 -            nsIDOMNode *itemNode = GetItemByIndex(aIndex, curAccChild).get();
 +            nsIDOMNode *itemNode = GetItemByIndex(aIndex, curAccChild);
              if (itemNode)
                return itemNode;
            }
-@@ -634,9 +634,9 @@ nsXFormsSelectableAccessible::GetItemByI
+@@ -634,9 +634,9 @@
        }
      }
  
 -    nsCOMPtr<nsIAccessible> nextAccChild;
 -    curAccChild->GetNextSibling(getter_AddRefs(nextAccChild));
 -    curAccChild.swap(nextAccChild);
 +    nsIAccessible* nextAccChild = nsnull;
 +    curAccChild->GetNextSibling(&nextAccChild);
 +    swap(curAccChild, nextAccChild);
    }
  
    return nsnull;
-@@ -680,17 +680,17 @@ nsXFormsSelectableItemAccessible::IsItem
+@@ -680,17 +680,17 @@
  {
    nsresult rv;
  
 -  nsCOMPtr<nsINode> parent = do_QueryInterface(mDOMNode);
 +  nsINode* parent = do_QueryInterface(mDOMNode);
    while (parent = parent->GetNodeParent()) {
 -    nsCOMPtr<nsIContent> content(do_QueryInterface(parent));
 +    nsIContent* content(do_QueryInterface(parent));
@@ -10256,211 +10256,211 @@ diff --git a/accessible/src/xforms/nsXFo
      if (!nodeinfo->NamespaceEquals(NS_LITERAL_STRING(NS_NAMESPACE_XFORMS)))
        continue;
  
 -    nsCOMPtr<nsIDOMNode> select(do_QueryInterface(parent));
 +    nsIDOMNode* select(do_QueryInterface(parent));
      if (!select)
        continue;
  
-@@ -701,9 +701,9 @@ nsXFormsSelectableItemAccessible::IsItem
+@@ -701,9 +701,9 @@
      }
  
      if (nodeinfo->Equals(nsAccessibilityAtoms::select1)) {
 -      nsCOMPtr<nsIDOMNode> selitem;
 +      nsIDOMNode* selitem = nsnull;
        rv = sXFormsService->GetSelectedItemForSelect1(select,
 -                                                     getter_AddRefs(selitem));
 +                                                     &selitem);
        return NS_SUCCEEDED(rv) && (selitem == mDOMNode);
      }
    }
-diff --git a/accessible/src/xforms/nsXFormsAccessible.h b/accessible/src/xforms/nsXFormsAccessible.h
---- a/accessible/src/xforms/nsXFormsAccessible.h
-+++ b/accessible/src/xforms/nsXFormsAccessible.h
-@@ -165,7 +165,7 @@ public:
+diff -r 332906b0e686 accessible/src/xforms/nsXFormsAccessible.h
+--- a/accessible/src/xforms/nsXFormsAccessible.h	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/xforms/nsXFormsAccessible.h	Fri Jul 04 01:35:36 2008 -0700
+@@ -165,7 +165,7 @@
    NS_DECL_NSIACCESSIBLESELECTABLE
  
  protected:
 -  already_AddRefed<nsIDOMNode> GetItemByIndex(PRInt32 *aIndex,
 +  nsIDOMNode* GetItemByIndex(PRInt32 *aIndex,
                                                nsIAccessible *aAccessible = nsnull);
    PRBool mIsSelect1Element;
  };
-diff --git a/accessible/src/xforms/nsXFormsWidgetsAccessible.cpp b/accessible/src/xforms/nsXFormsWidgetsAccessible.cpp
---- a/accessible/src/xforms/nsXFormsWidgetsAccessible.cpp
-+++ b/accessible/src/xforms/nsXFormsWidgetsAccessible.cpp
-@@ -203,8 +203,8 @@ void
+diff -r 332906b0e686 accessible/src/xforms/nsXFormsWidgetsAccessible.cpp
+--- a/accessible/src/xforms/nsXFormsWidgetsAccessible.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/xforms/nsXFormsWidgetsAccessible.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -203,8 +203,8 @@
  void
  nsXFormsComboboxPopupWidgetAccessible::CacheChildren()
  {
 -  nsCOMPtr<nsIDOMNode> parent;
 -  mDOMNode->GetParentNode(getter_AddRefs(parent));
 +  nsIDOMNode* parent = nsnull;
 +  mDOMNode->GetParentNode(&parent);
  
    // Parent node must be an xforms:select1 element.
    CacheSelectChildren(parent);
-diff --git a/accessible/src/xul/nsXULColorPickerAccessible.cpp b/accessible/src/xul/nsXULColorPickerAccessible.cpp
---- a/accessible/src/xul/nsXULColorPickerAccessible.cpp
-+++ b/accessible/src/xul/nsXULColorPickerAccessible.cpp
-@@ -77,7 +77,7 @@ nsXULColorPickerTileAccessible::GetState
+diff -r 332906b0e686 accessible/src/xul/nsXULColorPickerAccessible.cpp
+--- a/accessible/src/xul/nsXULColorPickerAccessible.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/xul/nsXULColorPickerAccessible.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -77,7 +77,7 @@
    *aState |= nsIAccessibleStates::STATE_FOCUSABLE;
  
    // Focused?
 -  nsCOMPtr<nsIDOMElement> element(do_QueryInterface(mDOMNode));
 +  nsIDOMElement* element(do_QueryInterface(mDOMNode));
    NS_ASSERTION(element, "No XUL Element for colorpicker");
    PRBool isFocused = PR_FALSE;
    element->HasAttribute(NS_LITERAL_STRING("hover"), &isFocused);
-@@ -102,7 +102,7 @@ NS_IMETHODIMP nsXULColorPickerTileAccess
+@@ -102,7 +102,7 @@
    if (!mDOMNode)
      return NS_ERROR_FAILURE;
  
 -  nsCOMPtr<nsIDOMElement> element(do_QueryInterface(mDOMNode));
 +  nsIDOMElement* element(do_QueryInterface(mDOMNode));
    NS_ASSERTION(element, "No XUL Element for colorpicker");
    return element->GetAttribute(NS_LITERAL_STRING("color"), _retval);
  }
-diff --git a/accessible/src/xul/nsXULFormControlAccessible.cpp b/accessible/src/xul/nsXULFormControlAccessible.cpp
---- a/accessible/src/xul/nsXULFormControlAccessible.cpp
-+++ b/accessible/src/xul/nsXULFormControlAccessible.cpp
-@@ -124,7 +124,7 @@ nsXULButtonAccessible::GetState(PRUint32
+diff -r 332906b0e686 accessible/src/xul/nsXULFormControlAccessible.cpp
+--- a/accessible/src/xul/nsXULFormControlAccessible.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/xul/nsXULFormControlAccessible.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -124,7 +124,7 @@
      return NS_OK;
  
    PRBool disabled = PR_FALSE;
 -  nsCOMPtr<nsIDOMXULControlElement> xulFormElement(do_QueryInterface(mDOMNode));
 +  nsIDOMXULControlElement* xulFormElement(do_QueryInterface(mDOMNode));
    if (xulFormElement) {
      xulFormElement->GetDisabled(&disabled);
      if (disabled)
-@@ -134,7 +134,7 @@ nsXULButtonAccessible::GetState(PRUint32
+@@ -134,7 +134,7 @@
    }
  
    // Buttons can be checked -- they simply appear pressed in rather than checked
 -  nsCOMPtr<nsIDOMXULButtonElement> xulButtonElement(do_QueryInterface(mDOMNode));
 +  nsIDOMXULButtonElement* xulButtonElement(do_QueryInterface(mDOMNode));
    if (xulButtonElement) {
      nsAutoString type;
      xulButtonElement->GetType(type);
-@@ -153,7 +153,7 @@ nsXULButtonAccessible::GetState(PRUint32
+@@ -153,7 +153,7 @@
      }
    }
  
 -  nsCOMPtr<nsIDOMElement> element(do_QueryInterface(mDOMNode));
 +  nsIDOMElement* element(do_QueryInterface(mDOMNode));
    if (element) {
      PRBool isDefault = PR_FALSE;
      element->HasAttribute(NS_LITERAL_STRING("default"), &isDefault) ;
-@@ -184,7 +184,7 @@ void nsXULButtonAccessible::CacheChildre
+@@ -184,7 +184,7 @@
      GetAllowsAnonChildAccessibles(&allowsAnonChildren);
      nsAccessibleTreeWalker walker(mWeakShell, mDOMNode, allowsAnonChildren);
      walker.GetFirstChild();
 -    nsCOMPtr<nsIAccessible> dropMarkerAccessible;
 +    nsIAccessible* dropMarkerAccessible = nsnull;
      while (walker.mState.accessible) {
        dropMarkerAccessible = walker.mState.accessible;
        walker.GetNextSibling();
-@@ -199,7 +199,7 @@ void nsXULButtonAccessible::CacheChildre
+@@ -199,7 +199,7 @@
        if (NS_SUCCEEDED(dropMarkerAccessible->GetRole(&role)) &&
            role == nsIAccessibleRole::ROLE_PUSHBUTTON) {
          SetFirstChild(dropMarkerAccessible);
 -        nsCOMPtr<nsPIAccessible> privChildAcc = do_QueryInterface(dropMarkerAccessible);
 +        nsPIAccessible* privChildAcc = do_QueryInterface(dropMarkerAccessible);
          privChildAcc->SetNextSibling(nsnull);
          privChildAcc->SetParent(this);
          mAccChildCount = 1;
-@@ -233,9 +233,9 @@ PRBool nsXULDropmarkerAccessible::Dropma
+@@ -233,9 +233,9 @@
  {
    PRBool isOpen = PR_FALSE;
  
 -  nsCOMPtr<nsIDOMNode> parentButtonNode;
 -  mDOMNode->GetParentNode(getter_AddRefs(parentButtonNode));
 -  nsCOMPtr<nsIDOMXULButtonElement> parentButtonElement(do_QueryInterface(parentButtonNode));
 +  nsIDOMNode* parentButtonNode = nsnull;
 +  mDOMNode->GetParentNode(&parentButtonNode);
 +  nsIDOMXULButtonElement* parentButtonElement(do_QueryInterface(parentButtonNode));
  
    if (parentButtonElement) {
      parentButtonElement->GetOpen(&isOpen);
-@@ -243,7 +243,7 @@ PRBool nsXULDropmarkerAccessible::Dropma
+@@ -243,7 +243,7 @@
        parentButtonElement->SetOpen(!isOpen);
    }
    else {
 -    nsCOMPtr<nsIDOMXULMenuListElement> parentMenuListElement(do_QueryInterface(parentButtonNode));
 +    nsIDOMXULMenuListElement* parentMenuListElement(do_QueryInterface(parentButtonNode));
      if (parentMenuListElement) {
        parentMenuListElement->GetOpen(&isOpen);
        if (aToggleOpen)
-@@ -386,7 +386,7 @@ nsXULCheckboxAccessible::GetState(PRUint
+@@ -386,7 +386,7 @@
    *aState |= nsIAccessibleStates::STATE_CHECKABLE;
    
    // Determine Checked state
 -  nsCOMPtr<nsIDOMXULCheckboxElement> xulCheckboxElement(do_QueryInterface(mDOMNode));
 +  nsIDOMXULCheckboxElement* xulCheckboxElement(do_QueryInterface(mDOMNode));
    if (xulCheckboxElement) {
      PRBool checked = PR_FALSE;
      xulCheckboxElement->GetChecked(&checked);
-@@ -422,9 +422,9 @@ nsXULGroupboxAccessible::GetName(nsAStri
+@@ -422,9 +422,9 @@
  {
    aName.Truncate();
  
 -  nsCOMPtr<nsIAccessible> label;
 +  nsIAccessible* label = nsnull;
    GetAccessibleRelated(nsIAccessibleRelation::RELATION_LABELLED_BY,
 -                       getter_AddRefs(label));
 +                       &label);
    if (label) {
      return label->GetName(aName);
    }
-@@ -448,13 +448,13 @@ nsXULGroupboxAccessible::GetAccessibleRe
+@@ -448,13 +448,13 @@
      // The label for xul:groupbox is generated from xul:label that is
      // inside the anonymous content of the xul:caption.
      // The xul:label has an accessible object but the xul:caption does not
 -    nsCOMPtr<nsIAccessible> testLabelAccessible;
 +    nsIAccessible* testLabelAccessible = nsnull;
      while (NextChild(testLabelAccessible)) {
        if (Role(testLabelAccessible) == nsIAccessibleRole::ROLE_LABEL) {
          // Ensure that it's our label
 -        nsCOMPtr<nsIAccessible> testGroupboxAccessible;
 +        nsIAccessible* testGroupboxAccessible = nsnull;
          testLabelAccessible->GetAccessibleRelated(nsIAccessibleRelation::RELATION_LABEL_FOR,
 -                                                  getter_AddRefs(testGroupboxAccessible));
 +                                                  &testGroupboxAccessible);
          if (testGroupboxAccessible == this) {
            // The <label> points back to this groupbox
            NS_ADDREF(*aRelated = testLabelAccessible);
-@@ -490,7 +490,7 @@ NS_IMETHODIMP nsXULProgressMeterAccessib
+@@ -490,7 +490,7 @@
    if (!aValue.IsEmpty()) {
      return NS_OK;
    }
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
    if (!content) {
      return NS_ERROR_FAILURE;
    }
-@@ -524,7 +524,7 @@ NS_IMETHODIMP nsXULProgressMeterAccessib
+@@ -524,7 +524,7 @@
  {
    *aCurrentValue = 0;
    nsAutoString currentValue;
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
    if (!content) {
      return NS_ERROR_FAILURE;
    }
-@@ -564,7 +564,7 @@ nsXULRadioButtonAccessible::GetState(PRU
+@@ -564,7 +564,7 @@
    
    PRBool selected = PR_FALSE;   // Radio buttons can be selected
  
 -  nsCOMPtr<nsIDOMXULSelectControlItemElement> radioButton(do_QueryInterface(mDOMNode));
 +  nsIDOMXULSelectControlItemElement* radioButton(do_QueryInterface(mDOMNode));
    if (radioButton) {
      radioButton->GetSelected(&selected);
      if (selected) {
-@@ -663,14 +663,14 @@ nsXULToolbarButtonAccessible::GetAttribu
+@@ -663,14 +663,14 @@
    nsresult rv = nsXULButtonAccessible::GetAttributesInternal(aAttributes);
    NS_ENSURE_SUCCESS(rv, rv);
  
 -  nsCOMPtr<nsIAccessible> parent(GetParent());
 +  nsIAccessible* parent(GetParent());
    PRInt32 setSize = 0;
    PRInt32 posInSet = 0;
  
@@ -10469,43 +10469,43 @@ diff --git a/accessible/src/xul/nsXULFor
 -    nsCOMPtr<nsIAccessible> tempSibling;
 -    parent->GetFirstChild(getter_AddRefs(sibling));
 +    nsIAccessible* sibling = nsnull;
 +    nsIAccessible* tempSibling = nsnull;
 +    parent->GetFirstChild(&sibling);
      while (sibling) {
        if (IsSeparator(sibling)) { // end of a group of buttons
          if (posInSet)
-@@ -681,8 +681,8 @@ nsXULToolbarButtonAccessible::GetAttribu
+@@ -681,8 +681,8 @@
          if (sibling == this)
            posInSet = setSize; // we've found our button
        }
 -      sibling->GetNextSibling(getter_AddRefs(tempSibling));
 -      sibling.swap(tempSibling);
 +      sibling->GetNextSibling(&tempSibling);
 +      swap(sibling, tempSibling);
      }
    }
    
-@@ -694,10 +694,10 @@ PRBool
+@@ -694,10 +694,10 @@
  PRBool
  nsXULToolbarButtonAccessible::IsSeparator(nsIAccessible *aAccessible)
  {
 -  nsCOMPtr<nsIDOMNode> domNode;
 -  nsCOMPtr<nsIAccessNode> accessNode(do_QueryInterface(aAccessible));
 -  accessNode->GetDOMNode(getter_AddRefs(domNode));
 -  nsCOMPtr<nsIContent> contentDomNode(do_QueryInterface(domNode));
 +  nsIDOMNode* domNode = nsnull;
 +  nsIAccessNode* accessNode(do_QueryInterface(aAccessible));
 +  accessNode->GetDOMNode(&domNode);
 +  nsIContent* contentDomNode(do_QueryInterface(domNode));
  
    if (!contentDomNode)
      return PR_FALSE;
-@@ -766,26 +766,26 @@ NS_IMETHODIMP nsXULTextFieldAccessible::
+@@ -766,26 +766,26 @@
    if (state & nsIAccessibleStates::STATE_PROTECTED)    // Don't return password text!
      return NS_ERROR_FAILURE;
  
 -  nsCOMPtr<nsIDOMXULTextBoxElement> textBox(do_QueryInterface(mDOMNode));
 +  nsIDOMXULTextBoxElement* textBox(do_QueryInterface(mDOMNode));
    if (textBox) {
      return textBox->GetValue(aValue);
    }
@@ -10527,92 +10527,92 @@ diff --git a/accessible/src/xul/nsXULFor
      textBox->GetInputField(&inputField);
      return inputField;
    }
 -  nsCOMPtr<nsIDOMXULMenuListElement> menuList = do_QueryInterface(mDOMNode);
 +  nsIDOMXULMenuListElement* menuList = do_QueryInterface(mDOMNode);
    if (menuList) {   // <xul:menulist droppable="false">
      menuList->GetInputField(&inputField);
    }
-@@ -801,7 +801,7 @@ nsXULTextFieldAccessible::GetState(PRUin
+@@ -801,7 +801,7 @@
    if (!mDOMNode)
      return NS_OK;
  
 -  nsCOMPtr<nsIDOMNode> inputField = GetInputField();
 +  nsIDOMNode* inputField = GetInputField();
    NS_ENSURE_TRUE(inputField, NS_ERROR_FAILURE);
  
    // Create a temporary accessible from the HTML text field
-@@ -811,7 +811,7 @@ nsXULTextFieldAccessible::GetState(PRUin
+@@ -811,7 +811,7 @@
      new nsHTMLTextFieldAccessible(inputField, mWeakShell);
    if (!tempAccessible)
      return NS_ERROR_OUT_OF_MEMORY;
 -  nsCOMPtr<nsIAccessible> kungFuDeathGrip = tempAccessible;
 +  nsIAccessible* kungFuDeathGrip = tempAccessible;
    rv = tempAccessible->GetState(aState, nsnull);
    NS_ENSURE_SUCCESS(rv, rv);
  
-@@ -819,10 +819,10 @@ nsXULTextFieldAccessible::GetState(PRUin
+@@ -819,10 +819,10 @@
      *aState |= nsIAccessibleStates::STATE_FOCUSED;
    }
  
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
    NS_ASSERTION(content, "Not possible since we have an mDOMNode");
  
 -  nsCOMPtr<nsIDOMXULMenuListElement> menuList(do_QueryInterface(mDOMNode));
 +  nsIDOMXULMenuListElement* menuList(do_QueryInterface(mDOMNode));
    if (menuList) {
      // <xul:menulist droppable="false">
      if (!content->AttrValueIs(kNameSpaceID_None, nsAccessibilityAtoms::editable,
-@@ -861,7 +861,7 @@ NS_IMETHODIMP nsXULTextFieldAccessible::
+@@ -861,7 +861,7 @@
  NS_IMETHODIMP nsXULTextFieldAccessible::GetRole(PRUint32 *aRole)
  {
    *aRole = nsIAccessibleRole::ROLE_ENTRY;
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
    if (content &&
        content->AttrValueIs(kNameSpaceID_None, nsAccessibilityAtoms::type,
                             nsAccessibilityAtoms::password, eIgnoreCase)) {
-@@ -898,7 +898,7 @@ NS_IMETHODIMP nsXULTextFieldAccessible::
+@@ -898,7 +898,7 @@
  NS_IMETHODIMP nsXULTextFieldAccessible::DoAction(PRUint8 index)
  {
    if (index == 0) {
 -    nsCOMPtr<nsIDOMXULElement> element(do_QueryInterface(mDOMNode));
 +    nsIDOMXULElement* element(do_QueryInterface(mDOMNode));
      if (element)
      {
        element->Focus();
-@@ -919,8 +919,8 @@ NS_IMETHODIMP nsXULTextFieldAccessible::
+@@ -919,8 +919,8 @@
  NS_IMETHODIMP nsXULTextFieldAccessible::GetAssociatedEditor(nsIEditor **aEditor)
  {
    *aEditor = nsnull;
 -  nsCOMPtr<nsIDOMNode> inputField = GetInputField();
 -  nsCOMPtr<nsIDOMNSEditableElement> editableElt(do_QueryInterface(inputField));
 +  nsIDOMNode* inputField = GetInputField();
 +  nsIDOMNSEditableElement* editableElt(do_QueryInterface(inputField));
    NS_ENSURE_TRUE(editableElt, NS_ERROR_FAILURE);
    return editableElt->GetEditor(aEditor);
  }
-diff --git a/accessible/src/xul/nsXULFormControlAccessible.h b/accessible/src/xul/nsXULFormControlAccessible.h
---- a/accessible/src/xul/nsXULFormControlAccessible.h
-+++ b/accessible/src/xul/nsXULFormControlAccessible.h
-@@ -175,7 +175,7 @@ public:
+diff -r 332906b0e686 accessible/src/xul/nsXULFormControlAccessible.h
+--- a/accessible/src/xul/nsXULFormControlAccessible.h	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/xul/nsXULFormControlAccessible.h	Fri Jul 04 01:35:36 2008 -0700
+@@ -175,7 +175,7 @@
    NS_IMETHOD GetAssociatedEditor(nsIEditor **aEditor);
  
  protected:
 -  already_AddRefed<nsIDOMNode> GetInputField();
 +  nsIDOMNode* GetInputField();
  };
  
  
-diff --git a/accessible/src/xul/nsXULMenuAccessible.cpp b/accessible/src/xul/nsXULMenuAccessible.cpp
---- a/accessible/src/xul/nsXULMenuAccessible.cpp
-+++ b/accessible/src/xul/nsXULMenuAccessible.cpp
-@@ -84,14 +84,14 @@ nsresult nsXULSelectableAccessible::Chan
+diff -r 332906b0e686 accessible/src/xul/nsXULMenuAccessible.cpp
+--- a/accessible/src/xul/nsXULMenuAccessible.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/xul/nsXULMenuAccessible.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -84,14 +84,14 @@
    if (!mSelectControl) {
      return NS_ERROR_FAILURE;
    }
 -  nsCOMPtr<nsIAccessible> childAcc;
 -  GetChildAt(aIndex, getter_AddRefs(childAcc));
 -  nsCOMPtr<nsIAccessNode> accNode = do_QueryInterface(childAcc);
 +  nsIAccessible* childAcc = nsnull;
 +  GetChildAt(aIndex, &childAcc);
@@ -10623,26 +10623,26 @@ diff --git a/accessible/src/xul/nsXULMen
 -  accNode->GetDOMNode(getter_AddRefs(childNode));
 -  nsCOMPtr<nsIDOMXULSelectControlItemElement> item(do_QueryInterface(childNode));
 +  nsIDOMNode* childNode = nsnull;
 +  accNode->GetDOMNode(&childNode);
 +  nsIDOMXULSelectControlItemElement* item(do_QueryInterface(childNode));
    NS_ENSURE_TRUE(item, NS_ERROR_FAILURE);
  
    item->GetSelected(aSelState);
-@@ -99,7 +99,7 @@ nsresult nsXULSelectableAccessible::Chan
+@@ -99,7 +99,7 @@
      return NS_OK;
    }
  
 -  nsCOMPtr<nsIDOMXULMultiSelectControlElement> xulMultiSelect =
 +  nsIDOMXULMultiSelectControlElement* xulMultiSelect =
      do_QueryInterface(mSelectControl);
  
    if (eSelection_Add == aMethod && !(*aSelState)) {
-@@ -121,37 +121,37 @@ NS_IMETHODIMP nsXULSelectableAccessible:
+@@ -121,37 +121,37 @@
      return NS_ERROR_FAILURE;
    }
  
 -  nsCOMPtr<nsIAccessibilityService> accService = GetAccService();
 +  nsIAccessibilityService* accService = GetAccService();
    NS_ENSURE_TRUE(accService, NS_ERROR_FAILURE);
  
 -  nsCOMPtr<nsIMutableArray> selectedAccessibles =
@@ -10682,17 +10682,17 @@ diff --git a/accessible/src/xul/nsXULMen
 +    nsIDOMNode* selectedNode(do_QueryInterface(selectedItem));
      if(selectedNode) {
        accService->GetAccessibleInWeakShell(selectedNode, mWeakShell,
 -                                           getter_AddRefs(selectedAccessible));
 +                                           &selectedAccessible);
        if (selectedAccessible)
          selectedAccessibles->AppendElement(selectedAccessible, PR_FALSE);
      }
-@@ -174,17 +174,17 @@ NS_IMETHODIMP nsXULSelectableAccessible:
+@@ -174,17 +174,17 @@
      return NS_ERROR_FAILURE;
    }
  
 -  nsCOMPtr<nsIDOMXULSelectControlItemElement> selectedItem;
 -  nsCOMPtr<nsIDOMXULMultiSelectControlElement> xulMultiSelect =
 +  nsIDOMXULSelectControlItemElement* selectedItem = nsnull;
 +  nsIDOMXULMultiSelectControlElement* xulMultiSelect =
      do_QueryInterface(mSelectControl);
@@ -10705,144 +10705,144 @@ diff --git a/accessible/src/xul/nsXULMen
 +    mSelectControl->GetSelectedItem(&selectedItem);
  
    if (selectedItem) {
 -    nsCOMPtr<nsIAccessibilityService> accService = GetAccService();
 +    nsIAccessibilityService* accService = GetAccService();
      if (accService) {
        accService->GetAccessibleInWeakShell(selectedItem, mWeakShell, aAccessible);
        if (*aAccessible) {
-@@ -205,7 +205,7 @@ NS_IMETHODIMP nsXULSelectableAccessible:
+@@ -205,7 +205,7 @@
    }
  
    // For XUL multi-select control
 -  nsCOMPtr<nsIDOMXULMultiSelectControlElement> xulMultiSelect =
 +  nsIDOMXULMultiSelectControlElement* xulMultiSelect =
      do_QueryInterface(mSelectControl);
    if (xulMultiSelect)
      return xulMultiSelect->GetSelectedCount(aSelectionCount);
-@@ -241,7 +241,7 @@ NS_IMETHODIMP nsXULSelectableAccessible:
+@@ -241,7 +241,7 @@
    if (!mSelectControl) {
      return NS_ERROR_FAILURE;
    }
 -  nsCOMPtr<nsIDOMXULMultiSelectControlElement> xulMultiSelect =
 +  nsIDOMXULMultiSelectControlElement* xulMultiSelect =
      do_QueryInterface(mSelectControl);
    return xulMultiSelect ? xulMultiSelect->ClearSelection() : mSelectControl->SetSelectedIndex(-1);
  }
-@@ -250,7 +250,7 @@ NS_IMETHODIMP nsXULSelectableAccessible:
+@@ -250,7 +250,7 @@
  {
    *aSucceeded = PR_TRUE;
  
 -  nsCOMPtr<nsIDOMXULMultiSelectControlElement> xulMultiSelect =
 +  nsIDOMXULMultiSelectControlElement* xulMultiSelect =
      do_QueryInterface(mSelectControl);
    if (xulMultiSelect)
      return xulMultiSelect->SelectAll();
-@@ -285,7 +285,7 @@ nsXULMenuitemAccessible::GetState(PRUint
+@@ -285,7 +285,7 @@
    }
  
    // Focused?
 -  nsCOMPtr<nsIDOMElement> element(do_QueryInterface(mDOMNode));
 +  nsIDOMElement* element(do_QueryInterface(mDOMNode));
    if (!element)
      return NS_ERROR_FAILURE;
    PRBool isFocused = PR_FALSE;
-@@ -331,14 +331,14 @@ nsXULMenuitemAccessible::GetState(PRUint
+@@ -331,14 +331,14 @@
    if (isComboboxOption) {
      // Is selected?
      PRBool isSelected = PR_FALSE;
 -    nsCOMPtr<nsIDOMXULSelectControlItemElement>
 +    nsIDOMXULSelectControlItemElement*
        item(do_QueryInterface(mDOMNode));
      NS_ENSURE_TRUE(item, NS_ERROR_FAILURE);
      item->GetSelected(&isSelected);
  
      // Is collapsed?
      PRBool isCollapsed = PR_FALSE;
 -    nsCOMPtr<nsIAccessible> parentAccessible(GetParent());
 +    nsIAccessible* parentAccessible(GetParent());
      if (parentAccessible &&
          State(parentAccessible) & nsIAccessibleStates::STATE_INVISIBLE) {
        isCollapsed = PR_TRUE;
-@@ -350,8 +350,8 @@ nsXULMenuitemAccessible::GetState(PRUint
+@@ -350,8 +350,8 @@
        // Selected and collapsed?
        if (isCollapsed) {
          // Set selected option offscreen/invisible according to combobox state
 -        nsCOMPtr<nsIAccessible> grandParentAcc;
 -        parentAccessible->GetParent(getter_AddRefs(grandParentAcc));
 +        nsIAccessible* grandParentAcc = nsnull;
 +        parentAccessible->GetParent(&grandParentAcc);
          NS_ENSURE_TRUE(grandParentAcc, NS_ERROR_FAILURE);
          NS_ASSERTION((Role(grandParentAcc) == nsIAccessibleRole::ROLE_COMBOBOX),
                       "grandparent of combobox listitem is not combobox");
-@@ -373,7 +373,7 @@ nsXULMenuitemAccessible::GetState(PRUint
+@@ -373,7 +373,7 @@
    // and whose metric setting does allow disabled items to be focused.
    if (*aState & nsIAccessibleStates::STATE_UNAVAILABLE) {
      // Honour the LookAndFeel metric.
 -    nsCOMPtr<nsILookAndFeel> lookNFeel(do_GetService(kLookAndFeelCID));
 +    nsILookAndFeel* lookNFeel(do_GetService(kLookAndFeelCID));
      PRInt32 skipDisabledMenuItems = 0;
      lookNFeel->GetMetric(nsILookAndFeel::eMetric_SkipNavigatingDisabledMenuItem,
                           skipDisabledMenuItems);
-@@ -391,7 +391,7 @@ nsXULMenuitemAccessible::GetState(PRUint
+@@ -391,7 +391,7 @@
  
  NS_IMETHODIMP nsXULMenuitemAccessible::GetName(nsAString& _retval)
  {
 -  nsCOMPtr<nsIDOMElement> element(do_QueryInterface(mDOMNode));
 +  nsIDOMElement* element(do_QueryInterface(mDOMNode));
    if (!element) {
      return NS_ERROR_FAILURE;
    }
-@@ -402,7 +402,7 @@ NS_IMETHODIMP nsXULMenuitemAccessible::G
+@@ -402,7 +402,7 @@
  
  NS_IMETHODIMP nsXULMenuitemAccessible::GetDescription(nsAString& aDescription)
  {
 -  nsCOMPtr<nsIDOMElement> element(do_QueryInterface(mDOMNode));
 +  nsIDOMElement* element(do_QueryInterface(mDOMNode));
    if (!element) {
      return NS_ERROR_FAILURE;
    }
-@@ -419,7 +419,7 @@ nsXULMenuitemAccessible::GetKeyboardShor
+@@ -419,7 +419,7 @@
  
    static PRInt32 gMenuAccesskeyModifier = -1;  // magic value of -1 indicates unitialized state
  
 -  nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(mDOMNode));
 +  nsIDOMElement* elt(do_QueryInterface(mDOMNode));
    if (elt) {
      nsAutoString accesskey;
      // We do not use nsAccUtils::GetAccesskeyFor() because accesskeys for
-@@ -428,7 +428,7 @@ nsXULMenuitemAccessible::GetKeyboardShor
+@@ -428,7 +428,7 @@
      if (accesskey.IsEmpty())
        return NS_OK;
  
 -    nsCOMPtr<nsIAccessible> parentAccessible(GetParent());
 +    nsIAccessible* parentAccessible(GetParent());
      if (parentAccessible) {
        PRUint32 role;
        parentAccessible->GetRole(&role);
-@@ -438,7 +438,7 @@ nsXULMenuitemAccessible::GetKeyboardShor
+@@ -438,7 +438,7 @@
          if (gMenuAccesskeyModifier == -1) {
            // Need to initialize cached global accesskey pref
            gMenuAccesskeyModifier = 0;
 -          nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID));
 +          nsIPrefBranch* prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID));
            if (prefBranch)
              prefBranch->GetIntPref("ui.key.menuAccessKey", &gMenuAccesskeyModifier);
          }
-@@ -465,7 +465,7 @@ nsXULMenuitemAccessible::GetDefaultKeyBi
+@@ -465,7 +465,7 @@
  {
    aKeyBinding.Truncate();
  
 -  nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(mDOMNode));
 +  nsIDOMElement* elt(do_QueryInterface(mDOMNode));
    NS_ENSURE_TRUE(elt, NS_ERROR_FAILURE);
  
    nsAutoString accelText;
-@@ -480,21 +480,21 @@ nsXULMenuitemAccessible::GetDefaultKeyBi
+@@ -480,21 +480,21 @@
  
  NS_IMETHODIMP nsXULMenuitemAccessible::GetRole(PRUint32 *aRole)
  {
 -  nsCOMPtr<nsIDOMXULContainerElement> xulContainer(do_QueryInterface(mDOMNode));
 +  nsIDOMXULContainerElement* xulContainer(do_QueryInterface(mDOMNode));
    if (xulContainer) {
      *aRole = nsIAccessibleRole::ROLE_PARENT_MENUITEM;
      return NS_OK;
@@ -10858,180 +10858,180 @@ diff --git a/accessible/src/xul/nsXULMen
    }
  
    *aRole = nsIAccessibleRole::ROLE_MENUITEM;
 -  nsCOMPtr<nsIDOMElement> element(do_QueryInterface(mDOMNode));
 +  nsIDOMElement* element(do_QueryInterface(mDOMNode));
    if (!element)
      return NS_ERROR_FAILURE;
    nsAutoString menuItemType;
-@@ -610,8 +610,8 @@ nsXULMenupopupAccessible::nsXULMenupopup
+@@ -610,8 +610,8 @@
    nsXULSelectableAccessible(aDOMNode, aShell)
  { 
    // May be the anonymous <menupopup> inside <menulist> (a combobox)
 -  nsCOMPtr<nsIDOMNode> parentNode;
 -  aDOMNode->GetParentNode(getter_AddRefs(parentNode));
 +  nsIDOMNode* parentNode = nsnull;
 +  aDOMNode->GetParentNode(&parentNode);
    mSelectControl = do_QueryInterface(parentNode);
  }
  
-@@ -651,7 +651,7 @@ nsXULMenupopupAccessible::GetState(PRUin
+@@ -651,7 +651,7 @@
    return NS_OK;
  }
  
 -already_AddRefed<nsIDOMNode>
 +nsIDOMNode*
  nsXULMenupopupAccessible::FindInNodeList(nsIDOMNodeList *aNodeList, 
                                           nsIAtom *aAtom, PRUint32 aNameSpaceID)
  {
-@@ -659,10 +659,10 @@ nsXULMenupopupAccessible::FindInNodeList
+@@ -659,10 +659,10 @@
    if (!aNodeList || NS_FAILED(aNodeList->GetLength(&numChildren))) {
      return nsnull;
    }
 -  nsCOMPtr<nsIDOMNode> childNode;
 +  nsIDOMNode* childNode = nsnull;
    for (PRUint32 childIndex = 0; childIndex < numChildren; childIndex++) {
 -    aNodeList->Item(childIndex, getter_AddRefs(childNode));
 -    nsCOMPtr<nsIContent> content = do_QueryInterface(childNode);
 +    aNodeList->Item(childIndex, &childNode);
 +    nsIContent* content = do_QueryInterface(childNode);
      if (content && content->NodeInfo()->Equals(aAtom, kNameSpaceID_XUL)) {
        nsIDOMNode *matchNode = childNode;
        NS_ADDREF(matchNode);
-@@ -676,12 +676,12 @@ void nsXULMenupopupAccessible::GenerateM
+@@ -676,12 +676,12 @@
  {
    // Set menugenerated="true" on the menupopup node to generate the
    // sub-menu items if they have not been generated
 -  nsCOMPtr<nsIDOMNodeList> nodeList;
 -  aNode->GetChildNodes(getter_AddRefs(nodeList));
 +  nsIDOMNodeList* nodeList = nsnull;
 +  aNode->GetChildNodes(&nodeList);
  
 -  nsCOMPtr<nsIDOMNode> menuPopup = FindInNodeList(nodeList, nsAccessibilityAtoms::menupopup,
 +  nsIDOMNode* menuPopup = FindInNodeList(nodeList, nsAccessibilityAtoms::menupopup,
                                                    kNameSpaceID_XUL);
 -  nsCOMPtr<nsIDOMElement> popupElement(do_QueryInterface(menuPopup));
 +  nsIDOMElement* popupElement(do_QueryInterface(menuPopup));
    if (popupElement) {
      nsAutoString attr;
      popupElement->GetAttribute(NS_LITERAL_STRING("menugenerated"), attr);
-@@ -699,7 +699,7 @@ nsXULMenupopupAccessible::GetName(nsAStr
+@@ -699,7 +699,7 @@
    if (!mDOMNode)
      return NS_ERROR_FAILURE;
  
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
    while (content && aName.IsEmpty()) {
      content->GetAttr(kNameSpaceID_None, nsAccessibilityAtoms::label, aName);
      content = content->GetParent();
-@@ -710,12 +710,12 @@ nsXULMenupopupAccessible::GetName(nsAStr
+@@ -710,12 +710,12 @@
  
  NS_IMETHODIMP nsXULMenupopupAccessible::GetRole(PRUint32 *aRole)
  {
 -  nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
 +  nsIContent* content(do_QueryInterface(mDOMNode));
    if (!content) {
      return NS_ERROR_FAILURE;
    }
 -  nsCOMPtr<nsIAccessible> parent;
 -  GetParent(getter_AddRefs(parent));
 +  nsIAccessible* parent = nsnull;
 +  GetParent(&parent);
    if (parent) {
      // Some widgets like the search bar have several popups, owned by buttons
      PRUint32 role = Role(parent);
-diff --git a/accessible/src/xul/nsXULMenuAccessible.h b/accessible/src/xul/nsXULMenuAccessible.h
---- a/accessible/src/xul/nsXULMenuAccessible.h
-+++ b/accessible/src/xul/nsXULMenuAccessible.h
-@@ -109,7 +109,7 @@ public:
+diff -r 332906b0e686 accessible/src/xul/nsXULMenuAccessible.h
+--- a/accessible/src/xul/nsXULMenuAccessible.h	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/xul/nsXULMenuAccessible.h	Fri Jul 04 01:35:36 2008 -0700
+@@ -109,7 +109,7 @@
    NS_IMETHOD GetName(nsAString& _retval); 
    NS_IMETHOD GetState(PRUint32 *aState, PRUint32 *aExtraState);
    NS_IMETHOD GetRole(PRUint32 *_retval); 
 -  static already_AddRefed<nsIDOMNode> FindInNodeList(nsIDOMNodeList *aNodeList,
 +  static nsIDOMNode* FindInNodeList(nsIDOMNodeList *aNodeList,
                                                       nsIAtom *aAtom, PRUint32 aNameSpaceID);
    static void GenerateMenu(nsIDOMNode *aNode);
  };
-diff --git a/accessible/src/xul/nsXULSelectAccessible.cpp b/accessible/src/xul/nsXULSelectAccessible.cpp
---- a/accessible/src/xul/nsXULSelectAccessible.cpp
-+++ b/accessible/src/xul/nsXULSelectAccessible.cpp
-@@ -199,7 +199,7 @@ nsXULListboxAccessible::GetState(PRUint3
+diff -r 332906b0e686 accessible/src/xul/nsXULSelectAccessible.cpp
+--- a/accessible/src/xul/nsXULSelectAccessible.cpp	Fri Jul 04 01:35:19 2008 -0700
++++ b/accessible/src/xul/nsXULSelectAccessible.cpp	Fri Jul 04 01:35:36 2008 -0700
+@@ -199,7 +199,7 @@
    }
  
  // see if we are multiple select if so set ourselves as such
 -  nsCOMPtr<nsIDOMElement> element (do_QueryInterface(mDOMNode));
 +  nsIDOMElement* element (do_QueryInterface(mDOMNode));
    if (element) {
      nsAutoString selType;
      element->GetAttribute(NS_LITERAL_STRING("seltype"), selType);
-@@ -217,10 +217,10 @@ NS_IMETHODIMP nsXULListboxAccessible::Ge
+@@ -217,10 +217,10 @@
  NS_IMETHODIMP nsXULListboxAccessible::GetValue(nsAString& _retval)
  {
    _retval.Truncate();
 -  nsCOMPtr<nsIDOMXULSelectControlElement> select(do_QueryInterface(mDOMNode));
 +  nsIDOMXULSelectControlElement* select(do_QueryInterface(mDOMNode));
    if (select) {
 -    nsCOMPtr<nsIDOMXULSelectControlItemElement> selectedItem;
 -    select->GetSelectedItem(getter_AddRefs(selectedItem));
 +    nsIDOMXULSelectControlItemElement* selectedItem = nsnull;
 +    select->GetSelectedItem(&selectedItem);
      if (selectedItem)
        return selectedItem->GetLabel(_retval);
    }
-@@ -229,11 +229,11 @@ NS_IMETHODIMP nsXULListboxAccessible::Ge
+@@ -229,11 +229,11 @@
  
  NS_IMETHODIMP nsXULListboxAccessible::GetRole(PRUint32 *aRole)
  {
 -  nsCOMPtr<nsIContent> content = do_QueryInterface(mDOMNode);<