dom/webidl/HTMLDocument.webidl
author James Cheng <jacheng@mozilla.com>
Fri, 05 Aug 2016 13:23:44 -0400
changeset 308428 8ee6f2eb8b349a351f6f76585eb85e0ec2b5c475
parent 298331 93d5271f033292f898407d8cb1a1a80721a0ab5d
child 316221 dffc1cba16ebb105bd6e3d8a6aea04ec698e7dbe
permissions -rw-r--r--
Bug 1291229 - Fix typo for moving Java bindings to mozilla::java namespace. r=jchen MozReview-Commit-ID: KGAS6EhnwAI

/* -*- 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/.
 */

[OverrideBuiltins]
interface HTMLDocument : Document {
           [SetterThrows]
           attribute DOMString? domain;
           [Throws]
           attribute DOMString cookie;
  // DOM tree accessors
  [Throws]
  getter object (DOMString name);
  [Pure, SetterThrows]
           attribute HTMLElement? body;
  [Pure]
  readonly attribute HTMLHeadElement? head;
  [Pure]
  readonly attribute HTMLCollection images;
  [Pure]
  readonly attribute HTMLCollection embeds;
  [Pure]
  readonly attribute HTMLCollection plugins;
  [Pure]
  readonly attribute HTMLCollection links;
  [Pure]
  readonly attribute HTMLCollection forms;
  [Pure]
  readonly attribute HTMLCollection scripts;
  NodeList getElementsByName(DOMString elementName);

  // dynamic markup insertion
  [Throws]
  Document open(optional DOMString type = "text/html", optional DOMString replace = "");
  [Throws]
  WindowProxy? open(DOMString url, DOMString name, DOMString features, optional boolean replace = false);
  [Throws]
  void close();
  [Throws]
  void write(DOMString... text);
  [Throws]
  void writeln(DOMString... text);

           [SetterThrows]
           attribute DOMString designMode;
  [Throws]
  boolean execCommand(DOMString commandId, optional boolean showUI = false,
                      optional DOMString value = "");
  [Throws]
  boolean queryCommandEnabled(DOMString commandId);
  [Throws]
  boolean queryCommandIndeterm(DOMString commandId);
  [Throws]
  boolean queryCommandState(DOMString commandId);
  boolean queryCommandSupported(DOMString commandId);
  [Throws]
  DOMString queryCommandValue(DOMString commandId);

  [TreatNullAs=EmptyString] attribute DOMString fgColor;
  [TreatNullAs=EmptyString] attribute DOMString linkColor;
  [TreatNullAs=EmptyString] attribute DOMString vlinkColor;
  [TreatNullAs=EmptyString] attribute DOMString alinkColor;
  [TreatNullAs=EmptyString] attribute DOMString bgColor;

  [Pure]
  readonly attribute HTMLCollection anchors;
  [Pure]
  readonly attribute HTMLCollection applets;

  void clear();

  readonly attribute HTMLAllCollection all;

  // https://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#selections
  [Throws]
  Selection? getSelection();

  // @deprecated These are old Netscape 4 methods. Do not use,
  //             the implementation is no-op.
  // XXXbz do we actually need these anymore?
  void                      captureEvents();
  void                      releaseEvents();
};

partial interface HTMLDocument {
  /*
   * Number of nodes that have been blocked by
   * the Safebrowsing API to prevent tracking.
   */
  [ChromeOnly, Pure]
  readonly attribute long blockedTrackingNodeCount;

  /*
   * List of nodes that have been blocked by
   * the Safebrowsing API to prevent tracking.
   */
  [ChromeOnly, Pure]
  readonly attribute NodeList blockedTrackingNodes;
};