-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Fire "visibilitychange" events explicitly #7153
Changes from all commits
48de1dc
55fbec8
d2de735
cf52ff2
4444fd7
a81a0be
16baa58
ef58f58
c777ffd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9314,6 +9314,7 @@ partial interface <dfn id="document" data-lt="">Document</dfn> { | |
|
||
// special <span>event handler IDL attributes</span> that only apply to Document objects | ||
[<span>LegacyLenientThis</span>] attribute <span>EventHandler</span> <span data-x="handler-onreadystatechange">onreadystatechange</span>; | ||
attribute <span>EventHandler</span> <span data-x="handler-onvisibilitychange">onvisibilitychange</span>; | ||
|
||
// <a href="#Document-partial">also has obsolete members</a> | ||
}; | ||
|
@@ -88419,13 +88420,9 @@ new PaymentRequest(…); // Allowed to use | |
|
||
<li><p>Set <var>newDocument</var>'s <span>page showing</span> flag to true.</p></li> | ||
|
||
<li> | ||
<p>Run any <dfn>session history document visibility change steps</dfn> for | ||
<var>newDocument</var> that are defined by <span>other applicable specifications</span>.</p> | ||
|
||
<p class="note">This is specifically intended for use by <cite>Page Visibility</cite>. <ref | ||
spec=PAGEVIS></p> | ||
</li> | ||
<li><p>Fire an event named <code data-x="event-visibilitychange">visibilitychange</code> at | ||
<var>newDocument</var>, with its <code data-x="dom-Event-bubbles">bubbles</code> attribute | ||
initialized to true.</p></li> | ||
|
||
<li><p><span>Fire a page transition event</span> named <code | ||
data-x="event-pageshow">pageshow</code> at <var>newDocument</var>'s <span>relevant global | ||
|
@@ -88878,40 +88875,36 @@ dictionary <dfn dictionary>PageTransitionEventInit</dfn> : <span>EventInit</span | |
|
||
<li><p>Increase <var>document</var>'s <span>unload counter</span> by 1.</p></li> | ||
|
||
<li><p>If <var>document</var>'s <span>page showing</span> flag is false, then jump to the | ||
step labeled <i>unload event</i> below (i.e. skip firing the <code | ||
data-x="event-pagehide">pagehide</code> event and don't rerun the <span>unloading document | ||
visibility change steps</span>).</p></li> | ||
|
||
<li><p>Set <var>document</var>'s <span>page showing</span> flag to false.</p></li> | ||
|
||
<li><p>If the user agent does not intend to keep <var>document</var> alive | ||
in a <span>session history entry</span> (such that it can be reused later on <span | ||
data-x="traverse the history">history traversal</span>), set <var>document</var>'s | ||
<i data-x="concept-document-salvageable">salvageable</i> state to false.</p></li> | ||
|
||
<li><p><span>Fire a page transition event</span> named <code | ||
data-x="event-pagehide">pagehide</code> at <var>document</var>'s <span>relevant global | ||
object</span> with <var>document</var>'s <i data-x="concept-document-salvageable">salvageable</i> | ||
state.</p></li> | ||
|
||
<li> | ||
<p>Run any <dfn>unloading document visibility change steps</dfn> for <var>document</var> that | ||
are defined by <span>other applicable specifications</span>.</p> | ||
<p>If <var>document</var>'s <span>page showing</span> flag is true:</p> | ||
|
||
<p class="note">This is specifically intended for use by <cite>Page Visibility</cite>. | ||
<ref spec=PAGEVIS></p> | ||
</li> | ||
<ol> | ||
<li><p>Set <var>document</var>'s <span>page showing</span> flag to false.</p></li> | ||
|
||
<li><p><span>Fire a page transition event</span> named <code | ||
data-x="event-pagehide">pagehide</code> at <var>document</var>'s <span>relevant global | ||
object</span> with <var>document</var>'s <i | ||
data-x="concept-document-salvageable">salvageable</i> state.</p></li> | ||
|
||
<li><p>Fire an event named <code data-x="event-visibilitychange">visibilitychange</code> at | ||
<var>newDocument</var>, with its <code data-x="dom-Event-bubbles">bubbles</code> attribute | ||
initialized to true.</p></li> | ||
</ol> | ||
</li> | ||
|
||
<li><p>If <var>unloadTimingInfo</var> is not null, then set <var>unloadTimingInfo</var>'s | ||
<span>unload event start time</span> to the <span>current high resolution time</span> given | ||
<var>document</var>'s <span>relevant global object</span>.</p></li> | ||
|
||
<li><p><i>Unload event</i>: If <var>document</var>'s <i | ||
data-x="concept-document-salvageable">salvageable</i> state is false, then <span | ||
data-x="concept-event-fire">fire an event</span> named <code data-x="event-unload">unload</code> | ||
at <var>document</var>'s <span>relevant global object</span>, with <var>legacy target override | ||
flag</var> set.</p></li> | ||
<li><p>If <var>document</var>'s <i data-x="concept-document-salvageable">salvageable</i> state is | ||
false, then <span data-x="concept-event-fire">fire an event</span> named | ||
<code data-x="event-unload">unload</code> at <var>document</var>'s | ||
<span>relevant global object</span>, with <var>legacy target override flag</var> set.</p></li> | ||
|
||
<li><p>If <var>unloadTimingInfo</var> is not null, then set <var>unloadTimingInfo</var>'s | ||
<span>unload event end time</span> to the <span>current high resolution time</span> given | ||
|
@@ -95096,6 +95089,7 @@ typedef <span>OnBeforeUnloadEventHandlerNonNull</span>? <dfn typedef>OnBeforeUnl | |
<tr><th><span data-x="event handlers">Event handler</span> <th><span>Event handler event type</span> | ||
<tbody> | ||
<tr><td><dfn attribute for="Document"><code data-x="handler-onreadystatechange">onreadystatechange</code></dfn> <td> <code data-x="event-readystatechange">readystatechange</code> | ||
<tr><td><dfn attribute for="Document"><code data-x="handler-onvisibilitychange">onvisibilitychange</code></dfn> <td> <code data-x="event-visibilitychange">visibilitychange</code> | ||
</table> | ||
|
||
|
||
|
@@ -125552,6 +125546,13 @@ INSERT INTERFACES HERE | |
<td> <code>Window</code> | ||
<td> Fired at the <code>Window</code> object when the page is going away | ||
|
||
<tr> <!-- visibilitychange --> | ||
<td> <dfn event for="Document"><code data-x="event-visibilitychange">visibilitychange</code></dfn> | ||
<td> <code>Event</code> | ||
<td> <code>Document</code> | ||
<td> Fired at the <code>Document</code> object when the page becomes visible or hidden to the | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will just produce the literal text There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed |
||
user. <ref spec=PAGEVIS> | ||
|
||
</table> | ||
|
||
<p class="note">See also <a href="#mediaevents">media element events</a> and <a | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is two-space indents, but it should be 1-space.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed