author L. David Baron <>
Thu, 24 Mar 2011 21:06:15 -0700
changeset 63859 1492b6e75639593efe4e45e153a34927605509a0
parent 21877 d584db13034e68e8642418410b10cd490a08932f
child 89074 81a9428d00f1b8866b43f0cdb55f66d7006e90aa
permissions -rw-r--r--
Backout changeset b97a060746f9 (Bug 620931 part 5) for causing bug 644790.

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * vim: ft=cpp tw=78 sw=2 et ts=2 sts=2 cin
 * ***** BEGIN LICENSE BLOCK *****
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 * The Original Code is code.
 * The Initial Developer of the Original Code is
 * Mozilla Corporation.
 * Portions created by the Initial Developer are Copyright (C) 2008
 * the Initial Developer. All Rights Reserved.
 * Contributor(s):
 *   Boris Zbarsky <> (original author)
 * Alternatively, the contents of this file may be used under the terms of
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 * in which case the provisions of the GPL or the LGPL are applicable instead
 * of those above. If you wish to allow use of your version of this file only
 * under the terms of either the GPL or the LGPL, and not to allow others to
 * use your version of this file under the terms of the MPL, indicate your
 * decision by deleting the provisions above and replace them with the notice
 * and other provisions required by the GPL or the LGPL. If you do not delete
 * the provisions above, a recipient may use your version of this file under
 * the terms of any one of the MPL, the GPL or the LGPL.
 * ***** END LICENSE BLOCK ***** */

#include "nsISupports.idl"

interface nsIDOMWindow;

 * An nsILoadContext represents the context of a load.  This interface
 * can be queried for various information about where the load is
 * happening.
[scriptable, uuid(314d8a54-1caf-4721-94d7-f6c82d9b82ed)]
interface nsILoadContext : nsISupports
   * associatedWindow is the window with which the load is associated, if any.
   * Note that the load may be triggered by a document which is different from
   * the document in associatedWindow, and in fact the source of the load need
   * not be same-origin with the document in associatedWindow.  This attribute
   * may be null if there is no associated window.
  readonly attribute nsIDOMWindow associatedWindow;

   * topWindow is the top window which is of same type as associatedWindow.
   * This is equivalent to, but is provided here as a
   * convenience.  All the same caveats as associatedWindow of apply, of
   * course.  This attribute may be null if there is no associated window.
  readonly attribute nsIDOMWindow topWindow;

   * Check whether the load is happening in a particular type of application.
   * @param an application type.  For now, the constants to be passed here are
   *        the nsIDocShell APP_TYPE_* constants.
   * @return whether there is some ancestor of the associatedWindow that is of
   *         the given app type.
  boolean isAppOfType(in unsigned long appType);

   * True if the load context is content (as opposed to chrome).  This is
   * determined based on the type of window the load is performed in, NOT based
   * on any URIs that might be around.
  readonly attribute boolean isContent;