diff options
Diffstat (limited to 'components/script/dom/webidls/Document.webidl')
-rw-r--r-- | components/script/dom/webidls/Document.webidl | 110 |
1 files changed, 59 insertions, 51 deletions
diff --git a/components/script/dom/webidls/Document.webidl b/components/script/dom/webidls/Document.webidl index e3c67851011..d2429e51489 100644 --- a/components/script/dom/webidls/Document.webidl +++ b/components/script/dom/webidls/Document.webidl @@ -1,6 +1,6 @@ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ /* * The origin of this IDL file is: * https://dom.spec.whatwg.org/#interface-document @@ -8,8 +8,9 @@ */ // https://dom.spec.whatwg.org/#interface-document -[Constructor] +[Exposed=Window] interface Document : Node { + [Throws] constructor(); [SameObject] readonly attribute DOMImplementation implementation; [Constant] @@ -32,22 +33,25 @@ interface Document : Node { HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString qualifiedName); HTMLCollection getElementsByClassName(DOMString classNames); - [NewObject, Throws] - Element createElement(DOMString localName); - [NewObject, Throws] - Element createElementNS(DOMString? namespace, DOMString qualifiedName); + [CEReactions, NewObject, Throws] + Element createElement(DOMString localName, optional (DOMString or ElementCreationOptions) options = {}); + [CEReactions, NewObject, Throws] + Element createElementNS(DOMString? namespace, DOMString qualifiedName, + optional (DOMString or ElementCreationOptions) options = {}); [NewObject] DocumentFragment createDocumentFragment(); [NewObject] Text createTextNode(DOMString data); + [NewObject, Throws] + CDATASection createCDATASection(DOMString data); [NewObject] Comment createComment(DOMString data); [NewObject, Throws] ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data); - [NewObject, Throws] + [CEReactions, NewObject, Throws] Node importNode(Node node, optional boolean deep = false); - [Throws] + [CEReactions, Throws] Node adoptNode(Node node); [NewObject, Throws] @@ -70,16 +74,20 @@ interface Document : Node { optional NodeFilter? filter = null); }; -Document implements NonElementParentNode; -Document implements ParentNode; +Document includes NonElementParentNode; +Document includes ParentNode; enum DocumentReadyState { "loading", "interactive", "complete" }; +dictionary ElementCreationOptions { + DOMString is; +}; + // https://html.spec.whatwg.org/multipage/#the-document-object // [OverrideBuiltins] partial /*sealed*/ interface Document { // resource metadata management - [/*PutForwards=href, */Unforgeable] + [PutForwards=href, Unforgeable] readonly attribute Location? location; [SetterThrows] attribute DOMString domain; readonly attribute DOMString referrer; @@ -90,9 +98,11 @@ partial /*sealed*/ interface Document { // DOM tree accessors getter object (DOMString name); + [CEReactions] attribute DOMString title; + // [CEReactions] // attribute DOMString dir; - [SetterThrows] + [CEReactions, SetterThrows] attribute HTMLElement? body; readonly attribute HTMLHeadElement? head; [SameObject] @@ -111,26 +121,28 @@ partial /*sealed*/ interface Document { readonly attribute HTMLScriptElement? currentScript; // dynamic markup insertion - [Throws] - Document open(optional DOMString type = "text/html", optional DOMString replace = ""); - // WindowProxy open(DOMString url, DOMString name, DOMString features, optional boolean replace = false); - [Throws] + [CEReactions, Throws] + Document open(optional DOMString unused1, optional DOMString unused2); + [CEReactions, Throws] + WindowProxy? open(USVString url, DOMString name, DOMString features); + [CEReactions, Throws] void close(); - [Throws] + [CEReactions, Throws] void write(DOMString... text); - [Throws] + [CEReactions, Throws] void writeln(DOMString... text); // user interaction readonly attribute Window?/*Proxy?*/ defaultView; - readonly attribute Element? activeElement; boolean hasFocus(); + // [CEReactions] // attribute DOMString designMode; + // [CEReactions] // boolean execCommand(DOMString commandId, optional boolean showUI = false, optional DOMString value = ""); // boolean queryCommandEnabled(DOMString commandId); // boolean queryCommandIndeterm(DOMString commandId); // boolean queryCommandState(DOMString commandId); - // boolean queryCommandSupported(DOMString commandId); + boolean queryCommandSupported(DOMString commandId); // DOMString queryCommandValue(DOMString commandId); // special event handler IDL attributes that only apply to Document objects @@ -138,26 +150,32 @@ partial /*sealed*/ interface Document { // also has obsolete members }; -Document implements GlobalEventHandlers; -Document implements DocumentAndElementEventHandlers; +Document includes GlobalEventHandlers; +Document includes DocumentAndElementEventHandlers; // https://html.spec.whatwg.org/multipage/#Document-partial partial interface Document { - [TreatNullAs=EmptyString] attribute DOMString fgColor; + [CEReactions] + attribute [TreatNullAs=EmptyString] DOMString fgColor; // https://github.com/servo/servo/issues/8715 - // [TreatNullAs=EmptyString] attribute DOMString linkColor; + // [CEReactions, TreatNullAs=EmptyString] + // attribute DOMString linkColor; // https://github.com/servo/servo/issues/8716 - // [TreatNullAs=EmptyString] attribute DOMString vlinkColor; + // [CEReactions, TreatNullAs=EmptyString] + // attribute DOMString vlinkColor; // https://github.com/servo/servo/issues/8717 - // [TreatNullAs=EmptyString] attribute DOMString alinkColor; + // [CEReactions, TreatNullAs=EmptyString] + // attribute DOMString alinkColor; - [TreatNullAs=EmptyString] attribute DOMString bgColor; + [CEReactions] + attribute [TreatNullAs=EmptyString] DOMString bgColor; [SameObject] readonly attribute HTMLCollection anchors; + [SameObject] readonly attribute HTMLCollection applets; @@ -169,30 +187,6 @@ partial interface Document { // readonly attribute HTMLAllCollection all; }; -// http://w3c.github.io/touch-events/#idl-def-Document -partial interface Document { - Touch createTouch(Window/*Proxy*/ view, - EventTarget target, - long identifier, - double pageX, - double pageY, - double screenX, - double screenY); - - TouchList createTouchList(Touch... touches); -}; - -// https://drafts.csswg.org/cssom-view/#dom-document-elementfrompoint -partial interface Document { - Element? elementFromPoint(double x, double y); - sequence<Element> elementsFromPoint(double x, double y); -}; - -// https://drafts.csswg.org/cssom/#extensions-to-the-document-interface -partial interface Document { - [SameObject] readonly attribute StyleSheetList styleSheets; -}; - // https://fullscreen.spec.whatwg.org/#api partial interface Document { [LenientSetter] readonly attribute boolean fullscreenEnabled; @@ -204,3 +198,17 @@ partial interface Document { attribute EventHandler onfullscreenchange; attribute EventHandler onfullscreenerror; }; + +Document includes DocumentOrShadowRoot; + +// https://w3c.github.io/selection-api/#dom-document +partial interface Document { + Selection? getSelection(); +}; + + +// Servo internal API. +partial interface Document { + [Throws] + ShadowRoot servoGetMediaControls(DOMString id); +}; |