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

Unified Diff: third_party/WebKit/Source/modules/accessibility/AXARIAGrid.cpp

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: third_party/WebKit/Source/modules/accessibility/AXARIAGrid.cpp
diff --git a/third_party/WebKit/Source/modules/accessibility/AXARIAGrid.cpp b/third_party/WebKit/Source/modules/accessibility/AXARIAGrid.cpp
index 8fea14fb15a87c1ba922be3df27ec133e845e791..4bb9d3daff3cf14ef3768afce36fcb0922aa2bd5 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXARIAGrid.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXARIAGrid.cpp
@@ -48,29 +48,31 @@ AXARIAGrid* AXARIAGrid::Create(LayoutObject* layout_object,
bool AXARIAGrid::AddTableRowChild(AXObject* child,
HeapHashSet<Member<AXObject>>& appended_rows,
unsigned& column_count) {
- if (!child || !child->IsTableRow() || child->RoleValue() != kRowRole)
+ if (!child || child->RoleValue() != kRowRole)
return false;
- AXTableRow* row = ToAXTableRow(child);
- if (appended_rows.Contains(row))
+ if (appended_rows.Contains(child))
return false;
// store the maximum number of columns
- unsigned row_cell_count = row->Children().size();
+ const unsigned row_cell_count = child->Children().size();
if (row_cell_count > column_count)
column_count = row_cell_count;
- row->SetRowIndex((int)rows_.size());
- rows_.push_back(row);
+ AXTableRow* row = child->IsTableRow() ? ToAXTableRow(child) : 0;
+ if (row) {
+ row->SetRowIndex((int)rows_.size());
+ }
+ rows_.push_back(child);
// Try adding the row if it's not ignoring accessibility,
// otherwise add its children (the cells) as the grid's children.
- if (!row->AccessibilityIsIgnored())
- children_.push_back(row);
+ if (!child->AccessibilityIsIgnored())
+ children_.push_back(child);
else
- children_.AppendVector(row->Children());
+ children_.AppendVector(child->Children());
- appended_rows.insert(row);
+ appended_rows.insert(child);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698