@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
package/README.md
CHANGED
|
@@ -50,6 +50,62 @@ findElements({ css: '.result' })
|
|
|
50
50
|
findElements({ 'link text': 'Continue' }, shadowRoot)
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
+
### Accessibility snapshot
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
accessibilitySnapshot(root?: Element | Document, options?: SnapshotOptions): AccessibilityNode
|
|
57
|
+
|
|
58
|
+
interface SnapshotOptions {
|
|
59
|
+
interestingOnly?: boolean // default true: prune unnamed generic and presentational nodes
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
interface AccessibilityNode {
|
|
63
|
+
role: string // WAI-ARIA role; "text" for text leaves
|
|
64
|
+
name: string // accessible name, "" when none
|
|
65
|
+
description: string // accessible description, "" when none
|
|
66
|
+
value?: string // textbox, searchbox, combobox and range roles
|
|
67
|
+
url?: string // the resolved href, on links that have one
|
|
68
|
+
states: Record<string, boolean | number | 'mixed'>
|
|
69
|
+
element?: Element // absent on text leaves
|
|
70
|
+
children: AccessibilityNode[]
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
```js
|
|
75
|
+
import accessibilitySnapshot from '@selenium/atoms/accessibility-snapshot'
|
|
76
|
+
|
|
77
|
+
const tree = accessibilitySnapshot() // the whole document
|
|
78
|
+
const dialog = accessibilitySnapshot(dialogElement) // one subtree
|
|
79
|
+
const full = accessibilitySnapshot(undefined, { interestingOnly: false }) // nothing pruned
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
The snapshot is *computed* by script from the DOM, following WAI-ARIA 1.2,
|
|
83
|
+
html-aam and accname 1.2. It is not the browser's own accessibility tree, and
|
|
84
|
+
it can differ from it at the edges. Elements that are hidden in the accname
|
|
85
|
+
sense are left out; generic wrappers are pruned and their children hoisted
|
|
86
|
+
unless `interestingOnly` is `false`, which keeps every rendered element as a
|
|
87
|
+
node with the role it has (Puppeteer's `accessibility.snapshot({ interestingOnly:
|
|
88
|
+
false })`); text an ancestor's name was computed from is not repeated as leaves.
|
|
89
|
+
A `link` node whose element has an `href` carries it, resolved, as `url`. Frames are
|
|
90
|
+
reported as `iframe` leaves with no children, whatever role attribute they
|
|
91
|
+
carry, since a child document is another browsing context the page cannot
|
|
92
|
+
reach; callers that can reach it stitch its snapshot in. Keys in `states` are
|
|
93
|
+
`checked`, `pressed`, `expanded`, `selected`, `level`, `disabled` and
|
|
94
|
+
`focused`; new keys may be added in any release, so ignore keys you do not
|
|
95
|
+
recognise. A password field's `value` is masked, one bullet per character, as
|
|
96
|
+
the browser's own tree exposes it.
|
|
97
|
+
|
|
98
|
+
`accessibilitySnapshotWire(root?: Element, options?: SnapshotOptions)` returns the same snapshot in the
|
|
99
|
+
shape the Selenium bindings fetch over WebDriver BiDi: `{ json, elements,
|
|
100
|
+
windows }`, the tree as JSON text with each `element` replaced by an index into
|
|
101
|
+
`elements` and each frame node given a `frame` index into `windows` (the
|
|
102
|
+
frame's content window), so a binding parses one string and maps two arrays
|
|
103
|
+
instead of decoding a nested remote value. It answers `null` for a root this
|
|
104
|
+
document does not own (one owned by another document, or a `null` root, which
|
|
105
|
+
is how Firefox hands over a shared id of another document's node) and
|
|
106
|
+
`{ error: 'detached' }` for a root no longer in its document. Page scripts have
|
|
107
|
+
no reason to use it over `accessibilitySnapshot`.
|
|
108
|
+
|
|
53
109
|
The atoms operate on the DOM of the document they are evaluated in, so they must
|
|
54
110
|
run in the page rather than in the driver process — for example via
|
|
55
111
|
`Runtime.evaluate` over CDP, `script.callFunction` over WebDriver BiDi, or
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,48 @@
|
|
|
1
1
|
export { default as getAttribute } from './typescript/get-attribute.js';
|
|
2
2
|
export { default as findElements } from './typescript/find-elements.js';
|
|
3
|
+
export { default as findElement } from './typescript/find-element.js';
|
|
4
|
+
export { default as activeElement } from './typescript/active-element.js';
|
|
5
|
+
export { default as defaultContent } from './typescript/default-content.js';
|
|
6
|
+
export { default as frameByIdOrName } from './typescript/frame-by-id-or-name.js';
|
|
7
|
+
export { default as frameByIndex } from './typescript/frame-by-index.js';
|
|
8
|
+
export { default as getFrameWindow } from './typescript/get-frame-window.js';
|
|
3
9
|
export { default as isDisplayed } from './typescript/is-displayed.js';
|
|
10
|
+
export { default as isEnabled } from './typescript/is-enabled.js';
|
|
11
|
+
export { default as isSelected } from './typescript/is-selected.js';
|
|
12
|
+
export { default as isEditable } from './typescript/is-editable.js';
|
|
13
|
+
export { default as isFocusable } from './typescript/is-focusable.js';
|
|
14
|
+
export { default as isInteractable } from './typescript/is-interactable.js';
|
|
15
|
+
export { default as getAttributeValue } from './typescript/get-attribute-value.js';
|
|
16
|
+
export { default as getSize } from './typescript/get-size.js';
|
|
17
|
+
export { default as getLocation } from './typescript/get-location.js';
|
|
18
|
+
export { default as getEffectiveStyle } from './typescript/get-effective-style.js';
|
|
19
|
+
export { default as getValueOfCssProperty } from './typescript/get-effective-style.js';
|
|
20
|
+
export { default as getTopLeftCoordinates } from './typescript/get-top-left-coordinates.js';
|
|
21
|
+
export { default as getText } from './typescript/get-text.js';
|
|
22
|
+
export { default as getLocalStorageItem } from './typescript/get-local-storage-item.js';
|
|
23
|
+
export { default as getLocalStorageKey } from './typescript/get-local-storage-key.js';
|
|
24
|
+
export { default as getLocalStorageKeys } from './typescript/get-local-storage-keys.js';
|
|
25
|
+
export { default as getLocalStorageSize } from './typescript/get-local-storage-size.js';
|
|
26
|
+
export { default as setLocalStorageItem } from './typescript/set-local-storage-item.js';
|
|
27
|
+
export { default as removeLocalStorageItem } from './typescript/remove-local-storage-item.js';
|
|
28
|
+
export { default as clearLocalStorage } from './typescript/clear-local-storage.js';
|
|
29
|
+
export { default as getSessionStorageItem } from './typescript/get-session-storage-item.js';
|
|
30
|
+
export { default as getSessionStorageKey } from './typescript/get-session-storage-key.js';
|
|
31
|
+
export { default as getSessionStorageKeys } from './typescript/get-session-storage-keys.js';
|
|
32
|
+
export { default as getSessionStorageSize } from './typescript/get-session-storage-size.js';
|
|
33
|
+
export { default as setSessionStorageItem } from './typescript/set-session-storage-item.js';
|
|
34
|
+
export { default as removeSessionStorageItem } from './typescript/remove-session-storage-item.js';
|
|
35
|
+
export { default as clearSessionStorage } from './typescript/clear-session-storage.js';
|
|
36
|
+
export { default as executeScript } from './typescript/execute-script.js';
|
|
37
|
+
export { default as executeAsyncScript } from './typescript/execute-async-script.js';
|
|
38
|
+
export { default as getElementFromCache } from './typescript/get-element-from-cache.js';
|
|
39
|
+
export { default as findElementFragment } from './typescript/find-element-fragment.js';
|
|
40
|
+
export { default as click } from './typescript/click.js';
|
|
41
|
+
export { default as type } from './typescript/type.js';
|
|
42
|
+
export { default as clear } from './typescript/clear.js';
|
|
43
|
+
export { default as submit } from './typescript/submit.js';
|
|
44
|
+
export { default as accessibilitySnapshot } from './typescript/accessibility-snapshot.js';
|
|
45
|
+
export type { AccessibilityNode, StateValue } from './typescript/accessibility-snapshot.js';
|
|
46
|
+
export { default as accessibilitySnapshotWire } from './typescript/accessibility-snapshot-wire.js';
|
|
47
|
+
export type { WireError, WireNode, WireSnapshot } from './typescript/accessibility-snapshot-wire.js';
|
|
4
48
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,8BAA8B,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,8BAA8B,CAAA;AACrE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,gCAAgC,CAAA;AACzE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAC3E,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,qCAAqC,CAAA;AAChF,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE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AA;AAC3F,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,6CAA6C,CAAA;AAClG,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,6CAA6C,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -19,5 +19,47 @@
|
|
|
19
19
|
// written here is what consumers resolve against.
|
|
20
20
|
export { default as getAttribute } from './typescript/get-attribute.js';
|
|
21
21
|
export { default as findElements } from './typescript/find-elements.js';
|
|
22
|
+
export { default as findElement } from './typescript/find-element.js';
|
|
23
|
+
export { default as activeElement } from './typescript/active-element.js';
|
|
24
|
+
export { default as defaultContent } from './typescript/default-content.js';
|
|
25
|
+
export { default as frameByIdOrName } from './typescript/frame-by-id-or-name.js';
|
|
26
|
+
export { default as frameByIndex } from './typescript/frame-by-index.js';
|
|
27
|
+
export { default as getFrameWindow } from './typescript/get-frame-window.js';
|
|
22
28
|
export { default as isDisplayed } from './typescript/is-displayed.js';
|
|
29
|
+
export { default as isEnabled } from './typescript/is-enabled.js';
|
|
30
|
+
export { default as isSelected } from './typescript/is-selected.js';
|
|
31
|
+
export { default as isEditable } from './typescript/is-editable.js';
|
|
32
|
+
export { default as isFocusable } from './typescript/is-focusable.js';
|
|
33
|
+
export { default as isInteractable } from './typescript/is-interactable.js';
|
|
34
|
+
export { default as getAttributeValue } from './typescript/get-attribute-value.js';
|
|
35
|
+
export { default as getSize } from './typescript/get-size.js';
|
|
36
|
+
export { default as getLocation } from './typescript/get-location.js';
|
|
37
|
+
export { default as getEffectiveStyle } from './typescript/get-effective-style.js';
|
|
38
|
+
export { default as getValueOfCssProperty } from './typescript/get-effective-style.js';
|
|
39
|
+
export { default as getTopLeftCoordinates } from './typescript/get-top-left-coordinates.js';
|
|
40
|
+
export { default as getText } from './typescript/get-text.js';
|
|
41
|
+
export { default as getLocalStorageItem } from './typescript/get-local-storage-item.js';
|
|
42
|
+
export { default as getLocalStorageKey } from './typescript/get-local-storage-key.js';
|
|
43
|
+
export { default as getLocalStorageKeys } from './typescript/get-local-storage-keys.js';
|
|
44
|
+
export { default as getLocalStorageSize } from './typescript/get-local-storage-size.js';
|
|
45
|
+
export { default as setLocalStorageItem } from './typescript/set-local-storage-item.js';
|
|
46
|
+
export { default as removeLocalStorageItem } from './typescript/remove-local-storage-item.js';
|
|
47
|
+
export { default as clearLocalStorage } from './typescript/clear-local-storage.js';
|
|
48
|
+
export { default as getSessionStorageItem } from './typescript/get-session-storage-item.js';
|
|
49
|
+
export { default as getSessionStorageKey } from './typescript/get-session-storage-key.js';
|
|
50
|
+
export { default as getSessionStorageKeys } from './typescript/get-session-storage-keys.js';
|
|
51
|
+
export { default as getSessionStorageSize } from './typescript/get-session-storage-size.js';
|
|
52
|
+
export { default as setSessionStorageItem } from './typescript/set-session-storage-item.js';
|
|
53
|
+
export { default as removeSessionStorageItem } from './typescript/remove-session-storage-item.js';
|
|
54
|
+
export { default as clearSessionStorage } from './typescript/clear-session-storage.js';
|
|
55
|
+
export { default as executeScript } from './typescript/execute-script.js';
|
|
56
|
+
export { default as executeAsyncScript } from './typescript/execute-async-script.js';
|
|
57
|
+
export { default as getElementFromCache } from './typescript/get-element-from-cache.js';
|
|
58
|
+
export { default as findElementFragment } from './typescript/find-element-fragment.js';
|
|
59
|
+
export { default as click } from './typescript/click.js';
|
|
60
|
+
export { default as type } from './typescript/type.js';
|
|
61
|
+
export { default as clear } from './typescript/clear.js';
|
|
62
|
+
export { default as submit } from './typescript/submit.js';
|
|
63
|
+
export { default as accessibilitySnapshot } from './typescript/accessibility-snapshot.js';
|
|
64
|
+
export { default as accessibilitySnapshotWire } from './typescript/accessibility-snapshot-wire.js';
|
|
23
65
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,+DAA+D;AAC/D,wDAAwD;AACxD,6DAA6D;AAC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} from './core/accessibility/types.js';
|
|
2
|
+
export type { WireError, WireNode, WireSnapshot } from './core/accessibility/wire.js';
|
|
3
|
+
export { default } from './core/accessibility/wire.js';
|
|
4
|
+
//# sourceMappingURL=accessibility-snapshot-wire.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accessibility-snapshot-wire.d.ts","sourceRoot":"","sources":["../../typescript/accessibility-snapshot-wire.ts"],"names":[],"mappings":"AAiBA,YAAY,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AACpE,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AACrF,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
export { default } from './core/accessibility/wire.js';
|
|
18
|
+
//# sourceMappingURL=accessibility-snapshot-wire.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accessibility-snapshot-wire.js","sourceRoot":"","sources":["../../typescript/accessibility-snapshot-wire.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;AAIrB,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accessibility-snapshot.d.ts","sourceRoot":"","sources":["../../typescript/accessibility-snapshot.ts"],"names":[],"mappings":"AAmBA,YAAY,EAAE,iBAAiB,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AACnG,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
export { default } from './core/accessibility/snapshot.js';
|
|
18
|
+
//# sourceMappingURL=accessibility-snapshot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accessibility-snapshot.js","sourceRoot":"","sources":["../../typescript/accessibility-snapshot.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;AAKrB,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"active-element.d.ts","sourceRoot":"","sources":["../../typescript/active-element.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,aAAa,IAAI,OAAO,EAAE,MAAM,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
// The focused element, or the body when nothing is focused.
|
|
18
|
+
export { activeElement as default } from './core/frame.js';
|
|
19
|
+
//# sourceMappingURL=active-element.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"active-element.js","sourceRoot":"","sources":["../../typescript/active-element.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,4DAA4D;AAC5D,OAAO,EAAE,aAAa,IAAI,OAAO,EAAE,MAAM,iBAAiB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clear-local-storage.d.ts","sourceRoot":"","sources":["../../typescript/clear-local-storage.ts"],"names":[],"mappings":"AAsBA,iBAAS,iBAAiB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAEnD;AAED,eAAe,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
import { getLocalStorage } from './core/storage.js';
|
|
18
|
+
// Empties the store.
|
|
19
|
+
//
|
|
20
|
+
// optWindow targets a frame other than the one the atom is running in.
|
|
21
|
+
function clearLocalStorage(optWindow) {
|
|
22
|
+
getLocalStorage(optWindow).clear();
|
|
23
|
+
}
|
|
24
|
+
export default clearLocalStorage;
|
|
25
|
+
//# sourceMappingURL=clear-local-storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clear-local-storage.js","sourceRoot":"","sources":["../../typescript/clear-local-storage.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,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAEnD,qBAAqB;AACrB,EAAE;AACF,uEAAuE;AACvE,SAAS,iBAAiB,CAAC,SAAkB;IAC3C,eAAe,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,CAAA;AACpC,CAAC;AAED,eAAe,iBAAiB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clear-session-storage.d.ts","sourceRoot":"","sources":["../../typescript/clear-session-storage.ts"],"names":[],"mappings":"AAsBA,iBAAS,mBAAmB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAErD;AAED,eAAe,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
import { getSessionStorage } from './core/storage.js';
|
|
18
|
+
// Empties the store.
|
|
19
|
+
//
|
|
20
|
+
// optWindow targets a frame other than the one the atom is running in.
|
|
21
|
+
function clearSessionStorage(optWindow) {
|
|
22
|
+
getSessionStorage(optWindow).clear();
|
|
23
|
+
}
|
|
24
|
+
export default clearSessionStorage;
|
|
25
|
+
//# sourceMappingURL=clear-session-storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clear-session-storage.js","sourceRoot":"","sources":["../../typescript/clear-session-storage.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,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAErD,qBAAqB;AACrB,EAAE;AACF,uEAAuE;AACvE,SAAS,mBAAmB,CAAC,SAAkB;IAC7C,iBAAiB,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,CAAA;AACtC,CAAC;AAED,eAAe,mBAAmB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clear.d.ts","sourceRoot":"","sources":["../../typescript/clear.ts"],"names":[],"mappings":"AAsCA,iBAAS,KAAK,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA2BrC;AAOD,eAAe,KAAK,CAAA"}
|
|
@@ -0,0 +1,67 @@
|
|
|
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
|
+
import { isContentEditable, isEditable } from './core/editable.js';
|
|
18
|
+
import { ELEMENT_NOT_INTERACTABLE, INVALID_ELEMENT_STATE, botError } from './core/error.js';
|
|
19
|
+
import { EventType, fire } from './core/events.js';
|
|
20
|
+
import { focusOnElement } from './core/focus.js';
|
|
21
|
+
import { isInteractable } from './core/interactable.js';
|
|
22
|
+
// Empties an editable element the way W3C Element Clear does: focus it, empty
|
|
23
|
+
// it, then take focus away so the page sees the edit committed.
|
|
24
|
+
//
|
|
25
|
+
// Differences from bot.action.clear, toward what clearing by hand produces:
|
|
26
|
+
// - input fires before change; bot.action.clear fired change alone. Its
|
|
27
|
+
// inputType is what select-all then Backspace reports: neither engine keeps
|
|
28
|
+
// the spec's generic "deleteContent" on a constructed InputEvent.
|
|
29
|
+
// - A number field holding unparseable text (value reads as "") is detected
|
|
30
|
+
// by validity.badInput rather than the type attribute, and gets the same
|
|
31
|
+
// events and blur as any other field.
|
|
32
|
+
// - contenteditable is emptied outright and fires input. The single space
|
|
33
|
+
// bot.action.clear left behind in Firefox kept the caret alive in Firefox 3.
|
|
34
|
+
// - The IE range-input and blur branches are gone.
|
|
35
|
+
function clear(element) {
|
|
36
|
+
var _a;
|
|
37
|
+
if (!isInteractable(element)) {
|
|
38
|
+
throw botError(ELEMENT_NOT_INTERACTABLE, 'Element is not currently interactable and may not be manipulated');
|
|
39
|
+
}
|
|
40
|
+
if (!isEditable(element)) {
|
|
41
|
+
throw botError(INVALID_ELEMENT_STATE, 'Element must be user-editable in order to clear it.');
|
|
42
|
+
}
|
|
43
|
+
if (isContentEditable(element)) {
|
|
44
|
+
if (element.textContent || element.children.length) {
|
|
45
|
+
focusOnElement(element);
|
|
46
|
+
element.textContent = '';
|
|
47
|
+
fire(element, EventType.INPUT, { inputType: 'deleteContentBackward', data: null });
|
|
48
|
+
unfocus(element);
|
|
49
|
+
}
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const field = element;
|
|
53
|
+
const badInput = !!((_a = field.validity) === null || _a === void 0 ? void 0 : _a.badInput);
|
|
54
|
+
if (field.value || badInput) {
|
|
55
|
+
focusOnElement(field);
|
|
56
|
+
field.value = '';
|
|
57
|
+
fire(field, EventType.INPUT, { inputType: 'deleteContentBackward', data: null });
|
|
58
|
+
fire(field, EventType.CHANGE, undefined);
|
|
59
|
+
unfocus(field);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
// Focusing the body cannot take focus, so this blurs whatever has it.
|
|
63
|
+
function unfocus(element) {
|
|
64
|
+
focusOnElement(element.ownerDocument.body);
|
|
65
|
+
}
|
|
66
|
+
export default clear;
|
|
67
|
+
//# sourceMappingURL=clear.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clear.js","sourceRoot":"","sources":["../../typescript/clear.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;AA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A;QAClB,CAAC;QACD,OAAM;IACR,CAAC;IAED,MAAM,KAAK,GAAG,OAAoB,CAAA;IAClC,MAAM,QAAQ,GAAG,CAAC,CAAC,CAAA,MAAC,KAA0B,CAAC,QAAQ,0CAAE,QAAQ,CAAA,CAAA;IACjE,IAAI,KAAK,CAAC,KAAK,IAAI,QAAQ,EAAE,CAAC;QAC5B,cAAc,CAAC,KAAK,CAAC,CAAA;QACrB,KAAK,CAAC,KAAK,GAAG,EAAE,CAAA;QAChB,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,uBAAuB,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAA;QAChF,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;QACxC,OAAO,CAAC,KAAK,CAAC,CAAA;IAChB,CAAC;AACH,CAAC;AAED,sEAAsE;AACtE,SAAS,OAAO,CAAC,OAAgB;IAC/B,cAAc,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,CAAA;AAC5C,CAAC;AAED,eAAe,KAAK,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"click.d.ts","sourceRoot":"","sources":["../../typescript/click.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,KAAK,UAAU,EAAiB,MAAM,oBAAoB,CAAA;AAWnE,iBAAS,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,UAAU,GAAG,IAAI,GAAG,IAAI,CASpE;AAgBD,eAAe,KAAK,CAAA"}
|
|
@@ -0,0 +1,52 @@
|
|
|
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
|
+
import { ELEMENT_NOT_INTERACTABLE, botError } from './core/error.js';
|
|
18
|
+
import { getClientRect } from './core/geometry.js';
|
|
19
|
+
import { Mouse } from './core/mouse.js';
|
|
20
|
+
import { scrollIntoView } from './core/scroll.js';
|
|
21
|
+
import isShown from './core/shown.js';
|
|
22
|
+
// Clicks the element with the primary button: scrolls it into view, moves a
|
|
23
|
+
// fresh mouse to `optCoords` (relative to the element's top-left) or its
|
|
24
|
+
// centre, presses and releases. See core/mouse.ts for the events produced.
|
|
25
|
+
//
|
|
26
|
+
// bot.action.click also took a mouse to reuse and a flag forcing mouseup onto
|
|
27
|
+
// a non-interactable element. Neither crosses the wire, so they are not kept.
|
|
28
|
+
function click(element, optCoords) {
|
|
29
|
+
if (!isShown(element, /* optIgnoreOpacity= */ true)) {
|
|
30
|
+
throw botError(ELEMENT_NOT_INTERACTABLE, 'Element is not currently visible and may not be manipulated');
|
|
31
|
+
}
|
|
32
|
+
scrollIntoView(element, optCoords || undefined);
|
|
33
|
+
const mouse = new Mouse();
|
|
34
|
+
mouse.move(element, optCoords || interactableCentre(element));
|
|
35
|
+
mouse.pressButton();
|
|
36
|
+
mouse.releaseButton();
|
|
37
|
+
}
|
|
38
|
+
// An element with no area of its own (an empty inline wrapper, say) is aimed
|
|
39
|
+
// at through its offsetParent's size, as bot.action.getInteractableSize did.
|
|
40
|
+
function interactableCentre(element) {
|
|
41
|
+
let node = element;
|
|
42
|
+
for (;;) {
|
|
43
|
+
const rect = getClientRect(node);
|
|
44
|
+
const parent = node.offsetParent;
|
|
45
|
+
if ((rect.width > 0 && rect.height > 0) || !parent) {
|
|
46
|
+
return { x: rect.width / 2, y: rect.height / 2 };
|
|
47
|
+
}
|
|
48
|
+
node = parent;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
export default click;
|
|
52
|
+
//# sourceMappingURL=click.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"click.js","sourceRoot":"","sources":["../../typescript/click.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,OAAO,EAAE,wBAAwB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AACpE,OAAO,EAAmB,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACnE,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,OAAO,MAAM,iBAAiB,CAAA;AAErC,4EAA4E;AAC5E,yEAAyE;AACzE,2EAA2E;AAC3E,EAAE;AACF,8EAA8E;AAC9E,8EAA8E;AAC9E,SAAS,KAAK,CAAC,OAAgB,EAAE,SAA6B;IAC5D,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,uBAAuB,CAAC,IAAI,CAAC,EAAE,CAAC;QACpD,MAAM,QAAQ,CAAC,wBAAwB,EAAE,6DAA6D,CAAC,CAAA;IACzG,CAAC;IACD,cAAc,CAAC,OAAO,EAAE,SAAS,IAAI,SAAS,CAAC,CAAA;IAC/C,MAAM,KAAK,GAAG,IAAI,KAAK,EAAE,CAAA;IACzB,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,IAAI,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAA;IAC7D,KAAK,CAAC,WAAW,EAAE,CAAA;IACnB,KAAK,CAAC,aAAa,EAAE,CAAA;AACvB,CAAC;AAED,6EAA6E;AAC7E,6EAA6E;AAC7E,SAAS,kBAAkB,CAAC,OAAgB;IAC1C,IAAI,IAAI,GAAY,OAAO,CAAA;IAC3B,SAAS,CAAC;QACR,MAAM,IAAI,GAAG,aAAa,CAAC,IAAI,CAAC,CAAA;QAChC,MAAM,MAAM,GAAI,IAAoB,CAAC,YAAY,CAAA;QACjD,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YACnD,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAA;QAClD,CAAC;QACD,IAAI,GAAG,MAAM,CAAA;IACf,CAAC;AACH,CAAC;AAED,eAAe,KAAK,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { NameResult, SnapshotContext } from './context.js';
|
|
2
|
+
/** The accessible name of an element and where it came from. */
|
|
3
|
+
export declare function computeName(element: Element, context: SnapshotContext): NameResult;
|
|
4
|
+
/** The accessible description: aria-describedby, aria-description, then title when the name did not use it. */
|
|
5
|
+
export declare function computeDescription(element: Element, context: SnapshotContext): string;
|
|
6
|
+
//# sourceMappingURL=accname.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accname.d.ts","sourceRoot":"","sources":["../../../../typescript/core/accessibility/accname.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,UAAU,EAAU,eAAe,EAAW,MAAM,cAAc,CAAA;AA8hB3E,gEAAgE;AAChE,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,GAAG,UAAU,CAOlF;AAED,+GAA+G;AAC/G,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,eAAe,GAAG,MAAM,CAgBrF"}
|