Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add definition for "weak map" #1804

Merged
merged 1 commit into from
Mar 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2222,7 +2222,7 @@ <h2>Sessions</h2>
Unless stated otherwise it is in the <a>dismiss and notify state</a>.

<p>A <a>session</a> has an associated <dfn>browsing context input
state map</dfn>, which is a Weak Map with <a>top-level browsing
state map</dfn>, which is a <a>weak map</a> with <a>top-level browsing
contexts</a> as keys, and <a>input state</a> objects as values. This
is initially set to an empty map.

Expand Down Expand Up @@ -4256,15 +4256,24 @@ <h2>Elements</h2>
representing a handle to a DOM node in a specific
WebDriver <a>session</a>.

<p>A <dfn>weak map</dfn> is a <a data-cite=infra>map</a> 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.

<p class=note>Unlike the ECMAScript <a data-lt="ecmascript type">WeakMap</a>,
a <a>weak map</a> can participate in the full set of operations available for
a Map.

<p>A WebDriver <a>session</a> has a <dfn>browsing context group node
map</dfn>, which is a weak map between a <a>browsing context group</a>
map</dfn>, which is a <a>weak map</a> between a <a>browsing context group</a>
and a <a>node id map</a>.

<p>A <dfn>node id map</dfn> is weak map between nodes and their
<p>A <dfn>node id map</dfn> is <a>weak map</a> between nodes and their
corresponding <a>WebDriver node id</a>.

<p>A WebDriver <a>session</a> has a <dfn>navigable seen nodes map</dfn>
which is a weak map between a [=navigable=] and a set.
which is a <a>weak map</a> between a [=navigable=] and a set.

<p>To <dfn>get a node</dfn> given <var>session</var>,
<var>browsing context</var>, and <var>reference</var>:
Expand Down Expand Up @@ -4299,7 +4308,7 @@ <h2>Elements</h2>

<li>If <var>browsing context group node map</var> does not
contain <var>browsing context group</var>, set <var>browsing context
group node map</var>[<var>browsing context group</var>] to a new weak map.
group node map</var>[<var>browsing context group</var>] to a new <a>weak map</a>.

<li>Let <var>node id map</var> be <var>browsing context group node
map</var>[<var>browsing context group</var>].
Expand Down
Loading