OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/accessibility/browser_accessibility_win.h" | 5 #include "content/browser/accessibility/browser_accessibility_win.h" |
6 | 6 |
7 #include <UIAutomationClient.h> | 7 #include <UIAutomationClient.h> |
8 #include <UIAutomationCoreApi.h> | 8 #include <UIAutomationCoreApi.h> |
9 | 9 |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 STDMETHODIMP BrowserAccessibilityWin::get_accHelpTopic(BSTR* help_file, | 591 STDMETHODIMP BrowserAccessibilityWin::get_accHelpTopic(BSTR* help_file, |
592 VARIANT var_id, | 592 VARIANT var_id, |
593 LONG* topic_id) { | 593 LONG* topic_id) { |
594 return E_NOTIMPL; | 594 return E_NOTIMPL; |
595 } | 595 } |
596 | 596 |
597 STDMETHODIMP BrowserAccessibilityWin::get_accSelection(VARIANT* selected) { | 597 STDMETHODIMP BrowserAccessibilityWin::get_accSelection(VARIANT* selected) { |
598 if (!instance_active_) | 598 if (!instance_active_) |
599 return E_FAIL; | 599 return E_FAIL; |
600 | 600 |
601 if (role_ != AccessibilityNodeData::ROLE_LISTBOX) | 601 if (role_ != WebKit::WebAXRoleListBox) |
602 return E_NOTIMPL; | 602 return E_NOTIMPL; |
603 | 603 |
604 unsigned long selected_count = 0; | 604 unsigned long selected_count = 0; |
605 for (size_t i = 0; i < children_.size(); ++i) { | 605 for (size_t i = 0; i < children_.size(); ++i) { |
606 if (children_[i]->HasState(AccessibilityNodeData::STATE_SELECTED)) | 606 if (children_[i]->HasState(WebKit::WebAXStateSelected)) |
607 ++selected_count; | 607 ++selected_count; |
608 } | 608 } |
609 | 609 |
610 if (selected_count == 0) { | 610 if (selected_count == 0) { |
611 selected->vt = VT_EMPTY; | 611 selected->vt = VT_EMPTY; |
612 return S_OK; | 612 return S_OK; |
613 } | 613 } |
614 | 614 |
615 if (selected_count == 1) { | 615 if (selected_count == 1) { |
616 for (size_t i = 0; i < children_.size(); ++i) { | 616 for (size_t i = 0; i < children_.size(); ++i) { |
617 if (children_[i]->HasState(AccessibilityNodeData::STATE_SELECTED)) { | 617 if (children_[i]->HasState(WebKit::WebAXStateSelected)) { |
618 selected->vt = VT_DISPATCH; | 618 selected->vt = VT_DISPATCH; |
619 selected->pdispVal = | 619 selected->pdispVal = |
620 children_[i]->ToBrowserAccessibilityWin()->NewReference(); | 620 children_[i]->ToBrowserAccessibilityWin()->NewReference(); |
621 return S_OK; | 621 return S_OK; |
622 } | 622 } |
623 } | 623 } |
624 } | 624 } |
625 | 625 |
626 // Multiple items are selected. | 626 // Multiple items are selected. |
627 base::win::EnumVariant* enum_variant = | 627 base::win::EnumVariant* enum_variant = |
628 new base::win::EnumVariant(selected_count); | 628 new base::win::EnumVariant(selected_count); |
629 enum_variant->AddRef(); | 629 enum_variant->AddRef(); |
630 unsigned long index = 0; | 630 unsigned long index = 0; |
631 for (size_t i = 0; i < children_.size(); ++i) { | 631 for (size_t i = 0; i < children_.size(); ++i) { |
632 if (children_[i]->HasState(AccessibilityNodeData::STATE_SELECTED)) { | 632 if (children_[i]->HasState(WebKit::WebAXStateSelected)) { |
633 enum_variant->ItemAt(index)->vt = VT_DISPATCH; | 633 enum_variant->ItemAt(index)->vt = VT_DISPATCH; |
634 enum_variant->ItemAt(index)->pdispVal = | 634 enum_variant->ItemAt(index)->pdispVal = |
635 children_[i]->ToBrowserAccessibilityWin()->NewReference(); | 635 children_[i]->ToBrowserAccessibilityWin()->NewReference(); |
636 ++index; | 636 ++index; |
637 } | 637 } |
638 } | 638 } |
639 selected->vt = VT_UNKNOWN; | 639 selected->vt = VT_UNKNOWN; |
640 selected->punkVal = static_cast<IUnknown*>( | 640 selected->punkVal = static_cast<IUnknown*>( |
641 static_cast<base::win::IUnknownImpl*>(enum_variant)); | 641 static_cast<base::win::IUnknownImpl*>(enum_variant)); |
642 return S_OK; | 642 return S_OK; |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
863 STDMETHODIMP BrowserAccessibilityWin::get_groupPosition( | 863 STDMETHODIMP BrowserAccessibilityWin::get_groupPosition( |
864 LONG* group_level, | 864 LONG* group_level, |
865 LONG* similar_items_in_group, | 865 LONG* similar_items_in_group, |
866 LONG* position_in_group) { | 866 LONG* position_in_group) { |
867 if (!instance_active_) | 867 if (!instance_active_) |
868 return E_FAIL; | 868 return E_FAIL; |
869 | 869 |
870 if (!group_level || !similar_items_in_group || !position_in_group) | 870 if (!group_level || !similar_items_in_group || !position_in_group) |
871 return E_INVALIDARG; | 871 return E_INVALIDARG; |
872 | 872 |
873 if (role_ == AccessibilityNodeData::ROLE_LISTBOX_OPTION && | 873 if (role_ == WebKit::WebAXRoleListBoxOption && |
874 parent_ && | 874 parent_ && |
875 parent_->role() == AccessibilityNodeData::ROLE_LISTBOX) { | 875 parent_->role() == WebKit::WebAXRoleListBox) { |
876 *group_level = 0; | 876 *group_level = 0; |
877 *similar_items_in_group = parent_->child_count(); | 877 *similar_items_in_group = parent_->child_count(); |
878 *position_in_group = index_in_parent_ + 1; | 878 *position_in_group = index_in_parent_ + 1; |
879 return S_OK; | 879 return S_OK; |
880 } | 880 } |
881 | 881 |
882 return E_NOTIMPL; | 882 return E_NOTIMPL; |
883 } | 883 } |
884 | 884 |
885 // | 885 // |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1124 | 1124 |
1125 if (column < 0 || column >= columns) | 1125 if (column < 0 || column >= columns) |
1126 return E_INVALIDARG; | 1126 return E_INVALIDARG; |
1127 | 1127 |
1128 const std::vector<int32>& cell_ids = GetIntListAttribute( | 1128 const std::vector<int32>& cell_ids = GetIntListAttribute( |
1129 AccessibilityNodeData::ATTR_CELL_IDS); | 1129 AccessibilityNodeData::ATTR_CELL_IDS); |
1130 for (int i = 0; i < rows; ++i) { | 1130 for (int i = 0; i < rows; ++i) { |
1131 int cell_id = cell_ids[i * columns + column]; | 1131 int cell_id = cell_ids[i * columns + column]; |
1132 BrowserAccessibilityWin* cell = static_cast<BrowserAccessibilityWin*>( | 1132 BrowserAccessibilityWin* cell = static_cast<BrowserAccessibilityWin*>( |
1133 manager_->GetFromRendererID(cell_id)); | 1133 manager_->GetFromRendererID(cell_id)); |
1134 if (cell && cell->role_ == AccessibilityNodeData::ROLE_COLUMN_HEADER) { | 1134 if (cell && cell->role_ == WebKit::WebAXRoleColumnHeader) { |
1135 string16 cell_name = cell->GetString16Attribute( | 1135 string16 cell_name = cell->GetString16Attribute( |
1136 AccessibilityNodeData::ATTR_NAME); | 1136 AccessibilityNodeData::ATTR_NAME); |
1137 if (cell_name.size() > 0) { | 1137 if (cell_name.size() > 0) { |
1138 *description = SysAllocString(cell_name.c_str()); | 1138 *description = SysAllocString(cell_name.c_str()); |
1139 return S_OK; | 1139 return S_OK; |
1140 } | 1140 } |
1141 | 1141 |
1142 return cell->GetStringAttributeAsBstr( | 1142 return cell->GetStringAttributeAsBstr( |
1143 AccessibilityNodeData::ATTR_DESCRIPTION, description); | 1143 AccessibilityNodeData::ATTR_DESCRIPTION, description); |
1144 } | 1144 } |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1311 | 1311 |
1312 if (row < 0 || row >= rows) | 1312 if (row < 0 || row >= rows) |
1313 return E_INVALIDARG; | 1313 return E_INVALIDARG; |
1314 | 1314 |
1315 const std::vector<int32>& cell_ids = GetIntListAttribute( | 1315 const std::vector<int32>& cell_ids = GetIntListAttribute( |
1316 AccessibilityNodeData::ATTR_CELL_IDS); | 1316 AccessibilityNodeData::ATTR_CELL_IDS); |
1317 for (int i = 0; i < columns; ++i) { | 1317 for (int i = 0; i < columns; ++i) { |
1318 int cell_id = cell_ids[row * columns + i]; | 1318 int cell_id = cell_ids[row * columns + i]; |
1319 BrowserAccessibilityWin* cell = | 1319 BrowserAccessibilityWin* cell = |
1320 manager_->GetFromRendererID(cell_id)->ToBrowserAccessibilityWin(); | 1320 manager_->GetFromRendererID(cell_id)->ToBrowserAccessibilityWin(); |
1321 if (cell && cell->role_ == AccessibilityNodeData::ROLE_ROW_HEADER) { | 1321 if (cell && cell->role_ == WebKit::WebAXRoleRowHeader) { |
1322 string16 cell_name = cell->GetString16Attribute( | 1322 string16 cell_name = cell->GetString16Attribute( |
1323 AccessibilityNodeData::ATTR_NAME); | 1323 AccessibilityNodeData::ATTR_NAME); |
1324 if (cell_name.size() > 0) { | 1324 if (cell_name.size() > 0) { |
1325 *description = SysAllocString(cell_name.c_str()); | 1325 *description = SysAllocString(cell_name.c_str()); |
1326 return S_OK; | 1326 return S_OK; |
1327 } | 1327 } |
1328 | 1328 |
1329 return cell->GetStringAttributeAsBstr( | 1329 return cell->GetStringAttributeAsBstr( |
1330 AccessibilityNodeData::ATTR_DESCRIPTION, description); | 1330 AccessibilityNodeData::ATTR_DESCRIPTION, description); |
1331 } | 1331 } |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1634 | 1634 |
1635 *n_column_header_cells = 0; | 1635 *n_column_header_cells = 0; |
1636 | 1636 |
1637 int column; | 1637 int column; |
1638 if (!GetIntAttribute( | 1638 if (!GetIntAttribute( |
1639 AccessibilityNodeData::ATTR_TABLE_CELL_COLUMN_INDEX, &column)) { | 1639 AccessibilityNodeData::ATTR_TABLE_CELL_COLUMN_INDEX, &column)) { |
1640 return S_FALSE; | 1640 return S_FALSE; |
1641 } | 1641 } |
1642 | 1642 |
1643 BrowserAccessibility* table = parent(); | 1643 BrowserAccessibility* table = parent(); |
1644 while (table && table->role() != AccessibilityNodeData::ROLE_TABLE) | 1644 while (table && table->role() != WebKit::WebAXRoleTable) |
1645 table = table->parent(); | 1645 table = table->parent(); |
1646 if (!table) { | 1646 if (!table) { |
1647 NOTREACHED(); | 1647 NOTREACHED(); |
1648 return S_FALSE; | 1648 return S_FALSE; |
1649 } | 1649 } |
1650 | 1650 |
1651 int columns; | 1651 int columns; |
1652 int rows; | 1652 int rows; |
1653 if (!table->GetIntAttribute( | 1653 if (!table->GetIntAttribute( |
1654 AccessibilityNodeData::ATTR_TABLE_COLUMN_COUNT, &columns) || | 1654 AccessibilityNodeData::ATTR_TABLE_COLUMN_COUNT, &columns) || |
1655 !table->GetIntAttribute( | 1655 !table->GetIntAttribute( |
1656 AccessibilityNodeData::ATTR_TABLE_ROW_COUNT, &rows)) { | 1656 AccessibilityNodeData::ATTR_TABLE_ROW_COUNT, &rows)) { |
1657 return S_FALSE; | 1657 return S_FALSE; |
1658 } | 1658 } |
1659 if (columns <= 0 || rows <= 0 || column < 0 || column >= columns) | 1659 if (columns <= 0 || rows <= 0 || column < 0 || column >= columns) |
1660 return S_FALSE; | 1660 return S_FALSE; |
1661 | 1661 |
1662 const std::vector<int32>& cell_ids = table->GetIntListAttribute( | 1662 const std::vector<int32>& cell_ids = table->GetIntListAttribute( |
1663 AccessibilityNodeData::ATTR_CELL_IDS); | 1663 AccessibilityNodeData::ATTR_CELL_IDS); |
1664 | 1664 |
1665 for (int i = 0; i < rows; ++i) { | 1665 for (int i = 0; i < rows; ++i) { |
1666 int cell_id = cell_ids[i * columns + column]; | 1666 int cell_id = cell_ids[i * columns + column]; |
1667 BrowserAccessibilityWin* cell = | 1667 BrowserAccessibilityWin* cell = |
1668 manager_->GetFromRendererID(cell_id)->ToBrowserAccessibilityWin(); | 1668 manager_->GetFromRendererID(cell_id)->ToBrowserAccessibilityWin(); |
1669 if (cell && cell->role_ == AccessibilityNodeData::ROLE_COLUMN_HEADER) | 1669 if (cell && cell->role_ == WebKit::WebAXRoleColumnHeader) |
1670 (*n_column_header_cells)++; | 1670 (*n_column_header_cells)++; |
1671 } | 1671 } |
1672 | 1672 |
1673 *cell_accessibles = static_cast<IUnknown**>(CoTaskMemAlloc( | 1673 *cell_accessibles = static_cast<IUnknown**>(CoTaskMemAlloc( |
1674 (*n_column_header_cells) * sizeof(cell_accessibles[0]))); | 1674 (*n_column_header_cells) * sizeof(cell_accessibles[0]))); |
1675 int index = 0; | 1675 int index = 0; |
1676 for (int i = 0; i < rows; ++i) { | 1676 for (int i = 0; i < rows; ++i) { |
1677 int cell_id = cell_ids[i * columns + column]; | 1677 int cell_id = cell_ids[i * columns + column]; |
1678 BrowserAccessibilityWin* cell = | 1678 BrowserAccessibilityWin* cell = |
1679 manager_->GetFromRendererID(cell_id)->ToBrowserAccessibilityWin(); | 1679 manager_->GetFromRendererID(cell_id)->ToBrowserAccessibilityWin(); |
1680 if (cell && cell->role_ == AccessibilityNodeData::ROLE_COLUMN_HEADER) { | 1680 if (cell && cell->role_ == WebKit::WebAXRoleColumnHeader) { |
1681 (*cell_accessibles)[index] = | 1681 (*cell_accessibles)[index] = |
1682 static_cast<IAccessible*>(cell->NewReference()); | 1682 static_cast<IAccessible*>(cell->NewReference()); |
1683 ++index; | 1683 ++index; |
1684 } | 1684 } |
1685 } | 1685 } |
1686 | 1686 |
1687 return S_OK; | 1687 return S_OK; |
1688 } | 1688 } |
1689 | 1689 |
1690 STDMETHODIMP BrowserAccessibilityWin::get_columnIndex(long* column_index) { | 1690 STDMETHODIMP BrowserAccessibilityWin::get_columnIndex(long* column_index) { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1733 | 1733 |
1734 *n_row_header_cells = 0; | 1734 *n_row_header_cells = 0; |
1735 | 1735 |
1736 int row; | 1736 int row; |
1737 if (!GetIntAttribute( | 1737 if (!GetIntAttribute( |
1738 AccessibilityNodeData::ATTR_TABLE_CELL_ROW_INDEX, &row)) { | 1738 AccessibilityNodeData::ATTR_TABLE_CELL_ROW_INDEX, &row)) { |
1739 return S_FALSE; | 1739 return S_FALSE; |
1740 } | 1740 } |
1741 | 1741 |
1742 BrowserAccessibility* table = parent(); | 1742 BrowserAccessibility* table = parent(); |
1743 while (table && table->role() != AccessibilityNodeData::ROLE_TABLE) | 1743 while (table && table->role() != WebKit::WebAXRoleTable) |
1744 table = table->parent(); | 1744 table = table->parent(); |
1745 if (!table) { | 1745 if (!table) { |
1746 NOTREACHED(); | 1746 NOTREACHED(); |
1747 return S_FALSE; | 1747 return S_FALSE; |
1748 } | 1748 } |
1749 | 1749 |
1750 int columns; | 1750 int columns; |
1751 int rows; | 1751 int rows; |
1752 if (!table->GetIntAttribute( | 1752 if (!table->GetIntAttribute( |
1753 AccessibilityNodeData::ATTR_TABLE_COLUMN_COUNT, &columns) || | 1753 AccessibilityNodeData::ATTR_TABLE_COLUMN_COUNT, &columns) || |
1754 !table->GetIntAttribute( | 1754 !table->GetIntAttribute( |
1755 AccessibilityNodeData::ATTR_TABLE_ROW_COUNT, &rows)) { | 1755 AccessibilityNodeData::ATTR_TABLE_ROW_COUNT, &rows)) { |
1756 return S_FALSE; | 1756 return S_FALSE; |
1757 } | 1757 } |
1758 if (columns <= 0 || rows <= 0 || row < 0 || row >= rows) | 1758 if (columns <= 0 || rows <= 0 || row < 0 || row >= rows) |
1759 return S_FALSE; | 1759 return S_FALSE; |
1760 | 1760 |
1761 const std::vector<int32>& cell_ids = table->GetIntListAttribute( | 1761 const std::vector<int32>& cell_ids = table->GetIntListAttribute( |
1762 AccessibilityNodeData::ATTR_CELL_IDS); | 1762 AccessibilityNodeData::ATTR_CELL_IDS); |
1763 | 1763 |
1764 for (int i = 0; i < columns; ++i) { | 1764 for (int i = 0; i < columns; ++i) { |
1765 int cell_id = cell_ids[row * columns + i]; | 1765 int cell_id = cell_ids[row * columns + i]; |
1766 BrowserAccessibilityWin* cell = | 1766 BrowserAccessibilityWin* cell = |
1767 manager_->GetFromRendererID(cell_id)->ToBrowserAccessibilityWin(); | 1767 manager_->GetFromRendererID(cell_id)->ToBrowserAccessibilityWin(); |
1768 if (cell && cell->role_ == AccessibilityNodeData::ROLE_ROW_HEADER) | 1768 if (cell && cell->role_ == WebKit::WebAXRoleRowHeader) |
1769 (*n_row_header_cells)++; | 1769 (*n_row_header_cells)++; |
1770 } | 1770 } |
1771 | 1771 |
1772 *cell_accessibles = static_cast<IUnknown**>(CoTaskMemAlloc( | 1772 *cell_accessibles = static_cast<IUnknown**>(CoTaskMemAlloc( |
1773 (*n_row_header_cells) * sizeof(cell_accessibles[0]))); | 1773 (*n_row_header_cells) * sizeof(cell_accessibles[0]))); |
1774 int index = 0; | 1774 int index = 0; |
1775 for (int i = 0; i < columns; ++i) { | 1775 for (int i = 0; i < columns; ++i) { |
1776 int cell_id = cell_ids[row * columns + i]; | 1776 int cell_id = cell_ids[row * columns + i]; |
1777 BrowserAccessibilityWin* cell = | 1777 BrowserAccessibilityWin* cell = |
1778 manager_->GetFromRendererID(cell_id)->ToBrowserAccessibilityWin(); | 1778 manager_->GetFromRendererID(cell_id)->ToBrowserAccessibilityWin(); |
1779 if (cell && cell->role_ == AccessibilityNodeData::ROLE_ROW_HEADER) { | 1779 if (cell && cell->role_ == WebKit::WebAXRoleRowHeader) { |
1780 (*cell_accessibles)[index] = | 1780 (*cell_accessibles)[index] = |
1781 static_cast<IAccessible*>(cell->NewReference()); | 1781 static_cast<IAccessible*>(cell->NewReference()); |
1782 ++index; | 1782 ++index; |
1783 } | 1783 } |
1784 } | 1784 } |
1785 | 1785 |
1786 return S_OK; | 1786 return S_OK; |
1787 } | 1787 } |
1788 | 1788 |
1789 STDMETHODIMP BrowserAccessibilityWin::get_rowIndex(long* row_index) { | 1789 STDMETHODIMP BrowserAccessibilityWin::get_rowIndex(long* row_index) { |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1858 if (!table) | 1858 if (!table) |
1859 return E_INVALIDARG; | 1859 return E_INVALIDARG; |
1860 | 1860 |
1861 | 1861 |
1862 int row; | 1862 int row; |
1863 int column; | 1863 int column; |
1864 GetIntAttribute(AccessibilityNodeData::ATTR_TABLE_CELL_ROW_INDEX, &row); | 1864 GetIntAttribute(AccessibilityNodeData::ATTR_TABLE_CELL_ROW_INDEX, &row); |
1865 GetIntAttribute(AccessibilityNodeData::ATTR_TABLE_CELL_COLUMN_INDEX, &column); | 1865 GetIntAttribute(AccessibilityNodeData::ATTR_TABLE_CELL_COLUMN_INDEX, &column); |
1866 | 1866 |
1867 BrowserAccessibility* find_table = parent(); | 1867 BrowserAccessibility* find_table = parent(); |
1868 while (find_table && find_table->role() != AccessibilityNodeData::ROLE_TABLE) | 1868 while (find_table && find_table->role() != WebKit::WebAXRoleTable) |
1869 find_table = find_table->parent(); | 1869 find_table = find_table->parent(); |
1870 if (!find_table) { | 1870 if (!find_table) { |
1871 NOTREACHED(); | 1871 NOTREACHED(); |
1872 return S_FALSE; | 1872 return S_FALSE; |
1873 } | 1873 } |
1874 | 1874 |
1875 *table = static_cast<IAccessibleTable*>( | 1875 *table = static_cast<IAccessibleTable*>( |
1876 find_table->ToBrowserAccessibilityWin()->NewReference()); | 1876 find_table->ToBrowserAccessibilityWin()->NewReference()); |
1877 | 1877 |
1878 return S_OK; | 1878 return S_OK; |
(...skipping 15 matching lines...) Expand all Loading... |
1894 } | 1894 } |
1895 | 1895 |
1896 STDMETHODIMP BrowserAccessibilityWin::get_caretOffset(LONG* offset) { | 1896 STDMETHODIMP BrowserAccessibilityWin::get_caretOffset(LONG* offset) { |
1897 if (!instance_active_) | 1897 if (!instance_active_) |
1898 return E_FAIL; | 1898 return E_FAIL; |
1899 | 1899 |
1900 if (!offset) | 1900 if (!offset) |
1901 return E_INVALIDARG; | 1901 return E_INVALIDARG; |
1902 | 1902 |
1903 *offset = 0; | 1903 *offset = 0; |
1904 if (role_ == AccessibilityNodeData::ROLE_TEXT_FIELD || | 1904 if (role_ == WebKit::WebAXRoleTextField || |
1905 role_ == AccessibilityNodeData::ROLE_TEXTAREA) { | 1905 role_ == WebKit::WebAXRoleTextArea) { |
1906 int sel_start = 0; | 1906 int sel_start = 0; |
1907 if (GetIntAttribute(AccessibilityNodeData::ATTR_TEXT_SEL_START, | 1907 if (GetIntAttribute(AccessibilityNodeData::ATTR_TEXT_SEL_START, |
1908 &sel_start)) | 1908 &sel_start)) |
1909 *offset = sel_start; | 1909 *offset = sel_start; |
1910 } | 1910 } |
1911 | 1911 |
1912 return S_OK; | 1912 return S_OK; |
1913 } | 1913 } |
1914 | 1914 |
1915 STDMETHODIMP BrowserAccessibilityWin::get_nSelections(LONG* n_selections) { | 1915 STDMETHODIMP BrowserAccessibilityWin::get_nSelections(LONG* n_selections) { |
1916 if (!instance_active_) | 1916 if (!instance_active_) |
1917 return E_FAIL; | 1917 return E_FAIL; |
1918 | 1918 |
1919 if (!n_selections) | 1919 if (!n_selections) |
1920 return E_INVALIDARG; | 1920 return E_INVALIDARG; |
1921 | 1921 |
1922 *n_selections = 0; | 1922 *n_selections = 0; |
1923 if (role_ == AccessibilityNodeData::ROLE_TEXT_FIELD || | 1923 if (role_ == WebKit::WebAXRoleTextField || |
1924 role_ == AccessibilityNodeData::ROLE_TEXTAREA) { | 1924 role_ == WebKit::WebAXRoleTextArea) { |
1925 int sel_start = 0; | 1925 int sel_start = 0; |
1926 int sel_end = 0; | 1926 int sel_end = 0; |
1927 if (GetIntAttribute(AccessibilityNodeData::ATTR_TEXT_SEL_START, | 1927 if (GetIntAttribute(AccessibilityNodeData::ATTR_TEXT_SEL_START, |
1928 &sel_start) && | 1928 &sel_start) && |
1929 GetIntAttribute(AccessibilityNodeData::ATTR_TEXT_SEL_END, &sel_end) && | 1929 GetIntAttribute(AccessibilityNodeData::ATTR_TEXT_SEL_END, &sel_end) && |
1930 sel_start != sel_end) | 1930 sel_start != sel_end) |
1931 *n_selections = 1; | 1931 *n_selections = 1; |
1932 } | 1932 } |
1933 | 1933 |
1934 return S_OK; | 1934 return S_OK; |
1935 } | 1935 } |
1936 | 1936 |
1937 STDMETHODIMP BrowserAccessibilityWin::get_selection(LONG selection_index, | 1937 STDMETHODIMP BrowserAccessibilityWin::get_selection(LONG selection_index, |
1938 LONG* start_offset, | 1938 LONG* start_offset, |
1939 LONG* end_offset) { | 1939 LONG* end_offset) { |
1940 if (!instance_active_) | 1940 if (!instance_active_) |
1941 return E_FAIL; | 1941 return E_FAIL; |
1942 | 1942 |
1943 if (!start_offset || !end_offset || selection_index != 0) | 1943 if (!start_offset || !end_offset || selection_index != 0) |
1944 return E_INVALIDARG; | 1944 return E_INVALIDARG; |
1945 | 1945 |
1946 *start_offset = 0; | 1946 *start_offset = 0; |
1947 *end_offset = 0; | 1947 *end_offset = 0; |
1948 if (role_ == AccessibilityNodeData::ROLE_TEXT_FIELD || | 1948 if (role_ == WebKit::WebAXRoleTextField || |
1949 role_ == AccessibilityNodeData::ROLE_TEXTAREA) { | 1949 role_ == WebKit::WebAXRoleTextArea) { |
1950 int sel_start = 0; | 1950 int sel_start = 0; |
1951 int sel_end = 0; | 1951 int sel_end = 0; |
1952 if (GetIntAttribute( | 1952 if (GetIntAttribute( |
1953 AccessibilityNodeData::ATTR_TEXT_SEL_START, &sel_start) && | 1953 AccessibilityNodeData::ATTR_TEXT_SEL_START, &sel_start) && |
1954 GetIntAttribute(AccessibilityNodeData::ATTR_TEXT_SEL_END, &sel_end)) { | 1954 GetIntAttribute(AccessibilityNodeData::ATTR_TEXT_SEL_END, &sel_end)) { |
1955 *start_offset = sel_start; | 1955 *start_offset = sel_start; |
1956 *end_offset = sel_end; | 1956 *end_offset = sel_end; |
1957 } | 1957 } |
1958 } | 1958 } |
1959 | 1959 |
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2785 | 2785 |
2786 // Expose the "display" and "tag" attributes. | 2786 // Expose the "display" and "tag" attributes. |
2787 StringAttributeToIA2(AccessibilityNodeData::ATTR_DISPLAY, "display"); | 2787 StringAttributeToIA2(AccessibilityNodeData::ATTR_DISPLAY, "display"); |
2788 StringAttributeToIA2(AccessibilityNodeData::ATTR_HTML_TAG, "tag"); | 2788 StringAttributeToIA2(AccessibilityNodeData::ATTR_HTML_TAG, "tag"); |
2789 StringAttributeToIA2(AccessibilityNodeData::ATTR_ROLE, "xml-roles"); | 2789 StringAttributeToIA2(AccessibilityNodeData::ATTR_ROLE, "xml-roles"); |
2790 | 2790 |
2791 // Expose "level" attribute for headings, trees, etc. | 2791 // Expose "level" attribute for headings, trees, etc. |
2792 IntAttributeToIA2(AccessibilityNodeData::ATTR_HIERARCHICAL_LEVEL, "level"); | 2792 IntAttributeToIA2(AccessibilityNodeData::ATTR_HIERARCHICAL_LEVEL, "level"); |
2793 | 2793 |
2794 // Expose the set size and position in set for listbox options. | 2794 // Expose the set size and position in set for listbox options. |
2795 if (role_ == AccessibilityNodeData::ROLE_LISTBOX_OPTION && | 2795 if (role_ == WebKit::WebAXRoleListBoxOption && |
2796 parent_ && | 2796 parent_ && |
2797 parent_->role() == AccessibilityNodeData::ROLE_LISTBOX) { | 2797 parent_->role() == WebKit::WebAXRoleListBox) { |
2798 ia2_attributes_.push_back( | 2798 ia2_attributes_.push_back( |
2799 L"setsize:" + base::IntToString16(parent_->child_count())); | 2799 L"setsize:" + base::IntToString16(parent_->child_count())); |
2800 ia2_attributes_.push_back( | 2800 ia2_attributes_.push_back( |
2801 L"setsize:" + base::IntToString16(index_in_parent_ + 1)); | 2801 L"setsize:" + base::IntToString16(index_in_parent_ + 1)); |
2802 } | 2802 } |
2803 | 2803 |
2804 if (ia_role_ == ROLE_SYSTEM_CHECKBUTTON || | 2804 if (ia_role_ == ROLE_SYSTEM_CHECKBUTTON || |
2805 ia_role_ == ROLE_SYSTEM_RADIOBUTTON || | 2805 ia_role_ == ROLE_SYSTEM_RADIOBUTTON || |
2806 ia2_role_ == IA2_ROLE_TOGGLE_BUTTON) { | 2806 ia2_role_ == IA2_ROLE_TOGGLE_BUTTON) { |
2807 ia2_attributes_.push_back(L"checkable:true"); | 2807 ia2_attributes_.push_back(L"checkable:true"); |
(...skipping 18 matching lines...) Expand all Loading... |
2826 // Expose slider value. | 2826 // Expose slider value. |
2827 if (ia_role_ == ROLE_SYSTEM_PROGRESSBAR || | 2827 if (ia_role_ == ROLE_SYSTEM_PROGRESSBAR || |
2828 ia_role_ == ROLE_SYSTEM_SCROLLBAR || | 2828 ia_role_ == ROLE_SYSTEM_SCROLLBAR || |
2829 ia_role_ == ROLE_SYSTEM_SLIDER) { | 2829 ia_role_ == ROLE_SYSTEM_SLIDER) { |
2830 ia2_attributes_.push_back(L"valuetext:" + GetValueText()); | 2830 ia2_attributes_.push_back(L"valuetext:" + GetValueText()); |
2831 } | 2831 } |
2832 | 2832 |
2833 // Expose table cell index. | 2833 // Expose table cell index. |
2834 if (ia_role_ == ROLE_SYSTEM_CELL) { | 2834 if (ia_role_ == ROLE_SYSTEM_CELL) { |
2835 BrowserAccessibility* table = parent(); | 2835 BrowserAccessibility* table = parent(); |
2836 while (table && table->role() != AccessibilityNodeData::ROLE_TABLE) | 2836 while (table && table->role() != WebKit::WebAXRoleTable) |
2837 table = table->parent(); | 2837 table = table->parent(); |
2838 if (table) { | 2838 if (table) { |
2839 const std::vector<int32>& unique_cell_ids = table->GetIntListAttribute( | 2839 const std::vector<int32>& unique_cell_ids = table->GetIntListAttribute( |
2840 AccessibilityNodeData::ATTR_UNIQUE_CELL_IDS); | 2840 AccessibilityNodeData::ATTR_UNIQUE_CELL_IDS); |
2841 for (size_t i = 0; i < unique_cell_ids.size(); ++i) { | 2841 for (size_t i = 0; i < unique_cell_ids.size(); ++i) { |
2842 if (unique_cell_ids[i] == renderer_id_) { | 2842 if (unique_cell_ids[i] == renderer_id_) { |
2843 ia2_attributes_.push_back( | 2843 ia2_attributes_.push_back( |
2844 string16(L"table-cell-index:") + base::IntToString16(i)); | 2844 string16(L"table-cell-index:") + base::IntToString16(i)); |
2845 } | 2845 } |
2846 } | 2846 } |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2896 description = help; | 2896 description = help; |
2897 help.clear(); | 2897 help.clear(); |
2898 } | 2898 } |
2899 if (!description.empty() && name_.empty() && !title_elem_id) { | 2899 if (!description.empty() && name_.empty() && !title_elem_id) { |
2900 name_ = description; | 2900 name_ = description; |
2901 description.clear(); | 2901 description.clear(); |
2902 } | 2902 } |
2903 | 2903 |
2904 // If it's a text field, also consider the placeholder. | 2904 // If it's a text field, also consider the placeholder. |
2905 std::string placeholder; | 2905 std::string placeholder; |
2906 if (role_ == AccessibilityNodeData::ROLE_TEXT_FIELD && | 2906 if (role_ == WebKit::WebAXRoleTextField && |
2907 HasState(AccessibilityNodeData::STATE_FOCUSABLE) && | 2907 HasState(WebKit::WebAXStateFocusable) && |
2908 GetHtmlAttribute("placeholder", &placeholder)) { | 2908 GetHtmlAttribute("placeholder", &placeholder)) { |
2909 if (name_.empty() && !title_elem_id) { | 2909 if (name_.empty() && !title_elem_id) { |
2910 name_ = placeholder; | 2910 name_ = placeholder; |
2911 } else if (description.empty()) { | 2911 } else if (description.empty()) { |
2912 description = placeholder; | 2912 description = placeholder; |
2913 } | 2913 } |
2914 } | 2914 } |
2915 | 2915 |
2916 SetStringAttribute(AccessibilityNodeData::ATTR_DESCRIPTION, description); | 2916 SetStringAttribute(AccessibilityNodeData::ATTR_DESCRIPTION, description); |
2917 SetStringAttribute(AccessibilityNodeData::ATTR_HELP, help); | 2917 SetStringAttribute(AccessibilityNodeData::ATTR_HELP, help); |
2918 | 2918 |
2919 // On Windows, the value of a document should be its url. | 2919 // On Windows, the value of a document should be its url. |
2920 if (role_ == AccessibilityNodeData::ROLE_ROOT_WEB_AREA || | 2920 if (role_ == WebKit::WebAXRoleRootWebArea || |
2921 role_ == AccessibilityNodeData::ROLE_WEB_AREA) { | 2921 role_ == WebKit::WebAXRoleWebArea) { |
2922 GetStringAttribute(AccessibilityNodeData::ATTR_DOC_URL, &value_); | 2922 GetStringAttribute(AccessibilityNodeData::ATTR_DOC_URL, &value_); |
2923 } | 2923 } |
2924 | 2924 |
2925 // For certain roles (listbox option, static text, and list marker) | 2925 // For certain roles (listbox option, static text, and list marker) |
2926 // WebKit stores the main accessible text in the "value" - swap it so | 2926 // WebKit stores the main accessible text in the "value" - swap it so |
2927 // that it's the "name". | 2927 // that it's the "name". |
2928 if (name_.empty() && | 2928 if (name_.empty() && |
2929 (role_ == AccessibilityNodeData::ROLE_LISTBOX_OPTION || | 2929 (role_ == WebKit::WebAXRoleListBoxOption || |
2930 role_ == AccessibilityNodeData::ROLE_STATIC_TEXT || | 2930 role_ == WebKit::WebAXRoleStaticText || |
2931 role_ == AccessibilityNodeData::ROLE_LIST_MARKER)) { | 2931 role_ == WebKit::WebAXRoleListMarker)) { |
2932 name_.swap(value_); | 2932 name_.swap(value_); |
2933 } | 2933 } |
2934 | 2934 |
2935 // If this doesn't have a value and is linked then set its value to the url | 2935 // If this doesn't have a value and is linked then set its value to the url |
2936 // attribute. This allows screen readers to read an empty link's destination. | 2936 // attribute. This allows screen readers to read an empty link's destination. |
2937 if (value_.empty() && (ia_state_ & STATE_SYSTEM_LINKED)) | 2937 if (value_.empty() && (ia_state_ & STATE_SYSTEM_LINKED)) |
2938 GetStringAttribute(AccessibilityNodeData::ATTR_URL, &value_); | 2938 GetStringAttribute(AccessibilityNodeData::ATTR_URL, &value_); |
2939 | 2939 |
2940 // Clear any old relationships between this node and other nodes. | 2940 // Clear any old relationships between this node and other nodes. |
2941 for (size_t i = 0; i < relations_.size(); ++i) | 2941 for (size_t i = 0; i < relations_.size(); ++i) |
(...skipping 16 matching lines...) Expand all Loading... |
2958 | 2958 |
2959 void BrowserAccessibilityWin::PostInitialize() { | 2959 void BrowserAccessibilityWin::PostInitialize() { |
2960 BrowserAccessibility::PostInitialize(); | 2960 BrowserAccessibility::PostInitialize(); |
2961 | 2961 |
2962 // Construct the hypertext for this node. | 2962 // Construct the hypertext for this node. |
2963 hyperlink_offset_to_index_.clear(); | 2963 hyperlink_offset_to_index_.clear(); |
2964 hyperlinks_.clear(); | 2964 hyperlinks_.clear(); |
2965 hypertext_.clear(); | 2965 hypertext_.clear(); |
2966 for (unsigned int i = 0; i < children().size(); ++i) { | 2966 for (unsigned int i = 0; i < children().size(); ++i) { |
2967 BrowserAccessibility* child = children()[i]; | 2967 BrowserAccessibility* child = children()[i]; |
2968 if (child->role() == AccessibilityNodeData::ROLE_STATIC_TEXT) { | 2968 if (child->role() == WebKit::WebAXRoleStaticText) { |
2969 hypertext_ += UTF8ToUTF16(child->name()); | 2969 hypertext_ += UTF8ToUTF16(child->name()); |
2970 } else { | 2970 } else { |
2971 hyperlink_offset_to_index_[hypertext_.size()] = hyperlinks_.size(); | 2971 hyperlink_offset_to_index_[hypertext_.size()] = hyperlinks_.size(); |
2972 hypertext_ += kEmbeddedCharacter; | 2972 hypertext_ += kEmbeddedCharacter; |
2973 hyperlinks_.push_back(i); | 2973 hyperlinks_.push_back(i); |
2974 } | 2974 } |
2975 } | 2975 } |
2976 DCHECK_EQ(hyperlink_offset_to_index_.size(), hyperlinks_.size()); | 2976 DCHECK_EQ(hyperlink_offset_to_index_.size(), hyperlinks_.size()); |
2977 | 2977 |
2978 // Fire an event when an alert first appears. | 2978 // Fire an event when an alert first appears. |
2979 if (role_ == AccessibilityNodeData::ROLE_ALERT && first_time_) | 2979 if (role_ == WebKit::WebAXRoleAlert && first_time_) |
2980 manager_->NotifyAccessibilityEvent(AccessibilityNotificationAlert, this); | 2980 manager_->NotifyAccessibilityEvent(WebKit::WebAXEventAlert, this); |
2981 | 2981 |
2982 // Fire events if text has changed. | 2982 // Fire events if text has changed. |
2983 string16 text = TextForIAccessibleText(); | 2983 string16 text = TextForIAccessibleText(); |
2984 if (previous_text_ != text) { | 2984 if (previous_text_ != text) { |
2985 if (!previous_text_.empty() && !text.empty()) { | 2985 if (!previous_text_.empty() && !text.empty()) { |
2986 manager_->NotifyAccessibilityEvent( | 2986 manager_->NotifyAccessibilityEvent( |
2987 AccessibilityNotificationObjectShow, this); | 2987 WebKit::WebAXEventShow, this); |
2988 } | 2988 } |
2989 | 2989 |
2990 // TODO(dmazzoni): Look into HIDE events, too. | 2990 // TODO(dmazzoni): Look into HIDE events, too. |
2991 | 2991 |
2992 old_text_ = previous_text_; | 2992 old_text_ = previous_text_; |
2993 previous_text_ = text; | 2993 previous_text_ = text; |
2994 } | 2994 } |
2995 | 2995 |
2996 // Fire events if the state has changed. | 2996 // Fire events if the state has changed. |
2997 if (!first_time_ && ia_state_ != old_ia_state_) { | 2997 if (!first_time_ && ia_state_ != old_ia_state_) { |
2998 BrowserAccessibilityManagerWin* manager = | 2998 BrowserAccessibilityManagerWin* manager = |
2999 manager_->ToBrowserAccessibilityManagerWin(); | 2999 manager_->ToBrowserAccessibilityManagerWin(); |
3000 | 3000 |
3001 // Normally focus events are handled elsewhere, however | 3001 // Normally focus events are handled elsewhere, however |
3002 // focus for managed descendants is platform-specific. | 3002 // focus for managed descendants is platform-specific. |
3003 // Fire a focus event if the focused descendant in a multi-select | 3003 // Fire a focus event if the focused descendant in a multi-select |
3004 // list box changes. | 3004 // list box changes. |
3005 if (role_ == AccessibilityNodeData::ROLE_LISTBOX_OPTION && | 3005 if (role_ == WebKit::WebAXRoleListBoxOption && |
3006 (ia_state_ & STATE_SYSTEM_FOCUSABLE) && | 3006 (ia_state_ & STATE_SYSTEM_FOCUSABLE) && |
3007 (ia_state_ & STATE_SYSTEM_SELECTABLE) && | 3007 (ia_state_ & STATE_SYSTEM_SELECTABLE) && |
3008 (ia_state_ & STATE_SYSTEM_FOCUSED) && | 3008 (ia_state_ & STATE_SYSTEM_FOCUSED) && |
3009 !(old_ia_state_ & STATE_SYSTEM_FOCUSED)) { | 3009 !(old_ia_state_ & STATE_SYSTEM_FOCUSED)) { |
3010 manager->MaybeCallNotifyWinEvent(EVENT_OBJECT_FOCUS, unique_id_win()); | 3010 manager->MaybeCallNotifyWinEvent(EVENT_OBJECT_FOCUS, unique_id_win()); |
3011 } | 3011 } |
3012 | 3012 |
3013 if ((ia_state_ & STATE_SYSTEM_SELECTED) && | 3013 if ((ia_state_ & STATE_SYSTEM_SELECTED) && |
3014 !(old_ia_state_ & STATE_SYSTEM_SELECTED)) { | 3014 !(old_ia_state_ & STATE_SYSTEM_SELECTED)) { |
3015 manager->MaybeCallNotifyWinEvent(EVENT_OBJECT_SELECTIONADD, | 3015 manager->MaybeCallNotifyWinEvent(EVENT_OBJECT_SELECTIONADD, |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3116 if (value.empty() && | 3116 if (value.empty() && |
3117 GetFloatAttribute(AccessibilityNodeData::ATTR_VALUE_FOR_RANGE, &fval)) { | 3117 GetFloatAttribute(AccessibilityNodeData::ATTR_VALUE_FOR_RANGE, &fval)) { |
3118 value = UTF8ToUTF16(base::DoubleToString(fval)); | 3118 value = UTF8ToUTF16(base::DoubleToString(fval)); |
3119 } | 3119 } |
3120 return value; | 3120 return value; |
3121 } | 3121 } |
3122 | 3122 |
3123 string16 BrowserAccessibilityWin::TextForIAccessibleText() { | 3123 string16 BrowserAccessibilityWin::TextForIAccessibleText() { |
3124 if (IsEditableText()) | 3124 if (IsEditableText()) |
3125 return UTF8ToUTF16(value_); | 3125 return UTF8ToUTF16(value_); |
3126 return (role_ == AccessibilityNodeData::ROLE_STATIC_TEXT) ? | 3126 return (role_ == WebKit::WebAXRoleStaticText) ? |
3127 UTF8ToUTF16(name_) : hypertext_; | 3127 UTF8ToUTF16(name_) : hypertext_; |
3128 } | 3128 } |
3129 | 3129 |
3130 void BrowserAccessibilityWin::HandleSpecialTextOffset(const string16& text, | 3130 void BrowserAccessibilityWin::HandleSpecialTextOffset(const string16& text, |
3131 LONG* offset) { | 3131 LONG* offset) { |
3132 if (*offset == IA2_TEXT_OFFSET_LENGTH) | 3132 if (*offset == IA2_TEXT_OFFSET_LENGTH) |
3133 *offset = static_cast<LONG>(text.size()); | 3133 *offset = static_cast<LONG>(text.size()); |
3134 else if (*offset == IA2_TEXT_OFFSET_CARET) | 3134 else if (*offset == IA2_TEXT_OFFSET_CARET) |
3135 get_caretOffset(offset); | 3135 get_caretOffset(offset); |
3136 } | 3136 } |
(...skipping 29 matching lines...) Expand all Loading... |
3166 BrowserAccessibilityWin* BrowserAccessibilityWin::GetFromRendererID( | 3166 BrowserAccessibilityWin* BrowserAccessibilityWin::GetFromRendererID( |
3167 int32 renderer_id) { | 3167 int32 renderer_id) { |
3168 return manager_->GetFromRendererID(renderer_id)->ToBrowserAccessibilityWin(); | 3168 return manager_->GetFromRendererID(renderer_id)->ToBrowserAccessibilityWin(); |
3169 } | 3169 } |
3170 | 3170 |
3171 void BrowserAccessibilityWin::InitRoleAndState() { | 3171 void BrowserAccessibilityWin::InitRoleAndState() { |
3172 ia_state_ = 0; | 3172 ia_state_ = 0; |
3173 ia2_state_ = IA2_STATE_OPAQUE; | 3173 ia2_state_ = IA2_STATE_OPAQUE; |
3174 ia2_attributes_.clear(); | 3174 ia2_attributes_.clear(); |
3175 | 3175 |
3176 if (HasState(AccessibilityNodeData::STATE_BUSY)) | 3176 if (HasState(WebKit::WebAXStateBusy)) |
3177 ia_state_ |= STATE_SYSTEM_BUSY; | 3177 ia_state_ |= STATE_SYSTEM_BUSY; |
3178 if (HasState(AccessibilityNodeData::STATE_CHECKED)) | 3178 if (HasState(WebKit::WebAXStateChecked)) |
3179 ia_state_ |= STATE_SYSTEM_CHECKED; | 3179 ia_state_ |= STATE_SYSTEM_CHECKED; |
3180 if (HasState(AccessibilityNodeData::STATE_COLLAPSED)) | 3180 if (HasState(WebKit::WebAXStateCollapsed)) |
3181 ia_state_ |= STATE_SYSTEM_COLLAPSED; | 3181 ia_state_ |= STATE_SYSTEM_COLLAPSED; |
3182 if (HasState(AccessibilityNodeData::STATE_EXPANDED)) | 3182 if (HasState(WebKit::WebAXStateExpanded)) |
3183 ia_state_ |= STATE_SYSTEM_EXPANDED; | 3183 ia_state_ |= STATE_SYSTEM_EXPANDED; |
3184 if (HasState(AccessibilityNodeData::STATE_FOCUSABLE)) | 3184 if (HasState(WebKit::WebAXStateFocusable)) |
3185 ia_state_ |= STATE_SYSTEM_FOCUSABLE; | 3185 ia_state_ |= STATE_SYSTEM_FOCUSABLE; |
3186 if (HasState(AccessibilityNodeData::STATE_HASPOPUP)) | 3186 if (HasState(WebKit::WebAXStateHaspopup)) |
3187 ia_state_ |= STATE_SYSTEM_HASPOPUP; | 3187 ia_state_ |= STATE_SYSTEM_HASPOPUP; |
3188 if (HasState(AccessibilityNodeData::STATE_HOTTRACKED)) | 3188 if (HasState(WebKit::WebAXStateHovered)) |
3189 ia_state_ |= STATE_SYSTEM_HOTTRACKED; | 3189 ia_state_ |= STATE_SYSTEM_HOTTRACKED; |
3190 if (HasState(AccessibilityNodeData::STATE_INDETERMINATE)) | 3190 if (HasState(WebKit::WebAXStateIndeterminate)) |
3191 ia_state_ |= STATE_SYSTEM_INDETERMINATE; | 3191 ia_state_ |= STATE_SYSTEM_INDETERMINATE; |
3192 if (HasState(AccessibilityNodeData::STATE_INVISIBLE)) | 3192 if (HasState(WebKit::WebAXStateInvisible)) |
3193 ia_state_ |= STATE_SYSTEM_INVISIBLE; | 3193 ia_state_ |= STATE_SYSTEM_INVISIBLE; |
3194 if (HasState(AccessibilityNodeData::STATE_LINKED)) | 3194 if (HasState(WebKit::WebAXStateLinked)) |
3195 ia_state_ |= STATE_SYSTEM_LINKED; | 3195 ia_state_ |= STATE_SYSTEM_LINKED; |
3196 if (HasState(AccessibilityNodeData::STATE_MULTISELECTABLE)) { | 3196 if (HasState(WebKit::WebAXStateMultiselectable)) { |
3197 ia_state_ |= STATE_SYSTEM_EXTSELECTABLE; | 3197 ia_state_ |= STATE_SYSTEM_EXTSELECTABLE; |
3198 ia_state_ |= STATE_SYSTEM_MULTISELECTABLE; | 3198 ia_state_ |= STATE_SYSTEM_MULTISELECTABLE; |
3199 } | 3199 } |
3200 // TODO(ctguil): Support STATE_SYSTEM_EXTSELECTABLE/accSelect. | 3200 // TODO(ctguil): Support STATE_SYSTEM_EXTSELECTABLE/accSelect. |
3201 if (HasState(AccessibilityNodeData::STATE_OFFSCREEN)) | 3201 if (HasState(WebKit::WebAXStateOffscreen)) |
3202 ia_state_ |= STATE_SYSTEM_OFFSCREEN; | 3202 ia_state_ |= STATE_SYSTEM_OFFSCREEN; |
3203 if (HasState(AccessibilityNodeData::STATE_PRESSED)) | 3203 if (HasState(WebKit::WebAXStatePressed)) |
3204 ia_state_ |= STATE_SYSTEM_PRESSED; | 3204 ia_state_ |= STATE_SYSTEM_PRESSED; |
3205 if (HasState(AccessibilityNodeData::STATE_PROTECTED)) | 3205 if (HasState(WebKit::WebAXStateProtected)) |
3206 ia_state_ |= STATE_SYSTEM_PROTECTED; | 3206 ia_state_ |= STATE_SYSTEM_PROTECTED; |
3207 if (HasState(AccessibilityNodeData::STATE_REQUIRED)) | 3207 if (HasState(WebKit::WebAXStateRequired)) |
3208 ia2_state_ |= IA2_STATE_REQUIRED; | 3208 ia2_state_ |= IA2_STATE_REQUIRED; |
3209 if (HasState(AccessibilityNodeData::STATE_SELECTABLE)) | 3209 if (HasState(WebKit::WebAXStateSelectable)) |
3210 ia_state_ |= STATE_SYSTEM_SELECTABLE; | 3210 ia_state_ |= STATE_SYSTEM_SELECTABLE; |
3211 if (HasState(AccessibilityNodeData::STATE_SELECTED)) | 3211 if (HasState(WebKit::WebAXStateSelected)) |
3212 ia_state_ |= STATE_SYSTEM_SELECTED; | 3212 ia_state_ |= STATE_SYSTEM_SELECTED; |
3213 if (HasState(AccessibilityNodeData::STATE_TRAVERSED)) | 3213 if (HasState(WebKit::WebAXStateVisited)) |
3214 ia_state_ |= STATE_SYSTEM_TRAVERSED; | 3214 ia_state_ |= STATE_SYSTEM_TRAVERSED; |
3215 if (HasState(AccessibilityNodeData::STATE_UNAVAILABLE)) | 3215 if (!HasState(WebKit::WebAXStateEnabled)) |
3216 ia_state_ |= STATE_SYSTEM_UNAVAILABLE; | 3216 ia_state_ |= STATE_SYSTEM_UNAVAILABLE; |
3217 if (HasState(AccessibilityNodeData::STATE_VERTICAL)) { | 3217 if (HasState(WebKit::WebAXStateVertical)) { |
3218 ia2_state_ |= IA2_STATE_VERTICAL; | 3218 ia2_state_ |= IA2_STATE_VERTICAL; |
3219 } else { | 3219 } else { |
3220 ia2_state_ |= IA2_STATE_HORIZONTAL; | 3220 ia2_state_ |= IA2_STATE_HORIZONTAL; |
3221 } | 3221 } |
3222 if (HasState(AccessibilityNodeData::STATE_VISITED)) | 3222 if (HasState(WebKit::WebAXStateVisited)) |
3223 ia_state_ |= STATE_SYSTEM_TRAVERSED; | 3223 ia_state_ |= STATE_SYSTEM_TRAVERSED; |
3224 | 3224 |
3225 // WebKit marks everything as readonly unless it's editable text, so if it's | 3225 // WebKit marks everything as readonly unless it's editable text, so if it's |
3226 // not readonly, mark it as editable now. The final computation of the | 3226 // not readonly, mark it as editable now. The final computation of the |
3227 // READONLY state for MSAA is below, after the switch. | 3227 // READONLY state for MSAA is below, after the switch. |
3228 if (!HasState(AccessibilityNodeData::STATE_READONLY)) | 3228 if (!HasState(WebKit::WebAXStateReadonly)) |
3229 ia2_state_ |= IA2_STATE_EDITABLE; | 3229 ia2_state_ |= IA2_STATE_EDITABLE; |
3230 | 3230 |
3231 string16 invalid; | 3231 string16 invalid; |
3232 if (GetHtmlAttribute("aria-invalid", &invalid)) | 3232 if (GetHtmlAttribute("aria-invalid", &invalid)) |
3233 ia2_state_ |= IA2_STATE_INVALID_ENTRY; | 3233 ia2_state_ |= IA2_STATE_INVALID_ENTRY; |
3234 | 3234 |
3235 if (GetBoolAttribute(AccessibilityNodeData::ATTR_BUTTON_MIXED)) | 3235 if (GetBoolAttribute(AccessibilityNodeData::ATTR_BUTTON_MIXED)) |
3236 ia_state_ |= STATE_SYSTEM_MIXED; | 3236 ia_state_ |= STATE_SYSTEM_MIXED; |
3237 | 3237 |
3238 if (GetBoolAttribute(AccessibilityNodeData::ATTR_CAN_SET_VALUE)) | 3238 if (GetBoolAttribute(AccessibilityNodeData::ATTR_CAN_SET_VALUE)) |
3239 ia2_state_ |= IA2_STATE_EDITABLE; | 3239 ia2_state_ |= IA2_STATE_EDITABLE; |
3240 | 3240 |
3241 string16 html_tag = GetString16Attribute( | 3241 string16 html_tag = GetString16Attribute( |
3242 AccessibilityNodeData::ATTR_HTML_TAG); | 3242 AccessibilityNodeData::ATTR_HTML_TAG); |
3243 ia_role_ = 0; | 3243 ia_role_ = 0; |
3244 ia2_role_ = 0; | 3244 ia2_role_ = 0; |
3245 switch (role_) { | 3245 switch (role_) { |
3246 case AccessibilityNodeData::ROLE_ALERT: | 3246 case WebKit::WebAXRoleAlert: |
3247 ia_role_ = ROLE_SYSTEM_ALERT; | 3247 ia_role_ = ROLE_SYSTEM_ALERT; |
3248 break; | 3248 break; |
3249 case AccessibilityNodeData::ROLE_ALERT_DIALOG: | 3249 case WebKit::WebAXRoleAlertDialog: |
3250 ia_role_ = ROLE_SYSTEM_DIALOG; | 3250 ia_role_ = ROLE_SYSTEM_DIALOG; |
3251 break; | 3251 break; |
3252 case AccessibilityNodeData::ROLE_APPLICATION: | 3252 case WebKit::WebAXRoleApplication: |
3253 ia_role_ = ROLE_SYSTEM_APPLICATION; | 3253 ia_role_ = ROLE_SYSTEM_APPLICATION; |
3254 break; | 3254 break; |
3255 case AccessibilityNodeData::ROLE_ARTICLE: | 3255 case WebKit::WebAXRoleArticle: |
3256 ia_role_ = ROLE_SYSTEM_GROUPING; | 3256 ia_role_ = ROLE_SYSTEM_GROUPING; |
3257 ia2_role_ = IA2_ROLE_SECTION; | 3257 ia2_role_ = IA2_ROLE_SECTION; |
3258 ia_state_ |= STATE_SYSTEM_READONLY; | 3258 ia_state_ |= STATE_SYSTEM_READONLY; |
3259 break; | 3259 break; |
3260 case AccessibilityNodeData::ROLE_BUSY_INDICATOR: | 3260 case WebKit::WebAXRoleBusyIndicator: |
3261 ia_role_ = ROLE_SYSTEM_ANIMATION; | 3261 ia_role_ = ROLE_SYSTEM_ANIMATION; |
3262 ia_state_ |= STATE_SYSTEM_READONLY; | 3262 ia_state_ |= STATE_SYSTEM_READONLY; |
3263 break; | 3263 break; |
3264 case AccessibilityNodeData::ROLE_BUTTON: | 3264 case WebKit::WebAXRoleButton: |
3265 ia_role_ = ROLE_SYSTEM_PUSHBUTTON; | 3265 ia_role_ = ROLE_SYSTEM_PUSHBUTTON; |
3266 bool is_aria_pressed_defined; | 3266 bool is_aria_pressed_defined; |
3267 bool is_mixed; | 3267 bool is_mixed; |
3268 if (GetAriaTristate("aria-pressed", &is_aria_pressed_defined, &is_mixed)) | 3268 if (GetAriaTristate("aria-pressed", &is_aria_pressed_defined, &is_mixed)) |
3269 ia_state_ |= STATE_SYSTEM_PRESSED; | 3269 ia_state_ |= STATE_SYSTEM_PRESSED; |
3270 if (is_aria_pressed_defined) | 3270 if (is_aria_pressed_defined) |
3271 ia2_role_ = IA2_ROLE_TOGGLE_BUTTON; | 3271 ia2_role_ = IA2_ROLE_TOGGLE_BUTTON; |
3272 if (is_mixed) | 3272 if (is_mixed) |
3273 ia_state_ |= STATE_SYSTEM_MIXED; | 3273 ia_state_ |= STATE_SYSTEM_MIXED; |
3274 break; | 3274 break; |
3275 case AccessibilityNodeData::ROLE_CANVAS: | 3275 case WebKit::WebAXRoleCanvas: |
3276 ia_role_ = ROLE_SYSTEM_GRAPHIC; | 3276 if (GetBoolAttribute(AccessibilityNodeData::ATTR_CANVAS_HAS_FALLBACK)) { |
| 3277 role_name_ = L"canvas"; |
| 3278 ia2_role_ = IA2_ROLE_CANVAS; |
| 3279 } else { |
| 3280 ia_role_ = ROLE_SYSTEM_GRAPHIC; |
| 3281 } |
3277 break; | 3282 break; |
3278 case AccessibilityNodeData::ROLE_CANVAS_WITH_FALLBACK_CONTENT: | 3283 case WebKit::WebAXRoleCell: |
3279 role_name_ = L"canvas"; | |
3280 ia2_role_ = IA2_ROLE_CANVAS; | |
3281 break; | |
3282 case AccessibilityNodeData::ROLE_CELL: | |
3283 ia_role_ = ROLE_SYSTEM_CELL; | 3284 ia_role_ = ROLE_SYSTEM_CELL; |
3284 break; | 3285 break; |
3285 case AccessibilityNodeData::ROLE_CHECKBOX: | 3286 case WebKit::WebAXRoleCheckBox: |
3286 ia_role_ = ROLE_SYSTEM_CHECKBUTTON; | 3287 ia_role_ = ROLE_SYSTEM_CHECKBUTTON; |
3287 break; | 3288 break; |
3288 case AccessibilityNodeData::ROLE_COLOR_WELL: | 3289 case WebKit::WebAXRoleColorWell: |
3289 ia_role_ = ROLE_SYSTEM_CLIENT; | 3290 ia_role_ = ROLE_SYSTEM_CLIENT; |
3290 ia2_role_ = IA2_ROLE_COLOR_CHOOSER; | 3291 ia2_role_ = IA2_ROLE_COLOR_CHOOSER; |
3291 break; | 3292 break; |
3292 case AccessibilityNodeData::ROLE_COLUMN: | 3293 case WebKit::WebAXRoleColumn: |
3293 ia_role_ = ROLE_SYSTEM_COLUMN; | 3294 ia_role_ = ROLE_SYSTEM_COLUMN; |
3294 ia_state_ |= STATE_SYSTEM_READONLY; | 3295 ia_state_ |= STATE_SYSTEM_READONLY; |
3295 break; | 3296 break; |
3296 case AccessibilityNodeData::ROLE_COLUMN_HEADER: | 3297 case WebKit::WebAXRoleColumnHeader: |
3297 ia_role_ = ROLE_SYSTEM_COLUMNHEADER; | 3298 ia_role_ = ROLE_SYSTEM_COLUMNHEADER; |
3298 ia_state_ |= STATE_SYSTEM_READONLY; | 3299 ia_state_ |= STATE_SYSTEM_READONLY; |
3299 break; | 3300 break; |
3300 case AccessibilityNodeData::ROLE_COMBO_BOX: | 3301 case WebKit::WebAXRoleComboBox: |
3301 ia_role_ = ROLE_SYSTEM_COMBOBOX; | 3302 ia_role_ = ROLE_SYSTEM_COMBOBOX; |
3302 break; | 3303 break; |
3303 case AccessibilityNodeData::ROLE_DIV: | 3304 case WebKit::WebAXRoleDiv: |
3304 role_name_ = L"div"; | 3305 role_name_ = L"div"; |
3305 ia2_role_ = IA2_ROLE_SECTION; | 3306 ia2_role_ = IA2_ROLE_SECTION; |
3306 break; | 3307 break; |
3307 case AccessibilityNodeData::ROLE_DEFINITION: | 3308 case WebKit::WebAXRoleDefinition: |
3308 role_name_ = html_tag; | 3309 role_name_ = html_tag; |
3309 ia2_role_ = IA2_ROLE_PARAGRAPH; | 3310 ia2_role_ = IA2_ROLE_PARAGRAPH; |
3310 ia_state_ |= STATE_SYSTEM_READONLY; | 3311 ia_state_ |= STATE_SYSTEM_READONLY; |
3311 break; | 3312 break; |
3312 case AccessibilityNodeData::ROLE_DESCRIPTION_LIST_DETAIL: | 3313 case WebKit::WebAXRoleDescriptionListDetail: |
3313 role_name_ = html_tag; | 3314 role_name_ = html_tag; |
3314 ia2_role_ = IA2_ROLE_PARAGRAPH; | 3315 ia2_role_ = IA2_ROLE_PARAGRAPH; |
3315 ia_state_ |= STATE_SYSTEM_READONLY; | 3316 ia_state_ |= STATE_SYSTEM_READONLY; |
3316 break; | 3317 break; |
3317 case AccessibilityNodeData::ROLE_DESCRIPTION_LIST_TERM: | 3318 case WebKit::WebAXRoleDescriptionListTerm: |
3318 ia_role_ = ROLE_SYSTEM_LISTITEM; | 3319 ia_role_ = ROLE_SYSTEM_LISTITEM; |
3319 ia_state_ |= STATE_SYSTEM_READONLY; | 3320 ia_state_ |= STATE_SYSTEM_READONLY; |
3320 break; | 3321 break; |
3321 case AccessibilityNodeData::ROLE_DIALOG: | 3322 case WebKit::WebAXRoleDialog: |
3322 ia_role_ = ROLE_SYSTEM_DIALOG; | 3323 ia_role_ = ROLE_SYSTEM_DIALOG; |
3323 ia_state_ |= STATE_SYSTEM_READONLY; | 3324 ia_state_ |= STATE_SYSTEM_READONLY; |
3324 break; | 3325 break; |
3325 case AccessibilityNodeData::ROLE_DISCLOSURE_TRIANGLE: | 3326 case WebKit::WebAXRoleDisclosureTriangle: |
3326 ia_role_ = ROLE_SYSTEM_OUTLINEBUTTON; | 3327 ia_role_ = ROLE_SYSTEM_OUTLINEBUTTON; |
3327 ia_state_ |= STATE_SYSTEM_READONLY; | 3328 ia_state_ |= STATE_SYSTEM_READONLY; |
3328 break; | 3329 break; |
3329 case AccessibilityNodeData::ROLE_DOCUMENT: | 3330 case WebKit::WebAXRoleDocument: |
3330 case AccessibilityNodeData::ROLE_ROOT_WEB_AREA: | 3331 case WebKit::WebAXRoleRootWebArea: |
3331 case AccessibilityNodeData::ROLE_WEB_AREA: | 3332 case WebKit::WebAXRoleWebArea: |
3332 ia_role_ = ROLE_SYSTEM_DOCUMENT; | 3333 ia_role_ = ROLE_SYSTEM_DOCUMENT; |
3333 ia_state_ |= STATE_SYSTEM_READONLY; | 3334 ia_state_ |= STATE_SYSTEM_READONLY; |
3334 ia_state_ |= STATE_SYSTEM_FOCUSABLE; | 3335 ia_state_ |= STATE_SYSTEM_FOCUSABLE; |
3335 break; | 3336 break; |
3336 case AccessibilityNodeData::ROLE_EDITABLE_TEXT: | 3337 case WebKit::WebAXRoleEditableText: |
3337 ia_role_ = ROLE_SYSTEM_TEXT; | 3338 ia_role_ = ROLE_SYSTEM_TEXT; |
3338 ia2_state_ |= IA2_STATE_SINGLE_LINE; | 3339 ia2_state_ |= IA2_STATE_SINGLE_LINE; |
3339 ia2_state_ |= IA2_STATE_EDITABLE; | 3340 ia2_state_ |= IA2_STATE_EDITABLE; |
3340 break; | 3341 break; |
3341 case AccessibilityNodeData::ROLE_FORM: | 3342 case WebKit::WebAXRoleForm: |
3342 role_name_ = L"form"; | 3343 role_name_ = L"form"; |
3343 ia2_role_ = IA2_ROLE_FORM; | 3344 ia2_role_ = IA2_ROLE_FORM; |
3344 break; | 3345 break; |
3345 case AccessibilityNodeData::ROLE_FOOTER: | 3346 case WebKit::WebAXRoleFooter: |
3346 ia_role_ = IA2_ROLE_FOOTER; | 3347 ia_role_ = IA2_ROLE_FOOTER; |
3347 ia_state_ |= STATE_SYSTEM_READONLY; | 3348 ia_state_ |= STATE_SYSTEM_READONLY; |
3348 break; | 3349 break; |
3349 case AccessibilityNodeData::ROLE_GRID: | 3350 case WebKit::WebAXRoleGrid: |
3350 ia_role_ = ROLE_SYSTEM_TABLE; | 3351 ia_role_ = ROLE_SYSTEM_TABLE; |
3351 ia_state_ |= STATE_SYSTEM_READONLY; | 3352 ia_state_ |= STATE_SYSTEM_READONLY; |
3352 break; | 3353 break; |
3353 case AccessibilityNodeData::ROLE_GROUP: { | 3354 case WebKit::WebAXRoleGroup: { |
3354 string16 aria_role = GetString16Attribute( | 3355 string16 aria_role = GetString16Attribute( |
3355 AccessibilityNodeData::ATTR_ROLE); | 3356 AccessibilityNodeData::ATTR_ROLE); |
3356 if (aria_role == L"group" || html_tag == L"fieldset") { | 3357 if (aria_role == L"group" || html_tag == L"fieldset") { |
3357 ia_role_ = ROLE_SYSTEM_GROUPING; | 3358 ia_role_ = ROLE_SYSTEM_GROUPING; |
3358 } else if (html_tag == L"li") { | 3359 } else if (html_tag == L"li") { |
3359 ia_role_ = ROLE_SYSTEM_LISTITEM; | 3360 ia_role_ = ROLE_SYSTEM_LISTITEM; |
3360 } else { | 3361 } else { |
3361 if (html_tag.empty()) | 3362 if (html_tag.empty()) |
3362 role_name_ = L"div"; | 3363 role_name_ = L"div"; |
3363 else | 3364 else |
3364 role_name_ = html_tag; | 3365 role_name_ = html_tag; |
3365 ia2_role_ = IA2_ROLE_SECTION; | 3366 ia2_role_ = IA2_ROLE_SECTION; |
3366 } | 3367 } |
3367 ia_state_ |= STATE_SYSTEM_READONLY; | 3368 ia_state_ |= STATE_SYSTEM_READONLY; |
3368 break; | 3369 break; |
3369 } | 3370 } |
3370 case AccessibilityNodeData::ROLE_GROW_AREA: | 3371 case WebKit::WebAXRoleGrowArea: |
3371 ia_role_ = ROLE_SYSTEM_GRIP; | 3372 ia_role_ = ROLE_SYSTEM_GRIP; |
3372 ia_state_ |= STATE_SYSTEM_READONLY; | 3373 ia_state_ |= STATE_SYSTEM_READONLY; |
3373 break; | 3374 break; |
3374 case AccessibilityNodeData::ROLE_HEADING: | 3375 case WebKit::WebAXRoleHeading: |
3375 role_name_ = html_tag; | 3376 role_name_ = html_tag; |
3376 ia2_role_ = IA2_ROLE_HEADING; | 3377 ia2_role_ = IA2_ROLE_HEADING; |
3377 ia_state_ |= STATE_SYSTEM_READONLY; | 3378 ia_state_ |= STATE_SYSTEM_READONLY; |
3378 break; | 3379 break; |
3379 case AccessibilityNodeData::ROLE_HORIZONTAL_RULE: | 3380 case WebKit::WebAXRoleHorizontalRule: |
3380 ia_role_ = ROLE_SYSTEM_SEPARATOR; | 3381 ia_role_ = ROLE_SYSTEM_SEPARATOR; |
3381 break; | 3382 break; |
3382 case AccessibilityNodeData::ROLE_IMAGE: | 3383 case WebKit::WebAXRoleImage: |
3383 ia_role_ = ROLE_SYSTEM_GRAPHIC; | 3384 ia_role_ = ROLE_SYSTEM_GRAPHIC; |
3384 ia_state_ |= STATE_SYSTEM_READONLY; | 3385 ia_state_ |= STATE_SYSTEM_READONLY; |
3385 break; | 3386 break; |
3386 case AccessibilityNodeData::ROLE_IMAGE_MAP: | 3387 case WebKit::WebAXRoleImageMap: |
3387 role_name_ = html_tag; | 3388 role_name_ = html_tag; |
3388 ia2_role_ = IA2_ROLE_IMAGE_MAP; | 3389 ia2_role_ = IA2_ROLE_IMAGE_MAP; |
3389 ia_state_ |= STATE_SYSTEM_READONLY; | 3390 ia_state_ |= STATE_SYSTEM_READONLY; |
3390 break; | 3391 break; |
3391 case AccessibilityNodeData::ROLE_IMAGE_MAP_LINK: | 3392 case WebKit::WebAXRoleImageMapLink: |
3392 ia_role_ = ROLE_SYSTEM_LINK; | 3393 ia_role_ = ROLE_SYSTEM_LINK; |
3393 ia_state_ |= STATE_SYSTEM_LINKED; | 3394 ia_state_ |= STATE_SYSTEM_LINKED; |
3394 ia_state_ |= STATE_SYSTEM_READONLY; | 3395 ia_state_ |= STATE_SYSTEM_READONLY; |
3395 break; | 3396 break; |
3396 case AccessibilityNodeData::ROLE_LABEL: | 3397 case WebKit::WebAXRoleLabel: |
3397 ia_role_ = ROLE_SYSTEM_TEXT; | 3398 ia_role_ = ROLE_SYSTEM_TEXT; |
3398 ia2_role_ = IA2_ROLE_LABEL; | 3399 ia2_role_ = IA2_ROLE_LABEL; |
3399 break; | 3400 break; |
3400 case AccessibilityNodeData::ROLE_LANDMARK_APPLICATION: | 3401 case WebKit::WebAXRoleBanner: |
3401 case AccessibilityNodeData::ROLE_LANDMARK_BANNER: | 3402 case WebKit::WebAXRoleComplementary: |
3402 case AccessibilityNodeData::ROLE_LANDMARK_COMPLEMENTARY: | 3403 case WebKit::WebAXRoleContentInfo: |
3403 case AccessibilityNodeData::ROLE_LANDMARK_CONTENTINFO: | 3404 case WebKit::WebAXRoleMain: |
3404 case AccessibilityNodeData::ROLE_LANDMARK_MAIN: | 3405 case WebKit::WebAXRoleNavigation: |
3405 case AccessibilityNodeData::ROLE_LANDMARK_NAVIGATION: | 3406 case WebKit::WebAXRoleSearch: |
3406 case AccessibilityNodeData::ROLE_LANDMARK_SEARCH: | |
3407 ia_role_ = ROLE_SYSTEM_GROUPING; | 3407 ia_role_ = ROLE_SYSTEM_GROUPING; |
3408 ia2_role_ = IA2_ROLE_SECTION; | 3408 ia2_role_ = IA2_ROLE_SECTION; |
3409 ia_state_ |= STATE_SYSTEM_READONLY; | 3409 ia_state_ |= STATE_SYSTEM_READONLY; |
3410 break; | 3410 break; |
3411 case AccessibilityNodeData::ROLE_LINK: | 3411 case WebKit::WebAXRoleLink: |
3412 case AccessibilityNodeData::ROLE_WEBCORE_LINK: | |
3413 ia_role_ = ROLE_SYSTEM_LINK; | 3412 ia_role_ = ROLE_SYSTEM_LINK; |
3414 ia_state_ |= STATE_SYSTEM_LINKED; | 3413 ia_state_ |= STATE_SYSTEM_LINKED; |
3415 break; | 3414 break; |
3416 case AccessibilityNodeData::ROLE_LIST: | 3415 case WebKit::WebAXRoleList: |
3417 ia_role_ = ROLE_SYSTEM_LIST; | 3416 ia_role_ = ROLE_SYSTEM_LIST; |
3418 ia_state_ |= STATE_SYSTEM_READONLY; | 3417 ia_state_ |= STATE_SYSTEM_READONLY; |
3419 break; | 3418 break; |
3420 case AccessibilityNodeData::ROLE_LISTBOX: | 3419 case WebKit::WebAXRoleListBox: |
3421 ia_role_ = ROLE_SYSTEM_LIST; | 3420 ia_role_ = ROLE_SYSTEM_LIST; |
3422 break; | 3421 break; |
3423 case AccessibilityNodeData::ROLE_LISTBOX_OPTION: | 3422 case WebKit::WebAXRoleListBoxOption: |
3424 ia_role_ = ROLE_SYSTEM_LISTITEM; | 3423 ia_role_ = ROLE_SYSTEM_LISTITEM; |
3425 if (ia_state_ & STATE_SYSTEM_SELECTABLE) { | 3424 if (ia_state_ & STATE_SYSTEM_SELECTABLE) { |
3426 ia_state_ |= STATE_SYSTEM_FOCUSABLE; | 3425 ia_state_ |= STATE_SYSTEM_FOCUSABLE; |
3427 if (HasState(AccessibilityNodeData::STATE_FOCUSED)) | 3426 if (HasState(WebKit::WebAXStateFocused)) |
3428 ia_state_ |= STATE_SYSTEM_FOCUSED; | 3427 ia_state_ |= STATE_SYSTEM_FOCUSED; |
3429 } | 3428 } |
3430 break; | 3429 break; |
3431 case AccessibilityNodeData::ROLE_LIST_ITEM: | 3430 case WebKit::WebAXRoleListItem: |
3432 ia_role_ = ROLE_SYSTEM_LISTITEM; | 3431 ia_role_ = ROLE_SYSTEM_LISTITEM; |
3433 ia_state_ |= STATE_SYSTEM_READONLY; | 3432 ia_state_ |= STATE_SYSTEM_READONLY; |
3434 break; | 3433 break; |
3435 case AccessibilityNodeData::ROLE_LIST_MARKER: | 3434 case WebKit::WebAXRoleListMarker: |
3436 ia_role_ = ROLE_SYSTEM_TEXT; | 3435 ia_role_ = ROLE_SYSTEM_TEXT; |
3437 ia_state_ |= STATE_SYSTEM_READONLY; | 3436 ia_state_ |= STATE_SYSTEM_READONLY; |
3438 break; | 3437 break; |
3439 case AccessibilityNodeData::ROLE_MATH: | 3438 case WebKit::WebAXRoleMath: |
3440 ia_role_ = ROLE_SYSTEM_EQUATION; | 3439 ia_role_ = ROLE_SYSTEM_EQUATION; |
3441 ia_state_ |= STATE_SYSTEM_READONLY; | 3440 ia_state_ |= STATE_SYSTEM_READONLY; |
3442 break; | 3441 break; |
3443 case AccessibilityNodeData::ROLE_MENU: | 3442 case WebKit::WebAXRoleMenu: |
3444 case AccessibilityNodeData::ROLE_MENU_BUTTON: | 3443 case WebKit::WebAXRoleMenuButton: |
3445 ia_role_ = ROLE_SYSTEM_MENUPOPUP; | 3444 ia_role_ = ROLE_SYSTEM_MENUPOPUP; |
3446 break; | 3445 break; |
3447 case AccessibilityNodeData::ROLE_MENU_BAR: | 3446 case WebKit::WebAXRoleMenuBar: |
3448 ia_role_ = ROLE_SYSTEM_MENUBAR; | 3447 ia_role_ = ROLE_SYSTEM_MENUBAR; |
3449 break; | 3448 break; |
3450 case AccessibilityNodeData::ROLE_MENU_ITEM: | 3449 case WebKit::WebAXRoleMenuItem: |
3451 ia_role_ = ROLE_SYSTEM_MENUITEM; | 3450 ia_role_ = ROLE_SYSTEM_MENUITEM; |
3452 break; | 3451 break; |
3453 case AccessibilityNodeData::ROLE_MENU_LIST_POPUP: | 3452 case WebKit::WebAXRoleMenuListPopup: |
3454 ia_role_ = ROLE_SYSTEM_CLIENT; | 3453 ia_role_ = ROLE_SYSTEM_CLIENT; |
3455 break; | 3454 break; |
3456 case AccessibilityNodeData::ROLE_MENU_LIST_OPTION: | 3455 case WebKit::WebAXRoleMenuListOption: |
3457 ia_role_ = ROLE_SYSTEM_LISTITEM; | 3456 ia_role_ = ROLE_SYSTEM_LISTITEM; |
3458 if (ia_state_ & STATE_SYSTEM_SELECTABLE) { | 3457 if (ia_state_ & STATE_SYSTEM_SELECTABLE) { |
3459 ia_state_ |= STATE_SYSTEM_FOCUSABLE; | 3458 ia_state_ |= STATE_SYSTEM_FOCUSABLE; |
3460 if (HasState(AccessibilityNodeData::STATE_FOCUSED)) | 3459 if (HasState(WebKit::WebAXStateFocused)) |
3461 ia_state_ |= STATE_SYSTEM_FOCUSED; | 3460 ia_state_ |= STATE_SYSTEM_FOCUSED; |
3462 } | 3461 } |
3463 break; | 3462 break; |
3464 case AccessibilityNodeData::ROLE_NOTE: | 3463 case WebKit::WebAXRoleNote: |
3465 ia_role_ = ROLE_SYSTEM_GROUPING; | 3464 ia_role_ = ROLE_SYSTEM_GROUPING; |
3466 ia2_role_ = IA2_ROLE_NOTE; | 3465 ia2_role_ = IA2_ROLE_NOTE; |
3467 ia_state_ |= STATE_SYSTEM_READONLY; | 3466 ia_state_ |= STATE_SYSTEM_READONLY; |
3468 break; | 3467 break; |
3469 case AccessibilityNodeData::ROLE_OUTLINE: | 3468 case WebKit::WebAXRoleOutline: |
3470 ia_role_ = ROLE_SYSTEM_OUTLINE; | 3469 ia_role_ = ROLE_SYSTEM_OUTLINE; |
3471 ia_state_ |= STATE_SYSTEM_READONLY; | 3470 ia_state_ |= STATE_SYSTEM_READONLY; |
3472 break; | 3471 break; |
3473 case AccessibilityNodeData::ROLE_PARAGRAPH: | 3472 case WebKit::WebAXRoleParagraph: |
3474 role_name_ = L"P"; | 3473 role_name_ = L"P"; |
3475 ia2_role_ = IA2_ROLE_PARAGRAPH; | 3474 ia2_role_ = IA2_ROLE_PARAGRAPH; |
3476 break; | 3475 break; |
3477 case AccessibilityNodeData::ROLE_POPUP_BUTTON: | 3476 case WebKit::WebAXRolePopUpButton: |
3478 if (html_tag == L"select") { | 3477 if (html_tag == L"select") { |
3479 ia_role_ = ROLE_SYSTEM_COMBOBOX; | 3478 ia_role_ = ROLE_SYSTEM_COMBOBOX; |
3480 } else { | 3479 } else { |
3481 ia_role_ = ROLE_SYSTEM_BUTTONMENU; | 3480 ia_role_ = ROLE_SYSTEM_BUTTONMENU; |
3482 } | 3481 } |
3483 break; | 3482 break; |
3484 case AccessibilityNodeData::ROLE_PROGRESS_INDICATOR: | 3483 case WebKit::WebAXRoleProgressIndicator: |
3485 ia_role_ = ROLE_SYSTEM_PROGRESSBAR; | 3484 ia_role_ = ROLE_SYSTEM_PROGRESSBAR; |
3486 ia_state_ |= STATE_SYSTEM_READONLY; | 3485 ia_state_ |= STATE_SYSTEM_READONLY; |
3487 break; | 3486 break; |
3488 case AccessibilityNodeData::ROLE_RADIO_BUTTON: | 3487 case WebKit::WebAXRoleRadioButton: |
3489 ia_role_ = ROLE_SYSTEM_RADIOBUTTON; | 3488 ia_role_ = ROLE_SYSTEM_RADIOBUTTON; |
3490 break; | 3489 break; |
3491 case AccessibilityNodeData::ROLE_RADIO_GROUP: | 3490 case WebKit::WebAXRoleRadioGroup: |
3492 ia_role_ = ROLE_SYSTEM_GROUPING; | 3491 ia_role_ = ROLE_SYSTEM_GROUPING; |
3493 ia2_role_ = IA2_ROLE_SECTION; | 3492 ia2_role_ = IA2_ROLE_SECTION; |
3494 break; | 3493 break; |
3495 case AccessibilityNodeData::ROLE_REGION: | 3494 case WebKit::WebAXRoleRegion: |
3496 ia_role_ = ROLE_SYSTEM_GROUPING; | 3495 ia_role_ = ROLE_SYSTEM_GROUPING; |
3497 ia2_role_ = IA2_ROLE_SECTION; | 3496 ia2_role_ = IA2_ROLE_SECTION; |
3498 ia_state_ |= STATE_SYSTEM_READONLY; | 3497 ia_state_ |= STATE_SYSTEM_READONLY; |
3499 break; | 3498 break; |
3500 case AccessibilityNodeData::ROLE_ROW: | 3499 case WebKit::WebAXRoleRow: |
3501 ia_role_ = ROLE_SYSTEM_ROW; | 3500 ia_role_ = ROLE_SYSTEM_ROW; |
3502 ia_state_ |= STATE_SYSTEM_READONLY; | 3501 ia_state_ |= STATE_SYSTEM_READONLY; |
3503 break; | 3502 break; |
3504 case AccessibilityNodeData::ROLE_ROW_HEADER: | 3503 case WebKit::WebAXRoleRowHeader: |
3505 ia_role_ = ROLE_SYSTEM_ROWHEADER; | 3504 ia_role_ = ROLE_SYSTEM_ROWHEADER; |
3506 ia_state_ |= STATE_SYSTEM_READONLY; | 3505 ia_state_ |= STATE_SYSTEM_READONLY; |
3507 break; | 3506 break; |
3508 case AccessibilityNodeData::ROLE_RULER: | 3507 case WebKit::WebAXRoleRuler: |
3509 ia_role_ = ROLE_SYSTEM_CLIENT; | 3508 ia_role_ = ROLE_SYSTEM_CLIENT; |
3510 ia2_role_ = IA2_ROLE_RULER; | 3509 ia2_role_ = IA2_ROLE_RULER; |
3511 ia_state_ |= STATE_SYSTEM_READONLY; | 3510 ia_state_ |= STATE_SYSTEM_READONLY; |
3512 break; | 3511 break; |
3513 case AccessibilityNodeData::ROLE_SCROLLAREA: | 3512 case WebKit::WebAXRoleScrollArea: |
3514 ia_role_ = ROLE_SYSTEM_CLIENT; | 3513 ia_role_ = ROLE_SYSTEM_CLIENT; |
3515 ia2_role_ = IA2_ROLE_SCROLL_PANE; | 3514 ia2_role_ = IA2_ROLE_SCROLL_PANE; |
3516 ia_state_ |= STATE_SYSTEM_READONLY; | 3515 ia_state_ |= STATE_SYSTEM_READONLY; |
3517 break; | 3516 break; |
3518 case AccessibilityNodeData::ROLE_SCROLLBAR: | 3517 case WebKit::WebAXRoleScrollBar: |
3519 ia_role_ = ROLE_SYSTEM_SCROLLBAR; | 3518 ia_role_ = ROLE_SYSTEM_SCROLLBAR; |
3520 break; | 3519 break; |
3521 case AccessibilityNodeData::ROLE_SLIDER: | 3520 case WebKit::WebAXRoleSlider: |
3522 ia_role_ = ROLE_SYSTEM_SLIDER; | 3521 ia_role_ = ROLE_SYSTEM_SLIDER; |
3523 break; | 3522 break; |
3524 case AccessibilityNodeData::ROLE_SPIN_BUTTON: | 3523 case WebKit::WebAXRoleSpinButton: |
3525 ia_role_ = ROLE_SYSTEM_SPINBUTTON; | 3524 ia_role_ = ROLE_SYSTEM_SPINBUTTON; |
3526 break; | 3525 break; |
3527 case AccessibilityNodeData::ROLE_SPIN_BUTTON_PART: | 3526 case WebKit::WebAXRoleSpinButtonPart: |
3528 ia_role_ = ROLE_SYSTEM_PUSHBUTTON; | 3527 ia_role_ = ROLE_SYSTEM_PUSHBUTTON; |
3529 break; | 3528 break; |
3530 case AccessibilityNodeData::ROLE_SPLIT_GROUP: | 3529 case WebKit::WebAXRoleSplitGroup: |
3531 ia_role_ = ROLE_SYSTEM_CLIENT; | 3530 ia_role_ = ROLE_SYSTEM_CLIENT; |
3532 ia2_role_ = IA2_ROLE_SPLIT_PANE; | 3531 ia2_role_ = IA2_ROLE_SPLIT_PANE; |
3533 ia_state_ |= STATE_SYSTEM_READONLY; | 3532 ia_state_ |= STATE_SYSTEM_READONLY; |
3534 break; | 3533 break; |
3535 case AccessibilityNodeData::ROLE_ANNOTATION: | 3534 case WebKit::WebAXRoleAnnotation: |
3536 case AccessibilityNodeData::ROLE_STATIC_TEXT: | 3535 case WebKit::WebAXRoleStaticText: |
3537 ia_role_ = ROLE_SYSTEM_TEXT; | 3536 ia_role_ = ROLE_SYSTEM_TEXT; |
3538 ia_state_ |= STATE_SYSTEM_READONLY; | 3537 ia_state_ |= STATE_SYSTEM_READONLY; |
3539 break; | 3538 break; |
3540 case AccessibilityNodeData::ROLE_STATUS: | 3539 case WebKit::WebAXRoleStatus: |
3541 ia_role_ = ROLE_SYSTEM_STATUSBAR; | 3540 ia_role_ = ROLE_SYSTEM_STATUSBAR; |
3542 ia_state_ |= STATE_SYSTEM_READONLY; | 3541 ia_state_ |= STATE_SYSTEM_READONLY; |
3543 break; | 3542 break; |
3544 case AccessibilityNodeData::ROLE_SPLITTER: | 3543 case WebKit::WebAXRoleSplitter: |
3545 ia_role_ = ROLE_SYSTEM_SEPARATOR; | 3544 ia_role_ = ROLE_SYSTEM_SEPARATOR; |
3546 break; | 3545 break; |
3547 case AccessibilityNodeData::ROLE_SVG_ROOT: | 3546 case WebKit::WebAXRoleSVGRoot: |
3548 ia_role_ = ROLE_SYSTEM_GRAPHIC; | 3547 ia_role_ = ROLE_SYSTEM_GRAPHIC; |
3549 break; | 3548 break; |
3550 case AccessibilityNodeData::ROLE_TAB: | 3549 case WebKit::WebAXRoleTab: |
3551 ia_role_ = ROLE_SYSTEM_PAGETAB; | 3550 ia_role_ = ROLE_SYSTEM_PAGETAB; |
3552 break; | 3551 break; |
3553 case AccessibilityNodeData::ROLE_TABLE: { | 3552 case WebKit::WebAXRoleTable: { |
3554 string16 aria_role = GetString16Attribute( | 3553 string16 aria_role = GetString16Attribute( |
3555 AccessibilityNodeData::ATTR_ROLE); | 3554 AccessibilityNodeData::ATTR_ROLE); |
3556 if (aria_role == L"treegrid") { | 3555 if (aria_role == L"treegrid") { |
3557 ia_role_ = ROLE_SYSTEM_OUTLINE; | 3556 ia_role_ = ROLE_SYSTEM_OUTLINE; |
3558 } else { | 3557 } else { |
3559 ia_role_ = ROLE_SYSTEM_TABLE; | 3558 ia_role_ = ROLE_SYSTEM_TABLE; |
3560 ia_state_ |= STATE_SYSTEM_READONLY; | 3559 ia_state_ |= STATE_SYSTEM_READONLY; |
3561 } | 3560 } |
3562 break; | 3561 break; |
3563 } | 3562 } |
3564 case AccessibilityNodeData::ROLE_TABLE_HEADER_CONTAINER: | 3563 case WebKit::WebAXRoleTableHeaderContainer: |
3565 ia_role_ = ROLE_SYSTEM_GROUPING; | 3564 ia_role_ = ROLE_SYSTEM_GROUPING; |
3566 ia2_role_ = IA2_ROLE_SECTION; | 3565 ia2_role_ = IA2_ROLE_SECTION; |
3567 ia_state_ |= STATE_SYSTEM_READONLY; | 3566 ia_state_ |= STATE_SYSTEM_READONLY; |
3568 break; | 3567 break; |
3569 case AccessibilityNodeData::ROLE_TAB_GROUP_UNUSED: | 3568 case WebKit::WebAXRoleTabList: |
3570 NOTREACHED(); | |
3571 ia_role_ = ROLE_SYSTEM_PAGETABLIST; | 3569 ia_role_ = ROLE_SYSTEM_PAGETABLIST; |
3572 break; | 3570 break; |
3573 case AccessibilityNodeData::ROLE_TAB_LIST: | 3571 case WebKit::WebAXRoleTabPanel: |
3574 ia_role_ = ROLE_SYSTEM_PAGETABLIST; | |
3575 break; | |
3576 case AccessibilityNodeData::ROLE_TAB_PANEL: | |
3577 ia_role_ = ROLE_SYSTEM_PROPERTYPAGE; | 3572 ia_role_ = ROLE_SYSTEM_PROPERTYPAGE; |
3578 break; | 3573 break; |
3579 case AccessibilityNodeData::ROLE_TOGGLE_BUTTON: | 3574 case WebKit::WebAXRoleToggleButton: |
3580 ia_role_ = ROLE_SYSTEM_PUSHBUTTON; | 3575 ia_role_ = ROLE_SYSTEM_PUSHBUTTON; |
3581 ia2_role_ = IA2_ROLE_TOGGLE_BUTTON; | 3576 ia2_role_ = IA2_ROLE_TOGGLE_BUTTON; |
3582 break; | 3577 break; |
3583 case AccessibilityNodeData::ROLE_TEXTAREA: | 3578 case WebKit::WebAXRoleTextArea: |
3584 ia_role_ = ROLE_SYSTEM_TEXT; | 3579 ia_role_ = ROLE_SYSTEM_TEXT; |
3585 ia2_state_ |= IA2_STATE_MULTI_LINE; | 3580 ia2_state_ |= IA2_STATE_MULTI_LINE; |
3586 ia2_state_ |= IA2_STATE_EDITABLE; | 3581 ia2_state_ |= IA2_STATE_EDITABLE; |
3587 ia2_state_ |= IA2_STATE_SELECTABLE_TEXT; | 3582 ia2_state_ |= IA2_STATE_SELECTABLE_TEXT; |
3588 break; | 3583 break; |
3589 case AccessibilityNodeData::ROLE_TEXT_FIELD: | 3584 case WebKit::WebAXRoleTextField: |
3590 ia_role_ = ROLE_SYSTEM_TEXT; | 3585 ia_role_ = ROLE_SYSTEM_TEXT; |
3591 ia2_state_ |= IA2_STATE_SINGLE_LINE; | 3586 ia2_state_ |= IA2_STATE_SINGLE_LINE; |
3592 ia2_state_ |= IA2_STATE_EDITABLE; | 3587 ia2_state_ |= IA2_STATE_EDITABLE; |
3593 ia2_state_ |= IA2_STATE_SELECTABLE_TEXT; | 3588 ia2_state_ |= IA2_STATE_SELECTABLE_TEXT; |
3594 break; | 3589 break; |
3595 case AccessibilityNodeData::ROLE_TIMER: | 3590 case WebKit::WebAXRoleTimer: |
3596 ia_role_ = ROLE_SYSTEM_CLOCK; | 3591 ia_role_ = ROLE_SYSTEM_CLOCK; |
3597 ia_state_ |= STATE_SYSTEM_READONLY; | 3592 ia_state_ |= STATE_SYSTEM_READONLY; |
3598 break; | 3593 break; |
3599 case AccessibilityNodeData::ROLE_TOOLBAR: | 3594 case WebKit::WebAXRoleToolbar: |
3600 ia_role_ = ROLE_SYSTEM_TOOLBAR; | 3595 ia_role_ = ROLE_SYSTEM_TOOLBAR; |
3601 ia_state_ |= STATE_SYSTEM_READONLY; | 3596 ia_state_ |= STATE_SYSTEM_READONLY; |
3602 break; | 3597 break; |
3603 case AccessibilityNodeData::ROLE_TOOLTIP: | 3598 case WebKit::WebAXRoleUserInterfaceTooltip: |
3604 ia_role_ = ROLE_SYSTEM_TOOLTIP; | 3599 ia_role_ = ROLE_SYSTEM_TOOLTIP; |
3605 ia_state_ |= STATE_SYSTEM_READONLY; | 3600 ia_state_ |= STATE_SYSTEM_READONLY; |
3606 break; | 3601 break; |
3607 case AccessibilityNodeData::ROLE_TREE: | 3602 case WebKit::WebAXRoleTree: |
3608 ia_role_ = ROLE_SYSTEM_OUTLINE; | 3603 ia_role_ = ROLE_SYSTEM_OUTLINE; |
3609 ia_state_ |= STATE_SYSTEM_READONLY; | 3604 ia_state_ |= STATE_SYSTEM_READONLY; |
3610 break; | 3605 break; |
3611 case AccessibilityNodeData::ROLE_TREE_GRID: | 3606 case WebKit::WebAXRoleTreeGrid: |
3612 ia_role_ = ROLE_SYSTEM_OUTLINE; | 3607 ia_role_ = ROLE_SYSTEM_OUTLINE; |
3613 ia_state_ |= STATE_SYSTEM_READONLY; | 3608 ia_state_ |= STATE_SYSTEM_READONLY; |
3614 break; | 3609 break; |
3615 case AccessibilityNodeData::ROLE_TREE_ITEM: | 3610 case WebKit::WebAXRoleTreeItem: |
3616 ia_role_ = ROLE_SYSTEM_OUTLINEITEM; | 3611 ia_role_ = ROLE_SYSTEM_OUTLINEITEM; |
3617 ia_state_ |= STATE_SYSTEM_READONLY; | 3612 ia_state_ |= STATE_SYSTEM_READONLY; |
3618 break; | 3613 break; |
3619 case AccessibilityNodeData::ROLE_WINDOW: | 3614 case WebKit::WebAXRoleWindow: |
3620 ia_role_ = ROLE_SYSTEM_WINDOW; | 3615 ia_role_ = ROLE_SYSTEM_WINDOW; |
3621 break; | 3616 break; |
3622 | 3617 |
3623 // TODO(dmazzoni): figure out the proper MSAA role for all of these. | 3618 // TODO(dmazzoni): figure out the proper MSAA role for all of these. |
3624 case AccessibilityNodeData::ROLE_BROWSER: | 3619 case WebKit::WebAXRoleBrowser: |
3625 case AccessibilityNodeData::ROLE_DIRECTORY: | 3620 case WebKit::WebAXRoleDirectory: |
3626 case AccessibilityNodeData::ROLE_DRAWER: | 3621 case WebKit::WebAXRoleDrawer: |
3627 case AccessibilityNodeData::ROLE_HELP_TAG: | 3622 case WebKit::WebAXRoleHelpTag: |
3628 case AccessibilityNodeData::ROLE_IGNORED: | 3623 case WebKit::WebAXRoleIgnored: |
3629 case AccessibilityNodeData::ROLE_INCREMENTOR: | 3624 case WebKit::WebAXRoleIncrementor: |
3630 case AccessibilityNodeData::ROLE_LOG: | 3625 case WebKit::WebAXRoleLog: |
3631 case AccessibilityNodeData::ROLE_MARQUEE: | 3626 case WebKit::WebAXRoleMarquee: |
3632 case AccessibilityNodeData::ROLE_MATTE: | 3627 case WebKit::WebAXRoleMatte: |
3633 case AccessibilityNodeData::ROLE_PRESENTATIONAL: | 3628 case WebKit::WebAXRolePresentational: |
3634 case AccessibilityNodeData::ROLE_RULER_MARKER: | 3629 case WebKit::WebAXRoleRulerMarker: |
3635 case AccessibilityNodeData::ROLE_SHEET: | 3630 case WebKit::WebAXRoleSheet: |
3636 case AccessibilityNodeData::ROLE_SLIDER_THUMB: | 3631 case WebKit::WebAXRoleSliderThumb: |
3637 case AccessibilityNodeData::ROLE_SYSTEM_WIDE: | 3632 case WebKit::WebAXRoleSystemWide: |
3638 case AccessibilityNodeData::ROLE_VALUE_INDICATOR: | 3633 case WebKit::WebAXRoleValueIndicator: |
3639 default: | 3634 default: |
3640 ia_role_ = ROLE_SYSTEM_CLIENT; | 3635 ia_role_ = ROLE_SYSTEM_CLIENT; |
3641 break; | 3636 break; |
3642 } | 3637 } |
3643 | 3638 |
3644 // Compute the final value of READONLY for MSAA. | 3639 // Compute the final value of READONLY for MSAA. |
3645 // | 3640 // |
3646 // We always set the READONLY state for elements that have the | 3641 // We always set the READONLY state for elements that have the |
3647 // aria-readonly attribute and for a few roles (in the switch above). | 3642 // aria-readonly attribute and for a few roles (in the switch above). |
3648 // We clear the READONLY state on focusable controls and on a document. | 3643 // We clear the READONLY state on focusable controls and on a document. |
3649 // Everything else, the majority of objects, do not have this state set. | 3644 // Everything else, the majority of objects, do not have this state set. |
3650 if (HasState(AccessibilityNodeData::STATE_FOCUSABLE) && | 3645 if (HasState(WebKit::WebAXStateFocusable) && |
3651 ia_role_ != ROLE_SYSTEM_DOCUMENT) { | 3646 ia_role_ != ROLE_SYSTEM_DOCUMENT) { |
3652 ia_state_ &= ~(STATE_SYSTEM_READONLY); | 3647 ia_state_ &= ~(STATE_SYSTEM_READONLY); |
3653 } | 3648 } |
3654 if (!HasState(AccessibilityNodeData::STATE_READONLY)) | 3649 if (!HasState(WebKit::WebAXStateReadonly)) |
3655 ia_state_ &= ~(STATE_SYSTEM_READONLY); | 3650 ia_state_ &= ~(STATE_SYSTEM_READONLY); |
3656 if (GetBoolAttribute(AccessibilityNodeData::ATTR_ARIA_READONLY)) | 3651 if (GetBoolAttribute(AccessibilityNodeData::ATTR_ARIA_READONLY)) |
3657 ia_state_ |= STATE_SYSTEM_READONLY; | 3652 ia_state_ |= STATE_SYSTEM_READONLY; |
3658 | 3653 |
3659 // The role should always be set. | 3654 // The role should always be set. |
3660 DCHECK(!role_name_.empty() || ia_role_); | 3655 DCHECK(!role_name_.empty() || ia_role_); |
3661 | 3656 |
3662 // If we didn't explicitly set the IAccessible2 role, make it the same | 3657 // If we didn't explicitly set the IAccessible2 role, make it the same |
3663 // as the MSAA role. | 3658 // as the MSAA role. |
3664 if (!ia2_role_) | 3659 if (!ia2_role_) |
3665 ia2_role_ = ia_role_; | 3660 ia2_role_ = ia_role_; |
3666 } | 3661 } |
3667 | 3662 |
3668 } // namespace content | 3663 } // namespace content |
OLD | NEW |