Reland: Returns optional values from any AXNode related API that might fail and drops the use of int32_t from countable arguments

The only difference from the previous patch that got reverted is a change to how table row and column indices get reported in accessibility dump tree tests on Linux.
In the reland, row and column indices are reported as -1 when the accessibility object is not a legal table cell, as per the Linux ATK documentation.

1. Certain APIs exposed by AXPlatformNodeDelegate, AXPlatformNode and automation might fail.
For example, asking for the number of rows when not inside a table object, or asking for the PosInSet of an object that is not part of a set.
2. Certain APIs do not conform to our C++ Style Guide by exposing int32_t arguments and thereby
infect the whole codebase that uses them.

This patch uses base::Optional as the return type of any API that might fail and
removes the use of int32_t from any API arguments that refer to something countable, e.g. a row_index or a set_size.
Intentionally, we don't remove the use of int32_t for representing AXNode IDs, because
node IDs should be treated as an opaque data type and no numeric calculations should be performed on them.

This patch has uncovered some bugs in the IAccessible2 table implementation, which have been fixed.
Specifically, if a row or column argument is out of range, E_INVALIDARG should be returned from get_columnExtents, get_rowExtents, get_rowDescription and get_columnDescription, instead of S_FALSE.
Also, get_rowDescription and get_columnDescription should return the header cell if called on a header cell.,

Bug: 953443
Change-Id: Iab56ab2ae92bda6aff445f84b57ff1a7371d3c17
Commit-Queue: Nektarios Paisios <>
Reviewed-by: Aaron Leventhal <>
Cr-Commit-Position: refs/heads/master@{#668478}
45 files changed