Bug 1657576 - Expose the data-at-shortcutkeys attribute as an object attribute, r=Jamie

Currently used mostly by Twitter and Facebook to allow them to specify which virtual quick navigation keys assistive technologies should not use when in those web applications, but instead pass them through to the browser. JAWS is currently the only known assistive technology making use of this feature.

This works in Chrome and the new Edge, but not in Firefox, because JAWS stopped using ISimpleDOM in Firefox, which no longer gave them access to this attribute.

This bug is to allow exposure of the non-standardized data-at-shortcutkeys attribute value via a same-named IAccessible2 and ATK Object Attribute.

Differential Revision: https://phabricator.services.mozilla.com/D86181
This commit is contained in:
Marco Zehe 2020-09-09 05:43:19 +00:00
Родитель 9ba4e16ce3
Коммит 8e98d90958
3 изменённых файлов: 16 добавлений и 0 удалений

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

@ -1083,6 +1083,15 @@ already_AddRefed<nsIPersistentProperties> Accessible::NativeAttributes() {
styleInfo.MarginBottom(value);
nsAccUtils::SetAccAttr(attributes, nsGkAtoms::marginBottom, value);
// Expose data-at-shortcutkeys attribute for web applications and virtual
// cursors. Currently mostly used by JAWS.
nsAutoString atShortcutKeys;
if (mContent->AsElement()->GetAttr(
kNameSpaceID_None, nsGkAtoms::dataAtShortcutkeys, atShortcutKeys)) {
nsAccUtils::SetAccAttr(attributes, nsGkAtoms::dataAtShortcutkeys,
atShortcutKeys);
}
return attributes.forget();
}

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

@ -161,6 +161,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=558036
testAttrs("aside1", {"xml-roles": "group"}, true);
testAttrs("aside2", {"xml-roles": "complementary"}, true);
// non-standard data-at-shortcutkeys attribute:
testAttrs("shortcuts", {'data-at-shortcutkeys': '{"n":"New message","r":"Reply to message"}'}, true);
SimpleTest.finish();
}
@ -279,5 +282,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=558036
<aside id="aside0" role="note">aside 0</aside>
<aside id="aside1" role="group">aside 1</aside>
<aside id="aside2">aside 2</aside>
<!-- Shortcuts for web applications -->
<div id="shortcuts" data-at-shortcutkeys='{"n":"New message","r":"Reply to message"}'></div>
</body>
</html>

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

@ -287,6 +287,7 @@ STATIC_ATOMS = [
Atom("cycler", "cycler"),
Atom("dashed", "dashed"),
Atom("data", "data"),
Atom("dataAtShortcutkeys", "data-at-shortcutkeys"),
Atom("datalist", "datalist"),
Atom("datal10nid", "data-l10n-id"),
Atom("datal10nargs", "data-l10n-args"),