Bug 1780878: [Part 2] Cache DESCRIBED_BY and DESCRIPTION_FOR relations r=Jamie

Differential Revision: https://phabricator.services.mozilla.com/D152580
This commit is contained in:
Morgan Rae Reschenberg
2022-08-03 05:09:55 +00:00
parent cf298a855a
commit cef77d3338
2 changed files with 3 additions and 0 deletions

View File

@@ -73,6 +73,8 @@ static constexpr RelationData kRelationTypeAtoms[] = {
RelationType::CONTROLLED_BY},
{nsGkAtoms::_for, nsGkAtoms::output, RelationType::CONTROLLED_BY,
RelationType::CONTROLLER_FOR},
{nsGkAtoms::aria_describedby, nullptr, RelationType::DESCRIBED_BY,
RelationType::DESCRIPTION_FOR},
};
} // namespace a11y

View File

@@ -1334,6 +1334,7 @@ void LocalAccessible::DOMAttributeChanged(int32_t aNameSpaceID,
}
if (aAttribute == nsGkAtoms::aria_describedby) {
mDoc->QueueCacheUpdate(this, CacheDomain::Relations);
mDoc->FireDelayedEvent(nsIAccessibleEvent::EVENT_DESCRIPTION_CHANGE, this);
if (aModType == dom::MutationEvent_Binding::MODIFICATION ||
aModType == dom::MutationEvent_Binding::ADDITION) {