Skip to content

Commit 29d400a

Browse files
authored
Add definition for "weak map" (#1804)
1 parent 52c3e3a commit 29d400a

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

index.html

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2232,7 +2232,7 @@ <h2>Sessions</h2>
22322232
Unless stated otherwise it is in the <a>dismiss and notify state</a>.
22332233

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

@@ -4266,15 +4266,24 @@ <h2>Elements</h2>
42664266
representing a handle to a DOM node in a specific
42674267
WebDriver <a>session</a>.
42684268

4269+
<p>A <dfn>weak map</dfn> is a <a data-cite=infra>map</a> in which keys are held
4270+
weakly i.e. items are removed if the key object is garbaged collected, and
4271+
presence in the map does not prevent garbage collection. This acts as an
4272+
alternative to defining properties directly on the key objects.
4273+
4274+
<p class=note>Unlike the ECMAScript <a data-lt="ecmascript type">WeakMap</a>,
4275+
a <a>weak map</a> can participate in the full set of operations available for
4276+
a Map.
4277+
42694278
<p>A WebDriver <a>session</a> has a <dfn>browsing context group node
4270-
map</dfn>, which is a weak map between a <a>browsing context group</a>
4279+
map</dfn>, which is a <a>weak map</a> between a <a>browsing context group</a>
42714280
and a <a>node id map</a>.
42724281

4273-
<p>A <dfn>node id map</dfn> is weak map between nodes and their
4282+
<p>A <dfn>node id map</dfn> is <a>weak map</a> between nodes and their
42744283
corresponding <a>WebDriver node id</a>.
42754284

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

42794288
<p>To <dfn>get a node</dfn> given <var>session</var>,
42804289
<var>browsing context</var>, and <var>reference</var>:
@@ -4309,7 +4318,7 @@ <h2>Elements</h2>
43094318

43104319
<li>If <var>browsing context group node map</var> does not
43114320
contain <var>browsing context group</var>, set <var>browsing context
4312-
group node map</var>[<var>browsing context group</var>] to a new weak map.
4321+
group node map</var>[<var>browsing context group</var>] to a new <a>weak map</a>.
43134322

43144323
<li>Let <var>node id map</var> be <var>browsing context group node
43154324
map</var>[<var>browsing context group</var>].

0 commit comments

Comments
 (0)