Bug 1258228 - create special child accessibles in owner's constructor, part3, r=marcoz
authorAlexander Surkov <surkov.alexander@gmail.com>
Thu, 31 Mar 2016 21:22:56 -0400
changeset 291112 cc5e38a943bb74b37182f5650bd12e2cfc0bac26
parent 291111 ed20f4a35b9a213167c869e93a30fc85ee9d78f4
child 291113 2724b036ed2b3a3bab2987a563ccc7fc64488618
push id30129
push usercbook@mozilla.com
push dateFri, 01 Apr 2016 09:48:09 +0000
treeherdermozilla-central@538d248fa252 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarcoz
bugs1258228
milestone48.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 1258228 - create special child accessibles in owner's constructor, part3, r=marcoz
accessible/html/HTMLSelectAccessible.cpp
--- a/accessible/html/HTMLSelectAccessible.cpp
+++ b/accessible/html/HTMLSelectAccessible.cpp
@@ -332,16 +332,26 @@ HTMLSelectOptGroupAccessible::DoAction(u
 ////////////////////////////////////////////////////////////////////////////////
 
 HTMLComboboxAccessible::
   HTMLComboboxAccessible(nsIContent* aContent, DocAccessible* aDoc) :
   AccessibleWrap(aContent, aDoc)
 {
   mType = eHTMLComboboxType;
   mGenericTypes |= eCombobox;
+
+  nsIComboboxControlFrame* comboFrame = do_QueryFrame(GetFrame());
+  if (comboFrame) {
+    nsIFrame* listFrame = comboFrame->GetDropDown();
+    if (listFrame) {
+      mListAccessible = new HTMLComboboxListAccessible(mParent, mContent, mDoc);
+      Document()->BindToDocument(mListAccessible, nullptr);
+      AppendChild(mListAccessible);
+    }
+  }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLComboboxAccessible: Accessible
 
 role
 HTMLComboboxAccessible::NativeRole()
 {
@@ -357,36 +367,16 @@ HTMLComboboxAccessible::RemoveChild(Acce
     return true;
   }
   return false;
 }
 
 void
 HTMLComboboxAccessible::CacheChildren()
 {
-  nsIComboboxControlFrame* comboFrame = do_QueryFrame(GetFrame());
-  if (!comboFrame)
-    return;
-
-  nsIFrame* listFrame = comboFrame->GetDropDown();
-  if (!listFrame)
-    return;
-
-  if (!mListAccessible) {
-    mListAccessible = new HTMLComboboxListAccessible(mParent, mContent, mDoc);
-
-    // Initialize and put into cache.
-    Document()->BindToDocument(mListAccessible, nullptr);
-  }
-
-  if (AppendChild(mListAccessible)) {
-    // Cache combobox option accessibles so that we build complete accessible
-    // tree for combobox.
-    mListAccessible->EnsureChildren();
-  }
 }
 
 void
 HTMLComboboxAccessible::Shutdown()
 {
   MOZ_ASSERT(mDoc->IsDefunct() || !mListAccessible);
   if (mListAccessible) {
     mListAccessible->Shutdown();