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

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: Added the actual test files. 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
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..552a87778ed1cf357702481ef70df5592856a6c9 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,7 +5499,8 @@ 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).
+ // aria-readonly attribute and for a few roles (in the switch above), such as
+ // read-only text fields.
// 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) &&

Powered by Google App Engine
This is Rietveld 408576698