Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #include "nsIDOMHTMLElement.idl" |
michael@0 | 7 | |
michael@0 | 8 | /** |
michael@0 | 9 | * The nsIDOMHTMLCanvasElement interface is the interface to a HTML |
michael@0 | 10 | * <canvas> element. |
michael@0 | 11 | * |
michael@0 | 12 | * For more information on this interface, please see |
michael@0 | 13 | * http://www.whatwg.org/specs/web-apps/current-work/#graphics |
michael@0 | 14 | * |
michael@0 | 15 | * @status UNDER_DEVELOPMENT |
michael@0 | 16 | */ |
michael@0 | 17 | |
michael@0 | 18 | interface nsIDOMBlob; |
michael@0 | 19 | interface nsIDOMFile; |
michael@0 | 20 | interface nsIVariant; |
michael@0 | 21 | interface nsIInputStreamCallback; |
michael@0 | 22 | |
michael@0 | 23 | [scriptable, uuid(8978d1c5-2981-4678-a1c3-b0b7bae04fbc)] |
michael@0 | 24 | interface nsIDOMHTMLCanvasElement : nsISupports |
michael@0 | 25 | { |
michael@0 | 26 | attribute unsigned long width; |
michael@0 | 27 | attribute unsigned long height; |
michael@0 | 28 | attribute boolean mozOpaque; |
michael@0 | 29 | |
michael@0 | 30 | // Valid calls are: |
michael@0 | 31 | // toDataURL(); -- defaults to image/png |
michael@0 | 32 | // toDataURL(type); -- uses given type |
michael@0 | 33 | // toDataURL(type, params); -- uses given type, and any valid parameters |
michael@0 | 34 | [implicit_jscontext] |
michael@0 | 35 | DOMString toDataURL([optional] in DOMString type, |
michael@0 | 36 | [optional] in jsval params); |
michael@0 | 37 | |
michael@0 | 38 | // Valid calls are |
michael@0 | 39 | // mozGetAsFile(name); -- defaults to image/png |
michael@0 | 40 | // mozGetAsFile(name, type); -- uses given type |
michael@0 | 41 | nsIDOMFile mozGetAsFile(in DOMString name, [optional] in DOMString type); |
michael@0 | 42 | |
michael@0 | 43 | // A Mozilla-only extension to get a canvas context backed by double-buffered |
michael@0 | 44 | // shared memory. Only privileged callers can call this. |
michael@0 | 45 | nsISupports MozGetIPCContext(in DOMString contextId); |
michael@0 | 46 | |
michael@0 | 47 | // A Mozilla-only extension that returns the canvas' image data as a data |
michael@0 | 48 | // stream in the desired image format. |
michael@0 | 49 | void mozFetchAsStream(in nsIInputStreamCallback callback, |
michael@0 | 50 | [optional] in DOMString type); |
michael@0 | 51 | }; |
michael@0 | 52 |