Bug 1822205 - collectionItemInfo.rowIndex should be 0 based in Android. r=Jamie,geckoview-reviewers,m_kato

Differential Revision: https://phabricator.services.mozilla.com/D172504
This commit is contained in:
Eitan Isaacson 2023-03-15 22:09:32 +00:00
parent f98e3aa593
commit 07ecb9af4d
2 changed files with 3 additions and 3 deletions

View file

@ -807,7 +807,7 @@ mozilla::java::GeckoBundle::LocalRef SessionAccessibility::ToBundle(
if (rowIndex) { if (rowIndex) {
GECKOBUNDLE_START(collectionItemInfo); GECKOBUNDLE_START(collectionItemInfo);
GECKOBUNDLE_PUT(collectionItemInfo, "rowIndex", GECKOBUNDLE_PUT(collectionItemInfo, "rowIndex",
java::sdk::Integer::ValueOf(*rowIndex)); java::sdk::Integer::ValueOf(*rowIndex - 1));
GECKOBUNDLE_PUT(collectionItemInfo, "columnIndex", GECKOBUNDLE_PUT(collectionItemInfo, "columnIndex",
java::sdk::Integer::ValueOf(0)); java::sdk::Integer::ValueOf(0));
GECKOBUNDLE_PUT(collectionItemInfo, "rowSpan", GECKOBUNDLE_PUT(collectionItemInfo, "rowSpan",
@ -980,7 +980,7 @@ void SessionAccessibility::PopulateNodeInfo(
attributes->GetAttribute<int32_t>(nsGkAtoms::posinset); attributes->GetAttribute<int32_t>(nsGkAtoms::posinset);
if (rowIndex) { if (rowIndex) {
mSessionAccessibility->PopulateNodeCollectionItemInfo(aNodeInfo, mSessionAccessibility->PopulateNodeCollectionItemInfo(aNodeInfo,
*rowIndex, 1, 0, 1); *rowIndex - 1, 1, 0, 1);
} }
Maybe<int32_t> rowCount = Maybe<int32_t> rowCount =

View file

@ -1738,7 +1738,7 @@ class AccessibilityTest : BaseSessionTest() {
val firstListFirstItem = createNodeInfo(firstList.getChildId(0)) val firstListFirstItem = createNodeInfo(firstList.getChildId(0))
if (Build.VERSION.SDK_INT >= 19) { if (Build.VERSION.SDK_INT >= 19) {
assertThat("Item has collectionItemInfo", firstListFirstItem.collectionItemInfo, notNullValue()) assertThat("Item has collectionItemInfo", firstListFirstItem.collectionItemInfo, notNullValue())
assertThat("Item has collectionItemInfo", firstListFirstItem.collectionItemInfo.rowIndex, equalTo(1)) assertThat("Item has correct rowIndex", firstListFirstItem.collectionItemInfo.rowIndex, equalTo(0))
} }
val secondList = createNodeInfo(rootNode.getChildId(1)) val secondList = createNodeInfo(rootNode.getChildId(1))