Index: content/browser/accessibility/browser_accessibility.cc |
diff --git a/content/browser/accessibility/browser_accessibility.cc b/content/browser/accessibility/browser_accessibility.cc |
index cf99c1c8f8c74d551b30848aabee2b2e8fbefc50..bb75e3a7f6d00c0c4697c7fe7eb1deffb52168ea 100644 |
--- a/content/browser/accessibility/browser_accessibility.cc |
+++ b/content/browser/accessibility/browser_accessibility.cc |
@@ -127,6 +127,11 @@ bool BrowserAccessibility::IsDescendantOf( |
return false; |
} |
+bool BrowserAccessibility::IsDocument() const { |
+ return GetRole() == ui::AX_ROLE_ROOT_WEB_AREA || |
+ GetRole() == ui::AX_ROLE_WEB_AREA; |
+} |
dougt
2017/06/27 17:23:38
Note in CL 2962453002, I started moving this kind
|
+ |
bool BrowserAccessibility::IsTextOnlyObject() const { |
return GetRole() == ui::AX_ROLE_STATIC_TEXT || |
GetRole() == ui::AX_ROLE_LINE_BREAK || |
@@ -967,6 +972,14 @@ bool BrowserAccessibility::IsNativeTextControl() const { |
return html_tag == "textarea"; |
} |
+// In general we should use IsEditBox() instead if we want to check for |
+// something that has a caret and the user can edit. |
+// TODO(aleventhal) this name is confusing because it returns true for combobox, |
+// and we should take a look at why a combobox is considered a text control. The |
+// ARIA spec says a combobox would contain (but not be) a text field. It looks |
+// like a mistake may have been made in that comboboxes have been considered a |
+// kind of textbox. Find an appropriate name for this function, and consider |
+// returning false for comboboxes it doesn't break existing websites. |
bool BrowserAccessibility::IsSimpleTextControl() const { |
// Time fields, color wells and spinner buttons might also use text fields as |
// constituent parts, but they are not considered text fields as a whole. |
@@ -981,6 +994,11 @@ bool BrowserAccessibility::IsSimpleTextControl() const { |
} |
} |
+bool BrowserAccessibility::IsEditBox() const { |
dougt
2017/06/27 17:23:38
Same.
|
+ return GetRole() == ui::AX_ROLE_TEXT_FIELD || |
+ GetRole() == ui::AX_ROLE_SEARCH_BOX; |
+} |
+ |
// Indicates if this object is at the root of a rich edit text control. |
bool BrowserAccessibility::IsRichTextControl() const { |
return HasState(ui::AX_STATE_RICHLY_EDITABLE) && |