bug 1334966 - make TabParent::GetTopLevelDocAccessible() only return documents that are top level r=eeejay
authorTrevor Saunders <tbsaunde@tbsaunde.org>
Mon, 30 Jan 2017 02:24:37 -0500
changeset 331775 2467b35c59b20469943c6091197dada4bcd1f69d
parent 331774 52b841bf65ba94e100da515c5d2b97b48d905708
child 331819 06928edb7f9eeb7c503496c5fb1913818a5c9e65
push id86360
push usertsaunders@mozilla.com
push dateTue, 31 Jan 2017 14:31:44 +0000
treeherdermozilla-inbound@2467b35c59b2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerseeejay
bugs1334966
milestone54.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 1334966 - make TabParent::GetTopLevelDocAccessible() only return documents that are top level r=eeejay There can be cases where a non top level document currently has no parent document, for example when a child doc has been unbound from its parent but not yet reattached to a new outer doc.
dom/ipc/TabParent.cpp
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -975,17 +975,17 @@ a11y::DocAccessibleParent*
 TabParent::GetTopLevelDocAccessible() const
 {
 #ifdef ACCESSIBILITY
   // XXX Consider managing non top level PDocAccessibles with their parent
   // document accessible.
   const ManagedContainer<PDocAccessibleParent>& docs = ManagedPDocAccessibleParent();
   for (auto iter = docs.ConstIter(); !iter.Done(); iter.Next()) {
     auto doc = static_cast<a11y::DocAccessibleParent*>(iter.Get()->GetKey());
-    if (!doc->ParentDoc()) {
+    if (doc->IsTopLevel()) {
       return doc;
     }
   }
 
   MOZ_ASSERT(docs.Count() == 0, "If there isn't a top level accessible doc "
                                 "there shouldn't be an accessible doc at all!");
 #endif
   return nullptr;