Selectable (but not editable) native Cocoa textfields allow the selected text range to be changed via an accessibility client, but in Chrome, views::Textfields only allow editable Textfields to change the selected text range.
Fix this behaviour to match - probably involves changing views::Textfield::SetSelectionRange() to not use ImeEditingAllowed() and instead gate changing the selection on ui::TextInputType == ui::TEXT_INPUT_TYPE_PASSWORD.
To repro:
1. Open the Accessibility Inspector.
2. Either find a read-only textfield in Chrome (I'm not aware of one) and skip to step 4, or change views::Textfield::read_only() to always return true.
3. Open the bookmark bubble and click 'Edit'. The name of the bookmark should already be populated, but it'll be read-only (so there's some text to select).
4. Select some text in the read-only textfield.
5. Use the Accessibility Inspector to view the NSAccessibilitySelectedTextRange. It should match up with the current selection, and provide an option to edit the range.
6. Editing the range should change the selection in the read-only Textfield. (Selection should show up when refocusing on the dialog due to Issue 645338).
7. Repeating steps 4 to 5 with a password views::Textfield should not show that the selected text range is editable.
Comment 1 by dmazz...@chromium.org
, Mar 27 2017