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 file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/.
6 * https://dom.spec.whatwg.org/#interface-document
7 * https://html.spec.whatwg.org/multipage/dom.html#the-document-object
8 * https://html.spec.whatwg.org/multipage/obsolete.html#other-elements%2C-attributes-and-apis
9 * https://fullscreen.spec.whatwg.org/#api
10 * https://w3c.github.io/pointerlock/#extensions-to-the-document-interface
11 * https://w3c.github.io/pointerlock/#extensions-to-the-documentorshadowroot-mixin
12 * https://w3c.github.io/page-visibility/#extensions-to-the-document-interface
13 * https://drafts.csswg.org/cssom/#extensions-to-the-document-interface
14 * https://drafts.csswg.org/cssom-view/#extensions-to-the-document-interface
15 * https://wicg.github.io/feature-policy/#policy
18 interface ContentSecurityPolicy;
20 interface WindowProxy;
21 interface nsISupports;
23 interface nsIDocShell;
24 interface nsILoadGroup;
25 interface nsIReferrerInfo;
26 interface nsICookieJarSettings;
27 interface nsIPermissionDelegateHandler;
28 interface XULCommandDispatcher;
30 enum VisibilityState { "hidden", "visible" };
32 /* https://dom.spec.whatwg.org/#dictdef-elementcreationoptions */
33 dictionary ElementCreationOptions {
40 /* https://dom.spec.whatwg.org/#interface-document */
42 interface Document : Node {
47 readonly attribute DOMImplementation implementation;
48 [Pure, Throws, BinaryName="documentURIFromJS", NeedsCallerType]
49 readonly attribute DOMString URL;
50 [Pure, Throws, BinaryName="documentURIFromJS", NeedsCallerType]
51 readonly attribute DOMString documentURI;
53 readonly attribute DOMString compatMode;
55 readonly attribute DOMString characterSet;
56 [Pure,BinaryName="characterSet"]
57 readonly attribute DOMString charset; // legacy alias of .characterSet
58 [Pure,BinaryName="characterSet"]
59 readonly attribute DOMString inputEncoding; // legacy alias of .characterSet
61 readonly attribute DOMString contentType;
64 readonly attribute DocumentType? doctype;
66 readonly attribute Element? documentElement;
68 HTMLCollection getElementsByTagName(DOMString localName);
70 HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
72 HTMLCollection getElementsByClassName(DOMString classNames);
74 Element? getElementById(DOMString elementId);
76 // These DOM methods cannot be accessed by UA Widget scripts
77 // because the DOM element reflectors will be in the content scope,
78 // instead of the desired UA Widget scope.
79 [CEReactions, NewObject, Throws, Func="IsNotUAWidget"]
80 Element createElement(DOMString localName, optional (ElementCreationOptions or DOMString) options = {});
81 [CEReactions, NewObject, Throws, Func="IsNotUAWidget"]
82 Element createElementNS(DOMString? namespace, DOMString qualifiedName, optional (ElementCreationOptions or DOMString) options = {});
84 DocumentFragment createDocumentFragment();
85 [NewObject, Func="IsNotUAWidget"]
86 Text createTextNode(DOMString data);
87 [NewObject, Func="IsNotUAWidget"]
88 Comment createComment(DOMString data);
90 ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data);
92 [CEReactions, Throws, Func="IsNotUAWidget"]
93 Node importNode(Node node, optional boolean deep = false);
94 [CEReactions, Throws, Func="IsNotUAWidget"]
95 Node adoptNode(Node node);
97 [NewObject, Throws, NeedsCallerType]
98 Event createEvent(DOMString interface);
103 // NodeFilter.SHOW_ALL = 0xFFFFFFFF
105 NodeIterator createNodeIterator(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
107 TreeWalker createTreeWalker(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
110 // No support for prepend/append yet
111 // undefined prepend((Node or DOMString)... nodes);
112 // undefined append((Node or DOMString)... nodes);
114 // These are not in the spec, but leave them for now for backwards compat.
115 // So sort of like Gecko extensions
117 CDATASection createCDATASection(DOMString data);
119 Attr createAttribute(DOMString name);
121 Attr createAttributeNS(DOMString? namespace, DOMString name);
124 // https://html.spec.whatwg.org/multipage/dom.html#the-document-object
125 partial interface Document {
126 [PutForwards=href, LegacyUnforgeable] readonly attribute Location? location;
127 [SetterThrows] attribute DOMString domain;
128 readonly attribute DOMString referrer;
129 [Throws] attribute DOMString cookie;
130 readonly attribute DOMString lastModified;
131 readonly attribute DOMString readyState;
133 // DOM tree accessors
134 //(Not proxy yet)getter object (DOMString name);
135 [CEReactions, SetterThrows, Pure]
136 attribute DOMString title;
138 attribute DOMString dir;
139 [CEReactions, Pure, SetterThrows]
140 attribute HTMLElement? body;
142 readonly attribute HTMLHeadElement? head;
143 [SameObject] readonly attribute HTMLCollection images;
144 [SameObject] readonly attribute HTMLCollection embeds;
145 [SameObject] readonly attribute HTMLCollection plugins;
146 [SameObject] readonly attribute HTMLCollection links;
147 [SameObject] readonly attribute HTMLCollection forms;
148 [SameObject] readonly attribute HTMLCollection scripts;
150 NodeList getElementsByName(DOMString elementName);
151 //(Not implemented)readonly attribute DOMElementMap cssElementMap;
153 // dynamic markup insertion
154 [CEReactions, Throws]
155 Document open(optional DOMString unused1, optional DOMString unused2); // both arguments are ignored
156 [CEReactions, Throws]
157 WindowProxy? open(USVString url, DOMString name, DOMString features);
158 [CEReactions, Throws]
160 [CEReactions, Throws]
161 undefined write(DOMString... text);
162 [CEReactions, Throws]
163 undefined writeln(DOMString... text);
167 readonly attribute WindowProxy? defaultView;
170 [CEReactions, SetterThrows, SetterNeedsSubjectPrincipal]
171 attribute DOMString designMode;
172 [CEReactions, Throws, NeedsSubjectPrincipal]
173 boolean execCommand(DOMString commandId, optional boolean showUI = false,
174 optional DOMString value = "");
175 [Throws, NeedsSubjectPrincipal]
176 boolean queryCommandEnabled(DOMString commandId);
178 boolean queryCommandIndeterm(DOMString commandId);
180 boolean queryCommandState(DOMString commandId);
181 [Throws, NeedsCallerType]
182 boolean queryCommandSupported(DOMString commandId);
184 DOMString queryCommandValue(DOMString commandId);
185 //(Not implemented)readonly attribute HTMLCollection commands;
187 // special event handler IDL attributes that only apply to Document objects
188 [LegacyLenientThis] attribute EventHandler onreadystatechange;
191 attribute EventHandler onbeforescriptexecute;
192 attribute EventHandler onafterscriptexecute;
195 * True if this document is synthetic : stand alone image, video, audio file,
198 [Func="IsChromeOrUAWidget"] readonly attribute boolean mozSyntheticDocument;
200 * Returns the script element whose script is currently being processed.
202 * @see <https://developer.mozilla.org/en/DOM/document.currentScript>
205 readonly attribute Element? currentScript;
207 * Release the current mouse capture if it is on an element within this
210 * @see <https://developer.mozilla.org/en/DOM/document.releaseCapture>
212 [Deprecated=DocumentReleaseCapture, Pref="dom.mouse_capture.enabled"]
213 undefined releaseCapture();
215 * Use the given DOM element as the source image of target |-moz-element()|.
217 * This function introduces a new special ID (called "image element ID"),
218 * which is only used by |-moz-element()|, and associates it with the given
219 * DOM element. Image elements ID's have the higher precedence than general
220 * HTML id's, so if |document.mozSetImageElement(<id>, <element>)| is called,
221 * |-moz-element(#<id>)| uses |<element>| as the source image even if there
222 * is another element with id attribute = |<id>|. To unregister an image
223 * element ID |<id>|, call |document.mozSetImageElement(<id>, null)|.
227 * canvas = document.createElement("canvas");
228 * canvas.setAttribute("width", 100);
229 * canvas.setAttribute("height", 100);
231 * document.mozSetImageElement("canvasbg", canvas);
233 * <div style="background-image: -moz-element(#canvasbg);"></div>
235 * @param aImageElementId an image element ID to associate with
237 * @param aImageElement a DOM element to be used as the source image of
238 * |-moz-element(#aImageElementId)|. If this is null, the function will
239 * unregister the image element ID |aImageElementId|.
241 * @see <https://developer.mozilla.org/en/DOM/document.mozSetImageElement>
244 undefined mozSetImageElement(DOMString aImageElementId,
245 Element? aImageElement);
248 readonly attribute URI? documentURIObject;
251 * Current referrer policy - one of the referrer policy value from
252 * ReferrerPolicy.webidl.
255 readonly attribute ReferrerPolicy referrerPolicy;
258 * Current referrer info, which holds all referrer related information
259 * including referrer policy and raw referrer of document.
262 readonly attribute nsIReferrerInfo referrerInfo;
266 // https://html.spec.whatwg.org/multipage/obsolete.html#other-elements%2C-attributes-and-apis
267 partial interface Document {
268 [CEReactions] attribute [LegacyNullToEmptyString] DOMString fgColor;
269 [CEReactions] attribute [LegacyNullToEmptyString] DOMString linkColor;
270 [CEReactions] attribute [LegacyNullToEmptyString] DOMString vlinkColor;
271 [CEReactions] attribute [LegacyNullToEmptyString] DOMString alinkColor;
272 [CEReactions] attribute [LegacyNullToEmptyString] DOMString bgColor;
274 [SameObject] readonly attribute HTMLCollection anchors;
275 [SameObject] readonly attribute HTMLCollection applets;
278 // @deprecated These are old Netscape 4 methods. Do not use,
279 // the implementation is no-op.
280 // XXXbz do we actually need these anymore?
281 undefined captureEvents();
282 undefined releaseEvents();
284 [SameObject] readonly attribute HTMLAllCollection all;
287 // https://fullscreen.spec.whatwg.org/#api
288 partial interface Document {
289 // Note: Per spec the 'S' in these two is lowercase, but the "Moz"
290 // versions have it uppercase.
291 [LegacyLenientSetter, Unscopable]
292 readonly attribute boolean fullscreen;
293 [BinaryName="fullscreen"]
294 readonly attribute boolean mozFullScreen;
295 [LegacyLenientSetter, NeedsCallerType]
296 readonly attribute boolean fullscreenEnabled;
297 [BinaryName="fullscreenEnabled", NeedsCallerType]
298 readonly attribute boolean mozFullScreenEnabled;
301 Promise<undefined> exitFullscreen();
302 [NewObject, BinaryName="exitFullscreen"]
303 Promise<undefined> mozCancelFullScreen();
306 attribute EventHandler onfullscreenchange;
307 attribute EventHandler onfullscreenerror;
310 // https://w3c.github.io/pointerlock/#extensions-to-the-document-interface
311 // https://w3c.github.io/pointerlock/#extensions-to-the-documentorshadowroot-mixin
312 partial interface Document {
313 undefined exitPointerLock();
316 attribute EventHandler onpointerlockchange;
317 attribute EventHandler onpointerlockerror;
320 // Mozilla-internal document extensions specific to error pages.
321 partial interface Document {
322 [Func="Document::CallerIsTrustedAboutCertError", NewObject]
323 Promise<any> addCertException(boolean isTemporary);
325 [Func="Document::CallerIsTrustedAboutHttpsOnlyError"]
326 undefined reloadWithHttpsOnlyException();
328 [Func="Document::CallerIsTrustedAboutCertError", Throws]
329 FailedCertSecurityInfo getFailedCertSecurityInfo();
331 [Func="Document::CallerIsTrustedAboutNetError", Throws]
332 NetErrorInfo getNetErrorInfo();
335 // https://w3c.github.io/page-visibility/#extensions-to-the-document-interface
336 partial interface Document {
337 readonly attribute boolean hidden;
338 readonly attribute VisibilityState visibilityState;
339 attribute EventHandler onvisibilitychange;
342 // https://drafts.csswg.org/cssom/#extensions-to-the-document-interface
343 partial interface Document {
344 attribute DOMString? selectedStyleSheetSet;
345 readonly attribute DOMString? lastStyleSheetSet;
346 readonly attribute DOMString? preferredStyleSheetSet;
348 readonly attribute DOMStringList styleSheetSets;
349 undefined enableStyleSheetsForSet (DOMString? name);
352 // https://drafts.csswg.org/cssom-view/#extensions-to-the-document-interface
353 partial interface Document {
354 CaretPosition? caretPositionFromPoint (float x, float y);
356 readonly attribute Element? scrollingElement;
359 // http://dev.w3.org/2006/webapi/selectors-api2/#interface-definitions
360 partial interface Document {
362 Element? querySelector(UTF8String selectors);
364 NodeList querySelectorAll(UTF8String selectors);
366 //(Not implemented)Element? find(DOMString selectors, optional (Element or sequence<Node>)? refNodes);
367 //(Not implemented)NodeList findAll(DOMString selectors, optional (Element or sequence<Node>)? refNodes);
370 // https://drafts.csswg.org/web-animations/#extensions-to-the-document-interface
371 partial interface Document {
372 [Func="Document::AreWebAnimationsTimelinesEnabled"]
373 readonly attribute DocumentTimeline timeline;
376 // https://svgwg.org/svg2-draft/struct.html#InterfaceDocumentExtensions
377 partial interface Document {
378 [BinaryName="SVGRootElement"]
379 readonly attribute SVGSVGElement? rootElement;
382 // Mozilla extensions of various sorts
383 partial interface Document {
384 // Creates a new XUL element regardless of the document's default type.
385 [ChromeOnly, CEReactions, NewObject, Throws]
386 Element createXULElement(DOMString localName, optional (ElementCreationOptions or DOMString) options = {});
387 // Wether the document was loaded using a nsXULPrototypeDocument.
389 readonly attribute boolean loadedFromPrototype;
391 // The principal to use for the storage area of this document
393 readonly attribute Principal effectiveStoragePrincipal;
395 // You should probably not be using this principal getter since it performs
396 // no checks to ensure that the partitioned principal should really be used
397 // here. It is only designed to be used in very specific circumstances, such
398 // as when inheriting the document/storage principal.
400 readonly attribute Principal partitionedPrincipal;
402 // The cookieJarSettings of this document
404 readonly attribute nsICookieJarSettings cookieJarSettings;
407 // XXXbz I can't find the sane spec for this stuff, so just cribbing
408 // from our xpidl for now.
409 [NewObject, Func="nsGenericHTMLElement::LegacyTouchAPIEnabled"]
410 Touch createTouch(optional Window? view = null,
411 optional EventTarget? target = null,
412 optional long identifier = 0,
413 optional long pageX = 0,
414 optional long pageY = 0,
415 optional long screenX = 0,
416 optional long screenY = 0,
417 optional long clientX = 0,
418 optional long clientY = 0,
419 optional long radiusX = 0,
420 optional long radiusY = 0,
421 optional float rotationAngle = 0,
422 optional float force = 0);
423 // XXXbz a hack to get around the fact that we don't support variadics as
424 // distinguishing arguments yet. Once this hack is removed. we can also
425 // remove the corresponding overload on Document, since Touch... and
426 // sequence<Touch> look the same in the C++.
427 [NewObject, Func="nsGenericHTMLElement::LegacyTouchAPIEnabled"]
428 TouchList createTouchList(Touch touch, Touch... touches);
429 // XXXbz and another hack for the fact that we can't usefully have optional
430 // distinguishing arguments but need a working zero-arg form of
431 // createTouchList().
432 [NewObject, Func="nsGenericHTMLElement::LegacyTouchAPIEnabled"]
433 TouchList createTouchList();
434 [NewObject, Func="nsGenericHTMLElement::LegacyTouchAPIEnabled"]
435 TouchList createTouchList(sequence<Touch> touches);
438 attribute boolean styleSheetChangeEventsEnabled;
441 attribute boolean devToolsAnonymousAndShadowEventsEnabled;
443 [ChromeOnly] readonly attribute DOMString contentLanguage;
445 [ChromeOnly] readonly attribute nsILoadGroup? documentLoadGroup;
447 // Blocks the initial document parser until the given promise is settled.
448 [ChromeOnly, NewObject]
449 Promise<any> blockParsing(Promise<any> promise,
450 optional BlockParsingOptions options = {});
452 [Func="nsContentUtils::IsSystemOrPDFJS", BinaryName="blockUnblockOnloadForSystemOrPDFJS"]
453 undefined blockUnblockOnload(boolean block);
455 // like documentURI, except that for error pages, it returns the URI we were
456 // trying to load when we hit an error, rather than the error page's own URI.
457 [ChromeOnly] readonly attribute URI? mozDocumentURIIfNotForErrorPages;
459 // A promise that is resolved when we have both fired DOMContentLoaded and
460 // are ready to start layout.
461 // This is used for the "document_idle" webextension script injection point.
463 readonly attribute Promise<undefined> documentReadyForIdle;
465 // Lazily created command dispatcher, returns null if the document is not
466 // chrome privileged.
468 readonly attribute XULCommandDispatcher? commandDispatcher;
471 attribute boolean devToolsWatchingDOMMutations;
474 * Returns all the shadow roots connected to the document, in no particular
475 * order, and without regard to open/closed-ness. Also returns UA widgets
476 * (like <video> controls), which can be checked using
477 * ShadowRoot.isUAWidget().
480 sequence<ShadowRoot> getConnectedShadowRoots();
483 dictionary BlockParsingOptions {
485 * If true, blocks script-created parsers (created via document.open()) in
486 * addition to network-created parsers.
488 boolean blockScriptCreated = true;
491 // Extension to give chrome JS the ability to determine when a document was
492 // created to satisfy an iframe with srcdoc attribute.
493 partial interface Document {
494 [ChromeOnly] readonly attribute boolean isSrcdocDocument;
498 // Extension to give chrome JS the ability to get the underlying
499 // sandbox flag attribute
500 partial interface Document {
501 [ChromeOnly] readonly attribute DOMString? sandboxFlagsAsString;
506 * Chrome document anonymous content management.
507 * This is a Chrome-only API that allows inserting fixed positioned anonymous
508 * content on top of the current page displayed in the document.
510 partial interface Document {
512 * If aForce is true, tries to update layout to be able to insert the element
515 [ChromeOnly, NewObject, Throws]
516 AnonymousContent insertAnonymousContent(optional boolean aForce = false);
519 * Removes the element inserted into the CanvasFrame given an AnonymousContent
523 undefined removeAnonymousContent(AnonymousContent aContent);
526 // http://w3c.github.io/selection-api/#extensions-to-document-interface
527 partial interface Document {
529 Selection? getSelection();
532 // https://github.com/whatwg/html/issues/3338
533 partial interface Document {
534 [Pref="dom.storage_access.enabled", NewObject]
535 Promise<boolean> hasStorageAccess();
536 [Pref="dom.storage_access.enabled", NewObject]
537 Promise<undefined> requestStorageAccess();
538 // https://github.com/privacycg/storage-access/pull/100
539 [Pref="dom.storage_access.forward_declared.enabled", NewObject]
540 Promise<undefined> requestStorageAccessUnderSite(DOMString serializedSite);
541 [Pref="dom.storage_access.forward_declared.enabled", NewObject]
542 Promise<undefined> completeStorageAccessRequestFromSite(DOMString serializedSite);
545 // A privileged API to give chrome privileged code and the content script of the
546 // webcompat extension the ability to request the storage access for a given
548 partial interface Document {
549 [Func="Document::CallerCanAccessPrivilegeSSA", NewObject]
550 Promise<undefined> requestStorageAccessForOrigin(DOMString thirdPartyOrigin, optional boolean requireUserInteraction = true);
553 // Extension to give chrome JS the ability to determine whether
554 // the user has interacted with the document or not.
555 partial interface Document {
556 [ChromeOnly] readonly attribute boolean userHasInteracted;
559 // Extension to give chrome JS the ability to simulate activate the document
561 partial interface Document {
563 undefined notifyUserGestureActivation();
566 undefined clearUserGestureActivation();
568 readonly attribute boolean hasBeenUserGestureActivated;
570 readonly attribute boolean hasValidTransientUserGestureActivation;
572 readonly attribute DOMHighResTimeStamp lastUserGestureTimeStamp;
574 boolean consumeTransientUserGestureActivation();
577 // Extension to give chrome JS the ability to set an event handler which is
578 // called with certain events that happened while events were suppressed in the
579 // document or one of its subdocuments.
580 partial interface Document {
582 undefined setSuppressedEventListener(EventListener? aListener);
585 // Allows frontend code to query a CSP which needs to be passed for a
586 // new load into docshell. Further, allows to query the CSP in JSON
587 // format for testing purposes.
588 partial interface Document {
589 [ChromeOnly] readonly attribute ContentSecurityPolicy? csp;
590 [ChromeOnly] readonly attribute DOMString cspJSON;
593 partial interface Document {
594 [Func="Document::DocumentSupportsL10n"] readonly attribute DocumentL10n? l10n;
595 [Func="Document::DocumentSupportsL10n"] readonly attribute boolean hasPendingL10nMutations;
598 Document includes XPathEvaluatorMixin;
599 Document includes GlobalEventHandlers;
600 Document includes TouchEventHandlers;
601 Document includes ParentNode;
602 Document includes OnErrorEventHandlerForNodes;
603 Document includes GeometryUtils;
604 Document includes FontFaceSource;
605 Document includes DocumentOrShadowRoot;
607 // https://w3c.github.io/webappsec-feature-policy/#idl-index
608 partial interface Document {
609 [SameObject, Pref="dom.security.featurePolicy.webidl.enabled"]
610 readonly attribute FeaturePolicy featurePolicy;
613 // Extension to give chrome JS the ability to specify a non-default keypress
615 partial interface Document {
617 * setKeyPressEventModel() is called when we need to check whether the web
618 * app requires specific keypress event model or not.
620 * @param aKeyPressEventModel Proper keypress event model for the web app.
621 * KEYPRESS_EVENT_MODEL_DEFAULT:
622 * Use default keypress event model. I.e., depending on
623 * "dom.keyboardevent.keypress.set_keycode_and_charcode_to_same_value"
625 * KEYPRESS_EVENT_MODEL_SPLIT:
626 * Use split model. I.e, if keypress event inputs a character,
627 * keyCode should be 0. Otherwise, charCode should be 0.
628 * KEYPRESS_EVENT_MODEL_CONFLATED:
629 * Use conflated model. I.e., keyCode and charCode values of each
630 * keypress event should be set to same value.
633 const unsigned short KEYPRESS_EVENT_MODEL_DEFAULT = 0;
635 const unsigned short KEYPRESS_EVENT_MODEL_SPLIT = 1;
637 const unsigned short KEYPRESS_EVENT_MODEL_CONFLATED = 2;
639 undefined setKeyPressEventModel(unsigned short aKeyPressEventModel);
642 // Extensions to return information about about the nodes blocked by the
643 // Safebrowsing API inside a document.
644 partial interface Document {
646 * Number of nodes that have been blocked by the Safebrowsing API to prevent
647 * tracking, cryptomining and so on. This method is for testing only.
650 readonly attribute long blockedNodeByClassifierCount;
653 * List of nodes that have been blocked by the Safebrowsing API to prevent
654 * tracking, fingerprinting, cryptomining and so on. This method is for
658 readonly attribute NodeList blockedNodesByClassifier;
661 // Extension to programmatically simulate a user interaction on a document,
663 partial interface Document {
664 [ChromeOnly, BinaryName="setUserHasInteracted"]
665 undefined userInteractionForTesting();
668 // Extension for permission delegation.
669 partial interface Document {
671 readonly attribute nsIPermissionDelegateHandler permDelegateHandler;
674 // Extension used by the password manager to infer form submissions.
675 partial interface Document {
677 * Set whether the document notifies an event when a fetch or
678 * XHR completes successfully.
681 undefined setNotifyFetchSuccess(boolean aShouldNotify);
684 * Set whether a form and a password field notify an event when it is
685 * removed from the DOM tree.
688 undefined setNotifyFormOrPasswordRemoved(boolean aShouldNotify);
691 // Extension to allow chrome code to detect initial about:blank documents.
692 partial interface Document {
694 readonly attribute boolean isInitialDocument;
697 // Extension to allow chrome code to get some wireframe-like structure.
698 enum WireframeRectType {
704 dictionary WireframeTaggedRect {
705 unrestricted double x = 0;
706 unrestricted double y = 0;
707 unrestricted double width = 0;
708 unrestricted double height = 0;
709 unsigned long color = 0; // in nscolor format
710 WireframeRectType type;
714 dictionary Wireframe {
715 unsigned long canvasBackground = 0; // in nscolor format
716 sequence<WireframeTaggedRect> rects;
717 unsigned long version = 1; // Increment when the wireframe structure changes in backwards-incompatible ways
719 partial interface Document {
721 Wireframe? getWireframe(optional boolean aIncludeNodes = false);
724 partial interface Document {
725 // Returns true if the document is the current active document in a browsing
726 // context which isn't in bfcache.