Bug 1279665 - skip aria-owns deferred accessible creation for XUL elements. r=yzen, a=gchang
authorAlexander Surkov <surkov.alexander@gmail.com>
Fri, 08 Jul 2016 11:56:30 -0400
changeset 341915 ea115aa628abd21b879228258690b33bcb0ddde7
parent 341914 11c6cfe72f401b89242a92b9def96768f01b4dc3
child 341916 3366b3cde4918ef217a57293f1cc9bd9a6656bcb
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersyzen, gchang
bugs1279665
milestone49.0a2
Bug 1279665 - skip aria-owns deferred accessible creation for XUL elements. r=yzen, a=gchang
accessible/base/TreeWalker.cpp
--- a/accessible/base/TreeWalker.cpp
+++ b/accessible/base/TreeWalker.cpp
@@ -283,17 +283,24 @@ TreeWalker::AccessibleFor(nsIContent* aN
       *aSkipSubtree = true;
       return nullptr;
     }
     return child;
   }
 
   // Create an accessible if allowed.
   if (!(aFlags & eWalkCache) && mContext->IsAcceptableChild(aNode)) {
-    if (mDoc->RelocateARIAOwnedIfNeeded(aNode)) {
+    // We may have ARIA owned element in the dependent attributes map, but the
+    // element may be not allowed for this ARIA owns relation, if the relation
+    // crosses out XBL anonymous content boundaries. In this case we won't
+    // create an accessible object for it, when aria-owns is processed, which
+    // may make the element subtree inaccessible. To avoid that let's create
+    // an accessible object now, and later, if allowed, move it in the tree,
+    // when aria-owns relation is processed.
+    if (mDoc->RelocateARIAOwnedIfNeeded(aNode) && !aNode->IsXULElement()) {
       *aSkipSubtree = true;
       return nullptr;
     }
     return GetAccService()->CreateAccessible(aNode, mContext, aSkipSubtree);
   }
 
   return nullptr;
 }