bug 1270916 - allow downcasting AccEvent to AccTreeMutationEvent r=davidb
☠☠ backed out by b3b9d24cdb97 ☠ ☠
authorTrevor Saunders <tbsaunde@tbsaunde.org>
Fri, 02 Sep 2016 19:08:52 -0400
changeset 322947 cd68b5fd88a6922643c848148b7ecf12dacdd407
parent 322946 4c58195d6bcf62a04f8f23b5c199b33db05808e7
child 322948 91a8f65a69feadf4a3f8ffc725b0eaad549e2721
push id21
push usermaklebus@msu.edu
push dateThu, 01 Dec 2016 06:22:08 +0000
reviewersdavidb
bugs1270916
milestone53.0a1
bug 1270916 - allow downcasting AccEvent to AccTreeMutationEvent r=davidb
accessible/base/AccEvent.h
--- a/accessible/base/AccEvent.h
+++ b/accessible/base/AccEvent.h
@@ -89,16 +89,17 @@ public:
 
   /**
    * Down casting.
    */
   enum EventGroup {
     eGenericEvent,
     eStateChangeEvent,
     eTextChangeEvent,
+    eTreeMutationEvent,
     eMutationEvent,
     eReorderEvent,
     eHideEvent,
     eShowEvent,
     eCaretMoveEvent,
     eTextSelChangeEvent,
     eSelectionChangeEvent,
     eTableChangeEvent,
@@ -206,16 +207,23 @@ private:
  * 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) {}
+
+  // Event
+  static const EventGroup kEventGroup = eTreeMutationEvent;
+  virtual unsigned int GetEventGroups() const override
+  {
+    return AccEvent::GetEventGroups() | (1U << eTreeMutationEvent);
+  }
 };
 
 /**
  * Base class for show and hide accessible events.
  */
 class AccMutationEvent: public AccTreeMutationEvent
 {
 public:
@@ -227,17 +235,17 @@ public:
     mParent = mAccessible->Parent();
   }
   virtual ~AccMutationEvent() { }
 
   // Event
   static const EventGroup kEventGroup = eMutationEvent;
   virtual unsigned int GetEventGroups() const override
   {
-    return AccEvent::GetEventGroups() | (1U << eMutationEvent);
+    return AccTreeMutationEvent::GetEventGroups() | (1U << eMutationEvent);
   }
 
   // MutationEvent
   bool IsShow() const { return mEventType == nsIAccessibleEvent::EVENT_SHOW; }
   bool IsHide() const { return mEventType == nsIAccessibleEvent::EVENT_HIDE; }
 
   Accessible* Parent() const { return mParent; }
 
@@ -314,17 +322,17 @@ public:
   explicit AccReorderEvent(Accessible* aTarget) :
     AccTreeMutationEvent(::nsIAccessibleEvent::EVENT_REORDER, aTarget) { }
   virtual ~AccReorderEvent() { }
 
   // Event
   static const EventGroup kEventGroup = eReorderEvent;
   virtual unsigned int GetEventGroups() const override
   {
-    return AccEvent::GetEventGroups() | (1U << eReorderEvent);
+    return AccTreeMutationEvent::GetEventGroups() | (1U << eReorderEvent);
   }
 };
 
 
 /**
  * Accessible caret move event.
  */
 class AccCaretMoveEvent: public AccEvent