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

Unified Diff: content/renderer/accessibility/blink_ax_tree_source.cc

Issue 2825803002: Expose internal treegrid role, do some cleanup for table/grid/treegrid handling (Closed)
Patch Set: Fix mac tests Created 3 years, 8 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/renderer/accessibility/blink_ax_tree_source.cc
diff --git a/content/renderer/accessibility/blink_ax_tree_source.cc b/content/renderer/accessibility/blink_ax_tree_source.cc
index 1c89507e2e60b7668dbd7fb82dd16802317dbb6f..8cff622b21c841a66c18983fb8fabe868d6f104a 100644
--- a/content/renderer/accessibility/blink_ax_tree_source.cc
+++ b/content/renderer/accessibility/blink_ax_tree_source.cc
@@ -669,7 +669,10 @@ void BlinkAXTreeSource::SerializeNode(blink::WebAXObject src,
if (dst->role == ui::AX_ROLE_ROOT_WEB_AREA)
dst->AddStringAttribute(ui::AX_ATTR_HTML_TAG, "#document");
- if (dst->role == ui::AX_ROLE_TABLE) {
+ const bool is_table_like_role = dst->role == ui::AX_ROLE_TABLE ||
+ dst->role == ui::AX_ROLE_GRID ||
+ dst->role == ui::AX_ROLE_TREE_GRID;
+ if (is_table_like_role) {
int column_count = src.ColumnCount();
int row_count = src.RowCount();
if (column_count > 0 && row_count > 0) {
@@ -697,11 +700,7 @@ void BlinkAXTreeSource::SerializeNode(blink::WebAXObject src,
dst->AddIntListAttribute(ui::AX_ATTR_CELL_IDS, cell_ids);
dst->AddIntListAttribute(ui::AX_ATTR_UNIQUE_CELL_IDS, unique_cell_ids);
}
- }
- if (dst->role == ui::AX_ROLE_TABLE ||
- dst->role == ui::AX_ROLE_GRID ||
- dst->role == ui::AX_ROLE_TREE_GRID) {
int aria_colcount = src.AriaColumnCount();
if (aria_colcount)
dst->AddIntAttribute(ui::AX_ATTR_ARIA_COL_COUNT, aria_colcount);

Powered by Google App Engine
This is Rietveld 408576698