bug 1262563 - fire show / hide events for proxied accessibles r=davidb
authorTrevor Saunders <tbsaunde@tbsaunde.org>
Tue, 05 Apr 2016 21:43:04 -0400
changeset 332231 d70ec2a355523fa316ff2b3f9c62092d59dbcb1b
parent 332230 c6223b401549bb00fa42b99afc2d9924472b601b
child 332232 c47cd2b5f4a6ecfeb4ca629eb335696b5883090b
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdavidb
bugs1262563
milestone48.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 1262563 - fire show / hide events for proxied accessibles r=davidb
accessible/atk/AccessibleWrap.cpp
accessible/base/Platform.h
accessible/ipc/DocAccessibleParent.cpp
accessible/mac/Platform.mm
accessible/other/Platform.cpp
accessible/windows/msaa/Platform.cpp
--- a/accessible/atk/AccessibleWrap.cpp
+++ b/accessible/atk/AccessibleWrap.cpp
@@ -1580,16 +1580,24 @@ MaiAtkObject::FireTextChangeEvent(const 
   } else {
     const char* signal_name =
       textChangedStrings[aFromUser][aIsInsert];
     g_signal_emit_by_name(this, signal_name, aStart, aLen,
                           NS_ConvertUTF16toUTF8(aStr).get());
   }
 }
 
+void
+a11y::ProxyShowHideEvent(ProxyAccessible* aTarget, ProxyAccessible* aParent,
+                         bool aInsert, bool aFromUser)
+{
+  MaiAtkObject* obj = MAI_ATK_OBJECT(GetWrapperFor(aTarget));
+  obj->FireAtkShowHideEvent(GetWrapperFor(aParent), aInsert, aFromUser);
+}
+
 #define ADD_EVENT "children_changed::add"
 #define HIDE_EVENT "children_changed::remove"
 
 static const char *kMutationStrings[2][2] = {
   { HIDE_EVENT NON_USER_EVENT, ADD_EVENT NON_USER_EVENT },
   { HIDE_EVENT, ADD_EVENT },
 };
 
--- a/accessible/base/Platform.h
+++ b/accessible/base/Platform.h
@@ -70,11 +70,13 @@ void ProxyDestroyed(ProxyAccessible*);
  */
 void ProxyEvent(ProxyAccessible* aTarget, uint32_t aEventType);
 void ProxyStateChangeEvent(ProxyAccessible* aTarget, uint64_t aState,
                            bool aEnabled);
 void ProxyCaretMoveEvent(ProxyAccessible* aTarget, int32_t aOffset);
 void ProxyTextChangeEvent(ProxyAccessible* aTarget, const nsString& aStr,
                           int32_t aStart, uint32_t aLen, bool aIsInsert,
                           bool aFromUser);
+void ProxyShowHideEvent(ProxyAccessible* aTarget, ProxyAccessible* aParent,
+                        bool aInsert, bool aFromUser);
 } // namespace a11y
 } // namespace mozilla
 
--- a/accessible/ipc/DocAccessibleParent.cpp
+++ b/accessible/ipc/DocAccessibleParent.cpp
@@ -52,16 +52,17 @@ DocAccessibleParent::RecvShowEvent(const
   for (uint32_t i = 0; i < consumed; i++) {
     uint64_t id = aData.NewTree()[i].ID();
     MOZ_ASSERT(mAccessibles.GetEntry(id));
   }
 #endif
 
   MOZ_DIAGNOSTIC_ASSERT(CheckDocTree());
 
+  ProxyShowHideEvent(parent->ChildAt(newChildIdx), parent, true, aFromUser);
   return true;
 }
 
 uint32_t
 DocAccessibleParent::AddSubtree(ProxyAccessible* aParent,
                                 const nsTArray<a11y::AccessibleData>& aNewTree,
                                 uint32_t aIdx, uint32_t aIdxInParent)
 {
@@ -127,16 +128,17 @@ DocAccessibleParent::RecvHideEvent(const
 
   ProxyAccessible* root = rootEntry->mProxy;
   if (!root) {
     NS_ERROR("invalid root being removed!");
     return true;
   }
 
   ProxyAccessible* parent = root->Parent();
+  ProxyShowHideEvent(root, parent, false, aFromUser);
   parent->RemoveChild(root);
   root->Shutdown();
 
   MOZ_DIAGNOSTIC_ASSERT(CheckDocTree());
 
   return true;
 }
 
--- a/accessible/mac/Platform.mm
+++ b/accessible/mac/Platform.mm
@@ -96,16 +96,21 @@ ProxyCaretMoveEvent(ProxyAccessible* aTa
     [wrapper selectedTextDidChange];
 }
 
 void
 ProxyTextChangeEvent(ProxyAccessible*, const nsString&, int32_t, uint32_t,
                      bool, bool)
 {
 }
+
+void
+ProxyShowHideEvent(ProxyAccessible*, ProxyAccessible*, bool, bool)
+{
+}
 } // namespace a11y
 } // namespace mozilla
 
 @interface GeckoNSApplication(a11y)
 -(void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute;
 @end
 
 @implementation GeckoNSApplication(a11y)
--- a/accessible/other/Platform.cpp
+++ b/accessible/other/Platform.cpp
@@ -44,8 +44,13 @@ a11y::ProxyCaretMoveEvent(ProxyAccessibl
 {
 }
 
 void
 a11y::ProxyTextChangeEvent(ProxyAccessible*, const nsString&, int32_t, uint32_t,
                      bool, bool)
 {
 }
+
+void
+a11y::ProxyShowHideEvent(ProxyAccessible*, ProxyAccessible*, bool, bool)
+{
+}
--- a/accessible/windows/msaa/Platform.cpp
+++ b/accessible/windows/msaa/Platform.cpp
@@ -113,8 +113,17 @@ a11y::ProxyTextChangeEvent(ProxyAccessib
   if (text) {
     ia2AccessibleText::UpdateTextChangeData(text, aInsert, aStr, aStart, aLen);
   }
 
   uint32_t eventType = aInsert ? nsIAccessibleEvent::EVENT_TEXT_INSERTED :
     nsIAccessibleEvent::EVENT_TEXT_REMOVED;
   AccessibleWrap::FireWinEvent(wrapper, eventType);
 }
+
+void
+a11y::ProxyShowHideEvent(ProxyAccessible* aTarget, ProxyAccessible*, bool aInsert, bool)
+{
+  uint32_t event = aInsert ? nsIAccessibleEvent::EVENT_SHOW :
+    nsIAccessibleEvent::EVENT_HIDE;
+  AccessibleWrap* wrapper = WrapperFor(aTarget);
+  AccessibleWrap::FireWinEvent(wrapper, event);
+}