nsIDOMHTMLDocument.idl 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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 "nsIDOMDocument.idl"
  6. /**
  7. * The nsIDOMHTMLDocument interface is the interface to a [X]HTML
  8. * document object.
  9. *
  10. * @see <http://www.whatwg.org/html/>
  11. */
  12. interface nsISelection;
  13. [uuid(cd31e61f-cfc2-4b91-9385-17b6a2d0633d)]
  14. interface nsIDOMHTMLDocument : nsIDOMDocument
  15. {
  16. attribute DOMString domain;
  17. attribute DOMString cookie;
  18. readonly attribute nsIDOMHTMLHeadElement head;
  19. attribute nsIDOMHTMLElement body;
  20. readonly attribute nsIDOMHTMLCollection images;
  21. readonly attribute nsIDOMHTMLCollection embeds;
  22. // mapped to attribute embeds for NS4 compat
  23. readonly attribute nsIDOMHTMLCollection plugins;
  24. readonly attribute nsIDOMHTMLCollection links;
  25. readonly attribute nsIDOMHTMLCollection forms;
  26. readonly attribute nsIDOMHTMLCollection scripts;
  27. nsIDOMNodeList getElementsByName(in DOMString elementName);
  28. // If aContentType is not something supported by nsHTMLDocument and
  29. // the HTML content sink, trying to write to the document will
  30. // probably throw.
  31. // Pass aReplace = true to trigger a replacement of the previous
  32. // document in session history; pass false for normal history handling.
  33. [implicit_jscontext, optional_argc]
  34. nsISupports open([optional] in DOMString aContentTypeOrUrl,
  35. [optional] in DOMString aReplaceOrName,
  36. [optional] in DOMString aFeatures);
  37. void close();
  38. [implicit_jscontext]
  39. void write([optional, Null(Stringify)] in DOMString text);
  40. [implicit_jscontext]
  41. void writeln([optional, Null(Stringify)] in DOMString text);
  42. /**
  43. * Midas additions
  44. */
  45. attribute DOMString designMode;
  46. boolean execCommand(in DOMString commandID,
  47. [optional] in boolean doShowUI,
  48. [optional] in DOMString value);
  49. // returns true if the command is enabled (false otherwise)
  50. boolean queryCommandEnabled(in DOMString commandID);
  51. // returns true if the command is in a indeterminate state (false otherwise)
  52. boolean queryCommandIndeterm(in DOMString commandID);
  53. // returns true if the command has been executed (false otherwise)
  54. boolean queryCommandState(in DOMString commandID);
  55. // returns true if the command is supported on the current range
  56. boolean queryCommandSupported(in DOMString commandID);
  57. // returns the current value of the document or current selection for command
  58. DOMString queryCommandValue(in DOMString commandID);
  59. // Obsolete APIs
  60. attribute DOMString fgColor;
  61. attribute DOMString bgColor;
  62. attribute DOMString linkColor;
  63. attribute DOMString vlinkColor;
  64. attribute DOMString alinkColor;
  65. readonly attribute nsIDOMHTMLCollection anchors;
  66. readonly attribute nsIDOMHTMLCollection applets;
  67. void clear();
  68. // DOM Range
  69. nsISelection getSelection();
  70. // More obsolete APIs
  71. /**
  72. * @deprecated These are old Netscape 4 methods. Do not use,
  73. * the implementation is no-op.
  74. */
  75. void captureEvents();
  76. void releaseEvents();
  77. };