From c62d07b686a29dd3050b71b8e72fc0d6e4b002b7 Mon Sep 17 00:00:00 2001 From: Trevor Saunders Date: Thu, 19 Jan 2017 16:35:17 -0500 Subject: [PATCH] bug 1322593 - don't coalesce non contiguous text changes under the same accessible r=davidb --- accessible/base/NotificationController.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/accessible/base/NotificationController.cpp b/accessible/base/NotificationController.cpp index 8bae834aa0af..34040807a9ac 100644 --- a/accessible/base/NotificationController.cpp +++ b/accessible/base/NotificationController.cpp @@ -220,6 +220,7 @@ NotificationController::QueueMutationEvent(AccTreeMutationEvent* aEvent) if (prevTextChange && prevHide->Parent() == mutEvent->Parent()) { if (prevHide->mNextSibling == target) { target->AppendTextTo(prevTextChange->mModifiedText); + prevHide->mTextChangeEvent.swap(mutEvent->mTextChangeEvent); } else if (prevHide->mPrevSibling == target) { nsString temp; target->AppendTextTo(temp); @@ -228,9 +229,8 @@ NotificationController::QueueMutationEvent(AccTreeMutationEvent* aEvent) temp += prevTextChange->mModifiedText;; prevTextChange->mModifiedText = temp; prevTextChange->mStart -= extraLen; + prevHide->mTextChangeEvent.swap(mutEvent->mTextChangeEvent); } - - prevHide->mTextChangeEvent.swap(mutEvent->mTextChangeEvent); } } else if (prevEvent && mutEvent->IsShow() && prevEvent->GetEventType() == nsIAccessibleEvent::EVENT_SHOW) { @@ -241,15 +241,15 @@ NotificationController::QueueMutationEvent(AccTreeMutationEvent* aEvent) int32_t prevIndex = prevShow->GetAccessible()->IndexInParent(); if (prevIndex + 1 == index) { target->AppendTextTo(prevTextChange->mModifiedText); + prevShow->mTextChangeEvent.swap(mutEvent->mTextChangeEvent); } else if (index + 1 == prevIndex) { nsString temp; target->AppendTextTo(temp); prevTextChange->mStart -= temp.Length(); temp += prevTextChange->mModifiedText; prevTextChange->mModifiedText = temp; + prevShow->mTextChangeEvent.swap(mutEvent->mTextChangeEvent); } - - prevShow->mTextChangeEvent.swap(mutEvent->mTextChangeEvent); } }