author Olli Pettay <>
Wed, 09 Oct 2013 21:58:15 +0300
changeset 164093 7a7b028f0a023198f94ac8aaf42b3edbc0e2e636
parent 153204 8103ed66ceef57e894a5fb8705d9b6ae63a1f568
child 176834 12aeb83eaee74f49cc92434a5791804b05cbcbc1
permissions -rw-r--r--
Bug 924682 - [Pure] getters for some often used attributes, r=bz

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

interface Selection;

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

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

           attribute DOMString designMode;
  boolean execCommand(DOMString commandId, optional boolean showUI = false,
                      optional DOMString value = "");
  boolean queryCommandEnabled(DOMString commandId);
  boolean queryCommandIndeterm(DOMString commandId);
  boolean queryCommandState(DOMString commandId);
  boolean queryCommandSupported(DOMString commandId);
  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;

  readonly attribute HTMLCollection anchors;
  readonly attribute HTMLCollection applets;

  void clear();

  readonly attribute object all;

  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(long eventFlags);
  void                      releaseEvents(long eventFlags);