bug 1270916 - add a common base class of AccMutationEvent and AccReorderEvent r=davidb
authorTrevor Saunders <tbsaunde@tbsaunde.org>
Fri, 02 Sep 2016 15:36:22 -0400
changeset 322913 72e9db0aa74f79f6a030e5f5edf85a77d2d399c8
parent 322912 8f2d9f13579c1c2410e13ddbe270c37967a372bf
child 322914 15e1b251bcc721aac41cc5ed8955a0be002e4469
push id84000
push usertsaunders@mozilla.com
push dateThu, 17 Nov 2016 04:39:30 +0000
treeherdermozilla-inbound@387d3acae9e9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdavidb
bugs1270916
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 1270916 - add a common base class of AccMutationEvent and AccReorderEvent r=davidb Soon we will want to operate on either a reorder event or a mutation event.
accessible/base/AccEvent.h
--- a/accessible/base/AccEvent.h
+++ b/accessible/base/AccEvent.h
@@ -197,25 +197,35 @@ public:
 private:
   int32_t mStart;
   bool mIsInserted;
   nsString mModifiedText;
 
   friend class EventTree;
 };
 
+/**
+ * A base class for events related to tree mutation, either an AccMutation
+ * event, or an AccReorderEvent.
+ */
+class AccTreeMutationEvent : public AccEvent
+{
+public:
+  AccTreeMutationEvent(uint32_t aEventType, Accessible* aTarget) :
+    AccEvent(aEventType, aTarget, eAutoDetect, eCoalesceReorder) {}
+};
 
 /**
  * Base class for show and hide accessible events.
  */
-class AccMutationEvent: public AccEvent
+class AccMutationEvent: public AccTreeMutationEvent
 {
 public:
   AccMutationEvent(uint32_t aEventType, Accessible* aTarget) :
-    AccEvent(aEventType, aTarget, eAutoDetect, eCoalesceReorder)
+    AccTreeMutationEvent(aEventType, aTarget)
   {
     // Don't coalesce these since they are coalesced by reorder event. Coalesce
     // contained text change events.
     mParent = mAccessible->Parent();
   }
   virtual ~AccMutationEvent() { }
 
   // Event
@@ -293,22 +303,21 @@ private:
 
   friend class EventTree;
 };
 
 
 /**
  * Class for reorder accessible event. Takes care about
  */
-class AccReorderEvent : public AccEvent
+class AccReorderEvent : public AccTreeMutationEvent
 {
 public:
   explicit AccReorderEvent(Accessible* aTarget) :
-    AccEvent(::nsIAccessibleEvent::EVENT_REORDER, aTarget,
-             eAutoDetect, eCoalesceReorder) { }
+    AccTreeMutationEvent(::nsIAccessibleEvent::EVENT_REORDER, aTarget) { }
   virtual ~AccReorderEvent() { }
 
   // Event
   static const EventGroup kEventGroup = eReorderEvent;
   virtual unsigned int GetEventGroups() const override
   {
     return AccEvent::GetEventGroups() | (1U << eReorderEvent);
   }