mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Complete Document WebIDL interface
This commit is contained in:
parent
b0ddd8149b
commit
34070b1348
1 changed files with 63 additions and 11 deletions
|
@ -8,16 +8,17 @@
|
||||||
* https://www.whatwg.org/specs/web-apps/current-work/#the-document-object
|
* https://www.whatwg.org/specs/web-apps/current-work/#the-document-object
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* https://dom.spec.whatwg.org/#interface-document */
|
// https://dom.spec.whatwg.org/#interface-document
|
||||||
[Constructor]
|
[Constructor]
|
||||||
interface Document : Node {
|
interface Document : Node {
|
||||||
|
[SameObject]
|
||||||
readonly attribute DOMImplementation implementation;
|
readonly attribute DOMImplementation implementation;
|
||||||
readonly attribute DOMString URL;
|
readonly attribute DOMString URL;
|
||||||
readonly attribute Element? activeElement;
|
readonly attribute Element? activeElement;
|
||||||
readonly attribute DOMString documentURI;
|
readonly attribute DOMString documentURI;
|
||||||
readonly attribute DOMString compatMode;
|
readonly attribute DOMString compatMode;
|
||||||
readonly attribute DOMString characterSet;
|
readonly attribute DOMString characterSet;
|
||||||
readonly attribute DOMString inputEncoding;
|
readonly attribute DOMString inputEncoding; // legacy alias of .characterSet
|
||||||
readonly attribute DOMString contentType;
|
readonly attribute DOMString contentType;
|
||||||
|
|
||||||
readonly attribute DocumentType? doctype;
|
readonly attribute DocumentType? doctype;
|
||||||
|
@ -66,35 +67,86 @@ Document implements ParentNode;
|
||||||
|
|
||||||
enum DocumentReadyState { "loading", "interactive", "complete" };
|
enum DocumentReadyState { "loading", "interactive", "complete" };
|
||||||
|
|
||||||
/* https://www.whatwg.org/specs/web-apps/current-work/#the-document-object */
|
// https://www.whatwg.org/specs/web-apps/current-work/#the-document-object
|
||||||
partial interface Document {
|
// [OverrideBuiltins]
|
||||||
|
partial /*sealed*/ interface Document {
|
||||||
// resource metadata management
|
// resource metadata management
|
||||||
readonly attribute DocumentReadyState readyState;
|
// [PutForwards=href, Unforgeable]
|
||||||
readonly attribute DOMString lastModified;
|
readonly attribute Location/*?*/ location;
|
||||||
readonly attribute Location location;
|
// attribute DOMString domain;
|
||||||
|
// readonly attribute DOMString referrer;
|
||||||
[Throws]
|
[Throws]
|
||||||
attribute DOMString cookie;
|
attribute DOMString cookie;
|
||||||
|
readonly attribute DOMString lastModified;
|
||||||
|
readonly attribute DocumentReadyState readyState;
|
||||||
|
|
||||||
// DOM tree accessors
|
// DOM tree accessors
|
||||||
|
// getter object (DOMString name);
|
||||||
attribute DOMString title;
|
attribute DOMString title;
|
||||||
[SetterThrows]
|
[SetterThrows]
|
||||||
attribute HTMLElement? body;
|
attribute HTMLElement? body;
|
||||||
readonly attribute HTMLHeadElement? head;
|
readonly attribute HTMLHeadElement? head;
|
||||||
|
[SameObject]
|
||||||
readonly attribute HTMLCollection images;
|
readonly attribute HTMLCollection images;
|
||||||
|
[SameObject]
|
||||||
readonly attribute HTMLCollection embeds;
|
readonly attribute HTMLCollection embeds;
|
||||||
|
[SameObject]
|
||||||
readonly attribute HTMLCollection plugins;
|
readonly attribute HTMLCollection plugins;
|
||||||
|
[SameObject]
|
||||||
readonly attribute HTMLCollection links;
|
readonly attribute HTMLCollection links;
|
||||||
|
[SameObject]
|
||||||
readonly attribute HTMLCollection forms;
|
readonly attribute HTMLCollection forms;
|
||||||
|
[SameObject]
|
||||||
readonly attribute HTMLCollection scripts;
|
readonly attribute HTMLCollection scripts;
|
||||||
readonly attribute HTMLCollection anchors;
|
|
||||||
readonly attribute HTMLCollection applets;
|
|
||||||
NodeList getElementsByName(DOMString elementName);
|
NodeList getElementsByName(DOMString elementName);
|
||||||
|
// NodeList getItems(optional DOMString typeNames = ""); // microdata
|
||||||
|
// [SameObject]
|
||||||
|
// readonly attribute DOMElementMap cssElementMap;
|
||||||
readonly attribute HTMLScriptElement? currentScript;
|
readonly attribute HTMLScriptElement? currentScript;
|
||||||
|
|
||||||
|
// dynamic markup insertion
|
||||||
|
// Document open(optional DOMString type = "text/html", optional DOMString replace = "");
|
||||||
|
// WindowProxy open(DOMString url, DOMString name, DOMString features, optional boolean replace = false);
|
||||||
|
// void close();
|
||||||
|
// void write(DOMString... text);
|
||||||
|
// void writeln(DOMString... text);
|
||||||
|
|
||||||
|
// user interaction
|
||||||
|
readonly attribute Window/*Proxy?*/ defaultView;
|
||||||
|
// readonly attribute Element? activeElement;
|
||||||
|
// boolean hasFocus();
|
||||||
|
// attribute DOMString designMode;
|
||||||
|
// 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);
|
||||||
|
// DOMString queryCommandValue(DOMString commandId);
|
||||||
|
// readonly attribute HTMLCollection commands;
|
||||||
|
|
||||||
// special event handler IDL attributes that only apply to Document objects
|
// special event handler IDL attributes that only apply to Document objects
|
||||||
[LenientThis] attribute EventHandler onreadystatechange;
|
[LenientThis] attribute EventHandler onreadystatechange;
|
||||||
|
|
||||||
// user interaction
|
// also has obsolete members
|
||||||
readonly attribute Window defaultView;
|
|
||||||
};
|
};
|
||||||
Document implements GlobalEventHandlers;
|
Document implements GlobalEventHandlers;
|
||||||
|
|
||||||
|
// https://html.spec.whatwg.org/#Document-partial
|
||||||
|
partial interface Document {
|
||||||
|
// [TreatNullAs=EmptyString] attribute DOMString fgColor;
|
||||||
|
// [TreatNullAs=EmptyString] attribute DOMString linkColor;
|
||||||
|
// [TreatNullAs=EmptyString] attribute DOMString vlinkColor;
|
||||||
|
// [TreatNullAs=EmptyString] attribute DOMString alinkColor;
|
||||||
|
// [TreatNullAs=EmptyString] attribute DOMString bgColor;
|
||||||
|
|
||||||
|
[SameObject]
|
||||||
|
readonly attribute HTMLCollection anchors;
|
||||||
|
[SameObject]
|
||||||
|
readonly attribute HTMLCollection applets;
|
||||||
|
|
||||||
|
// void clear();
|
||||||
|
// void captureEvents();
|
||||||
|
// void releaseEvents();
|
||||||
|
|
||||||
|
// readonly attribute HTMLAllCollection all;
|
||||||
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue