From 44c897cc272a30b389f7e1d0b122dd7cfb515bc7 Mon Sep 17 00:00:00 2001 From: Trevor Saunders Date: Thu, 10 Nov 2016 23:35:51 -0500 Subject: [PATCH] bug 1270916 - call CreateSubtree() before firing a show event for the tree root r=davidb This ensures that if creating the sub tree creates events to fire they will go before the show event for the root of the tree. It is fine to fire show events for the subtree before the root because they will just get coalesced away anyway. However it is important that any hide events come before the hidden subtree appears in the new tree. --- accessible/generic/DocAccessible.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/accessible/generic/DocAccessible.cpp b/accessible/generic/DocAccessible.cpp index 0747ba105594..056c80f68223 100644 --- a/accessible/generic/DocAccessible.cpp +++ b/accessible/generic/DocAccessible.cpp @@ -1860,8 +1860,8 @@ DocAccessible::ProcessContentInserted(Accessible* aContainer, "container", aContainer, "child", iter.Child(), nullptr); #endif - mt.AfterInsertion(iter.Child()); CreateSubtree(iter.Child()); + mt.AfterInsertion(iter.Child()); continue; } @@ -1907,10 +1907,10 @@ DocAccessible::ProcessContentInserted(Accessible* aContainer, nsIContent* aNode) if (!aContainer->InsertAfter(child, walker.Prev())) { return; } + CreateSubtree(child); mt.AfterInsertion(child); mt.Done(); - CreateSubtree(child); FireEventsOnInsertion(aContainer); } }