Bug 1408638: Ensure accessible isn't defunct in Windows RootAccessibleWrap::accNavigate. r?MarcoZ draft
authorJames Teh <jteh@mozilla.com>
Mon, 16 Oct 2017 11:22:47 +1000
changeset 680636 23f18c66f4bf11f9bc93ca0e13f6f6af185895e9
parent 680630 2ba9ba4fa63b942d8d9401f6ff6e40f5730adcd1
child 735913 590b997731f0ae54c712ab03da1d09ea58e870b8
push id84567
push userbmo:jteh@mozilla.com
push dateMon, 16 Oct 2017 01:32:30 +0000
reviewersMarcoZ
bugs1408638, 1407475
milestone58.0a1
Bug 1408638: Ensure accessible isn't defunct in Windows RootAccessibleWrap::accNavigate. r?MarcoZ 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
@@ -119,16 +119,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