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
16 * https://wicg.github.io/scroll-to-text-fragment/#feature-detectability
19 interface ContentSecurityPolicy;
21 interface WindowProxy;
22 interface nsISupports;
24 interface nsIDocShell;
25 interface nsILoadGroup;
26 interface nsIReferrerInfo;
27 interface nsICookieJarSettings;
28 interface nsIPermissionDelegateHandler;
29 interface XULCommandDispatcher;
31 enum VisibilityState { "hidden", "visible" };
33 /* https://dom.spec.whatwg.org/#dictdef-elementcreationoptions */
34 dictionary ElementCreationOptions {
41 /* https://dom.spec.whatwg.org/#interface-document */
43 interface Document : Node {
48 readonly attribute DOMImplementation implementation;
49 [Pure, Throws, BinaryName="documentURIFromJS", NeedsCallerType]
50 readonly attribute DOMString URL;
51 [Pure, Throws, BinaryName="documentURIFromJS", NeedsCallerType]
52 readonly attribute DOMString documentURI;
54 readonly attribute DOMString compatMode;
56 readonly attribute DOMString characterSet;
57 [Pure,BinaryName="characterSet"]
58 readonly attribute DOMString charset; // legacy alias of .characterSet
59 [Pure,BinaryName="characterSet"]
60 readonly attribute DOMString inputEncoding; // legacy alias of .characterSet
62 readonly attribute DOMString contentType;
65 readonly attribute DocumentType? doctype;
67 readonly attribute Element? documentElement;
69 HTMLCollection getElementsByTagName(DOMString localName);
71 HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
73 HTMLCollection getElementsByClassName(DOMString classNames);
75 // These DOM methods cannot be accessed by UA Widget scripts
76 // because the DOM element reflectors will be in the content scope,
77 // instead of the desired UA Widget scope.
78 [CEReactions, NewObject, Throws, Func="IsNotUAWidget"]
79 Element createElement(DOMString localName, optional (ElementCreationOptions or DOMString) options = {});
80 [CEReactions, NewObject, Throws, Func="IsNotUAWidget"]
81 Element createElementNS(DOMString? namespace, DOMString qualifiedName, optional (ElementCreationOptions or DOMString) options = {});
83 DocumentFragment createDocumentFragment();
84 [NewObject, Func="IsNotUAWidget"]
85 Text createTextNode(DOMString data);
86 [NewObject, Func="IsNotUAWidget"]
87 Comment createComment(DOMString data);
89 ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data);
91 [CEReactions, Throws, Func="IsNotUAWidget"]
92 Node importNode(Node node, optional boolean deep = false);
93 [CEReactions, Throws, Func="IsNotUAWidget"]
94 Node adoptNode(Node node);
96 [NewObject, Throws, NeedsCallerType]
97 Event createEvent(DOMString interface);
102 // NodeFilter.SHOW_ALL = 0xFFFFFFFF
104 NodeIterator createNodeIterator(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
106 TreeWalker createTreeWalker(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
109 // No support for prepend/append yet
110 // undefined prepend((Node or DOMString)... nodes);
111 // undefined append((Node or DOMString)... nodes);
113 // These are not in the spec, but leave them for now for backwards compat.
114 // So sort of like Gecko extensions
116 CDATASection createCDATASection(DOMString data);
118 Attr createAttribute(DOMString name);
120 Attr createAttributeNS(DOMString? namespace, DOMString name);
123 // https://html.spec.whatwg.org/multipage/dom.html#the-document-object
124 partial interface Document {
125 [Pref="dom.webcomponents.shadowdom.declarative.enabled", Throws]
126 static Document parseHTMLUnsafe((TrustedHTML or DOMString) html);
128 [PutForwards=href, LegacyUnforgeable] readonly attribute Location? location;
129 [SetterThrows] attribute DOMString domain;
130 readonly attribute UTF8String referrer;
131 [Throws] attribute DOMString cookie;
132 readonly attribute DOMString lastModified;
133 readonly attribute DOMString readyState;
135 // DOM tree accessors
136 //(Not proxy yet)getter object (DOMString name);
137 [CEReactions, SetterThrows, Pure]
138 attribute DOMString title;
140 attribute DOMString dir;
141 [CEReactions, Pure, SetterThrows]
142 attribute HTMLElement? body;
144 readonly attribute HTMLHeadElement? head;
145 [SameObject] readonly attribute HTMLCollection images;
146 [SameObject] readonly attribute HTMLCollection embeds;
147 [SameObject] readonly attribute HTMLCollection plugins;
148 [SameObject] readonly attribute HTMLCollection links;
149 [SameObject] readonly attribute HTMLCollection forms;
150 [SameObject] readonly attribute HTMLCollection scripts;
152 NodeList getElementsByName(DOMString elementName);
153 //(Not implemented)readonly attribute DOMElementMap cssElementMap;
155 // dynamic markup insertion
156 [CEReactions, Throws]
157 Document open(optional DOMString unused1, optional DOMString unused2); // both arguments are ignored
158 [CEReactions, Throws]
159 WindowProxy? open(UTF8String url, DOMString name, DOMString features);
160 [CEReactions, Throws]
162 [CEReactions, Throws]
163 undefined write((TrustedHTML or DOMString)... text);
164 [CEReactions, Throws]
165 undefined writeln((TrustedHTML or DOMString)... text);
169 readonly attribute WindowProxy? defaultView;
172 [CEReactions, SetterThrows, SetterNeedsSubjectPrincipal]
173 attribute DOMString designMode;
174 [CEReactions, Throws, NeedsSubjectPrincipal]
175 boolean execCommand(DOMString commandId, optional boolean showUI = false,
176 optional (TrustedHTML or DOMString) value = "");
177 [Throws, NeedsSubjectPrincipal]
178 boolean queryCommandEnabled(DOMString commandId);
180 boolean queryCommandIndeterm(DOMString commandId);
182 boolean queryCommandState(DOMString commandId);
183 [Throws, NeedsCallerType]
184 boolean queryCommandSupported(DOMString commandId);
186 DOMString queryCommandValue(DOMString commandId);
187 //(Not implemented)readonly attribute HTMLCollection commands;
189 // special event handler IDL attributes that only apply to Document objects
190 [LegacyLenientThis] attribute EventHandler onreadystatechange;
193 attribute EventHandler onbeforescriptexecute;
194 attribute EventHandler onafterscriptexecute;
197 * True if this document is synthetic : stand alone image, video, audio file,
200 [Func="IsChromeOrUAWidget"] readonly attribute boolean mozSyntheticDocument;
202 * Returns the script element whose script is currently being processed.
204 * @see <https://developer.mozilla.org/en/DOM/document.currentScript>
207 readonly attribute Element? currentScript;
209 * Release the current mouse capture if it is on an element within this
212 * @see <https://developer.mozilla.org/en/DOM/document.releaseCapture>
214 [Deprecated=DocumentReleaseCapture, Pref="dom.mouse_capture.enabled"]
215 undefined releaseCapture();
217 * Use the given DOM element as the source image of target |-moz-element()|.
219 * This function introduces a new special ID (called "image element ID"),
220 * which is only used by |-moz-element()|, and associates it with the given
221 * DOM element. Image elements ID's have the higher precedence than general
222 * HTML id's, so if |document.mozSetImageElement(<id>, <element>)| is called,
223 * |-moz-element(#<id>)| uses |<element>| as the source image even if there
224 * is another element with id attribute = |<id>|. To unregister an image
225 * element ID |<id>|, call |document.mozSetImageElement(<id>, null)|.
229 * canvas = document.createElement("canvas");
230 * canvas.setAttribute("width", 100);
231 * canvas.setAttribute("height", 100);
233 * document.mozSetImageElement("canvasbg", canvas);
235 * <div style="background-image: -moz-element(#canvasbg);"></div>
237 * @param aImageElementId an image element ID to associate with
239 * @param aImageElement a DOM element to be used as the source image of
240 * |-moz-element(#aImageElementId)|. If this is null, the function will
241 * unregister the image element ID |aImageElementId|.
243 * @see <https://developer.mozilla.org/en/DOM/document.mozSetImageElement>
246 undefined mozSetImageElement(DOMString aImageElementId,
247 Element? aImageElement);
250 readonly attribute URI? documentURIObject;
253 * Current referrer policy - one of the referrer policy value from
254 * ReferrerPolicy.webidl.
257 readonly attribute ReferrerPolicy referrerPolicy;
260 * Current referrer info, which holds all referrer related information
261 * including referrer policy and raw referrer of document.
264 readonly attribute nsIReferrerInfo referrerInfo;
268 // https://html.spec.whatwg.org/multipage/obsolete.html#other-elements%2C-attributes-and-apis
269 partial interface Document {
270 [CEReactions] attribute [LegacyNullToEmptyString] DOMString fgColor;
271 [CEReactions] attribute [LegacyNullToEmptyString] DOMString linkColor;
272 [CEReactions] attribute [LegacyNullToEmptyString] DOMString vlinkColor;
273 [CEReactions] attribute [LegacyNullToEmptyString] DOMString alinkColor;
274 [CEReactions] attribute [LegacyNullToEmptyString] DOMString bgColor;
276 [SameObject] readonly attribute HTMLCollection anchors;
277 [SameObject] readonly attribute HTMLCollection applets;
280 // @deprecated These are old Netscape 4 methods. Do not use,
281 // the implementation is no-op.
282 // XXXbz do we actually need these anymore?
283 undefined captureEvents();
284 undefined releaseEvents();
286 [SameObject] readonly attribute HTMLAllCollection all;
289 // https://fullscreen.spec.whatwg.org/#api
290 partial interface Document {
291 // Note: Per spec the 'S' in these two is lowercase, but the "Moz"
292 // versions have it uppercase.
293 [LegacyLenientSetter, Unscopable]
294 readonly attribute boolean fullscreen;
295 [BinaryName="fullscreen"]
296 readonly attribute boolean mozFullScreen;
297 [LegacyLenientSetter, NeedsCallerType]
298 readonly attribute boolean fullscreenEnabled;
299 [BinaryName="fullscreenEnabled", NeedsCallerType]
300 readonly attribute boolean mozFullScreenEnabled;
303 Promise<undefined> exitFullscreen();
304 [NewObject, BinaryName="exitFullscreen"]
305 Promise<undefined> mozCancelFullScreen();
308 attribute EventHandler onfullscreenchange;
309 attribute EventHandler onfullscreenerror;
312 // https://w3c.github.io/pointerlock/#extensions-to-the-document-interface
313 // https://w3c.github.io/pointerlock/#extensions-to-the-documentorshadowroot-mixin
314 partial interface Document {
315 undefined exitPointerLock();
318 attribute EventHandler onpointerlockchange;
319 attribute EventHandler onpointerlockerror;
322 // Mozilla-internal document extensions specific to error pages.
323 partial interface Document {
324 [Func="Document::CallerIsTrustedAboutCertError", NewObject]
325 Promise<any> addCertException(boolean isTemporary);
327 [Func="Document::CallerIsTrustedAboutHttpsOnlyError"]
328 undefined reloadWithHttpsOnlyException();
330 [Func="Document::CallerIsTrustedAboutCertError", Throws]
331 FailedCertSecurityInfo getFailedCertSecurityInfo();
333 [Func="Document::CallerIsTrustedAboutNetError", Throws]
334 NetErrorInfo getNetErrorInfo();
337 // https://w3c.github.io/page-visibility/#extensions-to-the-document-interface
338 partial interface Document {
339 readonly attribute boolean hidden;
340 readonly attribute VisibilityState visibilityState;
341 attribute EventHandler onvisibilitychange;
344 // https://drafts.csswg.org/cssom/#extensions-to-the-document-interface
345 partial interface Document {
346 attribute DOMString? selectedStyleSheetSet;
347 readonly attribute DOMString? lastStyleSheetSet;
348 readonly attribute DOMString? preferredStyleSheetSet;
350 readonly attribute DOMStringList styleSheetSets;
351 undefined enableStyleSheetsForSet (DOMString? name);
354 dictionary CaretPositionFromPointOptions {
355 [Pref="dom.shadowdom.new_caretPositionFromPoint_behavior.enabled"]
356 sequence<ShadowRoot> shadowRoots = [];
359 // https://drafts.csswg.org/cssom-view/#extensions-to-the-document-interface
360 partial interface Document {
361 CaretPosition? caretPositionFromPoint(float x, float y, optional CaretPositionFromPointOptions options = {});
363 readonly attribute Element? scrollingElement;
366 // https://drafts.csswg.org/web-animations/#extensions-to-the-document-interface
367 partial interface Document {
368 readonly attribute DocumentTimeline timeline;
371 // https://svgwg.org/svg2-draft/struct.html#InterfaceDocumentExtensions
372 partial interface Document {
373 [BinaryName="SVGRootElement"]
374 readonly attribute SVGSVGElement? rootElement;
377 // Mozilla extensions of various sorts
378 partial interface Document {
379 // Creates a new XUL element regardless of the document's default type.
380 [ChromeOnly, CEReactions, NewObject, Throws]
381 Element createXULElement(DOMString localName, optional (ElementCreationOptions or DOMString) options = {});
382 // Wether the document was loaded using a nsXULPrototypeDocument.
384 readonly attribute boolean loadedFromPrototype;
386 // The principal to use for the storage area of this document
388 readonly attribute Principal effectiveStoragePrincipal;
390 // You should probably not be using this principal getter since it performs
391 // no checks to ensure that the partitioned principal should really be used
392 // here. It is only designed to be used in very specific circumstances, such
393 // as when inheriting the document/storage principal.
395 readonly attribute Principal partitionedPrincipal;
397 // The cookieJarSettings of this document
399 readonly attribute nsICookieJarSettings cookieJarSettings;
402 // XXXbz I can't find the sane spec for this stuff, so just cribbing
403 // from our xpidl for now.
404 [NewObject, Func="nsGenericHTMLElement::LegacyTouchAPIEnabled"]
405 Touch createTouch(optional Window? view = null,
406 optional EventTarget? target = null,
407 optional long identifier = 0,
408 optional long pageX = 0,
409 optional long pageY = 0,
410 optional long screenX = 0,
411 optional long screenY = 0,
412 optional long clientX = 0,
413 optional long clientY = 0,
414 optional long radiusX = 0,
415 optional long radiusY = 0,
416 optional float rotationAngle = 0,
417 optional float force = 0);
418 // XXXbz a hack to get around the fact that we don't support variadics as
419 // distinguishing arguments yet. Once this hack is removed. we can also
420 // remove the corresponding overload on Document, since Touch... and
421 // sequence<Touch> look the same in the C++.
422 [NewObject, Func="nsGenericHTMLElement::LegacyTouchAPIEnabled"]
423 TouchList createTouchList(Touch touch, Touch... touches);
424 // XXXbz and another hack for the fact that we can't usefully have optional
425 // distinguishing arguments but need a working zero-arg form of
426 // createTouchList().
427 [NewObject, Func="nsGenericHTMLElement::LegacyTouchAPIEnabled"]
428 TouchList createTouchList();
429 [NewObject, Func="nsGenericHTMLElement::LegacyTouchAPIEnabled"]
430 TouchList createTouchList(sequence<Touch> touches);
433 attribute boolean styleSheetChangeEventsEnabled;
436 attribute boolean devToolsAnonymousAndShadowEventsEnabled;
438 [ChromeOnly, BinaryName="contentLanguageForBindings"] readonly attribute DOMString contentLanguage;
440 [ChromeOnly] readonly attribute nsILoadGroup? documentLoadGroup;
442 // Blocks the initial document parser until the given promise is settled.
443 [ChromeOnly, NewObject]
444 Promise<any> blockParsing(Promise<any> promise,
445 optional BlockParsingOptions options = {});
447 [Func="nsContentUtils::IsSystemOrPDFJS", BinaryName="blockUnblockOnloadForSystemOrPDFJS"]
448 undefined blockUnblockOnload(boolean block);
450 // like documentURI, except that for error pages, it returns the URI we were
451 // trying to load when we hit an error, rather than the error page's own URI.
452 [ChromeOnly] readonly attribute URI? mozDocumentURIIfNotForErrorPages;
454 // A promise that is resolved when we have both fired DOMContentLoaded and
455 // are ready to start layout.
456 // This is used for the "document_idle" webextension script injection point.
458 readonly attribute Promise<undefined> documentReadyForIdle;
460 // Lazily created command dispatcher, returns null if the document is not
461 // chrome privileged.
463 readonly attribute XULCommandDispatcher? commandDispatcher;
466 attribute boolean devToolsWatchingDOMMutations;
469 * Returns all the shadow roots connected to the document, in no particular
470 * order, and without regard to open/closed-ness. Also returns UA widgets
471 * (like <video> controls), which can be checked using
472 * ShadowRoot.isUAWidget().
475 sequence<ShadowRoot> getConnectedShadowRoots();
478 * By default, we don't send resizes to inactive top browsers.
479 * Some callers (as of this writing the window sizing code and puppeteer)
480 * need to trigger these resizes.
482 * @param aIncludeInactive whether to include background tabs.
485 undefined synchronouslyUpdateRemoteBrowserDimensions(optional boolean aIncludeInactive = false);
488 dictionary BlockParsingOptions {
490 * If true, blocks script-created parsers (created via document.open()) in
491 * addition to network-created parsers.
493 boolean blockScriptCreated = true;
496 // Extension to give chrome JS the ability to determine when a document was
497 // created to satisfy an iframe with srcdoc attribute.
498 partial interface Document {
499 [ChromeOnly] readonly attribute boolean isSrcdocDocument;
503 // Extension to give chrome JS the ability to get the underlying
504 // sandbox flag attribute
505 partial interface Document {
506 [ChromeOnly] readonly attribute DOMString? sandboxFlagsAsString;
511 * Chrome document anonymous content management.
512 * This is a Chrome-only API that allows inserting fixed positioned anonymous
513 * content on top of the current page displayed in the document.
515 partial interface Document {
517 * If aForce is true, tries to update layout to be able to insert the element
520 [ChromeOnly, NewObject, Throws]
521 AnonymousContent insertAnonymousContent(optional boolean aForce = false);
524 * Removes the element inserted into the CanvasFrame given an AnonymousContent
528 undefined removeAnonymousContent(AnonymousContent aContent);
531 // http://w3c.github.io/selection-api/#extensions-to-document-interface
532 partial interface Document {
534 Selection? getSelection();
537 // https://github.com/whatwg/html/issues/3338
538 partial interface Document {
539 [Pref="dom.storage_access.enabled", NewObject]
540 Promise<boolean> hasStorageAccess();
541 [Pref="dom.storage_access.enabled", NewObject]
542 Promise<undefined> requestStorageAccess();
543 // https://github.com/privacycg/storage-access/pull/100
544 [Pref="dom.storage_access.forward_declared.enabled", NewObject]
545 Promise<undefined> requestStorageAccessUnderSite(DOMString serializedSite);
546 [Pref="dom.storage_access.forward_declared.enabled", NewObject]
547 Promise<undefined> completeStorageAccessRequestFromSite(DOMString serializedSite);
550 // A privileged API to give chrome privileged code and the content script of the
551 // webcompat extension the ability to request the storage access for a given
553 partial interface Document {
554 [Func="Document::CallerCanAccessPrivilegeSSA", NewObject]
555 Promise<undefined> requestStorageAccessForOrigin(DOMString thirdPartyOrigin, optional boolean requireUserInteraction = true);
558 // Extension to give chrome JS the ability to determine whether
559 // the user has interacted with the document or not.
560 partial interface Document {
561 [ChromeOnly] readonly attribute boolean userHasInteracted;
564 // Extension to give chrome JS the ability to simulate activate the document
566 partial interface Document {
568 undefined notifyUserGestureActivation();
571 undefined clearUserGestureActivation();
573 readonly attribute boolean hasBeenUserGestureActivated;
575 readonly attribute boolean hasValidTransientUserGestureActivation;
577 readonly attribute DOMHighResTimeStamp lastUserGestureTimeStamp;
579 boolean consumeTransientUserGestureActivation();
582 // Extension to give chrome JS the ability to set an event handler which is
583 // called with certain events that happened while events were suppressed in the
584 // document or one of its subdocuments.
585 partial interface Document {
587 undefined setSuppressedEventListener(EventListener? aListener);
590 // Allows frontend code to query a CSP which needs to be passed for a
591 // new load into docshell. Further, allows to query the CSP in JSON
592 // format for testing purposes.
593 partial interface Document {
594 [ChromeOnly] readonly attribute ContentSecurityPolicy? csp;
595 [ChromeOnly] readonly attribute DOMString cspJSON;
598 partial interface Document {
599 [Func="Document::DocumentSupportsL10n"] readonly attribute DocumentL10n? l10n;
600 [Func="Document::DocumentSupportsL10n"] readonly attribute boolean hasPendingL10nMutations;
603 Document includes XPathEvaluatorMixin;
604 Document includes GlobalEventHandlers;
605 Document includes TouchEventHandlers;
606 Document includes ParentNode;
607 Document includes OnErrorEventHandlerForNodes;
608 Document includes GeometryUtils;
609 Document includes FontFaceSource;
610 Document includes DocumentOrShadowRoot;
612 // https://w3c.github.io/webappsec-feature-policy/#idl-index
613 partial interface Document {
614 [SameObject, Pref="dom.security.featurePolicy.webidl.enabled"]
615 readonly attribute FeaturePolicy featurePolicy;
618 // Extension to give chrome JS the ability to specify a non-default keypress
620 partial interface Document {
622 * setKeyPressEventModel() is called when we need to check whether the web
623 * app requires specific keypress event model or not.
625 * @param aKeyPressEventModel Proper keypress event model for the web app.
626 * KEYPRESS_EVENT_MODEL_DEFAULT:
627 * Use default keypress event model. I.e., depending on
628 * "dom.keyboardevent.keypress.set_keycode_and_charcode_to_same_value"
630 * KEYPRESS_EVENT_MODEL_SPLIT:
631 * Use split model. I.e, if keypress event inputs a character,
632 * keyCode should be 0. Otherwise, charCode should be 0.
633 * KEYPRESS_EVENT_MODEL_CONFLATED:
634 * Use conflated model. I.e., keyCode and charCode values of each
635 * keypress event should be set to same value.
638 const unsigned short KEYPRESS_EVENT_MODEL_DEFAULT = 0;
640 const unsigned short KEYPRESS_EVENT_MODEL_SPLIT = 1;
642 const unsigned short KEYPRESS_EVENT_MODEL_CONFLATED = 2;
644 undefined setKeyPressEventModel(unsigned short aKeyPressEventModel);
647 // Extensions to return information about about the nodes blocked by the
648 // Safebrowsing API inside a document.
649 partial interface Document {
651 * Number of nodes that have been blocked by the Safebrowsing API to prevent
652 * tracking, cryptomining and so on. This method is for testing only.
655 readonly attribute long blockedNodeByClassifierCount;
658 * List of nodes that have been blocked by the Safebrowsing API to prevent
659 * tracking, fingerprinting, cryptomining and so on. This method is for
663 readonly attribute NodeList blockedNodesByClassifier;
666 // Extension to programmatically simulate a user interaction on a document,
668 partial interface Document {
669 [ChromeOnly, BinaryName="setUserHasInteracted"]
670 undefined userInteractionForTesting();
673 // Extension for permission delegation.
674 partial interface Document {
676 readonly attribute nsIPermissionDelegateHandler permDelegateHandler;
679 // Extension used by the password manager to infer form submissions.
680 partial interface Document {
682 * Set whether the document notifies an event when a fetch or
683 * XHR completes successfully.
686 undefined setNotifyFetchSuccess(boolean aShouldNotify);
689 * Set whether a form and a password field notify an event when it is
690 * removed from the DOM tree.
693 undefined setNotifyFormOrPasswordRemoved(boolean aShouldNotify);
696 // Extension to allow chrome code to detect initial about:blank documents.
697 partial interface Document {
699 readonly attribute boolean isInitialDocument;
702 // Extension to allow chrome code to get some wireframe-like structure.
703 enum WireframeRectType {
709 dictionary WireframeTaggedRect {
710 unrestricted double x = 0;
711 unrestricted double y = 0;
712 unrestricted double width = 0;
713 unrestricted double height = 0;
714 unsigned long color = 0; // in nscolor format
715 WireframeRectType type;
719 dictionary Wireframe {
720 unsigned long canvasBackground = 0; // in nscolor format
721 sequence<WireframeTaggedRect> rects;
722 unsigned long version = 1; // Increment when the wireframe structure changes in backwards-incompatible ways
724 partial interface Document {
726 Wireframe? getWireframe(optional boolean aIncludeNodes = false);
729 partial interface Document {
730 // Returns true if the document is the current active document in a browsing
731 // context which isn't in bfcache.
736 Document includes NonElementParentNode;
739 * Extension to add the fragmentDirective property.
740 * https://wicg.github.io/scroll-to-text-fragment/#feature-detectability
742 partial interface Document {
743 [Pref="dom.text_fragments.enabled", SameObject]
744 readonly attribute FragmentDirective fragmentDirective;
747 // https://drafts.csswg.org/css-view-transitions-1/#additions-to-document-api
748 partial interface Document {
749 [Pref="dom.viewTransitions.enabled"]
750 ViewTransition startViewTransition(optional ViewTransitionUpdateCallback updateCallback);
753 // https://github.com/w3c/csswg-drafts/pull/10767 for the name divergence in the spec
754 callback ViewTransitionUpdateCallback = Promise<any> ();