bug 1270916 - add a common base class of AccMutationEvent and AccReorderEvent r=davidb
☠☠ backed out by 23c941430f51 ☠ ☠
authorTrevor Saunders <tbsaunde@tbsaunde.org>
Fri, 02 Sep 2016 15:36:22 -0400
changeset 322677 baca5dd6bab6ef87e6e93e32841a9a4d7497084e
parent 322676 35ebbb5e0d023368152658b91d5f056e7206d1b5
child 322678 2829bb27b8c4d27a9c9033743766bdd7ca059940
push id83956
push usertsaunders@mozilla.com
push dateWed, 16 Nov 2016 06:08:31 +0000
treeherdermozilla-inbound@fb3cad552a5f [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);
   }