nsIDOMHTMLCanvasElement.idl 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #include "nsIDOMHTMLElement.idl"
  6. /**
  7. * The nsIDOMHTMLCanvasElement interface is the interface to a HTML
  8. * <canvas> element.
  9. *
  10. * For more information on this interface, please see
  11. * http://www.whatwg.org/specs/web-apps/current-work/#graphics
  12. *
  13. * @status UNDER_DEVELOPMENT
  14. */
  15. interface nsIDOMBlob;
  16. interface nsIVariant;
  17. interface nsIInputStreamCallback;
  18. [uuid(4e8f1316-b601-471d-8f44-3c650d91ee9b)]
  19. interface nsIDOMHTMLCanvasElement : nsISupports
  20. {
  21. attribute unsigned long width;
  22. attribute unsigned long height;
  23. attribute boolean mozOpaque;
  24. // Valid calls are:
  25. // toDataURL(); -- defaults to image/png
  26. // toDataURL(type); -- uses given type
  27. // toDataURL(type, params); -- uses given type, and any valid parameters
  28. [implicit_jscontext]
  29. DOMString toDataURL([optional] in DOMString type,
  30. [optional] in jsval params);
  31. // Valid calls are
  32. // mozGetAsFile(name); -- defaults to image/png
  33. // mozGetAsFile(name, type); -- uses given type
  34. // The return value is a File object.
  35. nsISupports mozGetAsFile(in DOMString name, [optional] in DOMString type);
  36. // A Mozilla-only extension to get a canvas context backed by double-buffered
  37. // shared memory. Only privileged callers can call this.
  38. nsISupports MozGetIPCContext(in DOMString contextId);
  39. };