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

Side by Side Diff: content/renderer/accessibility/blink_ax_tree_source.cc

Issue 744843002: Added the aria-sort state to the accessibility tree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Android test expectations. Created 5 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/accessibility/blink_ax_tree_source.h" 5 #include "content/renderer/accessibility/blink_ax_tree_source.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 dst->role == ui::AX_ROLE_ROW_HEADER || 538 dst->role == ui::AX_ROLE_ROW_HEADER ||
539 dst->role == ui::AX_ROLE_COLUMN_HEADER) { 539 dst->role == ui::AX_ROLE_COLUMN_HEADER) {
540 dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_COLUMN_INDEX, 540 dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_COLUMN_INDEX,
541 src.cellColumnIndex()); 541 src.cellColumnIndex());
542 dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_COLUMN_SPAN, 542 dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_COLUMN_SPAN,
543 src.cellColumnSpan()); 543 src.cellColumnSpan());
544 dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_ROW_INDEX, src.cellRowIndex()); 544 dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_ROW_INDEX, src.cellRowIndex());
545 dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_ROW_SPAN, src.cellRowSpan()); 545 dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_ROW_SPAN, src.cellRowSpan());
546 } 546 }
547 547
548 if ((dst->role == ui::AX_ROLE_ROW_HEADER ||
549 dst->role == ui::AX_ROLE_COLUMN_HEADER) && src.sortDirection()) {
550 dst->AddIntAttribute(ui::AX_ATTR_SORT_DIRECTION,
551 AXSortDirectionFromBlink(src.sortDirection()));
552 }
553
548 dst->AddStringAttribute(ui::AX_ATTR_NAME, name); 554 dst->AddStringAttribute(ui::AX_ATTR_NAME, name);
549 555
550 // Add the ids of *indirect* children - those who are children of this node, 556 // Add the ids of *indirect* children - those who are children of this node,
551 // but whose parent is *not* this node. One example is a table 557 // but whose parent is *not* this node. One example is a table
552 // cell, which is a child of both a row and a column. Because the cell's 558 // cell, which is a child of both a row and a column. Because the cell's
553 // parent is the row, the row adds it as a child, and the column adds it 559 // parent is the row, the row adds it as a child, and the column adds it
554 // as an indirect child. 560 // as an indirect child.
555 int child_count = src.childCount(); 561 int child_count = src.childCount();
556 for (int i = 0; i < child_count; ++i) { 562 for (int i = 0; i < child_count; ++i) {
557 WebAXObject child = src.childAt(i); 563 WebAXObject child = src.childAt(i);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 AddIntListAttributeFromWebObjects(ui::AX_ATTR_OWNS_IDS, owns, dst); 595 AddIntListAttributeFromWebObjects(ui::AX_ATTR_OWNS_IDS, owns, dst);
590 } 596 }
591 597
592 blink::WebDocument BlinkAXTreeSource::GetMainDocument() const { 598 blink::WebDocument BlinkAXTreeSource::GetMainDocument() const {
593 if (render_frame_ && render_frame_->GetWebFrame()) 599 if (render_frame_ && render_frame_->GetWebFrame())
594 return render_frame_->GetWebFrame()->document(); 600 return render_frame_->GetWebFrame()->document();
595 return WebDocument(); 601 return WebDocument();
596 } 602 }
597 603
598 } // namespace content 604 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/accessibility/blink_ax_enum_conversion.cc ('k') | content/test/data/accessibility/aria/aria-sort.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698