bug 1316163 - remove eCoalesceMutationTextChange event rule r=davidb
The only difference between it and eCoalesceReorder is that for
eCoalesceReorder we assert the target is one of a outer doc, application
accessible or xul tree. However we never put events that have
eCoalesceMutationTextChange as there event rule in the queue, so there is no
reason for separate event rules, and we can remove eCoalesceMutationTextChange
and check that queued eCoalesceReorder events are in fact reorder events.
--- a/accessible/base/AccEvent.h
+++ b/accessible/base/AccEvent.h
@@ -46,20 +46,16 @@ public:
// This event will always be emitted. This flag is used for events that
// don't support coalescence.
eAllowDupes,
// eCoalesceReorder : For reorder events from the same subtree or the same
// node, only the umbrella event on the ancestor will be emitted.
eCoalesceReorder,
- // eCoalesceMutationTextChange : coalesce text change events caused by
- // tree mutations of the same tree level.
- eCoalesceMutationTextChange,
-
// eCoalesceOfSameType : For events of the same type, only the newest event
// will be processed.
eCoalesceOfSameType,
// eCoalesceSelectionChange: coalescence of selection change events.
eCoalesceSelectionChange,
// eCoalesceStateChange: coalesce state change events.
@@ -209,17 +205,17 @@ private:
/**
* Base class for show and hide accessible events.
*/
class AccMutationEvent: public AccEvent
{
public:
AccMutationEvent(uint32_t aEventType, Accessible* aTarget) :
- AccEvent(aEventType, aTarget, eAutoDetect, eCoalesceMutationTextChange)
+ AccEvent(aEventType, aTarget, eAutoDetect, eCoalesceReorder)
{
// Don't coalesce these since they are coalesced by reorder event. Coalesce
// contained text change events.
mParent = mAccessible->Parent();
}
virtual ~AccMutationEvent() { }
// Event
--- a/accessible/base/EventQueue.cpp
+++ b/accessible/base/EventQueue.cpp
@@ -85,21 +85,25 @@ void
EventQueue::CoalesceEvents()
{
NS_ASSERTION(mEvents.Length(), "There should be at least one pending event!");
uint32_t tail = mEvents.Length() - 1;
AccEvent* tailEvent = mEvents[tail];
switch(tailEvent->mEventRule) {
case AccEvent::eCoalesceReorder:
- MOZ_ASSERT(tailEvent->mAccessible->IsApplication() ||
- tailEvent->mAccessible->IsOuterDoc() ||
- tailEvent->mAccessible->IsXULTree(),
+ {
+ DebugOnly<Accessible*> target = tailEvent->mAccessible.get();
+ MOZ_ASSERT(target->IsApplication() ||
+ target->IsOuterDoc() ||
+ target->IsXULTree(),
"Only app or outerdoc accessible reorder events are in the queue");
+ MOZ_ASSERT(tailEvent->GetEventType() == nsIAccessibleEvent::EVENT_REORDER, "only reorder events should be queued");
break; // case eCoalesceReorder
+ }
case AccEvent::eCoalesceOfSameType:
{
// Coalesce old events by newer event.
for (uint32_t index = tail - 1; index < tail; index--) {
AccEvent* accEvent = mEvents[index];
if (accEvent->mEventType == tailEvent->mEventType &&
accEvent->mEventRule == tailEvent->mEventRule) {