summaryrefslogtreecommitdiffstats
path: root/accessible/windows/msaa
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
commitd8bbc7858622b6d9c278469aab701ca0b609cddf (patch)
treeeff41dc61d9f714852212739e6b3738b82a2af87 /accessible/windows/msaa
parentReleasing progress-linux version 125.0.3-1~progress7.99u1. (diff)
downloadfirefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz
firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'accessible/windows/msaa')
-rw-r--r--accessible/windows/msaa/MsaaAccessible.cpp12
-rw-r--r--accessible/windows/msaa/MsaaAccessible.h6
-rw-r--r--accessible/windows/msaa/MsaaRootAccessible.cpp8
-rw-r--r--accessible/windows/msaa/MsaaRootAccessible.h4
-rw-r--r--accessible/windows/msaa/Platform.cpp7
5 files changed, 30 insertions, 7 deletions
diff --git a/accessible/windows/msaa/MsaaAccessible.cpp b/accessible/windows/msaa/MsaaAccessible.cpp
index 3a0e8fc726..56e8cfd058 100644
--- a/accessible/windows/msaa/MsaaAccessible.cpp
+++ b/accessible/windows/msaa/MsaaAccessible.cpp
@@ -14,6 +14,7 @@
#include "mozilla/a11y/AccessibleWrap.h"
#include "mozilla/a11y/Compatibility.h"
#include "mozilla/a11y/DocAccessibleParent.h"
+#include "mozilla/StaticPrefs_accessibility.h"
#include "MsaaAccessible.h"
#include "MsaaDocAccessible.h"
#include "MsaaRootAccessible.h"
@@ -522,9 +523,11 @@ MsaaAccessible::QueryInterface(REFIID iid, void** ppv) {
if (SUCCEEDED(hr)) {
return hr;
}
- hr = uiaRawElmProvider::QueryInterface(iid, ppv);
- if (SUCCEEDED(hr)) {
- return hr;
+ if (StaticPrefs::accessibility_uia_enable()) {
+ hr = uiaRawElmProvider::QueryInterface(iid, ppv);
+ if (SUCCEEDED(hr)) {
+ return hr;
+ }
}
}
if (*ppv) {
@@ -769,7 +772,8 @@ MsaaAccessible::get_accRole(
uint32_t msaaRole = 0;
#define ROLE(_geckoRole, stringRole, ariaRole, atkRole, macRole, macSubrole, \
- _msaaRole, ia2Role, androidClass, iosIsElement, nameRule) \
+ _msaaRole, ia2Role, androidClass, iosIsElement, uiaControlType, \
+ nameRule) \
case roles::_geckoRole: \
msaaRole = _msaaRole; \
break;
diff --git a/accessible/windows/msaa/MsaaAccessible.h b/accessible/windows/msaa/MsaaAccessible.h
index 6d6582f010..fa43c441bf 100644
--- a/accessible/windows/msaa/MsaaAccessible.h
+++ b/accessible/windows/msaa/MsaaAccessible.h
@@ -31,7 +31,7 @@ class MsaaAccessible : public ia2Accessible,
public:
static MsaaAccessible* Create(Accessible* aAcc);
- Accessible* Acc() { return mAcc; }
+ Accessible* Acc() const { return mAcc; }
AccessibleWrap* LocalAcc();
uint32_t GetExistingID() const { return mID; }
@@ -146,6 +146,10 @@ class MsaaAccessible : public ia2Accessible,
EXCEPINFO* pExcepInfo,
UINT* puArgErr) override;
+ // UIA's IInvokeProvider has a method called Invoke too, but it's fine because
+ // it accepts very different parameters.
+ using uiaRawElmProvider::Invoke;
+
protected:
explicit MsaaAccessible(Accessible* aAcc);
virtual ~MsaaAccessible();
diff --git a/accessible/windows/msaa/MsaaRootAccessible.cpp b/accessible/windows/msaa/MsaaRootAccessible.cpp
index ac747ff3d1..2b28edb9b5 100644
--- a/accessible/windows/msaa/MsaaRootAccessible.cpp
+++ b/accessible/windows/msaa/MsaaRootAccessible.cpp
@@ -5,6 +5,7 @@
#include "mozilla/a11y/DocAccessibleParent.h"
#include "mozilla/dom/BrowserParent.h"
+#include "mozilla/StaticPrefs_accessibility.h"
#include "mozilla/WindowsVersion.h"
#include "MsaaRootAccessible.h"
#include "Relation.h"
@@ -36,6 +37,13 @@ MsaaRootAccessible::InternalQueryInterface(REFIID aIid, void** aOutInterface) {
return S_OK;
}
+ if (StaticPrefs::accessibility_uia_enable() &&
+ aIid == IID_IRawElementProviderFragmentRoot) {
+ RefPtr<IRawElementProviderFragmentRoot> root = this;
+ root.forget(aOutInterface);
+ return S_OK;
+ }
+
// ...Otherwise we pass through to the base COM implementation of
// QueryInterface which is provided by MsaaDocAccessible.
return MsaaDocAccessible::QueryInterface(aIid, aOutInterface);
diff --git a/accessible/windows/msaa/MsaaRootAccessible.h b/accessible/windows/msaa/MsaaRootAccessible.h
index a51533d7ba..efc42bc094 100644
--- a/accessible/windows/msaa/MsaaRootAccessible.h
+++ b/accessible/windows/msaa/MsaaRootAccessible.h
@@ -8,12 +8,14 @@
#include "mozilla/mscom/Aggregation.h"
#include "MsaaDocAccessible.h"
+#include "UiaRoot.h"
namespace mozilla {
namespace a11y {
+class RootAccessible;
-class MsaaRootAccessible : public MsaaDocAccessible {
+class MsaaRootAccessible : public MsaaDocAccessible, public UiaRoot {
public:
explicit MsaaRootAccessible(Accessible* aAcc)
: MsaaDocAccessible(aAcc), mOuter(&mInternalUnknown) {}
diff --git a/accessible/windows/msaa/Platform.cpp b/accessible/windows/msaa/Platform.cpp
index 018042c5d3..f4d1c7b176 100644
--- a/accessible/windows/msaa/Platform.cpp
+++ b/accessible/windows/msaa/Platform.cpp
@@ -69,10 +69,13 @@ void a11y::ProxyDestroyed(RemoteAccessible* aProxy) {
void a11y::PlatformEvent(Accessible* aTarget, uint32_t aEventType) {
MsaaAccessible::FireWinEvent(aTarget, aEventType);
+ uiaRawElmProvider::RaiseUiaEventForGeckoEvent(aTarget, aEventType);
}
-void a11y::PlatformStateChangeEvent(Accessible* aTarget, uint64_t, bool) {
+void a11y::PlatformStateChangeEvent(Accessible* aTarget, uint64_t aState,
+ bool aEnabled) {
MsaaAccessible::FireWinEvent(aTarget, nsIAccessibleEvent::EVENT_STATE_CHANGE);
+ uiaRawElmProvider::RaiseUiaEventForStateChange(aTarget, aState, aEnabled);
}
void a11y::PlatformFocusEvent(Accessible* aTarget,
@@ -91,6 +94,8 @@ void a11y::PlatformFocusEvent(Accessible* aTarget,
AccessibleWrap::UpdateSystemCaretFor(aTarget, aCaretRect);
MsaaAccessible::FireWinEvent(aTarget, nsIAccessibleEvent::EVENT_FOCUS);
+ uiaRawElmProvider::RaiseUiaEventForGeckoEvent(
+ aTarget, nsIAccessibleEvent::EVENT_FOCUS);
}
void a11y::PlatformCaretMoveEvent(Accessible* aTarget, int32_t aOffset,