Backed out changeset 492778e5c97b (bug 1832686) for causing browser-a11y failures on browser_test_general.js. CLOSED TREE

This commit is contained in:
Iulian Moraru 2023-05-24 06:39:16 +03:00
Родитель 415beb83a9
Коммит 18534f1d12
2 изменённых файлов: 0 добавлений и 47 удалений

Просмотреть файл

@ -499,22 +499,6 @@ Accessible* RemoteAccessibleBase<Derived>::ChildAtPoint(
// first match we encounter is guaranteed to be the // first match we encounter is guaranteed to be the
// deepest match. // deepest match.
lastMatch = acc; lastMatch = acc;
if (lastMatch->Role() == roles::TEXT_CONTAINER) {
// We've matched on a generic, we probably want its
// inner text leaf (if one exists). Drill down through
// subsequent generics, regardless of whether the point
// we want is actually contained therein."
while (lastMatch->ChildCount() == 1) {
if (lastMatch->Role() == roles::TEXT_CONTAINER) {
lastMatch = lastMatch->RemoteChildAt(0);
} else {
break;
}
}
// If we failed to find a text leaf, fall back to the
// original generic match.
lastMatch = lastMatch->IsTextLeaf() ? lastMatch : acc;
}
break; break;
} }
} }

Просмотреть файл

@ -276,34 +276,3 @@ addAccessibleTask(
}, },
{ chrome: true, iframe: true, remoteIframe: true } { chrome: true, iframe: true, remoteIframe: true }
); );
/**
* Verify that hit testing is appropriately fuzzy when working with generics.
* If we match on a generic which contains additional generics and a single text
* leaf, we should return the text leaf as the deepest match instead of the
* generic itself.
*/
addAccessibleTask(
`
<a href="example.com" id="link">
<span style="overflow:hidden;" id="generic">
<span aria-hidden="true" id="visible">I am some visible text</span><span id="invisible" style="overflow:hidden; height: 1px; width: 1px; position:absolute; clip: rect(0 0 0 0); display:block;">I am some invisible text</span>
</span>
</a>`,
async function (browser, docAcc) {
const link = findAccessibleChildByID(docAcc, "link");
const generic = findAccessibleChildByID(docAcc, "generic");
const invisible = findAccessibleChildByID(docAcc, "invisible");
const dpr = await getContentDPR(browser);
await testChildAtPoint(
dpr,
1,
1,
link,
generic, // Direct Child
invisible.firstChild // Deepest Child
);
},
{ chrome: true, iframe: true, remoteIframe: true }
);