| OLD | NEW |
| 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 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 533 dst->role == ui::AX_ROLE_ROW_HEADER || | 533 dst->role == ui::AX_ROLE_ROW_HEADER || |
| 534 dst->role == ui::AX_ROLE_COLUMN_HEADER) { | 534 dst->role == ui::AX_ROLE_COLUMN_HEADER) { |
| 535 dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_COLUMN_INDEX, | 535 dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_COLUMN_INDEX, |
| 536 src.cellColumnIndex()); | 536 src.cellColumnIndex()); |
| 537 dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_COLUMN_SPAN, | 537 dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_COLUMN_SPAN, |
| 538 src.cellColumnSpan()); | 538 src.cellColumnSpan()); |
| 539 dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_ROW_INDEX, src.cellRowIndex()); | 539 dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_ROW_INDEX, src.cellRowIndex()); |
| 540 dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_ROW_SPAN, src.cellRowSpan()); | 540 dst->AddIntAttribute(ui::AX_ATTR_TABLE_CELL_ROW_SPAN, src.cellRowSpan()); |
| 541 } | 541 } |
| 542 | 542 |
| 543 if ((dst->role == ui::AX_ROLE_ROW_HEADER || |
| 544 dst->role == ui::AX_ROLE_COLUMN_HEADER) && src.sortDirection()) { |
| 545 dst->AddIntAttribute(ui::AX_ATTR_SORT_DIRECTION, |
| 546 AXSortDirectionFromBlink(src.sortDirection())); |
| 547 } |
| 548 |
| 543 dst->AddStringAttribute(ui::AX_ATTR_NAME, name); | 549 dst->AddStringAttribute(ui::AX_ATTR_NAME, name); |
| 544 | 550 |
| 545 // Add the ids of *indirect* children - those who are children of this node, | 551 // Add the ids of *indirect* children - those who are children of this node, |
| 546 // but whose parent is *not* this node. One example is a table | 552 // but whose parent is *not* this node. One example is a table |
| 547 // cell, which is a child of both a row and a column. Because the cell's | 553 // cell, which is a child of both a row and a column. Because the cell's |
| 548 // parent is the row, the row adds it as a child, and the column adds it | 554 // parent is the row, the row adds it as a child, and the column adds it |
| 549 // as an indirect child. | 555 // as an indirect child. |
| 550 int child_count = src.childCount(); | 556 int child_count = src.childCount(); |
| 551 for (int i = 0; i < child_count; ++i) { | 557 for (int i = 0; i < child_count; ++i) { |
| 552 WebAXObject child = src.childAt(i); | 558 WebAXObject child = src.childAt(i); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 AddIntListAttributeFromWebObjects(ui::AX_ATTR_OWNS_IDS, owns, dst); | 590 AddIntListAttributeFromWebObjects(ui::AX_ATTR_OWNS_IDS, owns, dst); |
| 585 } | 591 } |
| 586 | 592 |
| 587 blink::WebDocument BlinkAXTreeSource::GetMainDocument() const { | 593 blink::WebDocument BlinkAXTreeSource::GetMainDocument() const { |
| 588 if (render_frame_ && render_frame_->GetWebFrame()) | 594 if (render_frame_ && render_frame_->GetWebFrame()) |
| 589 return render_frame_->GetWebFrame()->document(); | 595 return render_frame_->GetWebFrame()->document(); |
| 590 return WebDocument(); | 596 return WebDocument(); |
| 591 } | 597 } |
| 592 | 598 |
| 593 } // namespace content | 599 } // namespace content |
| OLD | NEW |