bug 1162543 - make DocAccessibleChild::IDToAccessible correctly get the document r=davidb
authorTrevor Saunders <tbsaunde@tbsaunde.org>
Thu, 07 May 2015 10:19:21 -0400
changeset 274226 b34c538f36804b7030a32404e67c859d52340a9d
parent 274225 b40e0753d6d3b83555f6d11cd4d36f5998aa1dfa
child 274227 4127a3c0300b4f84e2efabeb1e2431fe530f6dca
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdavidb
bugs1162543
milestone40.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 1162543 - make DocAccessibleChild::IDToAccessible correctly get the document r=davidb DocAccessible::mAccessibleCache doesn't contain an entry for the document itself so we need to handle it separately. The document always has ID 0, so we can just check if that is the ID we are getting and if so just return the document.
accessible/ipc/DocAccessibleChild.cpp
--- a/accessible/ipc/DocAccessibleChild.cpp
+++ b/accessible/ipc/DocAccessibleChild.cpp
@@ -59,16 +59,19 @@ SerializeTree(Accessible* aRoot, nsTArra
   aTree.AppendElement(AccessibleData(id, role, childCount, interfaces));
   for (uint32_t i = 0; i < childCount; i++)
     SerializeTree(aRoot->GetChildAt(i), aTree);
 }
 
 Accessible*
 DocAccessibleChild::IdToAccessible(const uint64_t& aID) const
 {
+  if (!aID)
+    return mDoc;
+
   return mDoc->GetAccessibleByUniqueID(reinterpret_cast<void*>(aID));
 }
 
 Accessible*
 DocAccessibleChild::IdToAccessibleLink(const uint64_t& aID) const
 {
   Accessible* acc = IdToAccessible(aID);
   return acc && acc->IsLink() ? acc : nullptr;