Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 9c2e9bd

Browse files
PR
1 parent 688e635 commit 9c2e9bd

File tree

4 files changed

+21
-24
lines changed

4 files changed

+21
-24
lines changed

shell/platform/windows/accessibility_alert.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,9 @@ IFACEMETHODIMP AccessibilityAlert::get_accParent(IDispatch** disp_parent) {
9595
*disp_parent = parent_;
9696
if (*disp_parent) {
9797
(*disp_parent)->AddRef();
98+
return S_OK;
9899
}
99-
return S_OK;
100-
//*disp_parent = nullptr;
101-
// return E_NOTIMPL;
100+
return S_FALSE;
102101
}
103102

104103
// Retrieves information describing the role of the specified object.
@@ -127,6 +126,7 @@ IFACEMETHODIMP AccessibilityAlert::get_accValue(VARIANT var_id, BSTR* value) {
127126
*value = SysAllocString(text_.c_str());
128127
return S_OK;
129128
}
129+
130130
IFACEMETHODIMP AccessibilityAlert::put_accValue(VARIANT var_id,
131131
BSTR new_value) {
132132
return E_NOTIMPL;
@@ -137,9 +137,11 @@ IFACEMETHODIMP AccessibilityAlert::get_accSelection(VARIANT* selected) {
137137
selected->vt = VT_EMPTY;
138138
return E_NOTIMPL;
139139
}
140+
140141
IFACEMETHODIMP AccessibilityAlert::accSelect(LONG flags_sel, VARIANT var_id) {
141142
return E_NOTIMPL;
142143
}
144+
143145
IFACEMETHODIMP AccessibilityAlert::get_accHelpTopic(BSTR* help_file,
144146
VARIANT var_id,
145147
LONG* topic_id) {

shell/platform/windows/accessibility_alert.h

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,6 @@ class AccessibilityAlert : public CComObjectRootEx<CComMultiThreadModel>,
3232
VARIANT* child) override;
3333

3434
// Performs the object's default action.
35-
IFACEMETHODIMP accDoDefaultAction(VARIANT var_id) override;
36-
37-
// Retrieves the specified object's current screen location.
38-
IFACEMETHODIMP accLocation(LONG* physical_pixel_left,
39-
LONG* physical_pixel_top,
40-
LONG* width,
41-
LONG* height,
42-
VARIANT var_id) override;
43-
44-
// Traverses to another UI element and retrieves the object.
45-
IFACEMETHODIMP accNavigate(LONG nav_dir,
46-
VARIANT start,
47-
VARIANT* end) override;
4835

4936
// Retrieves an IDispatch interface pointer for the specified child.
5037
IFACEMETHODIMP get_accChild(VARIANT var_child,
@@ -61,11 +48,6 @@ class AccessibilityAlert : public CComObjectRootEx<CComMultiThreadModel>,
6148
IFACEMETHODIMP get_accDescription(VARIANT var_id, BSTR* desc) override;
6249

6350
// Retrieves the object that has the keyboard focus.
64-
IFACEMETHODIMP get_accFocus(VARIANT* focus_child) override;
65-
66-
// Retrieves the specified object's shortcut.
67-
IFACEMETHODIMP get_accKeyboardShortcut(VARIANT var_id,
68-
BSTR* access_key) override;
6951

7052
// Retrieves the name of the specified object.
7153
IFACEMETHODIMP get_accName(VARIANT var_id, BSTR* name) override;
@@ -86,15 +68,27 @@ class AccessibilityAlert : public CComObjectRootEx<CComMultiThreadModel>,
8668
// Setting the value is not typically used by screen readers, but it's
8769
// used frequently by automation software.
8870
IFACEMETHODIMP get_accValue(VARIANT var_id, BSTR* value) override;
89-
IFACEMETHODIMP put_accValue(VARIANT var_id, BSTR new_value) override;
9071

9172
// IAccessible methods not implemented.
73+
IFACEMETHODIMP accLocation(LONG* physical_pixel_left,
74+
LONG* physical_pixel_top,
75+
LONG* width,
76+
LONG* height,
77+
VARIANT var_id) override;
78+
IFACEMETHODIMP accNavigate(LONG nav_dir,
79+
VARIANT start,
80+
VARIANT* end) override;
81+
IFACEMETHODIMP accDoDefaultAction(VARIANT var_id) override;
82+
IFACEMETHODIMP get_accFocus(VARIANT* focus_child) override;
83+
IFACEMETHODIMP get_accKeyboardShortcut(VARIANT var_id,
84+
BSTR* access_key) override;
9285
IFACEMETHODIMP get_accSelection(VARIANT* selected) override;
9386
IFACEMETHODIMP accSelect(LONG flags_sel, VARIANT var_id) override;
9487
IFACEMETHODIMP get_accHelpTopic(BSTR* help_file,
9588
VARIANT var_id,
9689
LONG* topic_id) override;
9790
IFACEMETHODIMP put_accName(VARIANT var_id, BSTR put_name) override;
91+
IFACEMETHODIMP put_accValue(VARIANT var_id, BSTR new_value) override;
9892

9993
AccessibilityAlert();
10094
~AccessibilityAlert() = default;

shell/platform/windows/accessibility_root_node.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ IAccessible* AccessibilityRootNode::GetTargetAndChildID(VARIANT* var_id) {
2424
LONG& child_id = var_id->lVal;
2525
if (V_VT(var_id) != VT_I4) {
2626
child_id = kInvalidChildId;
27-
return FALSE;
27+
return nullptr;
2828
}
2929
child_id = V_I4(var_id);
3030
if (!window_accessible_) {
@@ -38,6 +38,7 @@ IAccessible* AccessibilityRootNode::GetTargetAndChildID(VARIANT* var_id) {
3838
child_id = CHILDID_SELF;
3939
return alert_accessible_;
4040
}
41+
// A negative child ID can be used to refer to an AX node directly by its ID.
4142
if (child_id < 0) {
4243
return window_accessible_;
4344
}

shell/platform/windows/window.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ void Window::CreateAccessibilityRootNode() {
666666
ui::win::CreateATLModuleIfNeeded();
667667
CComObject<AccessibilityRootNode>* instance = nullptr;
668668
HRESULT hr = CComObject<AccessibilityRootNode>::CreateInstance(&instance);
669-
if (!SUCCEEDED(hr)) {
669+
if (!SUCCEEDED(hr) || !instance) {
670670
FML_LOG(FATAL) << "Failed to create accessibility root node";
671671
}
672672
instance->AddRef();

0 commit comments

Comments
 (0)