typedef (
#if defined(ENABLE_WEBGL) && ENABLE_WEBGL
WebGLRenderingContext or
#endif
#if defined(ENABLE_WEBGL2) && ENABLE_WEBGL2
WebGL2RenderingContext or
#endif
#if defined(ENABLE_WEBGPU) && ENABLE_WEBGPU
GPUCanvasContext or
#endif
ImageBitmapRenderingContext or
CanvasRenderingContext2D) RenderingContext;
[
Constructor,
ConstructorCallWith=Document,
CustomToJSObject,
CustomHeapSnapshot,
DOMJIT,
ExportMacro=WEBCORE_EXPORT,
JSCustomHeader,
JSCustomMarkFunction,
JSGenerateToNativeObject,
] interface Document : Node {
readonly attribute DOMImplementation implementation; [ImplementedAs=urlForBindings] readonly attribute USVString URL;
[ImplementedAs=urlForBindings] readonly attribute USVString documentURI;
readonly attribute USVString origin;
readonly attribute DOMString compatMode;
[ImplementedAs=characterSetWithUTF8Fallback] readonly attribute DOMString characterSet;
[ImplementedAs=characterSetWithUTF8Fallback] readonly attribute DOMString charset; [ImplementedAs=characterSetWithUTF8Fallback] readonly attribute DOMString inputEncoding; readonly attribute DOMString contentType;
readonly attribute DocumentType? doctype;
[DOMJIT=Getter] readonly attribute Element? documentElement;
HTMLCollection getElementsByTagName(DOMString qualifiedName);
HTMLCollection getElementsByTagNameNS(DOMString? namespaceURI, DOMString localName);
HTMLCollection getElementsByClassName(DOMString classNames);
[NewObject, MayThrowException, ImplementedAs=createElementForBindings] Element createElement(DOMString localName); [NewObject, MayThrowException] Element createElementNS(DOMString? namespaceURI, DOMString qualifiedName); [NewObject] DocumentFragment createDocumentFragment();
[NewObject] Text createTextNode(DOMString data);
[NewObject, MayThrowException] CDATASection createCDATASection(DOMString data);
[NewObject] Comment createComment(DOMString data);
[NewObject, MayThrowException] ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data);
[CEReactions, MayThrowException, NewObject] Node importNode(Node node, optional boolean deep = false);
[CEReactions, MayThrowException] Node adoptNode(Node node);
[NewObject, MayThrowException] Attr createAttribute(DOMString localName);
[NewObject, MayThrowException] Attr createAttributeNS(DOMString? namespaceURI, DOMString qualifiedName);
[MayThrowException, NewObject] Event createEvent(DOMString type);
[NewObject] Range createRange();
[NewObject] NodeIterator createNodeIterator(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
[NewObject] TreeWalker createTreeWalker(Node root, optional unsigned long whatToShow = 0xFFFFFFFF, optional NodeFilter? filter = null);
[PutForwards=href, Unforgeable] readonly attribute Location? location;
attribute USVString domain;
readonly attribute USVString referrer;
attribute USVString cookie;
readonly attribute DOMString lastModified;
readonly attribute DocumentReadyState readyState;
[CEReactions] attribute DOMString title;
[CEReactions] attribute DOMString dir;
[CEReactions, DOMJIT=Getter, ImplementedAs=bodyOrFrameset] attribute HTMLElement? body;
readonly attribute HTMLHeadElement? head;
readonly attribute HTMLCollection images; readonly attribute HTMLCollection embeds; readonly attribute HTMLCollection plugins; readonly attribute HTMLCollection links; readonly attribute HTMLCollection forms; readonly attribute HTMLCollection scripts; NodeList getElementsByName([AtomString] DOMString elementName);
readonly attribute HTMLScriptElement? currentScript;
[CEReactions, CallWith=ResponsibleDocument, ImplementedAs=openForBindings, MayThrowException] Document open(optional DOMString unused1, optional DOMString unused2); [CallWith=ActiveWindow&FirstWindow, ImplementedAs=openForBindings, MayThrowException] WindowProxy open(USVString url, DOMString name, DOMString features);
[CEReactions, ImplementedAs=closeForBindings, MayThrowException] void close();
[CEReactions, CallWith=ResponsibleDocument, MayThrowException] void write(DOMString... text);
[CEReactions, CallWith=ResponsibleDocument, MayThrowException] void writeln(DOMString... text);
[ImplementedAs=windowProxy] readonly attribute WindowProxy? defaultView;
boolean hasFocus();
[CEReactions] attribute DOMString designMode;
[CEReactions] boolean execCommand(DOMString commandId, optional boolean showUI = false, optional DOMString? value = null); boolean queryCommandEnabled(DOMString commandId);
boolean queryCommandIndeterm(DOMString commandId);
boolean queryCommandState(DOMString commandId);
boolean queryCommandSupported(DOMString commandId);
DOMString queryCommandValue(DOMString commandId);
[EnabledAtRuntime=UndoManagerAPI] readonly attribute UndoManager undoManager;
[LenientThis] attribute EventHandler onreadystatechange;
[ImplementedAs=scrollingElementForAPI] readonly attribute Element? scrollingElement;
DOMSelection? getSelection();
[MayThrowException] XPathExpression createExpression(optional DOMString expression = "undefined", optional XPathNSResolver? resolver); XPathNSResolver createNSResolver(Node? nodeResolver);
[MayThrowException] XPathResult evaluate(optional DOMString expression = "undefined", optional Node? contextNode, optional XPathNSResolver? resolver, optional unsigned short type = 0, optional XPathResult? inResult);
[NotEnumerable, Conditional=POINTER_LOCK] attribute EventHandler onpointerlockchange; [NotEnumerable, Conditional=POINTER_LOCK] attribute EventHandler onpointerlockerror; [Conditional=POINTER_LOCK] void exitPointerLock();
readonly attribute FontFaceSet fonts;
readonly attribute boolean hidden;
readonly attribute VisibilityState visibilityState;
attribute EventHandler onvisibilitychange;
readonly attribute DOMString? xmlEncoding;
attribute DOMString? xmlVersion;
attribute boolean xmlStandalone;
CSSStyleDeclaration? getOverrideStyle(optional Element? element = null, optional DOMString pseudoElement = "undefined");
[NotEnumerable] attribute EventHandler onselectstart; [NotEnumerable] attribute EventHandler onselectionchange;
Range caretRangeFromPoint(optional long x = 0, optional long y = 0);
RenderingContext? getCSSCanvasContext(DOMString contextId, DOMString name, long width, long height);
[CEReactions] attribute [TreatNullAs=EmptyString] DOMString fgColor;
[CEReactions, ImplementedAs=linkColorForBindings] attribute [TreatNullAs=EmptyString] DOMString linkColor;
[CEReactions] attribute [TreatNullAs=EmptyString] DOMString vlinkColor;
[CEReactions] attribute [TreatNullAs=EmptyString] DOMString alinkColor;
[CEReactions] attribute [TreatNullAs=EmptyString] DOMString bgColor;
readonly attribute HTMLCollection anchors;
readonly attribute HTMLCollection applets;
void clear();
void captureEvents();
void releaseEvents();
[Replaceable] readonly attribute HTMLAllCollection all;
[EnabledAtRuntime=WebAnimations] readonly attribute DocumentTimeline timeline;
[EnabledAtRuntime=WebAnimations] sequence<WebAnimation> getAnimations();
};
enum DocumentReadyState { "loading", "interactive", "complete" };
Document implements DocumentAndElementEventHandlers;
Document implements ParentNode;
Document implements NonElementParentNode;
Document implements DocumentOrShadowRoot;
Document implements GlobalEventHandlers;