Skip to content

Commit

Permalink
Add a navigator interface for user activation state.
Browse files Browse the repository at this point in the history
  • Loading branch information
mustaqahmed committed Sep 2, 2022
1 parent c7ad099 commit 80a8760
Showing 1 changed file with 67 additions and 1 deletion.
68 changes: 67 additions & 1 deletion source
Original file line number Diff line number Diff line change
Expand Up @@ -75753,7 +75753,7 @@ END:VCARD</pre>
seconds, so that the user can possibly perceive the link between an interaction with the page and
the page calling the activation-gated API.</p>

<p>These two values imply two boolean user activation states for <var>W</var>:</p>
<p>These two values imply two boolean <dfn>user activation states</dfn> for <var>W</var>:</p>

<dl>
<dt><dfn export>Sticky activation</dfn></dt>
Expand Down Expand Up @@ -75904,6 +75904,72 @@ END:VCARD</pre>
</dl>


<h4>The <code>UserActivation</code> interface</h4>

<p>The <span>user activation states</span> are exposed via the <code>UserActivation</code>
interface. <code>UserActivation</code> objects can be created either as a live or snapshot object,
it depends on how the object was referenced. Objects accessed via <code>navigator</code>'s <code
data-x="dom-Navigator-userActivation">userActivation</code> attribute are live, in that changes
will in the <span>user activation states</span> will be reflected in the attributes of the
object.</p>

<pre><code class="idl" data-x="">[Exposed=(Window,Worker,AudioWorklet)]
interface <dfn>UserActivation</dfn> {
readonly attribute boolean <span data-x="dom-UserActivation-hasBeenActive">hasBeenActive</span>;
readonly attribute boolean <span data-x="dom-UserActivation-isActive">isActive</span>;
};

partial interface <span id="NavigatorUserActivation-partial">Navigator</span> {
[SameObject] readyonly attribute <code>UserActivation</code> <span data-x="dom-Navigator-userActivation">userActivation</span>;
};</code></pre>

<dl class="domintro">

<dt><var>navigator</var> . <code subdfn
data-x="dom-Navigator-userActivation">userActivation</code></dt>

<dd>

<p>Returns the a live object representing the current <span>user activation states</span>.</p>

</dd>

<dt><var>userActivation</var> . <code subdfn
data-x="dom-UserActivation-hasBeenActive">hasBeenActive</code></dt>

<dd>

<p>Returns the state of the <span>sticky activation</span>.</p>

</dd>

<dt><var>userActivation</var> . <code subdfn
data-x="dom-UserActivation-isActive">isActive</code></dt>

<dd>

<p>Returns the state of the <span>transient activation</span>.</p>

</dd>

</dl>

<div w-nodev>

<p>The <dfn><code data-x="dom-UserActivation-hasBeenActive">hasBeenActive</code></dfn> attribute
must return the state of the <span>sticky activation</span>. If the object is live it must
always reflect the current state. If the object is a snapshot it must reflect the state at which
the time the object was created.</p>

<p>The <dfn><code data-x="dom-UserActivation-isActive">isActive</code></dfn> attribute must return
the state of the <span>transient activation</span>. If the object is live it must always
reflect the current state. If the object is a snapshot it must reflect the state at which the time
the object was created.</p>

<p>The <dfn><code data-x="dom-Navigator-userActivation">userActivation</code></dfn> attribute must
return a live representation of the <span>user activation states</span>.</p>

</div>

<h3 id="activation">Activation behavior of elements</h3>

Expand Down

0 comments on commit 80a8760

Please sign in to comment.