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;
typedef (HTMLScriptElement or SVGScriptElement) HTMLOrSVGScriptElement;
[
CustomToJSObject,
CustomHeapSnapshot,
DOMJIT,
ExportMacro=WEBCORE_EXPORT,
JSCustomHeader,
JSCustomMarkFunction,
JSGenerateToNativeObject,
Exposed=Window
] interface Document : Node {
[CallWith=Document] constructor();
[SameObject] readonly attribute DOMImplementation implementation;
[ImplementedAs=urlForBindings] readonly attribute USVString URL;
[ImplementedAs=urlForBindings] readonly attribute USVString documentURI;
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);
readonly attribute DOMString? xmlEncoding;
attribute DOMString? xmlVersion;
attribute boolean xmlStandalone;
CSSStyleDeclaration? getOverrideStyle(optional Element? element = null, optional DOMString pseudoElement = "undefined");
Range caretRangeFromPoint(optional long x = 0, optional long y = 0);
RenderingContext? getCSSCanvasContext(DOMString contextId, DOMString name, long width, long height);
};
enum DocumentReadyState { "loading", "interactive", "complete" };
Document includes ParentNode;
Document includes NonElementParentNode;
Document includes DocumentOrShadowRoot;
Document includes GlobalEventHandlers;
Document includes DocumentAndElementEventHandlers;
Document includes FontFaceSource;
Document includes XPathEvaluatorBase;