|
| 1 | +enum DocumentReadyState { "loading", "interactive", "complete" }; |
| 2 | +typedef (HTMLScriptElement or SVGScriptElement) HTMLOrSVGScriptElement; |
| 3 | + |
| 4 | +[OverrideBuiltins] |
| 5 | +partial interface Document { |
| 6 | + // resource metadata management |
| 7 | + [PutForwards=href, Unforgeable] readonly attribute Location? location; |
| 8 | + attribute USVString domain; |
| 9 | + readonly attribute USVString referrer; |
| 10 | + attribute USVString cookie; |
| 11 | + readonly attribute DOMString lastModified; |
| 12 | + readonly attribute DocumentReadyState readyState; |
| 13 | + |
| 14 | + // DOM tree accessors |
| 15 | + getter object (DOMString name); |
| 16 | + [CEReactions] attribute DOMString title; |
| 17 | + [CEReactions] attribute DOMString dir; |
| 18 | + [CEReactions] attribute HTMLElement? body; |
| 19 | + readonly attribute HTMLHeadElement? head; |
| 20 | + [SameObject] readonly attribute HTMLCollection images; |
| 21 | + [SameObject] readonly attribute HTMLCollection embeds; |
| 22 | + [SameObject] readonly attribute HTMLCollection plugins; |
| 23 | + [SameObject] readonly attribute HTMLCollection links; |
| 24 | + [SameObject] readonly attribute HTMLCollection forms; |
| 25 | + [SameObject] readonly attribute HTMLCollection scripts; |
| 26 | + NodeList getElementsByName(DOMString elementName); |
| 27 | + readonly attribute HTMLOrSVGScriptElement? currentScript; // classic scripts in a document tree only |
| 28 | + |
| 29 | + // dynamic markup insertion |
| 30 | + [CEReactions] Document open(optional DOMString type, optional DOMString replace = ""); // type is ignored |
| 31 | + WindowProxy open(USVString url, DOMString name, DOMString features); |
| 32 | + [CEReactions] void close(); |
| 33 | + [CEReactions] void write(DOMString... text); |
| 34 | + [CEReactions] void writeln(DOMString... text); |
| 35 | + |
| 36 | + // user interaction |
| 37 | + readonly attribute WindowProxy? defaultView; |
| 38 | + readonly attribute Element? activeElement; |
| 39 | + boolean hasFocus(); |
| 40 | + [CEReactions] attribute DOMString designMode; |
| 41 | + [CEReactions] boolean execCommand(DOMString commandId, optional boolean showUI = false, optional DOMString value = ""); |
| 42 | + boolean queryCommandEnabled(DOMString commandId); |
| 43 | + boolean queryCommandIndeterm(DOMString commandId); |
| 44 | + boolean queryCommandState(DOMString commandId); |
| 45 | + boolean queryCommandSupported(DOMString commandId); |
| 46 | + DOMString queryCommandValue(DOMString commandId); |
| 47 | + |
| 48 | + // special event handler IDL attributes that only apply to Document objects |
| 49 | + [LenientThis] attribute EventHandler onreadystatechange; |
| 50 | +}; |
| 51 | +Document includes GlobalEventHandlers; |
| 52 | +Document includes DocumentAndElementEventHandlers; |
| 53 | + |
| 54 | +[Exposed=Window, |
| 55 | + HTMLConstructor] |
| 56 | +interface HTMLElement : Element { |
| 57 | + // metadata attributes |
| 58 | + [CEReactions] attribute DOMString title; |
| 59 | + [CEReactions] attribute DOMString lang; |
| 60 | + [CEReactions] attribute boolean translate; |
| 61 | + [CEReactions] attribute DOMString dir; |
| 62 | + |
| 63 | + // user interaction |
| 64 | + [CEReactions] attribute boolean hidden; |
| 65 | + void click(); |
| 66 | + [CEReactions] attribute DOMString accessKey; |
| 67 | + readonly attribute DOMString accessKeyLabel; |
| 68 | + [CEReactions] attribute boolean draggable; |
| 69 | + [CEReactions] attribute boolean spellcheck; |
| 70 | + [CEReactions] attribute DOMString autocapitalize; |
| 71 | + |
| 72 | + [CEReactions] attribute [TreatNullAs=EmptyString] DOMString innerText; |
| 73 | +}; |
| 74 | + |
| 75 | +HTMLElement includes GlobalEventHandlers; |
| 76 | +HTMLElement includes DocumentAndElementEventHandlers; |
| 77 | +HTMLElement includes ElementContentEditable; |
| 78 | +HTMLElement includes HTMLOrSVGElement; |
| 79 | + |
| 80 | +// Note: intentionally not [HTMLConstructor] |
| 81 | +[Exposed=Window] |
| 82 | +interface HTMLUnknownElement : HTMLElement { }; |
| 83 | + |
| 84 | +interface mixin HTMLOrSVGElement { |
| 85 | + [SameObject] readonly attribute DOMStringMap dataset; |
| 86 | + attribute DOMString nonce; |
| 87 | + |
| 88 | + [CEReactions] attribute long tabIndex; |
| 89 | + void focus(optional FocusOptions options); |
| 90 | + void blur(); |
| 91 | +}; |
| 92 | + |
| 93 | +[Exposed=Window, |
| 94 | + OverrideBuiltins] |
| 95 | +interface DOMStringMap { |
| 96 | + getter DOMString (DOMString name); |
| 97 | + [CEReactions] setter void (DOMString name, DOMString value); |
| 98 | + [CEReactions] deleter void (DOMString name); |
| 99 | +}; |
0 commit comments