bug 1270916 - allow keeping AccTreeMutation in a list r=davidb

Soon we will use the list to track the order of the events.
This commit is contained in:
Trevor Saunders 2016-09-02 20:50:56 -04:00
parent fe3457276d
commit 9211a3aa51
2 changed files with 26 additions and 1 deletions

View File

@ -42,7 +42,23 @@ AccEvent::AccEvent(uint32_t aEventType, Accessible* aAccessible,
////////////////////////////////////////////////////////////////////////////////
// AccEvent cycle collection
NS_IMPL_CYCLE_COLLECTION(AccEvent, mAccessible)
NS_IMPL_CYCLE_COLLECTION_CLASS(AccEvent)
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(AccEvent)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mAccessible)
if (AccTreeMutationEvent* tmEvent = downcast_accEvent(tmp)) {
tmEvent->SetNextEvent(nullptr);
tmEvent->SetPrevEvent(nullptr);
}
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(AccEvent)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAccessible)
if (AccTreeMutationEvent* tmEvent = downcast_accEvent(tmp)) {
CycleCollectionNoteChild(cb, tmEvent->NextEvent(), "mNext");
CycleCollectionNoteChild(cb, tmEvent->PrevEvent(), "mPrevEvent");
}
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(AccEvent, AddRef)
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(AccEvent, Release)

View File

@ -219,6 +219,15 @@ public:
{
return AccEvent::GetEventGroups() | (1U << eTreeMutationEvent);
}
void SetNextEvent(AccTreeMutationEvent* aNext) { mNextEvent = aNext; }
void SetPrevEvent(AccTreeMutationEvent* aPrev) { mPrevEvent = aPrev; }
AccTreeMutationEvent* NextEvent() const { return mNextEvent; }
AccTreeMutationEvent* PrevEvent() const { return mPrevEvent; }
private:
RefPtr<AccTreeMutationEvent> mNextEvent;
RefPtr<AccTreeMutationEvent> mPrevEvent;
};
/**