dom/webidl/HTMLCanvasElement.webidl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/webidl/HTMLCanvasElement.webidl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,61 @@
     1.4 +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/.
     1.8 + *
     1.9 + * The origin of this IDL file is
    1.10 + * http://www.whatwg.org/specs/web-apps/current-work/#the-canvas-element
    1.11 + * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and
    1.12 + * Opera Software ASA. You are granted a license to use, reproduce
    1.13 + * and create derivative works of this document.
    1.14 + */
    1.15 +
    1.16 +interface Blob;
    1.17 +interface nsIInputStreamCallback;
    1.18 +interface nsISupports;
    1.19 +interface Variant;
    1.20 +
    1.21 +interface HTMLCanvasElement : HTMLElement {
    1.22 +  [Pure, SetterThrows]
    1.23 +           attribute unsigned long width;
    1.24 +  [Pure, SetterThrows]
    1.25 +           attribute unsigned long height;
    1.26 +
    1.27 +  [Throws]
    1.28 +  nsISupports? getContext(DOMString contextId, optional any contextOptions = null);
    1.29 +
    1.30 +  [Throws]
    1.31 +  DOMString toDataURL(optional DOMString type = "",
    1.32 +                      optional any encoderOptions);
    1.33 +  [Throws]
    1.34 +  void toBlob(FileCallback _callback,
    1.35 +              optional DOMString type = "",
    1.36 +              optional any encoderOptions);
    1.37 +};
    1.38 +
    1.39 +// Mozilla specific bits
    1.40 +partial interface HTMLCanvasElement {
    1.41 +  [Pure, SetterThrows]
    1.42 +           attribute boolean mozOpaque;
    1.43 +  [Throws]
    1.44 +  File mozGetAsFile(DOMString name, optional DOMString? type = null);
    1.45 +  [ChromeOnly, Throws]
    1.46 +  nsISupports? MozGetIPCContext(DOMString contextId);
    1.47 +  [ChromeOnly]
    1.48 +  void mozFetchAsStream(nsIInputStreamCallback callback, optional DOMString? type = null);
    1.49 +           attribute PrintCallback? mozPrintCallback;
    1.50 +};
    1.51 +
    1.52 +[ChromeOnly]
    1.53 +interface MozCanvasPrintState
    1.54 +{
    1.55 +  // A canvas rendering context.
    1.56 +  readonly attribute nsISupports context;
    1.57 +
    1.58 +  // To be called when rendering to the context is done.
    1.59 +  void done();
    1.60 +};
    1.61 +
    1.62 +callback PrintCallback = void(MozCanvasPrintState ctx);
    1.63 +
    1.64 +callback FileCallback = void(Blob file);

mercurial