web 3d图形渲染器
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.

29 lines
740 B

  1. "use strict";
  2. var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
  3. Object.defineProperty(exports, "__esModule", {
  4. value: true
  5. });
  6. exports["default"] = getImplicitRole;
  7. var _ariaQuery = require("aria-query");
  8. var _implicitRoles = _interopRequireDefault(require("./implicitRoles"));
  9. /**
  10. * Returns an element's implicit role given its attributes and type.
  11. * Some elements only have an implicit role when certain props are defined.
  12. */
  13. function getImplicitRole(type, attributes) {
  14. var implicitRole;
  15. if (_implicitRoles["default"][type]) {
  16. implicitRole = _implicitRoles["default"][type](attributes);
  17. }
  18. if (_ariaQuery.roles.has(implicitRole)) {
  19. return implicitRole;
  20. }
  21. return null;
  22. }