Bug 1408638 - Ensure accessible isn't defunct in Windows RootAccessibleWrap::accNavigate. r=MarcoZ, a=ritu
authorJames Teh <jteh@mozilla.com>
Mon, 16 Oct 2017 11:22:47 +1000
changeset 432588 ce581d83a38e142e9a43a300d0748e7b736e418e
parent 432587 21608c94652f308e27ee6779d23736f55e037eb2
child 432589 8bf87cac5783dbf98819debda5e74113b7e22b5b
push id8002
push userryanvm@gmail.com
push dateWed, 18 Oct 2017 18:59:59 +0000
treeherdermozilla-beta@d4e212a2b1e1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMarcoZ, ritu
bugs1408638, 1407475
milestone57.0
Bug 1408638 - Ensure accessible isn't defunct in Windows RootAccessibleWrap::accNavigate. r=MarcoZ, a=ritu Bug 1407475 added support for accNavigate(NAVRELATION_EMBEDS) for e10s. However, it's possible for a client to call this on the root accessible for a window which was since closed. Therefore, we must check whether the root accessible is defunct before trying to retrieve the tab document. MozReview-Commit-ID: 9iR6Kvzu5Mb
accessible/windows/msaa/RootAccessibleWrap.cpp
--- a/accessible/windows/msaa/RootAccessibleWrap.cpp
+++ b/accessible/windows/msaa/RootAccessibleWrap.cpp
@@ -117,16 +117,19 @@ RootAccessibleWrap::accNavigate(
     // We only handle EMBEDS on the root here.
     // Forward to the base implementation.
     return DocAccessibleWrap::accNavigate(navDir, varStart, pvarEndUpAt);
   }
 
   if (!pvarEndUpAt) {
     return E_INVALIDARG;
   }
+  if (IsDefunct()) {
+    return CO_E_OBJNOTCONNECTED;
+  }
 
   Accessible* target = nullptr;
   // Get the document in the active tab.
   ProxyAccessible* docProxy = GetPrimaryRemoteTopLevelContentDoc();
   if (docProxy) {
     target = WrapperFor(docProxy);
   } else {
     // The base implementation could handle this, but we may as well