Chromium Code Reviews| 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 1d7d95df5c701963ab1d15427d5b890799965f19..8b9ec79f0ef8979892ec6e76e0538b1e037c5cff 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 are not implemented except in tables. |
|
dmazzoni
2017/07/06 23:07:48
are not -> is not, throughout
dougt
2017/07/11 23:21:55
Done.
|
| + 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 are 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 are 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 are 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) |