Bug 1768269: Use IgnoredErrorResult instead of ErrorResult in LocalAccessible::IsActiveDescendant. r=eeejay

QuerySelector can fail if the id is invalid; e.g. if it contains a quote (") character.
ErrorResult treats a failure as an exception, so it asserts.
We explicitly check for and handle failure ourselves, so use IgnoredErrorResult instead.

Differential Revision: https://phabricator.services.mozilla.com/D151564
This commit is contained in:
James Teh 2022-07-12 02:44:31 +00:00
Родитель 87bdd97025
Коммит 143b3ab931
1 изменённых файлов: 1 добавлений и 1 удалений

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

@ -2966,7 +2966,7 @@ bool LocalAccessible::IsActiveDescendant(LocalAccessible** aWidget) const {
selector.AppendPrintf(
"[aria-activedescendant=\"%s\"]",
NS_ConvertUTF16toUTF8(mContent->GetID()->GetUTF16String()).get());
ErrorResult er;
IgnoredErrorResult er;
dom::Element* widgetElm =
docOrShadowRoot->AsNode().QuerySelector(selector, er);