Bug 1865582: Include xlink:title in svg link name computation, r=Jamie

This revision implements HTMLLinkAccessible::NativeName, which, if the element
is present in an SVG context, checks the xlink:title attribute for the name, as
required by the accessible name specification. This revision also removes eight
expected failures from the relevant web platform test meta file.

Differential Revision: https://phabricator.services.mozilla.com/D203031
This commit is contained in:
Nathan LaPre 2024-03-05 19:04:46 +00:00
Родитель 52945e7e84
Коммит ff4c89901f
3 изменённых файлов: 13 добавлений и 24 удалений

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

@ -112,6 +112,17 @@ void HTMLLinkAccessible::DOMAttributeChanged(int32_t aNameSpaceID,
}
}
ENameValueFlag HTMLLinkAccessible::NativeName(nsString& aName) const {
if (mContent->IsSVGElement()) {
mContent->AsElement()->GetAttr(kNameSpaceID_XLink, nsGkAtoms::title, aName);
if (!aName.IsEmpty()) {
return eNameOK;
}
}
return HyperTextAccessible::NativeName(aName);
}
////////////////////////////////////////////////////////////////////////////////
// HyperLinkAccessible

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

@ -46,6 +46,8 @@ class HTMLLinkAccessible : public HyperTextAccessible {
const nsAttrValue* aOldValue,
uint64_t aOldState) override;
virtual ENameValueFlag NativeName(nsString& aName) const override;
enum { eAction_Jump = 0 };
};

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

@ -1,24 +0,0 @@
[comp_host_language_label.html]
[[xlink:title\][href\] > circle]
expected: FAIL
[[xlink:title\][href\] > rect]
expected: FAIL
[[xlink:title\][href\] > polygon]
expected: FAIL
[[xlink:title\][href\] > g]
expected: FAIL
[[xlink:title\][xlink:href\] > circle]
expected: FAIL
[[xlink:title\][xlink:href\] > rect]
expected: FAIL
[[xlink:title\][xlink:href\] > polygon]
expected: FAIL
[[xlink:title\][xlink:href\] > g]
expected: FAIL