Bug 739190 - change AppendTarget(nsIContent aContent) to take nsDocAccessible argument, r=surkov, f=eeejay
authorMark Capella <markcapella@twcny.rr.com>
Tue, 08 May 2012 09:00:29 +0900
changeset 93433 f593f893ebd7858c375f2458d27249958a115907
parent 93432 bce99efec4258cf0ec122da170d233411cd39aa0
child 93434 bfe31dbdee16fed4191826d5b419a46b04e59415
push id22634
push useremorley@mozilla.com
push dateTue, 08 May 2012 09:48:43 +0000
treeherdermozilla-central@e4f9e2eab6b1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssurkov
bugs739190
milestone15.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 739190 - change AppendTarget(nsIContent aContent) to take nsDocAccessible argument, r=surkov, f=eeejay
accessible/src/base/Relation.h
accessible/src/base/nsAccessible.cpp
accessible/src/html/HTMLFormControlAccessible.cpp
accessible/src/xul/nsXULTabAccessible.cpp
--- a/accessible/src/base/Relation.h
+++ b/accessible/src/base/Relation.h
@@ -69,19 +69,19 @@ public:
     mFirstIter(aRelation.mFirstIter), mLastIter(aRelation.mLastIter) { }
 
   Relation(AccIterable* aIter) : mFirstIter(aIter), mLastIter(aIter) { }
 
   Relation(nsAccessible* aAcc) :
     mFirstIter(nsnull), mLastIter(nsnull)
     { AppendTarget(aAcc); }
 
-  Relation(nsIContent* aContent) :
+  Relation(nsDocAccessible* aDocument, nsIContent* aContent) :
     mFirstIter(nsnull), mLastIter(nsnull)
-    { AppendTarget(aContent); }
+    { AppendTarget(aDocument, aContent); }
 
   Relation& operator = (const RelationCopyHelper& aRH)
   {
     mFirstIter = aRH.mFirstIter;
     mLastIter = aRH.mLastIter;
     return *this;
   }
 
@@ -115,20 +115,20 @@ public:
     if (aAcc)
       AppendIter(new SingleAccIterator(aAcc));
   }
 
   /**
    * Append the one accessible for this content node to the set of related
    * accessibles.
    */
-  inline void AppendTarget(nsIContent* aContent)
+  void AppendTarget(nsDocAccessible* aDocument, nsIContent* aContent)
   {
     if (aContent)
-      AppendTarget(GetAccService()->GetAccessible(aContent, nsnull));
+      AppendTarget(aDocument->GetAccessible(aContent));
   }
 
   /**
    * compute and return the next related accessible.
    */
   inline nsAccessible* Next()
   {
     nsAccessible* target = nsnull;
--- a/accessible/src/base/nsAccessible.cpp
+++ b/accessible/src/base/nsAccessible.cpp
@@ -2104,17 +2104,17 @@ nsAccessible::RelationByType(PRUint32 aT
       if (mContent->IsHTML()) {
         // HTML form controls implements nsIFormControl interface.
         nsCOMPtr<nsIFormControl> control(do_QueryInterface(mContent));
         if (control) {
           nsCOMPtr<nsIForm> form(do_QueryInterface(control->GetFormElement()));
           if (form) {
             nsCOMPtr<nsIContent> formContent =
               do_QueryInterface(form->GetDefaultSubmitElement());
-            return Relation(formContent);
+            return Relation(mDoc, formContent);
           }
         }
       } else {
         // In XUL, use first <button default="true" .../> in the document
         nsCOMPtr<nsIDOMXULDocument> xulDoc =
           do_QueryInterface(mContent->OwnerDoc());
         nsCOMPtr<nsIDOMXULButtonElement> buttonEl;
         if (xulDoc) {
@@ -2145,23 +2145,23 @@ nsAccessible::RelationByType(PRUint32 aT
                                                       NS_LITERAL_STRING("default"),
                                                       NS_LITERAL_STRING("true"),
                                                       getter_AddRefs(possibleButtonEl));
                 buttonEl = do_QueryInterface(possibleButtonEl);
               }
             }
           }
           nsCOMPtr<nsIContent> relatedContent(do_QueryInterface(buttonEl));
-          return Relation(relatedContent);
+          return Relation(mDoc, relatedContent);
         }
       }
       return Relation();
     }
     case nsIAccessibleRelation::RELATION_MEMBER_OF:
-      return Relation(GetAtomicRegion());
+      return Relation(mDoc, GetAtomicRegion());
     case nsIAccessibleRelation::RELATION_SUBWINDOW_OF:
     case nsIAccessibleRelation::RELATION_EMBEDS:
     case nsIAccessibleRelation::RELATION_EMBEDDED_BY:
     case nsIAccessibleRelation::RELATION_POPUP_FOR:
     case nsIAccessibleRelation::RELATION_PARENT_WINDOW_OF:
     default:
     return Relation();
   }
--- a/accessible/src/html/HTMLFormControlAccessible.cpp
+++ b/accessible/src/html/HTMLFormControlAccessible.cpp
@@ -699,17 +699,17 @@ HTMLGroupboxAccessible::GetNameInternal(
 }
 
 Relation
 HTMLGroupboxAccessible::RelationByType(PRUint32 aType)
 {
   Relation rel = nsHyperTextAccessibleWrap::RelationByType(aType);
     // No override for label, so use <legend> for this <fieldset>
   if (aType == nsIAccessibleRelation::RELATION_LABELLED_BY)
-    rel.AppendTarget(GetLegend());
+    rel.AppendTarget(mDoc, GetLegend());
 
   return rel;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLLegendAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
@@ -785,17 +785,17 @@ HTMLFigureAccessible::GetNameInternal(ns
   return NS_OK;
 }
 
 Relation
 HTMLFigureAccessible::RelationByType(PRUint32 aType)
 {
   Relation rel = nsHyperTextAccessibleWrap::RelationByType(aType);
   if (aType == nsIAccessibleRelation::RELATION_LABELLED_BY)
-    rel.AppendTarget(Caption());
+    rel.AppendTarget(mDoc, Caption());
 
   return rel;
 }
 
 nsIContent*
 HTMLFigureAccessible::Caption() const
 {
   for (nsIContent* childContent = mContent->GetFirstChild(); childContent;
--- a/accessible/src/xul/nsXULTabAccessible.cpp
+++ b/accessible/src/xul/nsXULTabAccessible.cpp
@@ -155,17 +155,17 @@ nsXULTabAccessible::RelationByType(PRUin
 
   nsCOMPtr<nsIDOMNode> domNode(DOMNode());
   nsCOMPtr<nsIDOMNode> tabpanelNode;
   tabsElm->GetRelatedElement(domNode, getter_AddRefs(tabpanelNode));
   if (!tabpanelNode)
     return rel;
 
   nsCOMPtr<nsIContent> tabpanelContent(do_QueryInterface(tabpanelNode));
-  rel.AppendTarget(tabpanelContent);
+  rel.AppendTarget(mDoc, tabpanelContent);
   return rel;
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULTabsAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
@@ -249,11 +249,11 @@ nsXULTabpanelAccessible::RelationByType(
 
   nsCOMPtr<nsIDOMNode> domNode(DOMNode());
   nsCOMPtr<nsIDOMNode> tabNode;
   tabpanelsElm->GetRelatedElement(domNode, getter_AddRefs(tabNode));
   if (!tabNode)
     return rel;
 
   nsCOMPtr<nsIContent> tabContent(do_QueryInterface(tabNode));
-  rel.AppendTarget(tabContent);
+  rel.AppendTarget(mDoc, tabContent);
   return rel;
 }