Commit ce477143 authored by Eitan Isaacson's avatar Eitan Isaacson
Browse files

Bug 1713050 - P3: Add more granularities to AXSelectedTextChanged events. r=morgan

parent a479c8f1
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -111,7 +111,8 @@ void a11y::ProxyStateChangeEvent(RemoteAccessible* aTarget, uint64_t aState,
}

void a11y::ProxyCaretMoveEvent(RemoteAccessible* aTarget, int32_t aOffset,
                               bool aIsSelectionCollapsed) {
                               bool aIsSelectionCollapsed,
                               int32_t aGranularity) {
  RefPtr<SessionAccessibility> sessionAcc =
      SessionAccessibility::GetInstanceFor(aTarget);

+2 −1
Original line number Diff line number Diff line
@@ -1372,7 +1372,8 @@ void a11y::ProxyStateChangeEvent(RemoteAccessible* aTarget, uint64_t aState,
}

void a11y::ProxyCaretMoveEvent(RemoteAccessible* aTarget, int32_t aOffset,
                               bool aIsSelectionCollapsed) {
                               bool aIsSelectionCollapsed,
                               int32_t aGranularity) {
  AtkObject* wrapper = GetWrapperFor(aTarget);
  g_signal_emit_by_name(wrapper, "text_caret_moved", aOffset);
}
+3 −2
Original line number Diff line number Diff line
@@ -104,10 +104,11 @@ void ProxyStateChangeEvent(RemoteAccessible* aTarget, uint64_t aState,
void ProxyFocusEvent(RemoteAccessible* aTarget,
                     const LayoutDeviceIntRect& aCaretRect);
void ProxyCaretMoveEvent(RemoteAccessible* aTarget,
                         const LayoutDeviceIntRect& aCaretRect);
                         const LayoutDeviceIntRect& aCaretRect,
                         int32_t aGranularity);
#else
void ProxyCaretMoveEvent(RemoteAccessible* aTarget, int32_t aOffset,
                         bool aIsSelectionCollapsed);
                         bool aIsSelectionCollapsed, int32_t aGranularity);
#endif
void ProxyTextChangeEvent(RemoteAccessible* aTarget, const nsString& aStr,
                          int32_t aStart, uint32_t aLen, bool aIsInsert,
+2 −2
Original line number Diff line number Diff line
@@ -364,9 +364,9 @@ mozilla::ipc::IPCResult DocAccessibleParent::RecvCaretMoveEvent(
  }

#if defined(XP_WIN)
  ProxyCaretMoveEvent(proxy, aCaretRect);
  ProxyCaretMoveEvent(proxy, aCaretRect, aGranularity);
#else
  ProxyCaretMoveEvent(proxy, aOffset, aIsSelectionCollapsed);
  ProxyCaretMoveEvent(proxy, aOffset, aIsSelectionCollapsed, aGranularity);
#endif

  if (!nsCoreUtils::AccEventObserversExist()) {
+3 −1
Original line number Diff line number Diff line
@@ -226,7 +226,9 @@ nsresult AccessibleWrap::HandleAccEvent(AccEvent* aEvent) {
      int32_t caretOffset = event->GetCaretOffset();
      MOXTextMarkerDelegate* delegate =
          [MOXTextMarkerDelegate getOrCreateForDoc:aEvent->Document()];
      [delegate setCaretOffset:eventTarget at:caretOffset];
      [delegate setCaretOffset:eventTarget
                            at:caretOffset
               moveGranularity:event->GetGranularity()];
      if (event->IsSelectionCollapsed()) {
        // If the selection is collapsed, invalidate our text selection cache.
        [delegate setSelectionFrom:eventTarget
Loading