dom/interfaces/html/nsIDOMHTMLCanvasElement.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/interfaces/html/nsIDOMHTMLCanvasElement.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,52 @@
     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 +#include "nsIDOMHTMLElement.idl"
    1.10 +
    1.11 +/**
    1.12 + * The nsIDOMHTMLCanvasElement interface is the interface to a HTML
    1.13 + * <canvas> element.
    1.14 + *
    1.15 + * For more information on this interface, please see
    1.16 + * http://www.whatwg.org/specs/web-apps/current-work/#graphics
    1.17 + *
    1.18 + * @status UNDER_DEVELOPMENT
    1.19 + */
    1.20 +
    1.21 +interface nsIDOMBlob;
    1.22 +interface nsIDOMFile;
    1.23 +interface nsIVariant;
    1.24 +interface nsIInputStreamCallback;
    1.25 +
    1.26 +[scriptable, uuid(8978d1c5-2981-4678-a1c3-b0b7bae04fbc)]
    1.27 +interface nsIDOMHTMLCanvasElement : nsISupports
    1.28 +{
    1.29 +  attribute unsigned long width;
    1.30 +  attribute unsigned long height;
    1.31 +  attribute boolean mozOpaque;
    1.32 +
    1.33 +  // Valid calls are:
    1.34 +  //  toDataURL();              -- defaults to image/png
    1.35 +  //  toDataURL(type);          -- uses given type
    1.36 +  //  toDataURL(type, params);  -- uses given type, and any valid parameters
    1.37 +  [implicit_jscontext]
    1.38 +  DOMString toDataURL([optional] in DOMString type,
    1.39 +                      [optional] in jsval params);
    1.40 +
    1.41 +  // Valid calls are
    1.42 +  // mozGetAsFile(name);              -- defaults to image/png
    1.43 +  // mozGetAsFile(name, type);        -- uses given type
    1.44 +  nsIDOMFile mozGetAsFile(in DOMString name, [optional] in DOMString type);
    1.45 +
    1.46 +  // A Mozilla-only extension to get a canvas context backed by double-buffered
    1.47 +  // shared memory. Only privileged callers can call this.
    1.48 +  nsISupports MozGetIPCContext(in DOMString contextId);
    1.49 +
    1.50 +  // A Mozilla-only extension that returns the canvas' image data as a data
    1.51 +  // stream in the desired image format.
    1.52 +  void mozFetchAsStream(in nsIInputStreamCallback callback,
    1.53 +                                        [optional] in DOMString type);
    1.54 +};
    1.55 +

mercurial