diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-05-16 09:59:13 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-05-20 10:28:53 +0000 |
commit | 6c11fb357ec39bf087b8b632e2b1e375aef1b38b (patch) | |
tree | c8315530db18a8ee566521c39ab8a6af4f72bc03 /chromium/ui/accessibility/platform/ax_platform_node_delegate_base.cc | |
parent | 3ffaed019d0772e59d6cdb2d0d32fe4834c31f72 (diff) | |
download | qtwebengine-chromium-6c11fb357ec39bf087b8b632e2b1e375aef1b38b.tar.gz |
BASELINE: Update Chromium to 74.0.3729.159
Change-Id: I8d2497da544c275415aedd94dd25328d555de811
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/ui/accessibility/platform/ax_platform_node_delegate_base.cc')
-rw-r--r-- | chromium/ui/accessibility/platform/ax_platform_node_delegate_base.cc | 139 |
1 files changed, 111 insertions, 28 deletions
diff --git a/chromium/ui/accessibility/platform/ax_platform_node_delegate_base.cc b/chromium/ui/accessibility/platform/ax_platform_node_delegate_base.cc index d1aa8dbd235..21d9fe21192 100644 --- a/chromium/ui/accessibility/platform/ax_platform_node_delegate_base.cc +++ b/chromium/ui/accessibility/platform/ax_platform_node_delegate_base.cc @@ -4,8 +4,12 @@ #include "ui/accessibility/platform/ax_platform_node_delegate_base.h" +#include <vector> + #include "base/no_destructor.h" +#include "ui/accessibility/ax_constants.mojom.h" #include "ui/accessibility/ax_node_data.h" +#include "ui/accessibility/ax_role_properties.h" #include "ui/accessibility/ax_tree_data.h" namespace ui { @@ -24,6 +28,13 @@ const AXTreeData& AXPlatformNodeDelegateBase::GetTreeData() const { return *empty_data; } +AXNodePosition::AXPositionInstance +AXPlatformNodeDelegateBase::CreateTextPositionAt( + int offset, + ax::mojom::TextAffinity affinity) const { + return AXNodePosition::CreateNullPosition(); +} + gfx::NativeViewAccessible AXPlatformNodeDelegateBase::GetNSWindow() { return nullptr; } @@ -71,23 +82,33 @@ AXPlatformNodeDelegateBase::GetTargetForNativeAccessibilityEvent() { } bool AXPlatformNodeDelegateBase::IsTable() const { - return false; + return ui::IsTableLike(GetData().role); } int AXPlatformNodeDelegateBase::GetTableRowCount() const { - return 0; + return GetData().GetIntAttribute(ax::mojom::IntAttribute::kTableRowCount); } int AXPlatformNodeDelegateBase::GetTableColCount() const { - return 0; + return GetData().GetIntAttribute(ax::mojom::IntAttribute::kTableColumnCount); } -int32_t AXPlatformNodeDelegateBase::GetTableAriaColCount() const { - return 0; +base::Optional<int32_t> AXPlatformNodeDelegateBase::GetTableAriaColCount() + const { + int32_t aria_column_count = + GetData().GetIntAttribute(ax::mojom::IntAttribute::kAriaColumnCount); + if (aria_column_count == ax::mojom::kUnknownAriaColumnOrRowCount) + return base::nullopt; + return aria_column_count; } -int32_t AXPlatformNodeDelegateBase::GetTableAriaRowCount() const { - return 0; +base::Optional<int32_t> AXPlatformNodeDelegateBase::GetTableAriaRowCount() + const { + int32_t aria_row_count = + GetData().GetIntAttribute(ax::mojom::IntAttribute::kAriaRowCount); + if (aria_row_count == ax::mojom::kUnknownAriaColumnOrRowCount) + return base::nullopt; + return aria_row_count; } int32_t AXPlatformNodeDelegateBase::GetTableCellCount() const { @@ -96,58 +117,65 @@ int32_t AXPlatformNodeDelegateBase::GetTableCellCount() const { const std::vector<int32_t> AXPlatformNodeDelegateBase::GetColHeaderNodeIds() const { - return std::vector<int32_t>(); + return {}; } const std::vector<int32_t> AXPlatformNodeDelegateBase::GetColHeaderNodeIds( int32_t col_index) const { - return std::vector<int32_t>(); + return {}; } const std::vector<int32_t> AXPlatformNodeDelegateBase::GetRowHeaderNodeIds() const { - return std::vector<int32_t>(); + return {}; } const std::vector<int32_t> AXPlatformNodeDelegateBase::GetRowHeaderNodeIds( int32_t row_index) const { - return std::vector<int32_t>(); + return {}; +} + +AXPlatformNode* AXPlatformNodeDelegateBase::GetTableCaption() { + return nullptr; } bool AXPlatformNodeDelegateBase::IsTableRow() const { - return false; + return ui::IsTableRow(GetData().role); } int32_t AXPlatformNodeDelegateBase::GetTableRowRowIndex() const { - return 0; + return GetData().GetIntAttribute(ax::mojom::IntAttribute::kTableRowIndex); } bool AXPlatformNodeDelegateBase::IsTableCellOrHeader() const { - return false; + return ui::IsCellOrTableHeader(GetData().role); } int32_t AXPlatformNodeDelegateBase::GetTableCellColIndex() const { - return 0; + return GetData().GetIntAttribute( + ax::mojom::IntAttribute::kTableCellColumnIndex); } int32_t AXPlatformNodeDelegateBase::GetTableCellRowIndex() const { - return 0; + return GetData().GetIntAttribute(ax::mojom::IntAttribute::kTableCellRowIndex); } int32_t AXPlatformNodeDelegateBase::GetTableCellColSpan() const { - return 0; + return GetData().GetIntAttribute( + ax::mojom::IntAttribute::kTableCellColumnSpan); } int32_t AXPlatformNodeDelegateBase::GetTableCellRowSpan() const { - return 0; + return GetData().GetIntAttribute(ax::mojom::IntAttribute::kTableCellRowSpan); } int32_t AXPlatformNodeDelegateBase::GetTableCellAriaColIndex() const { - return 0; + return GetData().GetIntAttribute( + ax::mojom::IntAttribute::kAriaCellColumnIndex); } int32_t AXPlatformNodeDelegateBase::GetTableCellAriaRowIndex() const { - return 0; + return GetData().GetIntAttribute(ax::mojom::IntAttribute::kAriaCellRowIndex); } int32_t AXPlatformNodeDelegateBase::GetCellId(int32_t row_index, @@ -168,6 +196,18 @@ bool AXPlatformNodeDelegateBase::AccessibilityPerformAction( return false; } +base::string16 +AXPlatformNodeDelegateBase::GetLocalizedStringForImageAnnotationStatus( + ax::mojom::ImageAnnotationStatus status) const { + return base::string16(); +} + +base::string16 +AXPlatformNodeDelegateBase::GetLocalizedRoleDescriptionForUnlabeledImage() + const { + return base::string16(); +} + bool AXPlatformNodeDelegateBase::ShouldIgnoreHoveredStateForTesting() { return true; } @@ -176,16 +216,51 @@ bool AXPlatformNodeDelegateBase::IsOffscreen() const { return false; } -std::set<int32_t> AXPlatformNodeDelegateBase::GetReverseRelations( - ax::mojom::IntAttribute attr, - int32_t dst_id) { - return std::set<int32_t>(); +bool AXPlatformNodeDelegateBase::IsWebContent() const { + return false; +} + +AXPlatformNode* AXPlatformNodeDelegateBase::GetTargetNodeForRelation( + ax::mojom::IntAttribute attr) { + DCHECK(IsNodeIdIntAttribute(attr)); + + int target_id; + if (!GetData().GetIntAttribute(attr, &target_id)) + return nullptr; + + return GetFromNodeID(target_id); +} + +std::set<AXPlatformNode*> AXPlatformNodeDelegateBase::GetNodesForNodeIds( + const std::set<int32_t>& ids) { + std::set<AXPlatformNode*> nodes; + for (int32_t node_id : ids) { + if (AXPlatformNode* node = GetFromNodeID(node_id)) { + nodes.insert(node); + } + } + return nodes; +} + +std::set<AXPlatformNode*> AXPlatformNodeDelegateBase::GetTargetNodesForRelation( + ax::mojom::IntListAttribute attr) { + DCHECK(IsNodeIdIntListAttribute(attr)); + std::vector<int32_t> target_ids; + if (!GetData().GetIntListAttribute(attr, &target_ids)) + return std::set<AXPlatformNode*>(); + + std::set<int32_t> target_id_set(target_ids.begin(), target_ids.end()); + return GetNodesForNodeIds(target_id_set); +} + +std::set<AXPlatformNode*> AXPlatformNodeDelegateBase::GetReverseRelations( + ax::mojom::IntAttribute attr) { + return std::set<AXPlatformNode*>(); } -std::set<int32_t> AXPlatformNodeDelegateBase::GetReverseRelations( - ax::mojom::IntListAttribute attr, - int32_t dst_id) { - return std::set<int32_t>(); +std::set<AXPlatformNode*> AXPlatformNodeDelegateBase::GetReverseRelations( + ax::mojom::IntListAttribute attr) { + return std::set<AXPlatformNode*>(); } const AXUniqueId& AXPlatformNodeDelegateBase::GetUniqueId() const { @@ -193,6 +268,14 @@ const AXUniqueId& AXPlatformNodeDelegateBase::GetUniqueId() const { return *dummy_unique_id; } +AXPlatformNodeDelegate::EnclosingBoundaryOffsets +AXPlatformNodeDelegateBase::FindTextBoundariesAtOffset( + TextBoundaryType boundary_type, + int offset, + ax::mojom::TextAffinity affinity) const { + return base::nullopt; +} + bool AXPlatformNodeDelegateBase::IsOrderedSetItem() const { return false; } |