author J. Ryan Stinnett <jryans@gmail.com>
Wed, 17 Feb 2016 21:53:32 -0600
changeset 322810 981fee6f681f8e24aa8ea37c39ab74f91c7c5ede
parent 319732 7d6e0141de4fab594b48d54663a4cc90fc78e248
child 359692 ddf5af982d8b7a4258b3a6e05ee4c76ce66af605
permissions -rw-r--r--
Bug 1238160 - Set docshell isolation mode. r=smaug Renames nsDocShell isBrowser* attributes to add a "Moz" prefix for clarity. Adds nsDocShell::GetIsIsolatedMozBrowserElement, which parallels GetIsInIsolatedMozBrowserElement, but only checks the immediate docshell. Adds nsDocShell::SetIsInIsolatedMozBrowserElement for the frame loader and tab child to set the isolation state. nsDocShell methods related to mozbrowser elements (and their callers) are updated to use GetIs(In)?IsolatedMozBrowserElement when checking isolation / origins and GetIsMozBrowserElement when checking frame types. MozReview-Commit-ID: 6pGD5fF47ZN

/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "nsISupports.idl"

[scriptable, uuid(826e80c8-d70f-42e2-8aa9-82c05f2a370a)]
interface nsIScreen : nsISupports
   * Levels of brightness for the screen, from off to full brightness.
  const unsigned long BRIGHTNESS_DIM = 0;
  const unsigned long BRIGHTNESS_FULL = 1;

  /* The number of different brightness levels */
  const unsigned long BRIGHTNESS_LEVELS = 2;

   * Allowable screen rotations, when the underlying widget toolkit
   * supports rotating the screen.
   * ROTATION_0_DEG is the default, unrotated configuration.
  const unsigned long   ROTATION_0_DEG = 0;
  const unsigned long  ROTATION_90_DEG = 1;
  const unsigned long ROTATION_180_DEG = 2;
  const unsigned long ROTATION_270_DEG = 3;

   * A unique identifier for this device, useful for requerying
   * for it via nsIScreenManager.
  readonly attribute unsigned long id;

   * These report screen dimensions in (screen-specific) device pixels
  void GetRect(out long left, out long top, out long width, out long height);
  void GetAvailRect(out long left, out long top, out long width, out long height);

   * And these report in desktop pixels
  void GetRectDisplayPix(out long left, out long top, out long width, out long height);
  void GetAvailRectDisplayPix(out long left, out long top, out long width, out long height);

   * Locks the minimum brightness of the screen, forcing it to be at
   * least as bright as a certain brightness level. Each call to this
   * function must eventually be followed by a corresponding call to
   * unlockMinimumBrightness, with the same brightness level.
   * @param brightness A brightness level, one of the above constants.
  void lockMinimumBrightness(in unsigned long brightness);

   * Releases a lock on the screen brightness. This must be called
   * (eventually) after a corresponding call to lockMinimumBrightness.
   * @param brightness A brightness level, one of the above constants.
  void unlockMinimumBrightness(in unsigned long brightness);
  readonly attribute long pixelDepth;
  readonly attribute long colorDepth;
   * Get/set the screen rotation, on platforms that support changing
   * screen rotation.
  attribute unsigned long rotation;

   * The number of device pixels per desktop pixel for this screen (for
   * hidpi configurations where there may be multiple device pixels per
   * desktop px and/or per CSS px).
   * This seems poorly named (something like devicePixelsPerDesktopPixel
   * would be more accurate/explicit), but given that it is exposed to
   * front-end code and may also be used by add-ons, it's probably not
   * worth the disruption of changing it.
   * Returns 1.0 if HiDPI mode is disabled or unsupported, or if the
   * host OS uses device pixels as its desktop pixel units (as in Win8.1
   * per-monitor dpi support).
  readonly attribute double contentsScaleFactor;

   * The default number of device pixels per unscaled CSS pixel for this
   * screen. This is probably what contentsScaleFactor originally meant
   * to be, prior to confusion between CSS pixels and desktop pixel units.
  readonly attribute double defaultCSSScaleFactor;