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