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

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

Issue 2912243002: Fix todo's in AXPlatformNodeWin::get_accRole related to string results. (Closed)
Patch Set: Uppercase two more tests Created 3 years, 7 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/test/data/accessibility/event/text-changed-expected-win.txt ('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 44af7cdc285ee8207b5e4e822dfa6a5157813ef6..c73ad5022572b1d882856282b2def4ee9e8f79ba 100644
--- a/ui/accessibility/platform/ax_platform_node_win.cc
+++ b/ui/accessibility/platform/ax_platform_node_win.cc
@@ -10,6 +10,7 @@
#include "base/containers/hash_tables.h"
#include "base/lazy_instance.h"
+#include "base/strings/string_util.h"
#include "base/win/scoped_comptr.h"
#include "base/win/scoped_variant.h"
#include "third_party/iaccessible2/ia2_api_all.h"
@@ -503,7 +504,8 @@ STDMETHODIMP AXPlatformNodeWin::get_accRole(
// For historical reasons, we return a string (typically
// containing the HTML tag name) as the MSAA role, rather
// than a int.
- std::string role_string = target->StringOverrideForMSAARole();
+ std::string role_string =
+ base::ToUpperASCII(target->StringOverrideForMSAARole());
if (!role_string.empty()) {
role->vt = VT_BSTR;
std::wstring wsTmp(role_string.begin(), role_string.end());
@@ -1380,13 +1382,13 @@ std::string AXPlatformNodeWin::StringOverrideForMSAARole() {
case ui::AX_ROLE_CANVAS:
if (GetData().GetBoolAttribute(ui::AX_ATTR_CANVAS_HAS_FALLBACK)) {
- // TODO(dougt) why not just use the html_tag?
- return "canvas";
+ return html_tag;
}
break;
case ui::AX_ROLE_FORM:
- // TODO(dougt) why not just use the html_tag?
+ // This could be a div with the role of form
+ // so we return just the string "form".
return "form";
case ui::AX_ROLE_HEADING:
@@ -1395,8 +1397,7 @@ std::string AXPlatformNodeWin::StringOverrideForMSAARole() {
break;
case ui::AX_ROLE_PARAGRAPH:
- // TODO(dougt) why not just use the html_tag and why upper case?
- return "P";
+ return html_tag;
case ui::AX_ROLE_GENERIC_CONTAINER:
// TODO(dougt) why can't we always use div in this case?
« no previous file with comments | « content/test/data/accessibility/event/text-changed-expected-win.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698