Bug 1258228 - create special child accessibles in owner's constructor, part1, r=marcoz
authorAlexander Surkov <surkov.alexander@gmail.com>
Thu, 31 Mar 2016 21:22:34 -0400
changeset 291169 d32bcd5bd2cf9a0e504d6ad78583c7f95bc1ccf3
parent 291168 dbb5c40ec3a2ef633a55187f2f260ec098f18932
child 291170 ed20f4a35b9a213167c869e93a30fc85ee9d78f4
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarcoz
bugs1258228
milestone48.0a1
Bug 1258228 - create special child accessibles in owner's constructor, part1, r=marcoz
accessible/generic/OuterDocAccessible.cpp
accessible/generic/OuterDocAccessible.h
--- a/accessible/generic/OuterDocAccessible.cpp
+++ b/accessible/generic/OuterDocAccessible.cpp
@@ -24,16 +24,25 @@ using namespace mozilla::a11y;
 // OuterDocAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 OuterDocAccessible::
   OuterDocAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   AccessibleWrap(aContent, aDoc)
 {
   mType = eOuterDocType;
+
+  // Request document accessible for the content document to make sure it's
+  // created. It will appended to outerdoc accessible children asynchronously.
+  nsIDocument* outerDoc = mContent->GetCurrentDoc();
+  if (outerDoc) {
+    nsIDocument* innerDoc = outerDoc->GetSubDocumentFor(mContent);
+    if (innerDoc)
+      GetAccService()->GetDocAccessible(innerDoc);
+  }
 }
 
 OuterDocAccessible::~OuterDocAccessible()
 {
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsISupports
@@ -148,33 +157,16 @@ OuterDocAccessible::RemoveChild(Accessib
   bool wasRemoved = AccessibleWrap::RemoveChild(child);
 
   NS_ASSERTION(!mChildren.Length(),
                "This child document of outerdoc accessible wasn't removed!");
 
   return wasRemoved;
 }
 
-
-////////////////////////////////////////////////////////////////////////////////
-// Accessible protected
-
-void
-OuterDocAccessible::CacheChildren()
-{
-  // Request document accessible for the content document to make sure it's
-  // created. It will appended to outerdoc accessible children asynchronously.
-  nsIDocument* outerDoc = mContent->GetCurrentDoc();
-  if (outerDoc) {
-    nsIDocument* innerDoc = outerDoc->GetSubDocumentFor(mContent);
-    if (innerDoc)
-      GetAccService()->GetDocAccessible(innerDoc);
-  }
-}
-
 ProxyAccessible*
 OuterDocAccessible::RemoteChildDoc() const
 {
   dom::TabParent* tab = dom::TabParent::GetFrom(GetContent());
   if (!tab)
     return nullptr;
 
   return tab->GetTopLevelDocAccessible();
--- a/accessible/generic/OuterDocAccessible.h
+++ b/accessible/generic/OuterDocAccessible.h
@@ -36,19 +36,16 @@ public:
   virtual Accessible* ChildAtPoint(int32_t aX, int32_t aY,
                                    EWhichChildAtPoint aWhichChild) override;
 
   virtual bool InsertChildAt(uint32_t aIdx, Accessible* aChild) override;
   virtual bool RemoveChild(Accessible* aAccessible) override;
 
 protected:
   virtual ~OuterDocAccessible() override;
-
-  // Accessible
-  virtual void CacheChildren() override;
 };
 
 inline OuterDocAccessible*
 Accessible::AsOuterDoc()
 {
   return IsOuterDoc() ? static_cast<OuterDocAccessible*>(this) : nullptr;
 }