Bug 1660364 - Introduce IPDL getters for text range length, and absolute offsets. r=morgan,mccr8
authorEitan Isaacson <eitan@monotonous.org>
Thu, 27 Aug 2020 20:06:42 +0000
changeset 546652 009dd31f4932cd050cf9b5334d47dee23a28f77f
parent 546651 6b22f23037b753a0237adfb59b14cd60ab0118ab
child 546653 a25601920fab8afe0b399e3750c53cf411e3c8ec
push id37736
push userapavel@mozilla.com
push dateFri, 28 Aug 2020 15:31:26 +0000
treeherdermozilla-central@56166cae2e26 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmorgan, mccr8
bugs1660364
milestone82.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 1660364 - Introduce IPDL getters for text range length, and absolute offsets. r=morgan,mccr8 We need a sync IPC call for this because otherwise the number of smaller sync messages we would need to call would be variable. Differential Revision: https://phabricator.services.mozilla.com/D88076
accessible/ipc/extension/mac/DocAccessiblePlatformExtChild.cpp
accessible/ipc/extension/mac/DocAccessiblePlatformExtChild.h
accessible/ipc/extension/mac/PDocAccessiblePlatformExt.ipdl
ipc/ipdl/sync-messages.ini
--- a/accessible/ipc/extension/mac/DocAccessiblePlatformExtChild.cpp
+++ b/accessible/ipc/extension/mac/DocAccessiblePlatformExtChild.cpp
@@ -126,16 +126,29 @@ mozilla::ipc::IPCResult DocAccessiblePla
     return IPC_OK();
   }
 
   *aBounds = acc->BoundsForRange(aStartOffset, endContainer, aEndOffset);
 
   return IPC_OK();
 }
 
+mozilla::ipc::IPCResult DocAccessiblePlatformExtChild::RecvLengthForRange(
+    const uint64_t& aID, const int32_t& aStartOffset,
+    const uint64_t& aEndContainer, const int32_t& aEndOffset,
+    int32_t* aLength) {
+  return IPC_OK();
+}
+
+mozilla::ipc::IPCResult DocAccessiblePlatformExtChild::RecvOffsetAtIndex(
+    const uint64_t& aID, const int32_t& aIndex, uint64_t* aContainer,
+    int32_t* aOffset) {
+  return IPC_OK();
+}
+
 HyperTextAccessibleWrap*
 DocAccessiblePlatformExtChild::IdToHyperTextAccessibleWrap(
     const uint64_t& aID) const {
   return static_cast<HyperTextAccessibleWrap*>(
       static_cast<DocAccessibleChild*>(Manager())->IdToHyperTextAccessible(
           aID));
 }
 
--- a/accessible/ipc/extension/mac/DocAccessiblePlatformExtChild.h
+++ b/accessible/ipc/extension/mac/DocAccessiblePlatformExtChild.h
@@ -41,16 +41,27 @@ class DocAccessiblePlatformExtChild : pu
                                            nsString* aText);
 
   mozilla::ipc::IPCResult RecvBoundsForRange(const uint64_t& aID,
                                              const int32_t& aStartOffset,
                                              const uint64_t& aEndContainer,
                                              const int32_t& aEndOffset,
                                              nsIntRect* aBounds);
 
+  mozilla::ipc::IPCResult RecvLengthForRange(const uint64_t& aID,
+                                             const int32_t& aStartOffset,
+                                             const uint64_t& aEndContainer,
+                                             const int32_t& aEndOffset,
+                                             int32_t* aLength);
+
+  mozilla::ipc::IPCResult RecvOffsetAtIndex(const uint64_t& aID,
+                                            const int32_t& aIndex,
+                                            uint64_t* aContainer,
+                                            int32_t* aOffset);
+
  private:
   HyperTextAccessibleWrap* IdToHyperTextAccessibleWrap(
       const uint64_t& aID) const;
 };
 }  // namespace a11y
 }  // namespace mozilla
 
 #endif
--- a/accessible/ipc/extension/mac/PDocAccessiblePlatformExt.ipdl
+++ b/accessible/ipc/extension/mac/PDocAccessiblePlatformExt.ipdl
@@ -31,12 +31,19 @@ child:
   nested(inside_sync) sync PreviousClusterAt(uint64_t aID, int32_t aOffset)
       returns(uint64_t aNextContainer, int32_t aNextOffset);
 
   nested(inside_sync) sync TextForRange(uint64_t aID, int32_t aStartOffset, uint64_t aEndContainer, int32_t aEndOffset)
       returns(nsString aText);
 
   nested(inside_sync) sync BoundsForRange(uint64_t aID, int32_t aStartOffset, uint64_t aEndContainer, int32_t aEndOffset)
       returns(nsIntRect aRetVal);
+
+  nested(inside_sync) sync LengthForRange(uint64_t aID, int32_t aStartOffset, uint64_t aEndContainer, int32_t aEndOffset)
+      returns(int32_t aLength);
+
+  nested(inside_sync) sync OffsetAtIndex(uint64_t aID, int32_t aIndex)
+      returns(uint64_t aContainer, int32_t aOffset);
+
 };
 
 }  // namespace a11y
 }  // namespace mozilla
--- a/ipc/ipdl/sync-messages.ini
+++ b/ipc/ipdl/sync-messages.ini
@@ -627,16 +627,22 @@ platform = mac
 description = Retrieve previous character from offset. Platform API is synchronous, so this needs to be too.
 platform = mac
 [PDocAccessiblePlatformExt::TextForRange]
 description = Retrieve flattened string for text range. Platform API is synchronous, so this needs to be too.
 platform = mac
 [PDocAccessiblePlatformExt::BoundsForRange]
 description = Retrieve geometric bounds for text range. Platform API is synchronous, so this needs to be too.
 platform = mac
+[PDocAccessiblePlatformExt::LengthForRange]
+description = Retrieve length of text range. Platform API is synchronous, so this needs to be too.
+platform = mac
+[PDocAccessiblePlatformExt::OffsetAtIndex]
+description = Retrieve text offset at absolute index. Platform API is synchronous, so this needs to be too.
+platform = mac
 
 # Plugins
 [PPluginWidget::Create]
 description = Legacy NPAPI IPC
 [PPluginWidget::GetNativePluginPort]
 description = Legacy NPAPI IPC
 [PPluginWidget::SetNativeChildWindow]
 description = Legacy NPAPI IPC