Bug 1483911 - Defer scrolling events until after ipc doc construction. r=Jamie
authorEitan Isaacson <eitan@monotonous.org>
Mon, 20 Aug 2018 15:51:00 +0300
changeset 487640 34996338b92ff27d4ff98d0278c165f2b42fcb92
parent 487639 ab5ac052f221b03e0700351ec6534160b38b106c
child 487641 8464c338715daf9134f9c640d5da3519c9729447
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersJamie
bugs1483911
milestone63.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 1483911 - Defer scrolling events until after ipc doc construction. r=Jamie
accessible/ipc/win/DocAccessibleChild.cpp
accessible/ipc/win/DocAccessibleChild.h
--- a/accessible/ipc/win/DocAccessibleChild.cpp
+++ b/accessible/ipc/win/DocAccessibleChild.cpp
@@ -269,16 +269,36 @@ DocAccessibleChild::SendRoleChangedEvent
     return PDocAccessibleChild::SendRoleChangedEvent(aRole);
   }
 
   PushDeferredEvent(MakeUnique<SerializedRoleChanged>(this, aRole));
   return true;
 }
 
 bool
+DocAccessibleChild::SendScrollingEvent(const uint64_t& aID,
+                                       const uint64_t& aType,
+                                       const uint32_t& aScrollX,
+                                       const uint32_t& aScrollY,
+                                       const uint32_t& aMaxScrollX,
+                                       const uint32_t& aMaxScrollY)
+{
+  if (IsConstructedInParentProcess()) {
+    return PDocAccessibleChild::SendScrollingEvent(aID, aType,
+                                                   aScrollX, aScrollY,
+                                                   aMaxScrollX, aMaxScrollY);
+  }
+
+  PushDeferredEvent(MakeUnique<SerializedScrolling>(this, aID, aType,
+                                                    aScrollX, aScrollY,
+                                                    aMaxScrollX, aMaxScrollY));
+  return true;
+}
+
+bool
 DocAccessibleChild::ConstructChildDocInParentProcess(
                                         DocAccessibleChild* aNewChildDoc,
                                         uint64_t aUniqueID, uint32_t aMsaaID)
 {
   if (IsConstructedInParentProcess()) {
     // We may send the constructor immediately
     auto tabChild = static_cast<dom::TabChild*>(Manager());
     MOZ_ASSERT(tabChild);
--- a/accessible/ipc/win/DocAccessibleChild.h
+++ b/accessible/ipc/win/DocAccessibleChild.h
@@ -53,16 +53,20 @@ public:
                       const LayoutDeviceIntRect& aCaretRect);
   bool SendTextChangeEvent(const uint64_t& aID, const nsString& aStr,
                            const int32_t& aStart, const uint32_t& aLen,
                            const bool& aIsInsert, const bool& aFromUser,
                            const bool aDoSyncCheck = true);
   bool SendSelectionEvent(const uint64_t& aID, const uint64_t& aWidgetID,
                           const uint32_t& aType);
   bool SendRoleChangedEvent(const a11y::role& aRole);
+  bool SendScrollingEvent(const uint64_t& aID, const uint64_t& aType,
+                          const uint32_t& aScrollX, const uint32_t& aScrollY,
+                          const uint32_t& aMaxScrollX,
+                          const uint32_t& aMaxScrollY);
 
   bool ConstructChildDocInParentProcess(DocAccessibleChild* aNewChildDoc,
                                         uint64_t aUniqueID, uint32_t aMsaaID);
 
   bool SendBindChildDoc(DocAccessibleChild* aChildDoc,
                         const uint64_t& aNewParentID);
 
 protected:
@@ -264,16 +268,45 @@ private:
     void Dispatch(DocAccessibleChild* aIPCDoc) override
     {
       Unused << aIPCDoc->SendRoleChangedEvent(mRole);
     }
 
     a11y::role mRole;
   };
 
+  struct SerializedScrolling final : public DeferredEvent
+  {
+    explicit SerializedScrolling(DocAccessibleChild* aTarget,
+                                 uint64_t aID, uint64_t aType,
+                                 uint32_t aScrollX, uint32_t aScrollY,
+                                 uint32_t aMaxScrollX, uint32_t aMaxScrollY)
+      : DeferredEvent(aTarget)
+      , mID(aID)
+      , mType(aType)
+      , mScrollX(aScrollX)
+      , mScrollY(aScrollY)
+      , mMaxScrollX(aMaxScrollX)
+      , mMaxScrollY(aMaxScrollY)
+    {}
+
+    void Dispatch(DocAccessibleChild* aIPCDoc) override
+    {
+      Unused << aIPCDoc->SendScrollingEvent(mID, mType, mScrollX, mScrollY,
+                                            mMaxScrollX, mMaxScrollY);
+    }
+
+    uint64_t mID;
+    uint64_t mType;
+    uint32_t mScrollX;
+    uint32_t mScrollY;
+    uint32_t mMaxScrollX;
+    uint32_t mMaxScrollY;
+  };
+
   struct SerializedEvent final : public DeferredEvent
   {
     SerializedEvent(DocAccessibleChild* aTarget, uint64_t aID, uint32_t aType)
       : DeferredEvent(aTarget)
       , mID(aID)
       , mType(aType)
     {}