@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
|
@@ -15,501 +15,6 @@
|
|
|
15
15
|
// specific language governing permissions and limitations
|
|
16
16
|
// under the License.
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
left: number;
|
|
22
|
-
top: number;
|
|
23
|
-
right: number;
|
|
24
|
-
bottom: number;
|
|
25
|
-
width: number;
|
|
26
|
-
height: number;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
interface ImageMapResult {
|
|
30
|
-
image: Element | null;
|
|
31
|
-
rect: Rect;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
interface OverflowStyles {
|
|
35
|
-
x: string;
|
|
36
|
-
y: string;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
interface Coordinate {
|
|
40
|
-
x: number;
|
|
41
|
-
y: number;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function isShownElement(elem: Element, optIgnoreOpacity?: boolean): boolean {
|
|
45
|
-
// Guards against form children that shadow tagName (e.g. <form><input name="tagName">).
|
|
46
|
-
var tagNameDescriptor = Object.getOwnPropertyDescriptor(Element.prototype, 'tagName');
|
|
47
|
-
|
|
48
|
-
// Per-call memoisation caches. Scoped here so they live only for the
|
|
49
|
-
// duration of this synchronous call — no stale-data risk, no GC pressure
|
|
50
|
-
// between invocations.
|
|
51
|
-
var computedStyleCache = new Map<Element, CSSStyleDeclaration | null>();
|
|
52
|
-
var clientRectCache = new Map<Element, Rect>();
|
|
53
|
-
var displayedCache = new Map<Node, boolean>();
|
|
54
|
-
|
|
55
|
-
function toUpperCaseTag(tagName?: string): string | undefined {
|
|
56
|
-
return tagName ? tagName.toUpperCase() : undefined;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function isElement(node: unknown, tagName?: string): node is Element {
|
|
60
|
-
// Use nodeType instead of instanceof to handle cross-realm Elements
|
|
61
|
-
// (e.g., from iframes), where instanceof checks against a different Element.
|
|
62
|
-
if (!node || (node as Node).nodeType !== 1 /* ELEMENT_NODE */) {
|
|
63
|
-
return false;
|
|
64
|
-
}
|
|
65
|
-
var asElement = node as Element;
|
|
66
|
-
var rawTagName = tagNameDescriptor && typeof tagNameDescriptor.get === 'function'
|
|
67
|
-
? tagNameDescriptor.get.call(asElement)
|
|
68
|
-
: asElement.tagName;
|
|
69
|
-
var upperTagName = typeof rawTagName === 'string' ? rawTagName.toUpperCase() : '';
|
|
70
|
-
var normalizedTagName = toUpperCaseTag(tagName);
|
|
71
|
-
if (upperTagName === 'FORM') {
|
|
72
|
-
return !normalizedTagName || normalizedTagName === 'FORM';
|
|
73
|
-
}
|
|
74
|
-
return !!upperTagName && (!normalizedTagName || upperTagName === normalizedTagName);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function getParentElement(node: Node): Element | null {
|
|
78
|
-
var current = node.parentNode;
|
|
79
|
-
while (
|
|
80
|
-
current &&
|
|
81
|
-
current.nodeType !== Node.ELEMENT_NODE &&
|
|
82
|
-
current.nodeType !== Node.DOCUMENT_NODE &&
|
|
83
|
-
current.nodeType !== Node.DOCUMENT_FRAGMENT_NODE
|
|
84
|
-
) {
|
|
85
|
-
current = current.parentNode;
|
|
86
|
-
}
|
|
87
|
-
return current && current.nodeType === 1 /* ELEMENT_NODE */ ? (current as Element) : null;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
function getEffectiveStyle(elem: Element, propertyName: string): string | null {
|
|
91
|
-
var computed = computedStyleCache.get(elem);
|
|
92
|
-
if (computed === undefined) {
|
|
93
|
-
var win = elem.ownerDocument.defaultView;
|
|
94
|
-
computed = win ? (win.getComputedStyle(elem) || null) : null;
|
|
95
|
-
computedStyleCache.set(elem, computed);
|
|
96
|
-
}
|
|
97
|
-
if (!computed) {
|
|
98
|
-
return null;
|
|
99
|
-
}
|
|
100
|
-
var value = computed.getPropertyValue(propertyName);
|
|
101
|
-
return value || null;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
function getOpacity(elem: Element): number {
|
|
105
|
-
var opacityStyle = getEffectiveStyle(elem, 'opacity');
|
|
106
|
-
var opacity = opacityStyle ? Number(opacityStyle) : 1;
|
|
107
|
-
var parent = getParentElement(elem);
|
|
108
|
-
return parent ? opacity * getOpacity(parent) : opacity;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
function getParentNodeInComposedDom(node: Node): Node | null {
|
|
112
|
-
var parent = node.parentNode;
|
|
113
|
-
var slottable = node as Node & { assignedSlot?: HTMLSlotElement | null };
|
|
114
|
-
var parentWithShadow = parent as (Node & { shadowRoot?: ShadowRoot | null }) | null;
|
|
115
|
-
|
|
116
|
-
if (parentWithShadow && parentWithShadow.shadowRoot && slottable.assignedSlot !== undefined) {
|
|
117
|
-
return slottable.assignedSlot ? slottable.assignedSlot.parentNode : null;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
return parent;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
function createRect(left: number, top: number, width: number, height: number): Rect {
|
|
124
|
-
return {
|
|
125
|
-
left: left,
|
|
126
|
-
top: top,
|
|
127
|
-
right: left + width,
|
|
128
|
-
bottom: top + height,
|
|
129
|
-
width: width,
|
|
130
|
-
height: height,
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
function getClientRect(elem: Element): Rect {
|
|
135
|
-
var cachedRect = clientRectCache.get(elem);
|
|
136
|
-
if (cachedRect) {
|
|
137
|
-
return cachedRect;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
var rect: Rect;
|
|
141
|
-
var imageMap = maybeFindImageMap(elem);
|
|
142
|
-
if (imageMap) {
|
|
143
|
-
rect = imageMap.rect;
|
|
144
|
-
} else {
|
|
145
|
-
var elemTagName = typeof (elem as Element).tagName === 'string' ? (elem as Element).tagName : '';
|
|
146
|
-
if (elemTagName.toUpperCase() === 'HTML') {
|
|
147
|
-
var doc = (elem as Element).ownerDocument;
|
|
148
|
-
// In quirks mode (no DOCTYPE), viewport dimensions come from document.body;
|
|
149
|
-
// documentElement.clientWidth/Height is unreliable and can be 0.
|
|
150
|
-
var sizeElem = doc.compatMode === 'CSS1Compat' ? doc.documentElement : (doc.body || doc.documentElement);
|
|
151
|
-
rect = createRect(0, 0, sizeElem.clientWidth, sizeElem.clientHeight);
|
|
152
|
-
} else {
|
|
153
|
-
try {
|
|
154
|
-
var nativeRect = (elem as Element).getBoundingClientRect();
|
|
155
|
-
rect = {
|
|
156
|
-
left: nativeRect.left,
|
|
157
|
-
top: nativeRect.top,
|
|
158
|
-
right: nativeRect.right,
|
|
159
|
-
bottom: nativeRect.bottom,
|
|
160
|
-
width: nativeRect.right - nativeRect.left,
|
|
161
|
-
height: nativeRect.bottom - nativeRect.top,
|
|
162
|
-
};
|
|
163
|
-
} catch (_error) {
|
|
164
|
-
rect = createRect(0, 0, 0, 0);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
clientRectCache.set(elem, rect);
|
|
170
|
-
return rect;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
function getAreaRelativeRect(area: HTMLAreaElement): Rect {
|
|
174
|
-
var shape = area.shape.toLowerCase();
|
|
175
|
-
var coords = area.coords.split(',').map(function (value) {
|
|
176
|
-
return Number(value.trim());
|
|
177
|
-
});
|
|
178
|
-
|
|
179
|
-
if (shape === 'rect' && coords.length === 4) {
|
|
180
|
-
return createRect(coords[0], coords[1], coords[2] - coords[0], coords[3] - coords[1]);
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
if (shape === 'circle' && coords.length === 3) {
|
|
184
|
-
return createRect(coords[0] - coords[2], coords[1] - coords[2], coords[2] * 2, coords[2] * 2);
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
if (shape === 'poly' && coords.length > 2) {
|
|
188
|
-
var minX = coords[0];
|
|
189
|
-
var minY = coords[1];
|
|
190
|
-
var maxX = minX;
|
|
191
|
-
var maxY = minY;
|
|
192
|
-
|
|
193
|
-
for (var index = 2; index + 1 < coords.length; index += 2) {
|
|
194
|
-
minX = Math.min(minX, coords[index]);
|
|
195
|
-
maxX = Math.max(maxX, coords[index]);
|
|
196
|
-
minY = Math.min(minY, coords[index + 1]);
|
|
197
|
-
maxY = Math.max(maxY, coords[index + 1]);
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
return createRect(minX, minY, maxX - minX, maxY - minY);
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
return createRect(0, 0, 0, 0);
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
function findImageUsingMap(mapName: string, doc: Document): Element | null {
|
|
207
|
-
// Use querySelector instead of a full-DOM scan; escape the map name so
|
|
208
|
-
// special characters in the CSS attribute value string are handled safely.
|
|
209
|
-
return doc.querySelector('[usemap="#' + mapName.replace(/\\/g, '\\\\').replace(/"/g, '\\"') + '"]');
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
function maybeFindImageMap(elem: Element): ImageMapResult | null {
|
|
213
|
-
var isMap = isElement(elem, 'MAP');
|
|
214
|
-
if (!isMap && !isElement(elem, 'AREA')) {
|
|
215
|
-
return null;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
var map = isMap ? elem : isElement(elem.parentNode, 'MAP') ? elem.parentNode : null;
|
|
219
|
-
var image: Element | null = null;
|
|
220
|
-
var rect = createRect(0, 0, 0, 0);
|
|
221
|
-
|
|
222
|
-
if (isElement(map, 'MAP') && (map as HTMLMapElement).name) {
|
|
223
|
-
image = findImageUsingMap((map as HTMLMapElement).name, (map as HTMLMapElement).ownerDocument);
|
|
224
|
-
if (image) {
|
|
225
|
-
rect = getClientRect(image);
|
|
226
|
-
if (!isMap && isElement(elem, 'AREA') && (elem as HTMLAreaElement).shape.toLowerCase() !== 'default') {
|
|
227
|
-
var relativeRect = getAreaRelativeRect(elem as HTMLAreaElement);
|
|
228
|
-
var relativeX = Math.min(Math.max(relativeRect.left, 0), rect.width);
|
|
229
|
-
var relativeY = Math.min(Math.max(relativeRect.top, 0), rect.height);
|
|
230
|
-
var width = Math.min(relativeRect.width, rect.width - relativeX);
|
|
231
|
-
var height = Math.min(relativeRect.height, rect.height - relativeY);
|
|
232
|
-
rect = createRect(relativeX + rect.left, relativeY + rect.top, width, height);
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
return { image: image, rect: rect };
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
function getClientRegion(elem: Element): Rect {
|
|
241
|
-
return getClientRect(elem);
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
function getOverflowState(elem: Element): OverflowState {
|
|
245
|
-
var region = getClientRegion(elem);
|
|
246
|
-
var ownerDoc = elem.ownerDocument;
|
|
247
|
-
var htmlElem = ownerDoc.documentElement;
|
|
248
|
-
var bodyElem = ownerDoc.body;
|
|
249
|
-
var htmlOverflowStyle = getEffectiveStyle(htmlElem, 'overflow') || 'visible';
|
|
250
|
-
var treatAsFixedPosition = false;
|
|
251
|
-
|
|
252
|
-
function canBeOverflowed(container: Element, position: string | null): boolean {
|
|
253
|
-
if (container === htmlElem) {
|
|
254
|
-
return true;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
var display = getEffectiveStyle(container, 'display') || '';
|
|
258
|
-
if (display.indexOf('inline') === 0 || display === 'contents') {
|
|
259
|
-
return false;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
if (position === 'absolute' && getEffectiveStyle(container, 'position') === 'static') {
|
|
263
|
-
return false;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
return true;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
function getOverflowParent(current: Element): Element | null {
|
|
270
|
-
var position = getEffectiveStyle(current, 'position');
|
|
271
|
-
if (position === 'fixed') {
|
|
272
|
-
treatAsFixedPosition = true;
|
|
273
|
-
return current === htmlElem ? null : htmlElem;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
var parent = getParentElement(current);
|
|
277
|
-
while (parent && !canBeOverflowed(parent, position)) {
|
|
278
|
-
parent = getParentElement(parent);
|
|
279
|
-
}
|
|
280
|
-
return parent;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
function getOverflowStyles(current: Element): OverflowStyles {
|
|
284
|
-
var overflowElem = current;
|
|
285
|
-
if (htmlOverflowStyle === 'visible') {
|
|
286
|
-
if (current === htmlElem && bodyElem) {
|
|
287
|
-
overflowElem = bodyElem;
|
|
288
|
-
} else if (current === bodyElem) {
|
|
289
|
-
return { x: 'visible', y: 'visible' };
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
var overflow = {
|
|
294
|
-
x: getEffectiveStyle(overflowElem, 'overflow-x') || 'visible',
|
|
295
|
-
y: getEffectiveStyle(overflowElem, 'overflow-y') || 'visible',
|
|
296
|
-
};
|
|
297
|
-
|
|
298
|
-
if (current === htmlElem) {
|
|
299
|
-
overflow.x = overflow.x === 'visible' ? 'auto' : overflow.x;
|
|
300
|
-
overflow.y = overflow.y === 'visible' ? 'auto' : overflow.y;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
return overflow;
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
function getScroll(current: Element): Coordinate {
|
|
307
|
-
if (current === htmlElem) {
|
|
308
|
-
return {
|
|
309
|
-
x: ownerDoc.defaultView ? ownerDoc.defaultView.pageXOffset : 0,
|
|
310
|
-
y: ownerDoc.defaultView ? ownerDoc.defaultView.pageYOffset : 0,
|
|
311
|
-
};
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
return { x: current.scrollLeft, y: current.scrollTop };
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
for (var container = getOverflowParent(elem); container; container = getOverflowParent(container)) {
|
|
318
|
-
var containerOverflow = getOverflowStyles(container);
|
|
319
|
-
if (containerOverflow.x === 'visible' && containerOverflow.y === 'visible') {
|
|
320
|
-
continue;
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
var containerRect = getClientRect(container);
|
|
324
|
-
if (containerRect.width === 0 || containerRect.height === 0) {
|
|
325
|
-
return 'hidden';
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
var underflowsX = region.right < containerRect.left;
|
|
329
|
-
var underflowsY = region.bottom < containerRect.top;
|
|
330
|
-
if ((underflowsX && containerOverflow.x === 'hidden') || (underflowsY && containerOverflow.y === 'hidden')) {
|
|
331
|
-
return 'hidden';
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
if ((underflowsX && containerOverflow.x !== 'visible') || (underflowsY && containerOverflow.y !== 'visible')) {
|
|
335
|
-
var containerScroll = getScroll(container);
|
|
336
|
-
var unscrollableX = region.right < containerRect.left - containerScroll.x;
|
|
337
|
-
var unscrollableY = region.bottom < containerRect.top - containerScroll.y;
|
|
338
|
-
if ((unscrollableX && containerOverflow.x !== 'visible') || (unscrollableY && containerOverflow.y !== 'visible')) {
|
|
339
|
-
return 'hidden';
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
var containerUnderflowState = getOverflowState(container);
|
|
343
|
-
return containerUnderflowState === 'hidden' ? 'hidden' : 'scroll';
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
var overflowsX = region.left >= containerRect.left + containerRect.width;
|
|
347
|
-
var overflowsY = region.top >= containerRect.top + containerRect.height;
|
|
348
|
-
if ((overflowsX && containerOverflow.x === 'hidden') || (overflowsY && containerOverflow.y === 'hidden')) {
|
|
349
|
-
return 'hidden';
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
if ((overflowsX && containerOverflow.x !== 'visible') || (overflowsY && containerOverflow.y !== 'visible')) {
|
|
353
|
-
if (treatAsFixedPosition) {
|
|
354
|
-
var docScroll = getScroll(container);
|
|
355
|
-
if (region.left >= htmlElem.scrollWidth - docScroll.x || region.right >= htmlElem.scrollHeight - docScroll.y) {
|
|
356
|
-
return 'hidden';
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
var containerOverflowState = getOverflowState(container);
|
|
361
|
-
return containerOverflowState === 'hidden' ? 'hidden' : 'scroll';
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
return 'none';
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
function isShownInternal(elem: Element, ignoreOpacity: boolean, displayedFn: (element: Node) => boolean): boolean {
|
|
369
|
-
if (!isElement(elem)) {
|
|
370
|
-
throw new Error('Argument to isShown must be of type Element');
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
if (isElement(elem, 'BODY')) {
|
|
374
|
-
return true;
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
if (isElement(elem, 'OPTION') || isElement(elem, 'OPTGROUP')) {
|
|
378
|
-
var select = (elem as Element).closest('select');
|
|
379
|
-
return !!select && isShownInternal(select, true, displayedFn);
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
var imageMap = maybeFindImageMap(elem);
|
|
383
|
-
if (imageMap) {
|
|
384
|
-
return !!imageMap.image && imageMap.rect.width > 0 && imageMap.rect.height > 0 &&
|
|
385
|
-
isShownInternal(imageMap.image, ignoreOpacity, displayedFn);
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
if (isElement(elem, 'INPUT') && (elem as HTMLInputElement).type.toLowerCase() === 'hidden') {
|
|
389
|
-
return false;
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
if (isElement(elem, 'NOSCRIPT')) {
|
|
393
|
-
return false;
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
var visibility = getEffectiveStyle(elem, 'visibility');
|
|
397
|
-
if (visibility === 'collapse' || visibility === 'hidden') {
|
|
398
|
-
return false;
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
if (!displayedFn(elem)) {
|
|
402
|
-
return false;
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
if (!ignoreOpacity && getOpacity(elem) === 0) {
|
|
406
|
-
return false;
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
function positiveSize(element: Element): boolean {
|
|
410
|
-
var rect = getClientRect(element);
|
|
411
|
-
if (rect.height > 0 && rect.width > 0) {
|
|
412
|
-
return true;
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
if (isElement(element, 'PATH') && (rect.height > 0 || rect.width > 0)) {
|
|
416
|
-
var strokeWidth = getEffectiveStyle(element, 'stroke-width');
|
|
417
|
-
return !!strokeWidth && parseInt(strokeWidth, 10) > 0;
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
var elementVisibility = getEffectiveStyle(element, 'visibility');
|
|
421
|
-
if (elementVisibility === 'collapse' || elementVisibility === 'hidden') {
|
|
422
|
-
return false;
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
if (!displayedFn(element)) {
|
|
426
|
-
return false;
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
if (getEffectiveStyle(element, 'overflow') === 'hidden') {
|
|
430
|
-
return false;
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
for (var index = 0; index < element.childNodes.length; index += 1) {
|
|
434
|
-
var child = element.childNodes[index];
|
|
435
|
-
if (child.nodeType === Node.TEXT_NODE) {
|
|
436
|
-
var text = child.nodeValue || '';
|
|
437
|
-
if (/^[\s]*$/.test(text) && /[\n\r\t]/.test(text)) {
|
|
438
|
-
continue;
|
|
439
|
-
}
|
|
440
|
-
return true;
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
if (isElement(child) && positiveSize(child)) {
|
|
444
|
-
return true;
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
return false;
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
if (!positiveSize(elem)) {
|
|
452
|
-
return false;
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
function hiddenByOverflow(element: Element): boolean {
|
|
456
|
-
if (getOverflowState(element) !== 'hidden') {
|
|
457
|
-
return false;
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
for (var index = 0; index < element.childNodes.length; index += 1) {
|
|
461
|
-
var child = element.childNodes[index];
|
|
462
|
-
if (isElement(child) && !hiddenByOverflow(child) && positiveSize(child)) {
|
|
463
|
-
return false;
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
return true;
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
return !hiddenByOverflow(elem);
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
function displayed(node: Node): boolean {
|
|
474
|
-
var cached = displayedCache.get(node);
|
|
475
|
-
if (cached !== undefined) {
|
|
476
|
-
return cached;
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
if (isElement(node)) {
|
|
480
|
-
var display = getEffectiveStyle(node, 'display');
|
|
481
|
-
var contentVisibility = getEffectiveStyle(node, 'content-visibility');
|
|
482
|
-
if (display === 'none' || contentVisibility === 'hidden') {
|
|
483
|
-
displayedCache.set(node, false);
|
|
484
|
-
return false;
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
var parent = getParentNodeInComposedDom(node);
|
|
489
|
-
if (typeof ShadowRoot === 'function' && parent instanceof ShadowRoot) {
|
|
490
|
-
if (parent.host.shadowRoot && parent.host.shadowRoot !== parent) {
|
|
491
|
-
displayedCache.set(node, false);
|
|
492
|
-
return false;
|
|
493
|
-
}
|
|
494
|
-
parent = parent.host;
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
if (parent && (parent.nodeType === Node.DOCUMENT_NODE || parent.nodeType === Node.DOCUMENT_FRAGMENT_NODE)) {
|
|
498
|
-
displayedCache.set(node, true);
|
|
499
|
-
return true;
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
if (isElement(parent, 'DETAILS') && !(<HTMLDetailsElement>parent).open && !isElement(node, 'SUMMARY')) {
|
|
503
|
-
displayedCache.set(node, false);
|
|
504
|
-
return false;
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
var result = !!parent && displayed(parent);
|
|
508
|
-
displayedCache.set(node, result);
|
|
509
|
-
return result;
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
return isShownInternal(elem, !!optIgnoreOpacity, displayed);
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
export default isShownElement;
|
|
18
|
+
// The implementation lives in core/ because is_interactable needs to call it
|
|
19
|
+
// too, and an atom entry point is not a module other atoms should import from.
|
|
20
|
+
export { default } from './core/shown.js'
|
|
@@ -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
|
+
|
|
18
|
+
export { isEditable as default } from './core/editable.js'
|
|
@@ -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
|
+
|
|
18
|
+
export { isEnabled as default } from './core/enabled.js'
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
|
|
18
|
+
// An element can take focus if it is a form field, carries a non-negative
|
|
19
|
+
// tabindex, or is editable.
|
|
20
|
+
export { isFocusable as default } from './core/focusable.js'
|
|
@@ -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
|
+
|
|
18
|
+
// Shown (ignoring opacity), enabled, and not pointer-events: none.
|
|
19
|
+
export { isInteractable as default } from './core/interactable.js'
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
|
|
18
|
+
import { isSelectable, isSelectedState } from './core/element.js'
|
|
19
|
+
|
|
20
|
+
// Ported from webdriver.atoms.element.isSelected, which answers false for an
|
|
21
|
+
// element that cannot be selected at all. The lower-level bot.dom.core.isSelected
|
|
22
|
+
// threw ELEMENT_NOT_SELECTABLE there instead; this is the shape the bindings
|
|
23
|
+
// and Appium consume.
|
|
24
|
+
function isSelected(element: Element): boolean {
|
|
25
|
+
if (!isSelectable(element)) {
|
|
26
|
+
return false
|
|
27
|
+
}
|
|
28
|
+
return isSelectedState(element)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export default isSelected
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
|
|
18
|
+
import { getLocalStorage } from './core/storage.js'
|
|
19
|
+
|
|
20
|
+
// Removes a key and returns the value it held, or null when absent.
|
|
21
|
+
//
|
|
22
|
+
// optWindow targets a frame other than the one the atom is running in.
|
|
23
|
+
function removeLocalStorageItem(key: string, optWindow?: Window): string | null {
|
|
24
|
+
return getLocalStorage(optWindow).removeItem(key)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default removeLocalStorageItem
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
|
|
18
|
+
import { getSessionStorage } from './core/storage.js'
|
|
19
|
+
|
|
20
|
+
// Removes a key and returns the value it held, or null when absent.
|
|
21
|
+
//
|
|
22
|
+
// optWindow targets a frame other than the one the atom is running in.
|
|
23
|
+
function removeSessionStorageItem(key: string, optWindow?: Window): string | null {
|
|
24
|
+
return getSessionStorage(optWindow).removeItem(key)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default removeSessionStorageItem
|