Index: ui/accessibility/platform/ax_platform_node_win.cc |
diff --git a/ui/accessibility/platform/ax_platform_node_win.cc b/ui/accessibility/platform/ax_platform_node_win.cc |
index 295a404af706d24c7b75645fc0b09881e2db1a4b..b29c62fb1ac84bcfb55b1b1465207950c7581f15 100644 |
--- a/ui/accessibility/platform/ax_platform_node_win.cc |
+++ b/ui/accessibility/platform/ax_platform_node_win.cc |
@@ -20,6 +20,7 @@ |
#include "third_party/skia/include/core/SkColor.h" |
#include "ui/accessibility/ax_action_data.h" |
#include "ui/accessibility/ax_node_data.h" |
+#include "ui/accessibility/ax_role_properties.h" |
#include "ui/accessibility/ax_text_utils.h" |
#include "ui/accessibility/ax_tree_data.h" |
#include "ui/accessibility/platform/ax_platform_node_delegate.h" |
@@ -361,12 +362,6 @@ STDMETHODIMP AXPlatformNodeWin::accNavigate( |
IAccessible* result = nullptr; |
switch (nav_dir) { |
- case NAVDIR_DOWN: |
- case NAVDIR_UP: |
- case NAVDIR_LEFT: |
- case NAVDIR_RIGHT: |
- // These directions are not implemented except in tables. |
- return E_NOTIMPL; |
case NAVDIR_FIRSTCHILD: |
if (delegate_->GetChildCount() > 0) |
@@ -391,6 +386,67 @@ STDMETHODIMP AXPlatformNodeWin::accNavigate( |
result = previous->GetNativeViewAccessible(); |
break; |
} |
+ |
+ case NAVDIR_DOWN: { |
+ // This direction is not implemented except in tables. |
+ if (!ui::IsTableLikeRole(GetData().role) && |
+ !ui::IsCellOrTableHeaderRole(GetData().role)) |
+ return E_NOTIMPL; |
+ |
+ AXPlatformNodeBase* next = target->GetTableCell( |
+ GetTableRow() + GetTableRowSpan(), GetTableColumn()); |
+ if (!next) |
+ return S_OK; |
+ |
+ result = next->GetNativeViewAccessible(); |
+ break; |
+ } |
+ |
+ case NAVDIR_UP: { |
+ // This direction is not implemented except in tables. |
+ if (!ui::IsTableLikeRole(GetData().role) && |
+ !ui::IsCellOrTableHeaderRole(GetData().role)) |
+ return E_NOTIMPL; |
+ |
+ AXPlatformNodeBase* next = |
+ target->GetTableCell(GetTableRow() - 1, GetTableColumn()); |
+ if (!next) |
+ return S_OK; |
+ |
+ result = next->GetNativeViewAccessible(); |
+ break; |
+ } |
+ |
+ case NAVDIR_LEFT: { |
+ // This direction is not implemented except in tables. |
+ if (!ui::IsTableLikeRole(GetData().role) && |
+ !ui::IsCellOrTableHeaderRole(GetData().role)) |
+ return E_NOTIMPL; |
+ |
+ AXPlatformNodeBase* next = |
+ target->GetTableCell(GetTableRow(), GetTableColumn() - 1); |
+ if (!next) |
+ return S_OK; |
+ |
+ result = next->GetNativeViewAccessible(); |
+ break; |
+ } |
+ |
+ case NAVDIR_RIGHT: { |
+ // This direction is not implemented except in tables. |
+ |
+ if (!ui::IsTableLikeRole(GetData().role) && |
+ !ui::IsCellOrTableHeaderRole(GetData().role)) |
+ return E_NOTIMPL; |
+ |
+ AXPlatformNodeBase* next = target->GetTableCell( |
+ GetTableRow(), GetTableColumn() + GetTableColumnSpan()); |
+ if (!next) |
+ return S_OK; |
+ |
+ result = next->GetNativeViewAccessible(); |
+ break; |
+ } |
} |
if (!result) |