You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
800B

  1. import { computeTextAlternative } from "./accessible-name-and-description.mjs";
  2. import { hasAnyConcreteRoles } from "./util.mjs";
  3. /**
  4. * https://w3c.github.io/aria/#namefromprohibited
  5. */
  6. function prohibitsNaming(node) {
  7. return hasAnyConcreteRoles(node, ["caption", "code", "deletion", "emphasis", "generic", "insertion", "paragraph", "presentation", "strong", "subscript", "superscript"]);
  8. }
  9. /**
  10. * implements https://w3c.github.io/accname/#mapping_additional_nd_name
  11. * @param root
  12. * @param options
  13. * @returns
  14. */
  15. export function computeAccessibleName(root) {
  16. var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  17. if (prohibitsNaming(root)) {
  18. return "";
  19. }
  20. return computeTextAlternative(root, options);
  21. }
  22. //# sourceMappingURL=accessible-name.mjs.map