Bug 1258228 - create special child accessibles in owner's constructor, part4, r=marcoz
authorAlexander Surkov <surkov.alexander@gmail.com>
Thu, 31 Mar 2016 21:23:03 -0400
changeset 291172 2724b036ed2b3a3bab2987a563ccc7fc64488618
parent 291171 cc5e38a943bb74b37182f5650bd12e2cfc0bac26
child 291173 9146977af0d77727c5f81a75943b1c4dd7a2f38d
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, part4, r=marcoz
accessible/windows/msaa/HTMLWin32ObjectAccessible.cpp
--- a/accessible/windows/msaa/HTMLWin32ObjectAccessible.cpp
+++ b/accessible/windows/msaa/HTMLWin32ObjectAccessible.cpp
@@ -15,18 +15,20 @@ using namespace mozilla::a11y;
 ////////////////////////////////////////////////////////////////////////////////
 
 HTMLWin32ObjectOwnerAccessible::
   HTMLWin32ObjectOwnerAccessible(nsIContent* aContent,
                                  DocAccessible* aDoc, void* aHwnd) :
   AccessibleWrap(aContent, aDoc), mHwnd(aHwnd)
 {
   // Our only child is a HTMLWin32ObjectAccessible object.
-  if (mHwnd)
+  if (mHwnd) {
     mNativeAccessible = new HTMLWin32ObjectAccessible(mHwnd, aDoc);
+    AppendChild(mNativeAccessible);
+  }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLWin32ObjectOwnerAccessible: Accessible implementation
 
 void
 HTMLWin32ObjectOwnerAccessible::Shutdown()
 {
@@ -49,18 +51,16 @@ HTMLWin32ObjectOwnerAccessible::Natively
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLWin32ObjectOwnerAccessible: Accessible protected implementation
 
 void
 HTMLWin32ObjectOwnerAccessible::CacheChildren()
 {
-  if (mNativeAccessible)
-    AppendChild(mNativeAccessible);
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLWin32ObjectAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 HTMLWin32ObjectAccessible::HTMLWin32ObjectAccessible(void* aHwnd,