Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(406)

Unified Diff: ui/accessibility/platform/ax_platform_node_win.cc

Issue 2855463003: Forward BrowserAccessibilityWin::get_accName to platform node. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/accessibility/browser_accessibility_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/accessibility/platform/ax_platform_node_win.cc
diff --git a/ui/accessibility/platform/ax_platform_node_win.cc b/ui/accessibility/platform/ax_platform_node_win.cc
index 9aa621d744534c20dd673fb7bb182d82566a2a4c..45febe854b95fcef69d659740b6088c101864e0d 100644
--- a/ui/accessibility/platform/ax_platform_node_win.cc
+++ b/ui/accessibility/platform/ax_platform_node_win.cc
@@ -474,7 +474,17 @@ STDMETHODIMP AXPlatformNodeWin::get_accName(
AXPlatformNodeWin* target;
COM_OBJECT_VALIDATE_VAR_ID_1_ARG_AND_GET_TARGET(var_id, name, target);
- return target->GetStringAttributeAsBstr(ui::AX_ATTR_NAME, name);
+ HRESULT result = target->GetStringAttributeAsBstr(ui::AX_ATTR_NAME, name);
+ if (FAILED(result) && MSAARole() == ROLE_SYSTEM_DOCUMENT && GetParent()) {
+ // Hack: Some versions of JAWS crash if they get an empty name on
+ // a document that's the child of an iframe, so always return a
+ // nonempty string for this role. https://crbug.com/583057
+ base::string16 str = L" ";
+
+ *name = SysAllocString(str.c_str());
+ DCHECK(*name);
+ }
+ return result;
}
STDMETHODIMP AXPlatformNodeWin::get_accParent(
« no previous file with comments | « content/browser/accessibility/browser_accessibility_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698