From 8e62bb08f50ce3f9552ce56d4ee63a94f7a2e863 Mon Sep 17 00:00:00 2001 From: Henrik Skupin Date: Thu, 7 Mar 2024 14:43:20 +0000 Subject: [PATCH] Add definition for "weak map" (#1804) SHA: 29d400adcfb6011eff926dd718d6dfd92b8ec11f Reason: push, by whimboo Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- index.html | 97 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 63 insertions(+), 34 deletions(-) diff --git a/index.html b/index.html index 231c0347..c7733ad7 100644 --- a/index.html +++ b/index.html @@ -191,7 +191,7 @@ .mdn .samsunginternet_android::before{background-image:url(https://www.w3.org/assets/logos/browser-logos/samsung-internet/samsung-internet.svg)} .mdn .webview_android::before{background-image:url(https://www.w3.org/assets/logos/browser-logos/android-webview/android-webview.png)} - + @@ -2584,7 +2584,7 @@

WebDriver

Unless stated otherwise it is in the dismiss and notify state.

A session has an associated browsing context input -state map, which is a Weak Map with top-level browsing +state map, which is a weak map with top-level browsing contexts as keys, and input state objects as values. This is initially set to an empty map. @@ -4920,15 +4920,24 @@

WebDriver

representing a handle to a DOM node in a specific WebDriver session. -

A WebDriver session has a browsing context group node -map, which is a weak map between a browsing context group +

A weak map is a map in which keys are held +weakly i.e. items are removed if the key object is garbaged collected, and +presence in the map does not prevent garbage collection. This acts as an +alternative to defining properties directly on the key objects. + +

Note

Unlike the ECMAScript WeakMap, +a weak map can participate in the full set of operations available for +a Map. + +

A WebDriver session has a browsing context group node +map, which is a weak map between a browsing context group and a node id map. -

A node id map is weak map between nodes and their +

A node id map is weak map between nodes and their corresponding WebDriver node id.

A WebDriver session has a navigable seen nodes map -which is a weak map between a navigable and a set. +which is a weak map between a navigable and a set.

To get a node given session, browsing context, and reference: @@ -4963,7 +4972,7 @@

WebDriver

  • If browsing context group node map does not contain browsing context group, set browsing context - group node map[browsing context group] to a new weak map. + group node map[browsing context group] to a new weak map.
  • Let node id map be browsing context group node map[browsing context group]. @@ -5576,7 +5585,7 @@

    WebDriver

    ORDERED_NODE_SNAPSHOT_TYPE, and null. -

    Note

    A snapshot is used to promote operation atomicity. +

    Note

    A snapshot is used to promote operation atomicity.

  • Let index be 0. @@ -5625,7 +5634,7 @@

    WebDriver

    -
    Note
  • Return success with data result.

  • -
    Note

    Please note that the behavior of this command +

    Note

    Please note that the behavior of this command deviates from the behavior of getAttribute() in [DOM], which in the case of a set boolean attribute would return an empty string. @@ -6377,7 +6386,7 @@

    WebDriver

    -
    Note