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

Unified Diff: content/browser/accessibility/browser_accessibility_win.cc

Issue 2406233003: Sets the readonly state on read-only text fields on Windows. (Closed)
Patch Set: Fixed test expectations. Created 4 years, 2 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 | « no previous file | content/browser/accessibility/dump_accessibility_tree_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/accessibility/browser_accessibility_win.cc
diff --git a/content/browser/accessibility/browser_accessibility_win.cc b/content/browser/accessibility/browser_accessibility_win.cc
index aca1a5841402f061555cdc2f375757d86e5939b6..eb41132a43c507064f4e557574a2169b9a09241c 100644
--- a/content/browser/accessibility/browser_accessibility_win.cc
+++ b/content/browser/accessibility/browser_accessibility_win.cc
@@ -5438,10 +5438,13 @@ void BrowserAccessibilityWin::InitRoleAndState() {
case ui::AX_ROLE_TEXT_FIELD:
case ui::AX_ROLE_SEARCH_BOX:
ia_role = ROLE_SYSTEM_TEXT;
- if (HasState(ui::AX_STATE_MULTILINE))
+ if (HasState(ui::AX_STATE_MULTILINE)) {
ia2_state |= IA2_STATE_MULTI_LINE;
- else
+ } else {
ia2_state |= IA2_STATE_SINGLE_LINE;
+ }
+ if (HasState(ui::AX_STATE_READ_ONLY))
+ ia_state |= STATE_SYSTEM_READONLY;
ia2_state |= IA2_STATE_SELECTABLE_TEXT;
break;
case ui::AX_ROLE_ABBR:
@@ -5496,11 +5499,11 @@ void BrowserAccessibilityWin::InitRoleAndState() {
// Compute the final value of READONLY for MSAA.
//
// We always set the READONLY state for elements that have the
- // aria-readonly attribute and for a few roles (in the switch above).
- // We clear the READONLY state on focusable controls and on a document.
- // Everything else, the majority of objects, do not have this state set.
- if (HasState(ui::AX_STATE_FOCUSABLE) &&
- ia_role != ROLE_SYSTEM_DOCUMENT) {
+ // aria-readonly attribute and for a few roles (in the switch above),
+ // including read-only text fields.
+ // The majority of focusable controls should not have the read-only state set.
+ if (HasState(ui::AX_STATE_FOCUSABLE) && ia_role != ROLE_SYSTEM_DOCUMENT &&
+ ia_role != ROLE_SYSTEM_TEXT) {
ia_state &= ~(STATE_SYSTEM_READONLY);
}
if (!HasState(ui::AX_STATE_READ_ONLY))
« no previous file with comments | « no previous file | content/browser/accessibility/dump_accessibility_tree_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698