@@ -72499,62 +72499,105 @@ END:VCARD</pre>
72499
72499
72500
72500
<h4>Processing model</h4>
72501
72501
72502
- <p>A user interaction <dfn data-x="activates-a-window">activates a <code>Window</code> object
72503
- <var>W</var></dfn> if either:</p>
72504
- <ul>
72505
- <li>input events from the user interaction is targetted to an element of <var>W</var>, or</li>
72506
-
72507
- <li>the interaction <span data-x="activates-a-window">activates the <code>Window</code>
72508
- object</span> in a subframe of <var>W</var>.</li>
72509
- </ul>
72502
+ <p>When a user interaction in a <span>browsing context</span> <var>B</var> causes firing of an <a
72503
+ href="#activation-triggering-event">activation triggering input events</a> in that context, it
72504
+ <dfn data-x="activate-window">activates the <code>Window</code> objects</dfn> in all <span
72505
+ data-x="ancestor browsing context">ancestor browsing contexts</span> of <var>B</var> (including
72506
+ the one in <var>B</var> itself).</p>
72510
72507
72511
72508
<p>The <dfn>user activation state</dfn> of a <code>Window</code> object <var>W</var> consists of
72512
72509
two boolean flags, both of which are initially set to false:</p>
72510
+
72513
72511
<ul>
72514
- <li>The <dfn>sticky activation flag</dfn> indicates the historical activation state: whether the
72515
- user has ever interacted with <var>W</var> or its subframes. The flag is set when <var>W</var>
72516
- is <span data-x="activates-a-window">activated</span> for the very first time, and is never
72517
- reset during the lifetime of <var>W</var>.</li>
72518
-
72519
- <li>The <dfn>transient activation flag</dfn> indicates the current activation state: whether the
72520
- user is currently interacting with <var>W</var> or its subframes. The flag is set every time
72521
- <var>W</var> is <span data-x="activates-a-window">activated</span>, and is reset either
72522
- <ul>
72523
- <li>after an expiry time defined by the browser, or</li>
72524
- <li>through a call to an <span data-x="">activation-consuming API</span> in the context of
72525
- any <code>Window</code> object of the page.</li>
72526
- </ul>
72527
- </li>
72512
+
72513
+ <li><p>The <dfn>sticky activation flag</dfn> indicates the historical activation state: whether
72514
+ the user has ever interacted with <var>W</var> or its subframes. When <var>W</var> is <span
72515
+ data-x="activate-window">activated</span> for the very first time, the UA sets the flag to true.
72516
+ This flag is never set to false during the lifetime of <var>W</var>.</p></li>
72517
+
72518
+ <li><p>The <dfn>transient activation flag</dfn> indicates the current activation state: whether
72519
+ the user is currently interacting with <var>W</var> or its subframes. Every time <var>W</var> is
72520
+ <span data-x="activate-window">activated</span>, the UA sets the flag to true. The UA sets the
72521
+ flag to false when the flag either <span data-x="expiration of transient
72522
+ activation">expires</span> or gets <span data-x="consumption of transient
72523
+ activation">consumed</span>.</p></li>
72524
+
72528
72525
</ul>
72529
72526
72530
- <p class="note"> The propagation of the <span>transient activation flag</span> in the frame tree
72531
- is assymetric between setting vs resetting of the flag. A user interaction with a frame
72532
- <var>F</var> sets the flag in the <code>Window</code> object of each ancestor frame of
72533
- <var>F</var> (including <var>F</var> itself). However, an <span data-x="">activation-consuming
72534
- API</span> call in the context of the <code>Window</code> object of frame of <var>F</var> resets
72535
- the flag in <em>all</em> <code>Window</code> objects across the whole frame tree. This prevents
72536
- multiple calls to an <span data-x="">activation-consuming API</span> even when the frame hierarchy
72537
- is deep.</p>
72527
+ <dl>
72528
+
72529
+ <dt><dfn>Expiration of transient activation</dfn></dt>
72530
+
72531
+ <dd>
72532
+
72533
+ <p>The UA sets the <span>transient activation flag</span> to false after a UA-defined expiry
72534
+ time has elapsed since the last time <var>W</var> was
72535
+ <span data-x="activate-window">activated</span>.</p>
72536
+
72537
+ <p class="note">The expiry time has to be at most a few seconds so that the user can possibly
72538
+ perceive the link between an interaction with a page and the page opening a popup, for
72539
+ example.</p>
72540
+
72541
+ <p class="note">The UA can possibly implement the expiration of <span>transient activation
72542
+ flag</span> through time-stamping: the UA would have an internal time-stamp field in <span>user
72543
+ activation state</span> which is updated to current time-stamp every time <var>W</var> is
72544
+ <span data-x="activate-window">activated</span>. Then every time the <span>transient activation
72545
+ flag</span> is checked, the UA would return true iff current time-stamp is less than the stored
72546
+ time-stamp plus the expiry time.</p>
72547
+
72548
+ </dd>
72549
+
72550
+ <dt><dfn>Consumption of transient activation</dfn><dt>
72551
+
72552
+ <dd>
72553
+
72554
+ <p>The UA sets the <span>transient activation flag</span> to whenever any script in the page
72555
+ makes a call to an <span>activation consuming API</span> such as <code
72556
+ data-x="dom-open">window.open()</code>.</p>
72557
+
72558
+ <p class="note" w-nodev>Note the assymetry between setting the <span>transient activation
72559
+ flag</span> to true and false from the perspective of the <span data-x="browsing
72560
+ context">browsing contexts</span> of the page. A user interaction with a <code>Window</code>
72561
+ object <var>W</var> sets to true the transient activation flags in only the <span
72562
+ data-x="ancestor browsing context">ancestor browsing contexts</span> of <var>W</var>. However,
72563
+ a consumping in <var>W</var> sets to false the flags in all browsing contexts of the page (more
72564
+ precisely, all <span data-x="list of the descendant browsing contexts">descendant browsing
72565
+ contexts</span> of the <span>top-level browsing context</span> of <var>W</var>). Consuming the
72566
+ flag in this manner prevents malicious sites from making multiple calls to an <span>activation
72567
+ consuming API</span> from a single user activation (possibly by exploiting a deep hierarchy of
72568
+ browsing contexts).</p>
72569
+
72570
+ </dd>
72571
+
72572
+ </dl>
72538
72573
72539
72574
<h4>APIs gated by user activation</h4>
72540
72575
72541
72576
<p>APIs that are dependent on <span>user activation state</span> are classified into three
72542
72577
different levels. The levels are as follows, sorted by their "strength of dependence" on user
72543
72578
activation (from strongest to weakest):</p>
72544
- <ol>
72545
- <li><dfn>Transient activation consuming APIs</dfn>: These APIs require the transient bit, and
72546
- they consume the bit in each call to prevent multiple calls per user activation.</li>
72579
+ <dl>
72580
+ <dt><dfn data-x="activation consuming api">Transient activation consuming APIs</dfn></dt>
72547
72581
72548
- <li><dfn>Transient activation gated APIs</dfn>: These APIs require the transient bit but don't
72549
- consume it, so multiple calls are allowed per user activation until the transient bit
72550
- expires .</li >
72582
+ <dd><p> These APIs require the transient activation flag to be true, and they <span
72583
+ data-x="consumption of transient activation">consume</span> the flag in each call to prevent multiple
72584
+ calls per user activation .</p></dd >
72551
72585
72552
- <li><dfn>Sticky activation gated APIs</dfn>: These APIs require the sticky activation bit, so
72553
- they are blocked until the very first user activation.</li>
72554
- </ol>
72586
+ <dt><dfn data-x="transient activation gated api">Transient activation gated APIs</dfn><dt>
72587
+
72588
+ <dd><p>These APIs require the transient activation flag to be true but don't consume it, so
72589
+ multiple calls are allowed per user activation until the transient bit <span data-x="expiration
72590
+ of transient activation">expires</span>.</p></dd>
72591
+
72592
+ <dt><dfn data-x="sticky activation gated api">Sticky activation gated APIs</dfn></dt>
72593
+
72594
+ <dd><p>These APIs require the sticky activation flag to be true, so they are blocked
72595
+ until the very first user activation.</p></dd>
72596
+
72597
+ </dl>
72555
72598
72556
72599
72557
- <h4>Events triggering user activation</h4>
72600
+ <h4 id="activation-triggering-event">Input events triggering user activation</h4>
72558
72601
72559
72602
<div w-nodev>
72560
72603
@@ -72571,15 +72614,15 @@ END:VCARD</pre>
72571
72614
data-x="dom-Event-isTrusted">isTrusted</code> attribute is true and whose <code
72572
72615
data-x="dom-Event-type">type</code> is one of:</p>
72573
72616
<ul class="brief">
72574
- <li><code data-x="event-change">change</code></li>
72575
- <li><code data-x="event-click">click</code></li>
72576
- <li><code data-x="event-contextmenu">contextmenu</code></li>
72577
- <li><code data-x="event-dblclick">dblclick</code></li>
72578
- <li><code data-x="event-mouseup">mouseup</code></li>
72579
- <li><code data-x="event-pointerup">pointerup</code></li>
72580
- <li><code data-x="event-reset">reset</code></li>
72581
- <li><code data-x="event-submit">submit</code></li>
72582
- <li><code data-x="event-touchend">touchend</code></li>
72617
+ <li><code data-x="event-change">change</code></li>
72618
+ <li><code data-x="event-click">click</code></li>
72619
+ <li><code data-x="event-contextmenu">contextmenu</code></li>
72620
+ <li><code data-x="event-dblclick">dblclick</code></li>
72621
+ <li><code data-x="event-mouseup">mouseup</code></li>
72622
+ <li><code data-x="event-pointerup">pointerup</code></li>
72623
+ <li><code data-x="event-reset">reset</code></li>
72624
+ <li><code data-x="event-submit">submit</code></li>
72625
+ <li><code data-x="event-touchend">touchend</code></li>
72583
72626
</ul>
72584
72627
72585
72628
</div>
0 commit comments