From 02bc02e68797442b1b81cb4f7cc225af70c5867e Mon Sep 17 00:00:00 2001 From: Trevor Saunders Date: Thu, 3 Sep 2015 02:06:22 -0400 Subject: [PATCH] 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. --- accessible/ipc/DocAccessibleChild.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/accessible/ipc/DocAccessibleChild.cpp b/accessible/ipc/DocAccessibleChild.cpp index 0b1b010ef2f..8b27df0b53a 100644 --- a/accessible/ipc/DocAccessibleChild.cpp +++ b/accessible/ipc/DocAccessibleChild.cpp @@ -57,7 +57,8 @@ SerializeTree(Accessible* aRoot, nsTArray& 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));