bug 1186536 - make SerializeTree() use IsOuterDoc() to check if an accessible is an outer doc r=davidb

In theory this should be the same, but slightly faster than checking there is
one child and it is a document.  However it appears ChildCount() sometimes
returns 1 when there is no child 0.
This commit is contained in:
Trevor Saunders 2015-09-03 02:06:22 -04:00
parent 5418bb6d17
commit 02bc02e687

View File

@ -57,7 +57,8 @@ SerializeTree(Accessible* aRoot, nsTArray<AccessibleData>& aTree)
// OuterDocAccessibles are special because we don't want to serialize the
// child doc here, we'll call PDocAccessibleConstructor in
// NotificationController.
if (childCount == 1 && aRoot->GetChildAt(0)->IsDoc())
MOZ_ASSERT(!aRoot->IsDoc(), "documents shouldn't be serialized");
if (aRoot->IsOuterDoc())
childCount = 0;
aTree.AppendElement(AccessibleData(id, role, childCount, interfaces));