Bug 391846. Fire correct text change events when a node is shown or hidden. r=surkov, sr=sicking, a=sicking
This commit is contained in:
@@ -125,6 +125,11 @@
|
||||
#include "nsIXULDocument.h"
|
||||
#endif /* MOZ_XUL */
|
||||
|
||||
#ifdef ACCESSIBILITY
|
||||
#include "nsIAccessibilityService.h"
|
||||
#include "nsIAccessibleEvent.h"
|
||||
#endif /* ACCESSIBILITY */
|
||||
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "nsCCUncollectableMarker.h"
|
||||
#include "nsCycleCollector.h"
|
||||
@@ -2694,6 +2699,22 @@ nsGenericElement::doRemoveChildAt(PRUint32 aIndex, PRBool aNotify,
|
||||
NS_PRECONDITION(!aParent || aParent->GetCurrentDoc() == aDocument,
|
||||
"Incorrect aDocument");
|
||||
|
||||
#ifdef ACCESSIBILITY
|
||||
// A11y needs to be notified of content removals first, so accessibility
|
||||
// events can be fired before any changes occur
|
||||
if (aNotify && aDocument) {
|
||||
nsIPresShell *presShell = aDocument->GetPrimaryShell();
|
||||
if (presShell && presShell->IsAccessibilityActive()) {
|
||||
nsCOMPtr<nsIAccessibilityService> accService =
|
||||
do_GetService("@mozilla.org/accessibilityService;1");
|
||||
if (accService) {
|
||||
accService->InvalidateSubtreeFor(presShell, aKid,
|
||||
nsIAccessibleEvent::EVENT_DOM_DESTROY);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
nsMutationGuard::DidMutate();
|
||||
|
||||
nsINode* container = NODE_FROM(aParent, aDocument);
|
||||
|
||||
Reference in New Issue
Block a user