@selenium/atoms 4.51.0 → 4.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +42 -0
- package/dist/index.js.map +1 -1
- package/dist/typescript/accessibility-snapshot-wire.d.ts +4 -0
- package/dist/typescript/accessibility-snapshot-wire.d.ts.map +1 -0
- package/dist/typescript/accessibility-snapshot-wire.js +18 -0
- package/dist/typescript/accessibility-snapshot-wire.js.map +1 -0
- package/dist/typescript/accessibility-snapshot.d.ts +3 -0
- package/dist/typescript/accessibility-snapshot.d.ts.map +1 -0
- package/dist/typescript/accessibility-snapshot.js +18 -0
- package/dist/typescript/accessibility-snapshot.js.map +1 -0
- package/dist/typescript/active-element.d.ts +2 -0
- package/dist/typescript/active-element.d.ts.map +1 -0
- package/dist/typescript/active-element.js +19 -0
- package/dist/typescript/active-element.js.map +1 -0
- package/dist/typescript/clear-local-storage.d.ts +3 -0
- package/dist/typescript/clear-local-storage.d.ts.map +1 -0
- package/dist/typescript/clear-local-storage.js +25 -0
- package/dist/typescript/clear-local-storage.js.map +1 -0
- package/dist/typescript/clear-session-storage.d.ts +3 -0
- package/dist/typescript/clear-session-storage.d.ts.map +1 -0
- package/dist/typescript/clear-session-storage.js +25 -0
- package/dist/typescript/clear-session-storage.js.map +1 -0
- package/dist/typescript/clear.d.ts +3 -0
- package/dist/typescript/clear.d.ts.map +1 -0
- package/dist/typescript/clear.js +67 -0
- package/dist/typescript/clear.js.map +1 -0
- package/dist/typescript/click.d.ts +4 -0
- package/dist/typescript/click.d.ts.map +1 -0
- package/dist/typescript/click.js +52 -0
- package/dist/typescript/click.js.map +1 -0
- package/dist/typescript/core/accessibility/accname.d.ts +6 -0
- package/dist/typescript/core/accessibility/accname.d.ts.map +1 -0
- package/dist/typescript/core/accessibility/accname.js +537 -0
- package/dist/typescript/core/accessibility/accname.js.map +1 -0
- package/dist/typescript/core/accessibility/context.d.ts +43 -0
- package/dist/typescript/core/accessibility/context.d.ts.map +1 -0
- package/dist/typescript/core/accessibility/context.js +49 -0
- package/dist/typescript/core/accessibility/context.js.map +1 -0
- package/dist/typescript/core/accessibility/hidden.d.ts +39 -0
- package/dist/typescript/core/accessibility/hidden.d.ts.map +1 -0
- package/dist/typescript/core/accessibility/hidden.js +216 -0
- package/dist/typescript/core/accessibility/hidden.js.map +1 -0
- package/dist/typescript/core/accessibility/roles.d.ts +28 -0
- package/dist/typescript/core/accessibility/roles.d.ts.map +1 -0
- package/dist/typescript/core/accessibility/roles.js +381 -0
- package/dist/typescript/core/accessibility/roles.js.map +1 -0
- package/dist/typescript/core/accessibility/snapshot.d.ts +13 -0
- package/dist/typescript/core/accessibility/snapshot.d.ts.map +1 -0
- package/dist/typescript/core/accessibility/snapshot.js +55 -0
- package/dist/typescript/core/accessibility/snapshot.js.map +1 -0
- package/dist/typescript/core/accessibility/states.d.ts +18 -0
- package/dist/typescript/core/accessibility/states.d.ts.map +1 -0
- package/dist/typescript/core/accessibility/states.js +215 -0
- package/dist/typescript/core/accessibility/states.js.map +1 -0
- package/dist/typescript/core/accessibility/tree.d.ts +10 -0
- package/dist/typescript/core/accessibility/tree.d.ts.map +1 -0
- package/dist/typescript/core/accessibility/tree.js +261 -0
- package/dist/typescript/core/accessibility/tree.js.map +1 -0
- package/dist/typescript/core/accessibility/types.d.ts +30 -0
- package/dist/typescript/core/accessibility/types.d.ts.map +1 -0
- package/dist/typescript/core/accessibility/types.js +18 -0
- package/dist/typescript/core/accessibility/types.js.map +1 -0
- package/dist/typescript/core/accessibility/value.d.ts +4 -0
- package/dist/typescript/core/accessibility/value.d.ts.map +1 -0
- package/dist/typescript/core/accessibility/value.js +83 -0
- package/dist/typescript/core/accessibility/value.js.map +1 -0
- package/dist/typescript/core/accessibility/wire.d.ts +57 -0
- package/dist/typescript/core/accessibility/wire.d.ts.map +1 -0
- package/dist/typescript/core/accessibility/wire.js +72 -0
- package/dist/typescript/core/accessibility/wire.js.map +1 -0
- package/dist/typescript/core/attribute.d.ts +3 -0
- package/dist/typescript/core/attribute.d.ts.map +1 -0
- package/dist/typescript/core/attribute.js +60 -0
- package/dist/typescript/core/attribute.js.map +1 -0
- package/dist/typescript/core/color.d.ts +2 -0
- package/dist/typescript/core/color.d.ts.map +1 -0
- package/dist/typescript/core/color.js +248 -0
- package/dist/typescript/core/color.js.map +1 -0
- package/dist/typescript/core/editable.d.ts +5 -0
- package/dist/typescript/core/editable.d.ts.map +1 -0
- package/dist/typescript/core/editable.js +55 -0
- package/dist/typescript/core/editable.js.map +1 -0
- package/dist/typescript/core/element.d.ts +6 -0
- package/dist/typescript/core/element.d.ts.map +1 -0
- package/dist/typescript/core/element.js +97 -0
- package/dist/typescript/core/element.js.map +1 -0
- package/dist/typescript/core/enabled.d.ts +2 -0
- package/dist/typescript/core/enabled.d.ts.map +1 -0
- package/dist/typescript/core/enabled.js +69 -0
- package/dist/typescript/core/enabled.js.map +1 -0
- package/dist/typescript/core/error.d.ts +13 -0
- package/dist/typescript/core/error.d.ts.map +1 -0
- package/dist/typescript/core/error.js +40 -0
- package/dist/typescript/core/error.js.map +1 -0
- package/dist/typescript/core/events.d.ts +91 -0
- package/dist/typescript/core/events.d.ts.map +1 -0
- package/dist/typescript/core/events.js +131 -0
- package/dist/typescript/core/events.js.map +1 -0
- package/dist/typescript/core/focus.d.ts +4 -0
- package/dist/typescript/core/focus.d.ts.map +1 -0
- package/dist/typescript/core/focus.js +88 -0
- package/dist/typescript/core/focus.js.map +1 -0
- package/dist/typescript/core/focusable.d.ts +2 -0
- package/dist/typescript/core/focusable.d.ts.map +1 -0
- package/dist/typescript/core/focusable.js +36 -0
- package/dist/typescript/core/focusable.js.map +1 -0
- package/dist/typescript/core/form.d.ts +2 -0
- package/dist/typescript/core/form.d.ts.map +1 -0
- package/dist/typescript/core/form.js +76 -0
- package/dist/typescript/core/form.js.map +1 -0
- package/dist/typescript/core/frame.d.ts +8 -0
- package/dist/typescript/core/frame.d.ts.map +1 -0
- package/dist/typescript/core/frame.js +95 -0
- package/dist/typescript/core/frame.js.map +1 -0
- package/dist/typescript/core/geometry.d.ts +28 -0
- package/dist/typescript/core/geometry.d.ts.map +1 -0
- package/dist/typescript/core/geometry.js +134 -0
- package/dist/typescript/core/geometry.js.map +1 -0
- package/dist/typescript/core/inject.d.ts +21 -0
- package/dist/typescript/core/inject.d.ts.map +1 -0
- package/dist/typescript/core/inject.js +282 -0
- package/dist/typescript/core/inject.js.map +1 -0
- package/dist/typescript/core/interactable.d.ts +2 -0
- package/dist/typescript/core/interactable.d.ts.map +1 -0
- package/dist/typescript/core/interactable.js +27 -0
- package/dist/typescript/core/interactable.js.map +1 -0
- package/dist/typescript/core/keyboard.d.ts +15 -0
- package/dist/typescript/core/keyboard.d.ts.map +1 -0
- package/dist/typescript/core/keyboard.js +356 -0
- package/dist/typescript/core/keyboard.js.map +1 -0
- package/dist/typescript/core/keys.d.ts +65 -0
- package/dist/typescript/core/keys.d.ts.map +1 -0
- package/dist/typescript/core/keys.js +125 -0
- package/dist/typescript/core/keys.js.map +1 -0
- package/dist/typescript/core/locators.d.ts +6 -0
- package/dist/typescript/core/locators.d.ts.map +1 -0
- package/dist/typescript/core/locators.js +610 -0
- package/dist/typescript/core/locators.js.map +1 -0
- package/dist/typescript/core/mouse.d.ts +17 -0
- package/dist/typescript/core/mouse.d.ts.map +1 -0
- package/dist/typescript/core/mouse.js +186 -0
- package/dist/typescript/core/mouse.js.map +1 -0
- package/dist/typescript/core/overflow.d.ts +5 -0
- package/dist/typescript/core/overflow.d.ts.map +1 -0
- package/dist/typescript/core/overflow.js +133 -0
- package/dist/typescript/core/overflow.js.map +1 -0
- package/dist/typescript/core/scroll.d.ts +3 -0
- package/dist/typescript/core/scroll.d.ts.map +1 -0
- package/dist/typescript/core/scroll.js +77 -0
- package/dist/typescript/core/scroll.js.map +1 -0
- package/dist/typescript/core/shown.d.ts +3 -0
- package/dist/typescript/core/shown.d.ts.map +1 -0
- package/dist/typescript/core/shown.js +190 -0
- package/dist/typescript/core/shown.js.map +1 -0
- package/dist/typescript/core/storage.d.ts +14 -0
- package/dist/typescript/core/storage.d.ts.map +1 -0
- package/dist/typescript/core/storage.js +98 -0
- package/dist/typescript/core/storage.js.map +1 -0
- package/dist/typescript/core/style.d.ts +2 -0
- package/dist/typescript/core/style.d.ts.map +1 -0
- package/dist/typescript/core/style.js +32 -0
- package/dist/typescript/core/style.js.map +1 -0
- package/dist/typescript/core/useragent.d.ts +3 -0
- package/dist/typescript/core/useragent.d.ts.map +1 -0
- package/dist/typescript/core/useragent.js +31 -0
- package/dist/typescript/core/useragent.js.map +1 -0
- package/dist/typescript/default-content.d.ts +2 -0
- package/dist/typescript/default-content.d.ts.map +1 -0
- package/dist/typescript/default-content.js +20 -0
- package/dist/typescript/default-content.js.map +1 -0
- package/dist/typescript/execute-async-script.d.ts +2 -0
- package/dist/typescript/execute-async-script.d.ts.map +1 -0
- package/dist/typescript/execute-async-script.js +20 -0
- package/dist/typescript/execute-async-script.js.map +1 -0
- package/dist/typescript/execute-script.d.ts +2 -0
- package/dist/typescript/execute-script.d.ts.map +1 -0
- package/dist/typescript/execute-script.js +20 -0
- package/dist/typescript/execute-script.js.map +1 -0
- package/dist/typescript/find-element-fragment.d.ts +8 -0
- package/dist/typescript/find-element-fragment.d.ts.map +1 -0
- package/dist/typescript/find-element-fragment.js +39 -0
- package/dist/typescript/find-element-fragment.js.map +1 -0
- package/dist/typescript/find-element.d.ts +2 -0
- package/dist/typescript/find-element.d.ts.map +1 -0
- package/dist/typescript/find-element.js +18 -0
- package/dist/typescript/find-element.js.map +1 -0
- package/dist/typescript/find-elements.d.ts +1 -2
- package/dist/typescript/find-elements.d.ts.map +1 -1
- package/dist/typescript/find-elements.js +1 -289
- package/dist/typescript/find-elements.js.map +1 -1
- package/dist/typescript/frame-by-id-or-name.d.ts +2 -0
- package/dist/typescript/frame-by-id-or-name.d.ts.map +1 -0
- package/dist/typescript/frame-by-id-or-name.js +22 -0
- package/dist/typescript/frame-by-id-or-name.js.map +1 -0
- package/dist/typescript/frame-by-index.d.ts +2 -0
- package/dist/typescript/frame-by-index.d.ts.map +1 -0
- package/dist/typescript/frame-by-index.js +19 -0
- package/dist/typescript/frame-by-index.js.map +1 -0
- package/dist/typescript/get-attribute-value.d.ts +2 -0
- package/dist/typescript/get-attribute-value.d.ts.map +1 -0
- package/dist/typescript/get-attribute-value.js +22 -0
- package/dist/typescript/get-attribute-value.js.map +1 -0
- package/dist/typescript/get-effective-style.d.ts +3 -0
- package/dist/typescript/get-effective-style.d.ts.map +1 -0
- package/dist/typescript/get-effective-style.js +84 -0
- package/dist/typescript/get-effective-style.js.map +1 -0
- package/dist/typescript/get-element-from-cache.d.ts +2 -0
- package/dist/typescript/get-element-from-cache.d.ts.map +1 -0
- package/dist/typescript/get-element-from-cache.js +20 -0
- package/dist/typescript/get-element-from-cache.js.map +1 -0
- package/dist/typescript/get-frame-window.d.ts +2 -0
- package/dist/typescript/get-frame-window.d.ts.map +1 -0
- package/dist/typescript/get-frame-window.js +22 -0
- package/dist/typescript/get-frame-window.js.map +1 -0
- package/dist/typescript/get-local-storage-item.d.ts +3 -0
- package/dist/typescript/get-local-storage-item.d.ts.map +1 -0
- package/dist/typescript/get-local-storage-item.js +25 -0
- package/dist/typescript/get-local-storage-item.js.map +1 -0
- package/dist/typescript/get-local-storage-key.d.ts +3 -0
- package/dist/typescript/get-local-storage-key.d.ts.map +1 -0
- package/dist/typescript/get-local-storage-key.js +26 -0
- package/dist/typescript/get-local-storage-key.js.map +1 -0
- package/dist/typescript/get-local-storage-keys.d.ts +3 -0
- package/dist/typescript/get-local-storage-keys.d.ts.map +1 -0
- package/dist/typescript/get-local-storage-keys.js +25 -0
- package/dist/typescript/get-local-storage-keys.js.map +1 -0
- package/dist/typescript/get-local-storage-size.d.ts +3 -0
- package/dist/typescript/get-local-storage-size.d.ts.map +1 -0
- package/dist/typescript/get-local-storage-size.js +25 -0
- package/dist/typescript/get-local-storage-size.js.map +1 -0
- package/dist/typescript/get-location.d.ts +9 -0
- package/dist/typescript/get-location.d.ts.map +1 -0
- package/dist/typescript/get-location.js +49 -0
- package/dist/typescript/get-location.js.map +1 -0
- package/dist/typescript/get-session-storage-item.d.ts +3 -0
- package/dist/typescript/get-session-storage-item.d.ts.map +1 -0
- package/dist/typescript/get-session-storage-item.js +25 -0
- package/dist/typescript/get-session-storage-item.js.map +1 -0
- package/dist/typescript/get-session-storage-key.d.ts +3 -0
- package/dist/typescript/get-session-storage-key.d.ts.map +1 -0
- package/dist/typescript/get-session-storage-key.js +26 -0
- package/dist/typescript/get-session-storage-key.js.map +1 -0
- package/dist/typescript/get-session-storage-keys.d.ts +3 -0
- package/dist/typescript/get-session-storage-keys.d.ts.map +1 -0
- package/dist/typescript/get-session-storage-keys.js +25 -0
- package/dist/typescript/get-session-storage-keys.js.map +1 -0
- package/dist/typescript/get-session-storage-size.d.ts +3 -0
- package/dist/typescript/get-session-storage-size.d.ts.map +1 -0
- package/dist/typescript/get-session-storage-size.js +25 -0
- package/dist/typescript/get-session-storage-size.js.map +1 -0
- package/dist/typescript/get-size.d.ts +7 -0
- package/dist/typescript/get-size.d.ts.map +1 -0
- package/dist/typescript/get-size.js +36 -0
- package/dist/typescript/get-size.js.map +1 -0
- package/dist/typescript/get-text.d.ts +3 -0
- package/dist/typescript/get-text.d.ts.map +1 -0
- package/dist/typescript/get-text.js +294 -0
- package/dist/typescript/get-text.js.map +1 -0
- package/dist/typescript/get-top-left-coordinates.d.ts +4 -0
- package/dist/typescript/get-top-left-coordinates.d.ts.map +1 -0
- package/dist/typescript/get-top-left-coordinates.js +36 -0
- package/dist/typescript/get-top-left-coordinates.js.map +1 -0
- package/dist/typescript/is-displayed.d.ts +1 -2
- package/dist/typescript/is-displayed.d.ts.map +1 -1
- package/dist/typescript/is-displayed.js +3 -396
- package/dist/typescript/is-displayed.js.map +1 -1
- package/dist/typescript/is-editable.d.ts +2 -0
- package/dist/typescript/is-editable.d.ts.map +1 -0
- package/dist/typescript/is-editable.js +18 -0
- package/dist/typescript/is-editable.js.map +1 -0
- package/dist/typescript/is-enabled.d.ts +2 -0
- package/dist/typescript/is-enabled.d.ts.map +1 -0
- package/dist/typescript/is-enabled.js +18 -0
- package/dist/typescript/is-enabled.js.map +1 -0
- package/dist/typescript/is-focusable.d.ts +2 -0
- package/dist/typescript/is-focusable.d.ts.map +1 -0
- package/dist/typescript/is-focusable.js +20 -0
- package/dist/typescript/is-focusable.js.map +1 -0
- package/dist/typescript/is-interactable.d.ts +2 -0
- package/dist/typescript/is-interactable.d.ts.map +1 -0
- package/dist/typescript/is-interactable.js +19 -0
- package/dist/typescript/is-interactable.js.map +1 -0
- package/dist/typescript/is-selected.d.ts +3 -0
- package/dist/typescript/is-selected.d.ts.map +1 -0
- package/dist/typescript/is-selected.js +29 -0
- package/dist/typescript/is-selected.js.map +1 -0
- package/dist/typescript/remove-local-storage-item.d.ts +3 -0
- package/dist/typescript/remove-local-storage-item.d.ts.map +1 -0
- package/dist/typescript/remove-local-storage-item.js +25 -0
- package/dist/typescript/remove-local-storage-item.js.map +1 -0
- package/dist/typescript/remove-session-storage-item.d.ts +3 -0
- package/dist/typescript/remove-session-storage-item.d.ts.map +1 -0
- package/dist/typescript/remove-session-storage-item.js +25 -0
- package/dist/typescript/remove-session-storage-item.js.map +1 -0
- package/dist/typescript/set-local-storage-item.d.ts +3 -0
- package/dist/typescript/set-local-storage-item.d.ts.map +1 -0
- package/dist/typescript/set-local-storage-item.js +26 -0
- package/dist/typescript/set-local-storage-item.js.map +1 -0
- package/dist/typescript/set-session-storage-item.d.ts +3 -0
- package/dist/typescript/set-session-storage-item.d.ts.map +1 -0
- package/dist/typescript/set-session-storage-item.js +26 -0
- package/dist/typescript/set-session-storage-item.js.map +1 -0
- package/dist/typescript/submit.d.ts +3 -0
- package/dist/typescript/submit.d.ts.map +1 -0
- package/dist/typescript/submit.js +50 -0
- package/dist/typescript/submit.js.map +1 -0
- package/dist/typescript/type.d.ts +3 -0
- package/dist/typescript/type.d.ts.map +1 -0
- package/dist/typescript/type.js +201 -0
- package/dist/typescript/type.js.map +1 -0
- package/index.ts +44 -0
- package/package.json +306 -5
- package/typescript/accessibility-snapshot-wire.ts +20 -0
- package/typescript/accessibility-snapshot.ts +21 -0
- package/typescript/active-element.ts +19 -0
- package/typescript/clear-local-storage.ts +27 -0
- package/typescript/clear-session-storage.ts +27 -0
- package/typescript/clear.ts +73 -0
- package/typescript/click.ts +55 -0
- package/typescript/core/accessibility/accname.ts +587 -0
- package/typescript/core/accessibility/context.ts +116 -0
- package/typescript/core/accessibility/hidden.ts +242 -0
- package/typescript/core/accessibility/roles.ts +410 -0
- package/typescript/core/accessibility/snapshot.ts +61 -0
- package/typescript/core/accessibility/states.ts +233 -0
- package/typescript/core/accessibility/tree.ts +306 -0
- package/typescript/core/accessibility/types.ts +52 -0
- package/typescript/core/accessibility/value.ts +89 -0
- package/typescript/core/accessibility/wire.ts +123 -0
- package/typescript/core/attribute.ts +68 -0
- package/typescript/core/color.ts +257 -0
- package/typescript/core/editable.ts +63 -0
- package/typescript/core/element.ts +110 -0
- package/typescript/core/enabled.ts +76 -0
- package/typescript/core/error.ts +41 -0
- package/typescript/core/events.ts +268 -0
- package/typescript/core/focus.ts +92 -0
- package/typescript/core/focusable.ts +38 -0
- package/typescript/core/form.ts +81 -0
- package/typescript/core/frame.ts +105 -0
- package/typescript/core/geometry.ts +183 -0
- package/typescript/core/inject.ts +336 -0
- package/typescript/core/interactable.ts +30 -0
- package/typescript/core/keyboard.ts +369 -0
- package/typescript/core/keys.ts +204 -0
- package/typescript/core/locators.ts +704 -0
- package/typescript/core/mouse.ts +211 -0
- package/typescript/core/overflow.ts +172 -0
- package/typescript/core/scroll.ts +92 -0
- package/typescript/core/shown.ts +233 -0
- package/typescript/core/storage.ts +111 -0
- package/typescript/core/style.ts +32 -0
- package/typescript/core/useragent.ts +33 -0
- package/typescript/default-content.ts +20 -0
- package/typescript/execute-async-script.ts +20 -0
- package/typescript/execute-script.ts +20 -0
- package/typescript/find-element-fragment.ts +45 -0
- package/typescript/find-element.ts +18 -0
- package/typescript/find-elements.ts +1 -326
- package/typescript/frame-by-id-or-name.ts +22 -0
- package/typescript/frame-by-index.ts +19 -0
- package/typescript/get-attribute-value.ts +22 -0
- package/typescript/get-effective-style.ts +93 -0
- package/typescript/get-element-from-cache.ts +20 -0
- package/typescript/get-frame-window.ts +22 -0
- package/typescript/get-local-storage-item.ts +27 -0
- package/typescript/get-local-storage-key.ts +28 -0
- package/typescript/get-local-storage-keys.ts +27 -0
- package/typescript/get-local-storage-size.ts +27 -0
- package/typescript/get-location.ts +63 -0
- package/typescript/get-session-storage-item.ts +27 -0
- package/typescript/get-session-storage-key.ts +28 -0
- package/typescript/get-session-storage-keys.ts +27 -0
- package/typescript/get-session-storage-size.ts +27 -0
- package/typescript/get-size.ts +43 -0
- package/typescript/get-text.ts +353 -0
- package/typescript/get-top-left-coordinates.ts +38 -0
- package/typescript/is-displayed.ts +3 -498
- package/typescript/is-editable.ts +18 -0
- package/typescript/is-enabled.ts +18 -0
- package/typescript/is-focusable.ts +20 -0
- package/typescript/is-interactable.ts +19 -0
- package/typescript/is-selected.ts +31 -0
- package/typescript/remove-local-storage-item.ts +27 -0
- package/typescript/remove-session-storage-item.ts +27 -0
- package/typescript/set-local-storage-item.ts +28 -0
- package/typescript/set-session-storage-item.ts +28 -0
- package/typescript/submit.ts +53 -0
- package/typescript/type.ts +210 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { computeRole } from './roles.js';
|
|
2
|
+
export function createContext(options) {
|
|
3
|
+
return {
|
|
4
|
+
interestingOnly: options === undefined || options === null || options.interestingOnly !== false,
|
|
5
|
+
roles: new Map(),
|
|
6
|
+
hidden: new Map(),
|
|
7
|
+
imageMaps: new Map(),
|
|
8
|
+
styles: new Map(),
|
|
9
|
+
names: new Map(),
|
|
10
|
+
descriptions: new Map(),
|
|
11
|
+
descendantTexts: new Map(),
|
|
12
|
+
contentTexts: new Map(),
|
|
13
|
+
referenceTexts: new Map(),
|
|
14
|
+
generated: new Map(),
|
|
15
|
+
generatedScopes: new Map(),
|
|
16
|
+
placed: new Set(),
|
|
17
|
+
owned: new Map(),
|
|
18
|
+
claimed: new Set(),
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export function roleOf(element, context) {
|
|
22
|
+
let role = context.roles.get(element);
|
|
23
|
+
if (role === undefined) {
|
|
24
|
+
// The role of a cell depends on its table's, which every cell would
|
|
25
|
+
// otherwise recompute; the lookup goes through this cache.
|
|
26
|
+
role = computeRole(element, (owner) => roleOf(owner, context));
|
|
27
|
+
context.roles.set(element, role);
|
|
28
|
+
}
|
|
29
|
+
return role;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The computed style of an element, or of one of its pseudo-elements when
|
|
33
|
+
* `pseudo` is "::before" or "::after". Null when the element has no view.
|
|
34
|
+
*/
|
|
35
|
+
export function styleOf(element, context, pseudo = '') {
|
|
36
|
+
let perPseudo = context.styles.get(element);
|
|
37
|
+
if (!perPseudo) {
|
|
38
|
+
perPseudo = new Map();
|
|
39
|
+
context.styles.set(element, perPseudo);
|
|
40
|
+
}
|
|
41
|
+
let style = perPseudo.get(pseudo);
|
|
42
|
+
if (style === undefined) {
|
|
43
|
+
const view = element.ownerDocument.defaultView;
|
|
44
|
+
style = view ? view.getComputedStyle(element, pseudo || null) : null;
|
|
45
|
+
perPseudo.set(pseudo, style);
|
|
46
|
+
}
|
|
47
|
+
return style;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../../typescript/core/accessibility/context.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAkDxC,MAAM,UAAU,aAAa,CAAC,OAAyB;IACrD,OAAO;QACL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C3C,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,SAAS,GAAG,IAAI,GAAG,EAAE,CAAA;QACrB,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,SAAS,CAAC,CAAA;IACxC,CAAC;IACD,IAAI,KAAK,GAAG,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;IACjC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,WAAW,CAAA;QAC9C,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;QACpE,SAAS,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;IAC9B,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { SnapshotContext } from './context.js';
|
|
2
|
+
/**
|
|
3
|
+
* What an element does to its own visibility, with no regard to ancestors:
|
|
4
|
+
* rendered it has a box
|
|
5
|
+
* self its own box is invisible but a descendant may set itself visible
|
|
6
|
+
* again (visibility is inherited, not a subtree switch)
|
|
7
|
+
* contents its own box is rendered but nothing below it is
|
|
8
|
+
* (content-visibility: hidden, which hidden="until-found" uses)
|
|
9
|
+
* subtree neither it nor anything below it is rendered
|
|
10
|
+
*/
|
|
11
|
+
export type HiddenState = 'rendered' | 'self' | 'contents' | 'subtree';
|
|
12
|
+
export declare function isClosedDetails(element: Element): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* The nodes rendered as this element's children, in render order: the shadow
|
|
15
|
+
* root's children for a host, the assigned nodes (or the fallback while none
|
|
16
|
+
* are assigned) for a slot, otherwise the DOM children. Nested slots are
|
|
17
|
+
* flattened away, so a slot element never appears in the result.
|
|
18
|
+
*
|
|
19
|
+
* A closed shadow root cannot be seen, so its host's light children are
|
|
20
|
+
* returned as if they rendered; see flatTreeParent.
|
|
21
|
+
*/
|
|
22
|
+
export declare function flatTreeChildren(element: Element): ArrayLike<Node>;
|
|
23
|
+
/**
|
|
24
|
+
* Children of a closed details element are not rendered, apart from its first
|
|
25
|
+
* summary. The browser does this through a UA shadow tree that is closed to
|
|
26
|
+
* script, so it has to be known here rather than read from the DOM.
|
|
27
|
+
*/
|
|
28
|
+
export declare function isCollapsedDetailsContent(child: Element, parent: Element): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* See HiddenState. Ancestors are not consulted; isHidden does that. Cached
|
|
31
|
+
* per element in the context: the walk, name-from-content and reference
|
|
32
|
+
* resolution all ask about the same elements.
|
|
33
|
+
*/
|
|
34
|
+
export declare function hiddenState(element: Element, context: SnapshotContext): HiddenState;
|
|
35
|
+
/** Whether an ancestor in the flat tree hides this element, whatever the element does itself. */
|
|
36
|
+
export declare function isHiddenByAncestor(element: Element, context: SnapshotContext): boolean;
|
|
37
|
+
/** Whether the element is hidden in the accname sense. */
|
|
38
|
+
export declare function isHidden(element: Element, context: SnapshotContext): boolean;
|
|
39
|
+
//# sourceMappingURL=hidden.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hidden.d.ts","sourceRoot":"","sources":["../../../../typescript/core/accessibility/hidden.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAE,eAAe,EAAW,MAAM,cAAc,CAAA;AAKvD;;;;;;;;GAQG;AACH,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,CAAA;AAuCtE,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAEzD;AA4CD;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,CAAC,IAAI,CAAC,CAQlE;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,CAUlF;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,GAAG,WAAW,CAOnF;AAsCD,iGAAiG;AACjG,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAgBtF;AAED,0DAA0D;AAC1D,wBAAgB,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAS5E"}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
// Licensed to the Software Freedom Conservancy (SFC) under one
|
|
2
|
+
// or more contributor license agreements. See the NOTICE file
|
|
3
|
+
// distributed with this work for additional information
|
|
4
|
+
// regarding copyright ownership. The SFC licenses this file
|
|
5
|
+
// to you under the Apache License, Version 2.0 (the
|
|
6
|
+
// "License"); you may not use this file except in compliance
|
|
7
|
+
// with the License. You may obtain a copy of the License at
|
|
8
|
+
//
|
|
9
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
//
|
|
11
|
+
// Unless required by applicable law or agreed to in writing,
|
|
12
|
+
// software distributed under the License is distributed on an
|
|
13
|
+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
// KIND, either express or implied. See the License for the
|
|
15
|
+
// specific language governing permissions and limitations
|
|
16
|
+
// under the License.
|
|
17
|
+
// "Hidden" in the accname sense (https://w3c.github.io/accname/#dfn-hidden):
|
|
18
|
+
// an element that is not rendered, or that has aria-hidden=true on itself or
|
|
19
|
+
// an ancestor. This is deliberately not bot.dom.isShown. WebDriver's
|
|
20
|
+
// displayedness also prunes zero-size, transparent and off-screen content,
|
|
21
|
+
// which assistive technology does reach; the "visually hidden" CSS pattern
|
|
22
|
+
// that screen-reader-only text relies on is built on exactly that difference.
|
|
23
|
+
//
|
|
24
|
+
// Ancestry follows the flat tree (slots and shadow hosts), because that is
|
|
25
|
+
// what gets rendered, not the light DOM.
|
|
26
|
+
import { styleOf } from './context.js';
|
|
27
|
+
const DOCUMENT_NODE = 9;
|
|
28
|
+
const DOCUMENT_FRAGMENT_NODE = 11;
|
|
29
|
+
// The flat-tree parent of a node, or one of two terminals.
|
|
30
|
+
const NOT_RENDERED = Symbol('not rendered');
|
|
31
|
+
function isAriaHidden(element) {
|
|
32
|
+
const value = element.getAttribute('aria-hidden');
|
|
33
|
+
return value !== null && value.trim().toLowerCase() === 'true';
|
|
34
|
+
}
|
|
35
|
+
// The UA stylesheet gives every area display: none; what renders it is the
|
|
36
|
+
// image whose usemap points at its map. So an area is as hidden as that image.
|
|
37
|
+
// The document-wide image lookup is done once per map name and snapshot, since
|
|
38
|
+
// every area of a map shares the answer.
|
|
39
|
+
function areaState(area, context) {
|
|
40
|
+
const map = area.closest('map');
|
|
41
|
+
const name = map ? map.getAttribute('name') : null;
|
|
42
|
+
if (!name) {
|
|
43
|
+
return 'subtree';
|
|
44
|
+
}
|
|
45
|
+
const known = context.imageMaps.get(name);
|
|
46
|
+
if (known !== undefined) {
|
|
47
|
+
return known;
|
|
48
|
+
}
|
|
49
|
+
let state = 'subtree';
|
|
50
|
+
const images = area.ownerDocument.querySelectorAll('img[usemap]');
|
|
51
|
+
for (let i = 0; i < images.length; i++) {
|
|
52
|
+
const image = images[i];
|
|
53
|
+
const usemap = (image.getAttribute('usemap') || '').replace(/^#/, '');
|
|
54
|
+
if (usemap === name && hiddenState(image, context) === 'rendered' && !isHiddenByAncestor(image, context)) {
|
|
55
|
+
state = 'rendered';
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
context.imageMaps.set(name, state);
|
|
60
|
+
return state;
|
|
61
|
+
}
|
|
62
|
+
export function isClosedDetails(element) {
|
|
63
|
+
return element.localName === 'details' && !element.hasAttribute('open');
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* The parent that renders this node: its slot when it is assigned to one, the
|
|
67
|
+
* host when it sits directly in a shadow root, otherwise its DOM parent. Null
|
|
68
|
+
* at the document; NOT_RENDERED for nodes the flat tree leaves out (a child of
|
|
69
|
+
* a shadow host that no slot took, fallback content of a slot that has
|
|
70
|
+
* assigned nodes, anything detached or inside an inert fragment).
|
|
71
|
+
*
|
|
72
|
+
* A closed shadow root cannot be seen from outside: `shadowRoot` and
|
|
73
|
+
* `assignedSlot` are both null for its host's children, so those read as
|
|
74
|
+
* ordinary children of the host and are treated as rendered.
|
|
75
|
+
*/
|
|
76
|
+
// An HTML slot element; an element merely named slot in another namespace
|
|
77
|
+
// has no assigned nodes to ask for.
|
|
78
|
+
function isSlot(element) {
|
|
79
|
+
return element.localName === 'slot' && 'assignedNodes' in element;
|
|
80
|
+
}
|
|
81
|
+
function flatTreeParent(node) {
|
|
82
|
+
const parent = node.parentNode;
|
|
83
|
+
if (!parent) {
|
|
84
|
+
return NOT_RENDERED;
|
|
85
|
+
}
|
|
86
|
+
if (node.assignedSlot) {
|
|
87
|
+
return node.assignedSlot;
|
|
88
|
+
}
|
|
89
|
+
if (parent.nodeType === DOCUMENT_FRAGMENT_NODE) {
|
|
90
|
+
const host = parent.host;
|
|
91
|
+
return host ? host : NOT_RENDERED;
|
|
92
|
+
}
|
|
93
|
+
if (parent.nodeType === DOCUMENT_NODE) {
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
const parentElement = parent;
|
|
97
|
+
if (parentElement.shadowRoot) {
|
|
98
|
+
return NOT_RENDERED;
|
|
99
|
+
}
|
|
100
|
+
if (isSlot(parentElement) && parentElement.assignedNodes().length > 0) {
|
|
101
|
+
return NOT_RENDERED;
|
|
102
|
+
}
|
|
103
|
+
return parentElement;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* The nodes rendered as this element's children, in render order: the shadow
|
|
107
|
+
* root's children for a host, the assigned nodes (or the fallback while none
|
|
108
|
+
* are assigned) for a slot, otherwise the DOM children. Nested slots are
|
|
109
|
+
* flattened away, so a slot element never appears in the result.
|
|
110
|
+
*
|
|
111
|
+
* A closed shadow root cannot be seen, so its host's light children are
|
|
112
|
+
* returned as if they rendered; see flatTreeParent.
|
|
113
|
+
*/
|
|
114
|
+
export function flatTreeChildren(element) {
|
|
115
|
+
if (isSlot(element)) {
|
|
116
|
+
return element.assignedNodes({ flatten: true });
|
|
117
|
+
}
|
|
118
|
+
if (element.shadowRoot) {
|
|
119
|
+
return element.shadowRoot.childNodes;
|
|
120
|
+
}
|
|
121
|
+
return element.childNodes;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Children of a closed details element are not rendered, apart from its first
|
|
125
|
+
* summary. The browser does this through a UA shadow tree that is closed to
|
|
126
|
+
* script, so it has to be known here rather than read from the DOM.
|
|
127
|
+
*/
|
|
128
|
+
export function isCollapsedDetailsContent(child, parent) {
|
|
129
|
+
if (!isClosedDetails(parent)) {
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
for (let sibling = parent.firstElementChild; sibling; sibling = sibling.nextElementSibling) {
|
|
133
|
+
if (sibling.localName === 'summary') {
|
|
134
|
+
return sibling !== child;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return true;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* See HiddenState. Ancestors are not consulted; isHidden does that. Cached
|
|
141
|
+
* per element in the context: the walk, name-from-content and reference
|
|
142
|
+
* resolution all ask about the same elements.
|
|
143
|
+
*/
|
|
144
|
+
export function hiddenState(element, context) {
|
|
145
|
+
let state = context.hidden.get(element);
|
|
146
|
+
if (state === undefined) {
|
|
147
|
+
state = computeHiddenState(element, context);
|
|
148
|
+
context.hidden.set(element, state);
|
|
149
|
+
}
|
|
150
|
+
return state;
|
|
151
|
+
}
|
|
152
|
+
function computeHiddenState(element, context) {
|
|
153
|
+
// Inert content is still painted, but browsers leave it out of the
|
|
154
|
+
// accessibility tree along with everything it contains.
|
|
155
|
+
if (isAriaHidden(element) || element.hasAttribute('inert')) {
|
|
156
|
+
return 'subtree';
|
|
157
|
+
}
|
|
158
|
+
// With scripting enabled a noscript element renders nothing, but Chromium
|
|
159
|
+
// decides that in layout rather than in its UA stylesheet, so its computed
|
|
160
|
+
// display still reads inline. This atom only ever runs as script.
|
|
161
|
+
if (element.localName === 'noscript') {
|
|
162
|
+
return 'subtree';
|
|
163
|
+
}
|
|
164
|
+
if (element.localName === 'area') {
|
|
165
|
+
return areaState(element, context);
|
|
166
|
+
}
|
|
167
|
+
const style = styleOf(element, context);
|
|
168
|
+
// No view (an inert template fragment) and a detached element (empty
|
|
169
|
+
// computed values) are both unrendered.
|
|
170
|
+
if (!style || style.display === '' || style.display === 'none') {
|
|
171
|
+
return 'subtree';
|
|
172
|
+
}
|
|
173
|
+
const visibility = style.visibility;
|
|
174
|
+
const invisible = visibility === 'hidden' || visibility === 'collapse';
|
|
175
|
+
const contentsSkipped = style.getPropertyValue('content-visibility') === 'hidden';
|
|
176
|
+
if (invisible && contentsSkipped) {
|
|
177
|
+
return 'subtree';
|
|
178
|
+
}
|
|
179
|
+
if (contentsSkipped) {
|
|
180
|
+
return 'contents';
|
|
181
|
+
}
|
|
182
|
+
if (invisible) {
|
|
183
|
+
return 'self';
|
|
184
|
+
}
|
|
185
|
+
return 'rendered';
|
|
186
|
+
}
|
|
187
|
+
/** Whether an ancestor in the flat tree hides this element, whatever the element does itself. */
|
|
188
|
+
export function isHiddenByAncestor(element, context) {
|
|
189
|
+
let child = element;
|
|
190
|
+
for (;;) {
|
|
191
|
+
const parent = flatTreeParent(child);
|
|
192
|
+
if (parent === NOT_RENDERED) {
|
|
193
|
+
return true;
|
|
194
|
+
}
|
|
195
|
+
if (parent === null) {
|
|
196
|
+
return false;
|
|
197
|
+
}
|
|
198
|
+
const state = hiddenState(parent, context);
|
|
199
|
+
if (isCollapsedDetailsContent(child, parent) || state === 'subtree' || state === 'contents') {
|
|
200
|
+
return true;
|
|
201
|
+
}
|
|
202
|
+
child = parent;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
/** Whether the element is hidden in the accname sense. */
|
|
206
|
+
export function isHidden(element, context) {
|
|
207
|
+
const own = hiddenState(element, context);
|
|
208
|
+
if (own === 'self' || own === 'subtree') {
|
|
209
|
+
return true;
|
|
210
|
+
}
|
|
211
|
+
// Visibility is inherited, so the element's own computed value above already
|
|
212
|
+
// accounts for ancestors that set it; only subtree-wide hiding is checked
|
|
213
|
+
// on the way up.
|
|
214
|
+
return isHiddenByAncestor(element, context);
|
|
215
|
+
}
|
|
216
|
+
//# sourceMappingURL=hidden.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hidden.js","sourceRoot":"","sources":["../../../../typescript/core/accessibility/hidden.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAC/D,wDAAwD;AACxD,6DAA6D;AAC7D,oDAAoD;AACpD,6DAA6D;AAC7D,6DAA6D;AAC7D,EAAE;AACF,+CAA+C;AAC/C,EAAE;AACF,6DAA6D;AAC7D,8DAA8D;AAC9D,yDAAyD;AACzD,4DAA4D;AAC5D,0DAA0D;AAC1D,qBAAqB;AAErB,6EAA6E;AAC7E,6EAA6E;AAC7E,qEAAqE;AACrE,2EAA2E;AAC3E,2EAA2E;AAC3E,8EAA8E;AAC9E,EAAE;AACF,2EAA2E;AAC3E,yCAAyC;AAEzC,OAAO,EAAmB,OAAO,EAAE,MAAM,cAAc,CAAA;AAEvD,MAAM,aAAa,GAAG,CAAC,CAAA;AACvB,MAAM,sBAAsB,GAAG,EAAE,CAAA;AAajC,2DAA2D;AAC3D,MAAM,YAAY,GAAkB,MAAM,CAAC,cAAc,CAAC,CAAA;AAG1D,SAAS,YAAY,CAAC,OAAgB;IACpC,MAAM,KAAK,GAAG,OAAO,CAAC,YAAY,CAAC,aAAa,CAAC,CAAA;IACjD,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,MAAM,CAAA;AAChE,CAAC;AAED,2E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AAA;QACd,CAAC;QACD,MAAM,KAAK,GAAG,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;QAC1C,IAAI,yBAAyB,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,UAAU,EAAE,CAAC;YAC5F,OAAO,IAAI,CAAA;QACb,CAAC;QACD,KAAK,GAAG,MAAM,CAAA;IAChB,CAAC;AACH,CAAC;AAED,0DAA0D;AAC1D,MAAM,UAAU,QAAQ,CAAC,OAAgB,EAAE,OAAwB;IACjE,MAAM,GAAG,GAAG,WAAW,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IACzC,IAAI,GAAG,KAAK,MAAM,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;QACxC,OAAO,IAAI,CAAA;IACb,CAAC;IACD,6EAA6E;IAC7E,0EAA0E;IAC1E,iBAAiB;IACjB,OAAO,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;AAC7C,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare function isPresentational(role: string): boolean;
|
|
2
|
+
/**
|
|
3
|
+
* How the role of another element is found when one element's role depends
|
|
4
|
+
* on it (a cell on its table, an li on its list). The snapshot context
|
|
5
|
+
* passes its cached lookup so the owner is computed once for all of them.
|
|
6
|
+
*/
|
|
7
|
+
export type RoleLookup = (element: Element) => string;
|
|
8
|
+
/**
|
|
9
|
+
* The first token of the role attribute that names a role authors may use,
|
|
10
|
+
* or null when there is none. Tokens match ASCII case-insensitively, which is
|
|
11
|
+
* what engines do.
|
|
12
|
+
*/
|
|
13
|
+
export declare function explicitRole(element: Element): string | null;
|
|
14
|
+
export declare function canTakeFocus(element: Element): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* The html-aam implicit role of an element, with no regard to its role
|
|
17
|
+
* attribute. `lookup` finds the role of an element this one depends on.
|
|
18
|
+
*/
|
|
19
|
+
export declare function implicitRole(element: Element, lookup?: RoleLookup): string;
|
|
20
|
+
/**
|
|
21
|
+
* The role the snapshot reports for an element: the explicit role when it
|
|
22
|
+
* names a usable role and is not a presentational role on an element that
|
|
23
|
+
* cannot be presentational (WAI-ARIA 1.2 §9.1), otherwise the implicit one.
|
|
24
|
+
* `lookup` finds the role of an element this one depends on; without one,
|
|
25
|
+
* it is computed afresh.
|
|
26
|
+
*/
|
|
27
|
+
export declare function computeRole(element: Element, lookup?: RoleLookup): string;
|
|
28
|
+
//# sourceMappingURL=roles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"roles.d.ts","sourceRoot":"","sources":["../../../../typescript/core/accessibility/roles.ts"],"names":[],"mappings":"AAkEA,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,MAAM,CAAA;AAErD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAW5D;AAUD,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAiBtD;AA2HD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,GAAE,UAAwB,GAAG,MAAM,CAyIvF;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,GAAE,UAAwB,GAAG,MAAM,CAgBtF"}
|