1/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/.
5 */
6
7/**
8 * The PageTransitionEvent interface is used for the pageshow and
9 * pagehide events, which are generic events that apply to both page
10 * load/unload and saving/restoring a document from session history.
11 */
12
13[Exposed=Window]
14interface PageTransitionEvent : Event
15{
16  constructor(DOMString type,
17              optional PageTransitionEventInit eventInitDict = {});
18
19  /**
20   * Set to true if the document has been or will be persisted across
21   * firing of the event.  For example, if a document is being cached in
22   * session history, |persisted| is true for the PageHide event.
23   */
24  readonly attribute boolean persisted;
25
26  // Whether the document is in the middle of a frame swap.
27  [ChromeOnly]
28  readonly attribute boolean inFrameSwap;
29};
30
31dictionary PageTransitionEventInit : EventInit
32{
33  boolean persisted = false;
34  boolean inFrameSwap = false;
35};
36