Bug 1779303: Don't add null attribute values for RemoteAccessibles with markup attributes that must be fetched from DOM. r=morgan

Some markup elements expose Accessible attributes which must be retrieved from DOM; e.g. the datetime attribute of the datetime element.
We don't cache these yet for RemoteAccessible.
Previously, these were unintentionally exposed from MarkupAttributes with null values.
For now, these should be skipped instead until we have caching code for them.
This fixes crashes whenever a client tries to fetch attributes from such an element.

Differential Revision: https://phabricator.services.mozilla.com/D151659
This commit is contained in:
James Teh 2022-07-14 00:21:27 +00:00
Родитель c58fc06b93
Коммит bbcfab7595
1 изменённых файлов: 5 добавлений и 2 удалений

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

@ -1551,8 +1551,11 @@ void nsAccessibilityService::MarkupAttributes(
const MarkupAttrInfo* info = markupMap->attrs + i;
if (!info->name) break;
// XXX Expose DOM attributes for cached RemoteAccessibles.
if (info->DOMAttrName && el) {
if (info->DOMAttrName) {
if (!el) {
// XXX Expose DOM attributes for cached RemoteAccessibles.
continue;
}
if (info->DOMAttrValue) {
if (el->AttrValueIs(kNameSpaceID_None, info->DOMAttrName,
info->DOMAttrValue, eCaseMatters)) {