Document Class
https://dom.spec.whatwg.org/#interface-document
public class Document : Node, INonElementParentNode, IParentNode- Inheritance
NodeDocument- Implements
Constructors
| Name | Description |
|---|---|
| Document() | https://dom.spec.whatwg.org/#dom-document-document |
Document()
Document.cshttps://dom.spec.whatwg.org/#dom-document-document
public Document()Properties
| Name | Description |
|---|---|
| ActiveElement | https://html.spec.whatwg.org/multipage/interaction.html#dom-documentorshadowroot-activeelement: the focused element, retargeted against the document, or the body element (or the document element) when the viewport is focused. |
| ActiveViewTransition | Gets the active view transition of the document, or null (https://drafts.csswg.org/css-view-transitions-2/#dom-document-activeviewtransition). |
| AdoptedStyleSheets | Gets the list of the constructed style sheets adopted by the document. |
| AlinkColor | https://html.spec.whatwg.org/multipage/obsolete.html#dom-document-alinkcolor |
| All | https://html.spec.whatwg.org/multipage/obsolete.html#dom-document-all |
| Anchors | Gets a live collection of the a elements of the document that have a name attribute. |
| AnimationWorklet | Gets the animation worklet of the document (https://drafts.css-houdini.org/css-animation-worklet-1/#dom-css-animationworklet, CSS.animationWorklet): the scripts added to it register the animators that drive the WorkletAnimation objects of the document. The scripts need a script engine that supports the module scripts. |
| Applets | Gets an always empty collection, as applets are no longer supported. |
| BgColor | https://html.spec.whatwg.org/multipage/obsolete.html#dom-document-bgcolor |
| Body | https://html.spec.whatwg.org/multipage/dom.html#dom-document-body |
| CharacterSet | Gets the name of the character encoding of the document. |
| Charset | Gets the name of the character encoding of the document (alias of characterSet). |
| ChildElementCount | Gets the number of child elements. |
| Children | Gets the live collection of the child elements. |
| CompatMode | Gets BackCompat when the document is in quirks mode, otherwise CSS1Compat. |
| ContentType | Gets the content type (MIME type) of the document. |
| Cookie | https://html.spec.whatwg.org/multipage/dom.html#dom-document-cookie: the cookies of BrowsingContextOptions.CookieJar for the URL of the document, except the HttpOnly cookies (the cookie-string of a "non-HTTP" API, https://httpwg.org/http-extensions/draft-ietf-httpbis-rfc6265bis.html#name-non-http-apis). A document whose site for cookies is opaque (e.g. a cross-site iframe) only reads and writes the SameSite=None cookies. A document without browsing context or cookie jar, or whose URL is not an http(s) URL, is cookie-averse: it has no cookies. |
| CurrentScript | Always null, as scripts are not executed, unless the host executes scripts. |
| CustomElementRegistry | https://dom.spec.whatwg.org/#dom-documentorshadowroot-customelementregistry |
| DefaultView | The window of the browsing context (https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-document-defaultview). It is null unless the document was created in a BrowsingContext. |
| DesignMode | https://html.spec.whatwg.org/multipage/interaction.html#designMode |
| Dir | https://html.spec.whatwg.org/multipage/dom.html#dom-document-dir |
| Doctype | Gets the document type node that is a child of the document, or null when there is none. |
| DocumentElement | Gets the root element of the document, or null when there is none. |
| DocumentUri | Gets the serialized URL of the document (alias of URL). |
| Domain | https://html.spec.whatwg.org/multipage/browsers.html#dom-document-domain: the effective domain of the origin. Setting it relaxes the same-origin restriction: the origin's domain is set to a registrable domain suffix of the effective domain (it does nothing in an origin-keyed agent cluster). |
| Embeds | Gets a live collection of the embed elements of the document. |
| FgColor | https://html.spec.whatwg.org/multipage/obsolete.html#dom-document-fgcolor |
| FirstElementChild | Gets the first child that is an element, or null when there is none. |
| Fonts | The font source of the document (https://drafts.csswg.org/css-font-loading/#font-source). |
| Forms | Gets a live collection of the form elements of the document. |
| FragmentDirective | Gets the fragment directive of the document (https://wicg.github.io/scroll-to-text-fragment/#dom-document-fragmentdirective): an object without members, which tells the scripts that the text directives are supported. The fragment directive of the URL is not exposed. |
| Fullscreen | Gets whether the document has a fullscreen element (https://fullscreen.spec.whatwg.org/#dom-document-fullscreen, historical: use Document.FullscreenElement). |
| FullscreenElement | Gets the fullscreen element of the document (https://fullscreen.spec.whatwg.org/#dom-document-fullscreenelement): the host of the shadow tree of the element when it is in a shadow tree. |
| FullscreenEnabled | Gets whether the document is allowed to display elements fullscreen (https://fullscreen.spec.whatwg.org/#dom-document-fullscreenenabled): its permissions policy allows the fullscreen feature. |
| Head | https://html.spec.whatwg.org/multipage/dom.html#dom-document-head |
| Hidden | https://html.spec.whatwg.org/multipage/interaction.html#dom-document-hidden |
| Highlights | The custom highlights registered for the document (https://drafts.csswg.org/css-highlight-api-1/#highlight-registry), returned by CSS.highlights in the scripts of its window. |
| Images | Gets a live collection of the img elements of the document. |
| Implementation | Gets the DOMImplementation object associated with the document. |
| InputEncoding | Gets the name of the character encoding of the document (alias of characterSet). |
| IsNetworkErrorDocument | Gets whether the document is the error document of a navigation whose response is a network error (e.g. the BrowsingContextOptions.DocumentLoader returned null, or the request was blocked by a policy): an empty document whose origin is opaque. |
| LastElementChild | Gets the last child that is an element, or null when there is none. |
| LastModified | https://html.spec.whatwg.org/multipage/dom.html#dom-document-lastmodified: the date and time of the Last-Modified header of the response of the document, in the local time zone, or the current date and time when it is unknown (measured with BrowsingContextOptions.TimeProvider). |
| LayoutWorklet | Gets the layout worklet of the document (https://drafts.css-houdini.org/css-layout-api-1/#dom-css-layoutworklet, CSS.layoutWorklet): the scripts added to it register the classes that lay out the display: layout() boxes of the document. The scripts need a script engine that supports the module scripts. |
| LinkColor | https://html.spec.whatwg.org/multipage/obsolete.html#dom-document-linkcolor |
| Links | Gets a live collection of the a and area elements of the document that have an href attribute. |
| Location | The location of the window, when the document is fully active (https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-document-location). |
| NodeName | Gets the node name of a document, which is #document. |
| NodeType | Gets the node type of a document, which is 9 (DOCUMENT_NODE). |
| OnAbort | Gets or sets the event handler of the abort event (the onabort event handler attribute). |
| OnAnimationCancel | Gets or sets the event handler of the animationcancel event (the onanimationcancel event handler attribute). |
| OnAnimationEnd | Gets or sets the event handler of the animationend event (the onanimationend event handler attribute). |
| OnAnimationIteration | Gets or sets the event handler of the animationiteration event (the onanimationiteration event handler attribute). |
| OnAnimationStart | Gets or sets the event handler of the animationstart event (the onanimationstart event handler attribute). |
| OnAuxClick | Gets or sets the event handler of the auxclick event (the onauxclick event handler attribute). |
| OnBeforeInput | Gets or sets the event handler of the beforeinput event (the onbeforeinput event handler attribute). |
| OnBeforeMatch | Gets or sets the event handler of the beforematch event (the onbeforematch event handler attribute). |
| OnBeforeToggle | Gets or sets the event handler of the beforetoggle event (the onbeforetoggle event handler attribute). |
| OnBlur | Gets or sets the event handler of the blur event (the onblur event handler attribute). |
| OnCanPlay | Gets or sets the event handler of the canplay event (the oncanplay event handler attribute). |
| OnCanPlayThrough | Gets or sets the event handler of the canplaythrough event (the oncanplaythrough event handler attribute). |
| OnCancel | Gets or sets the event handler of the cancel event (the oncancel event handler attribute). |
| OnChange | Gets or sets the event handler of the change event (the onchange event handler attribute). |
| OnClick | Gets or sets the event handler of the click event (the onclick event handler attribute). |
| OnClose | Gets or sets the event handler of the close event (the onclose event handler attribute). |
| OnCommand | Gets or sets the event handler of the command event (the oncommand event handler attribute). |
| OnContentVisibilityAutoStateChange | Gets or sets the event handler of the contentvisibilityautostatechange event (the oncontentvisibilityautostatechange event handler attribute). |
| OnContextMenu | Gets or sets the event handler of the contextmenu event (the oncontextmenu event handler attribute). |
| OnContextRestored | Gets or sets the event handler of the contextrestored event (the oncontextrestored event handler attribute). |
| OnContextlost | Gets or sets the event handler of the contextlost event (the oncontextlost event handler attribute). |
| OnCopy | Gets or sets the event handler of the copy event (the oncopy event handler attribute). |
| OnCueChange | Gets or sets the event handler of the cuechange event (the oncuechange event handler attribute). |
| OnCut | Gets or sets the event handler of the cut event (the oncut event handler attribute). |
| OnDblClick | Gets or sets the event handler of the dblclick event (the ondblclick event handler attribute). |
| OnDrag | Gets or sets the event handler of the drag event (the ondrag event handler attribute). |
| OnDragEnd | Gets or sets the event handler of the dragend event (the ondragend event handler attribute). |
| OnDragEnter | Gets or sets the event handler of the dragenter event (the ondragenter event handler attribute). |
| OnDragLeave | Gets or sets the event handler of the dragleave event (the ondragleave event handler attribute). |
| OnDragOver | Gets or sets the event handler of the dragover event (the ondragover event handler attribute). |
| OnDragStart | Gets or sets the event handler of the dragstart event (the ondragstart event handler attribute). |
| OnDrop | Gets or sets the event handler of the drop event (the ondrop event handler attribute). |
| OnDurationChange | Gets or sets the event handler of the durationchange event (the ondurationchange event handler attribute). |
| OnEmptied | Gets or sets the event handler of the emptied event (the onemptied event handler attribute). |
| OnEnded | Gets or sets the event handler of the ended event (the onended event handler attribute). |
| OnError | Gets or sets the event handler of the error event (the onerror event handler attribute). |
| OnFocus | Gets or sets the event handler of the focus event (the onfocus event handler attribute). |
| OnFormData | Gets or sets the event handler of the formdata event (the onformdata event handler attribute). |
| OnFreeze | Gets or sets the event handler of the freeze event, fired when the document is frozen. |
| OnFullscreenChange | Gets or sets the event handler of the fullscreenchange event (the onfullscreenchange event handler attribute). |
| OnFullscreenError | Gets or sets the event handler of the fullscreenerror event (the onfullscreenerror event handler attribute). |
| OnGotPointerCapture | Gets or sets the event handler of the gotpointercapture event (the ongotpointercapture event handler attribute). |
| OnInput | Gets or sets the event handler of the input event (the oninput event handler attribute). |
| OnInvalid | Gets or sets the event handler of the invalid event (the oninvalid event handler attribute). |
| OnKeyDown | Gets or sets the event handler of the keydown event (the onkeydown event handler attribute). |
| OnKeyPress | Gets or sets the event handler of the keypress event (the onkeypress event handler attribute). |
| OnKeyUp | Gets or sets the event handler of the keyup event (the onkeyup event handler attribute). |
| OnLoad | Gets or sets the event handler of the load event (the onload event handler attribute). |
| OnLoadStart | Gets or sets the event handler of the loadstart event (the onloadstart event handler attribute). |
| OnLoadedData | Gets or sets the event handler of the loadeddata event (the onloadeddata event handler attribute). |
| OnLoadedMetadata | Gets or sets the event handler of the loadedmetadata event (the onloadedmetadata event handler attribute). |
| OnLostPointerCapture | Gets or sets the event handler of the lostpointercapture event (the onlostpointercapture event handler attribute). |
| OnMouseDown | Gets or sets the event handler of the mousedown event (the onmousedown event handler attribute). |
| OnMouseEnter | Gets or sets the event handler of the mouseenter event (the onmouseenter event handler attribute). |
| OnMouseLeave | Gets or sets the event handler of the mouseleave event (the onmouseleave event handler attribute). |
| OnMouseMove | Gets or sets the event handler of the mousemove event (the onmousemove event handler attribute). |
| OnMouseOut | Gets or sets the event handler of the mouseout event (the onmouseout event handler attribute). |
| OnMouseOver | Gets or sets the event handler of the mouseover event (the onmouseover event handler attribute). |
| OnMouseUp | Gets or sets the event handler of the mouseup event (the onmouseup event handler attribute). |
| OnPaste | Gets or sets the event handler of the paste event (the onpaste event handler attribute). |
| OnPause | Gets or sets the event handler of the pause event (the onpause event handler attribute). |
| OnPlay | Gets or sets the event handler of the play event (the onplay event handler attribute). |
| OnPlaying | Gets or sets the event handler of the playing event (the onplaying event handler attribute). |
| OnPointerCancel | Gets or sets the event handler of the pointercancel event (the onpointercancel event handler attribute). |
| OnPointerDown | Gets or sets the event handler of the pointerdown event (the onpointerdown event handler attribute). |
| OnPointerEnter | Gets or sets the event handler of the pointerenter event (the onpointerenter event handler attribute). |
| OnPointerLeave | Gets or sets the event handler of the pointerleave event (the onpointerleave event handler attribute). |
| OnPointerLockChange | Gets or sets the event handler of the pointerlockchange event (the onpointerlockchange event handler attribute). |
| OnPointerLockError | Gets or sets the event handler of the pointerlockerror event (the onpointerlockerror event handler attribute). |
| OnPointerMove | Gets or sets the event handler of the pointermove event (the onpointermove event handler attribute). |
| OnPointerOut | Gets or sets the event handler of the pointerout event (the onpointerout event handler attribute). |
| OnPointerOver | Gets or sets the event handler of the pointerover event (the onpointerover event handler attribute). |
| OnPointerRawUpdate | Gets or sets the event handler of the pointerrawupdate event (the onpointerrawupdate event handler attribute). |
| OnPointerUp | Gets or sets the event handler of the pointerup event (the onpointerup event handler attribute). |
| OnPrerenderingChange | Gets or sets the event handler of the prerenderingchange event (the onprerenderingchange event handler attribute). |
| OnProgress | Gets or sets the event handler of the progress event (the onprogress event handler attribute). |
| OnRateChange | Gets or sets the event handler of the ratechange event (the onratechange event handler attribute). |
| OnReadyStateChange | Gets or sets the event handler of the readystatechange event (the onreadystatechange event handler attribute). |
| OnReset | Gets or sets the event handler of the reset event (the onreset event handler attribute). |
| OnResize | Gets or sets the event handler of the resize event (the onresize event handler attribute). |
| OnResume | Gets or sets the event handler of the resume event, fired when the document is resumed. |
| OnScroll | Gets or sets the event handler of the scroll event (the onscroll event handler attribute). |
| OnScrollEnd | Gets or sets the event handler of the scrollend event (the onscrollend event handler attribute). |
| OnScrollSnapChange | Gets or sets the event handler of the scrollsnapchange event (the onscrollsnapchange event handler attribute). |
| OnScrollSnapChanging | Gets or sets the event handler of the scrollsnapchanging event (the onscrollsnapchanging event handler attribute). |
| OnSecurityPolicyViolation | Gets or sets the event handler of the securitypolicyviolation event (the onsecuritypolicyviolation event handler attribute). |
| OnSeeked | Gets or sets the event handler of the seeked event (the onseeked event handler attribute). |
| OnSeeking | Gets or sets the event handler of the seeking event (the onseeking event handler attribute). |
| OnSelect | Gets or sets the event handler of the select event (the onselect event handler attribute). |
| OnSelectStart | Gets or sets the event handler of the selectstart event (the onselectstart event handler attribute). |
| OnSelectionChange | Gets or sets the event handler of the selectionchange event (the onselectionchange event handler attribute). |
| OnSlotChange | Gets or sets the event handler of the slotchange event (the onslotchange event handler attribute). |
| OnStalled | Gets or sets the event handler of the stalled event (the onstalled event handler attribute). |
| OnSubmit | Gets or sets the event handler of the submit event (the onsubmit event handler attribute). |
| OnSuspend | Gets or sets the event handler of the suspend event (the onsuspend event handler attribute). |
| OnTimeUpdate | Gets or sets the event handler of the timeupdate event (the ontimeupdate event handler attribute). |
| OnToggle | Gets or sets the event handler of the toggle event (the ontoggle event handler attribute). |
| OnTransitionCancel | Gets or sets the event handler of the transitioncancel event (the ontransitioncancel event handler attribute). |
| OnTransitionEnd | Gets or sets the event handler of the transitionend event (the ontransitionend event handler attribute). |
| OnTransitionRun | Gets or sets the event handler of the transitionrun event (the ontransitionrun event handler attribute). |
| OnTransitionStart | Gets or sets the event handler of the transitionstart event (the ontransitionstart event handler attribute). |
| OnVisibilityChange | Gets or sets the event handler of the visibilitychange event (the onvisibilitychange event handler attribute). |
| OnVolumeChange | Gets or sets the event handler of the volumechange event (the onvolumechange event handler attribute). |
| OnWaiting | Gets or sets the event handler of the waiting event (the onwaiting event handler attribute). |
| OnWebkitAnimationEnd | Gets or sets the event handler of the webkitanimationend event (the onwebkitanimationend event handler attribute). |
| OnWebkitAnimationIteration | Gets or sets the event handler of the webkitanimationiteration event (the onwebkitanimationiteration event handler attribute). |
| OnWebkitAnimationStart | Gets or sets the event handler of the webkitanimationstart event (the onwebkitanimationstart event handler attribute). |
| OnWebkitTransitionEnd | Gets or sets the event handler of the webkittransitionend event (the onwebkittransitionend event handler attribute). |
| OnWheel | Gets or sets the event handler of the wheel event (the onwheel event handler attribute). |
| PaintWorklet | Gets the paint worklet of the document (https://drafts.css-houdini.org/css-paint-api-1/#dom-css-paintworklet, CSS.paintWorklet): the scripts added to it register the classes that paint the paint() images of the document. The scripts need a script engine that supports the module scripts, and the images a rendering backend. |
| PermissionsPolicy | Gets the policy object of the document (https://w3c.github.io/webappsec-permissions-policy/#dom-document-permissionspolicy): the features that its permissions policy allows. |
| Plugins | Gets a live collection of the embed elements of the document (alias of embeds). |
| PointerLockElement | Gets the element the pointer is locked to when it is in the document (https://w3c.github.io/pointerlock/#dom-documentorshadowroot-pointerlockelement): the host of the shadow tree of the element when it is in a shadow tree. Null while a request is pending. |
| Prerendering | Gets whether the document is prerendering: it is in a prerendering traversable, which is not shown, until a navigation activates it (https://wicg.github.io/nav-speculation/prerendering.html#dom-document-prerendering). |
| ReadyState | Documents parsed by this library are fully loaded, so the readiness is "complete" unless the host changes it. |
| Referrer | https://html.spec.whatwg.org/multipage/dom.html#dom-document-referrer: the URL of the document that created or navigated to this document. |
| RootElement | https://svgwg.org/svg2-draft/struct.html#__svg__Document__rootElement |
| Scripts | Gets a live collection of the script elements of the document. |
| ScrollingElement | Gets the element that scrolls the viewport (https://drafts.csswg.org/cssom-view/#dom-document-scrollingelement): the root element, or in quirks mode the body element when it is not potentially scrollable. |
| StyleSheets | Gets the list of the style sheets of the document. |
| TextContent | Gets or sets the text content of the document; the value is always null and setting it has no effect. |
| Timeline | Gets the default document timeline (https://drafts.csswg.org/web-animations-1/#dom-document-timeline). |
| Title | https://html.spec.whatwg.org/multipage/dom.html#document.title |
| TrustedTypes | The trusted type policy factory of the relevant global object of the document (https://w3c.github.io/trusted-types/dist/spec/#dom-windoworworkerglobalscope-trustedtypes): the one of its window (Window.TrustedTypes), or of the window of the document that created it. A document without a window is its own global object. |
| TrustedTypesDirectives | The Trusted Types directives of the content security policies of the document (the CSP list of its policy container), which enforce Trusted Types for the objects whose relevant global object is the window of the document (or the document itself when it has no window). A document loaded in a Document.BrowsingContext gets the directives of the Content-Security-Policy and Content-Security-Policy-Report-Only headers of its response (DocumentResource.Headers) and of its <meta http-equiv="Content-Security-Policy"> elements. Otherwise, it is empty by default: Trusted Types are not enforced. See TrustedTypesDirectives.Parse to get the directives of a Content-Security-Policy header. |
| Url | Gets the serialized URL of the document. |
| VisibilityState | https://html.spec.whatwg.org/multipage/interaction.html#dom-document-visibilitystate: visible for the active document of a browsing context whose top-level browsing context is visible (see BrowsingContext.IsVisible), else hidden. |
| VlinkColor | https://html.spec.whatwg.org/multipage/obsolete.html#dom-document-vlinkcolor |
| WasDiscarded | Gets whether the document was loaded again after the user agent discarded its browsing context to save resources (https://wicg.github.io/page-lifecycle/#dom-document-wasdiscarded, see BrowsingContext.Discard). |
ActiveElement
Focus.cshttps://html.spec.whatwg.org/multipage/interaction.html#dom-documentorshadowroot-activeelement: the focused element, retargeted against the document, or the body element (or the document element) when the viewport is focused.
public Element? ActiveElement { get; }ActiveViewTransition
Document.ViewTransitions.csGets the active view transition of the document, or null (https://drafts.csswg.org/css-view-transitions-2/#dom-document-activeviewtransition).
public ViewTransition? ActiveViewTransition { get; }AdoptedStyleSheets
LinkStyle.csGets the list of the constructed style sheets adopted by the document.
public IList<CssStyleSheet> AdoptedStyleSheets { get; set; }AlinkColor
HandWrittenReflection.cshttps://html.spec.whatwg.org/multipage/obsolete.html#dom-document-alinkcolor
public string AlinkColor { get; set; }Property value
See also
https://html.spec.whatwg.org/multipage/obsolete.html#dom-document-all
public HtmlAllCollection All { get; }Property value
See also
Anchors
Document.Legacy.csGets a live collection of the a elements of the document that have a name attribute.
public HtmlCollection Anchors { get; }Property value
See also
AnimationWorklet
Document.Worklets.csGets the animation worklet of the document (https://drafts.css-houdini.org/css-animation-worklet-1/#dom-css-animationworklet, CSS.animationWorklet): the scripts added to it register the animators that drive the WorkletAnimation objects of the document. The scripts need a script engine that supports the module scripts.
public Worklet AnimationWorklet { get; }Property value
Applets
Document.Legacy.csGets an always empty collection, as applets are no longer supported.
public HtmlCollection Applets { get; }Property value
See also
BgColor
HandWrittenReflection.cshttps://html.spec.whatwg.org/multipage/obsolete.html#dom-document-bgcolor
public string BgColor { get; set; }Property value
See also
Body
Document.Html.cshttps://html.spec.whatwg.org/multipage/dom.html#dom-document-body
public HtmlElement? Body { get; set; }CharacterSet
Document.csGets the name of the character encoding of the document.
public string CharacterSet { get; }Charset
Document.csGets the name of the character encoding of the document (alias of characterSet).
public string Charset { get; }ChildElementCount
Mixins.Members.csGets the number of child elements.
public uint ChildElementCount { get; }Children
Mixins.Members.csGets the live collection of the child elements.
public HtmlCollection Children { get; }CompatMode
Document.csGets BackCompat when the document is in quirks mode, otherwise CSS1Compat.
public string CompatMode { get; }ContentType
Document.csGets the content type (MIME type) of the document.
public string ContentType { get; }Cookie
Document.Legacy.cshttps://html.spec.whatwg.org/multipage/dom.html#dom-document-cookie: the cookies of BrowsingContextOptions.CookieJar for the URL of the document, except the HttpOnly cookies (the cookie-string of a "non-HTTP" API, https://httpwg.org/http-extensions/draft-ietf-httpbis-rfc6265bis.html#name-non-http-apis). A document whose site for cookies is opaque (e.g. a cross-site iframe) only reads and writes the SameSite=None cookies. A document without browsing context or cookie jar, or whose URL is not an http(s) URL, is cookie-averse: it has no cookies.
public string Cookie { get; set; }Property value
Exceptions
DomException- The origin of the document is opaque (e.g. a sandboxed document).
See also
CurrentScript
Document.Html.csAlways null, as scripts are not executed, unless the host executes scripts.
public Element? CurrentScript { get; }Property value
See also
CustomElementRegistry
Document.cshttps://dom.spec.whatwg.org/#dom-documentorshadowroot-customelementregistry
public CustomElementRegistry? CustomElementRegistry { get; }DefaultView
Document.Html.csThe window of the browsing context (https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-document-defaultview). It is null unless the document was created in a BrowsingContext.
public Window? DefaultView { get; }DesignMode
Document.Legacy.cshttps://html.spec.whatwg.org/multipage/interaction.html#designMode
public string DesignMode { get; set; }Property value
See also
https://html.spec.whatwg.org/multipage/dom.html#dom-document-dir
public string Dir { get; set; }Doctype
Document.csGets the document type node that is a child of the document, or null when there is none.
public DocumentType? Doctype { get; }DocumentElement
Document.csGets the root element of the document, or null when there is none.
public Element? DocumentElement { get; }DocumentUri
Document.csGets the serialized URL of the document (alias of URL).
public string DocumentUri { get; }Domain
Document.Legacy.cshttps://html.spec.whatwg.org/multipage/browsers.html#dom-document-domain: the effective domain of the origin. Setting it relaxes the same-origin restriction: the origin's domain is set to a registrable domain suffix of the effective domain (it does nothing in an origin-keyed agent cluster).
public string Domain { get; set; }Property value
See also
Embeds
Document.Legacy.csGets a live collection of the embed elements of the document.
public HtmlCollection Embeds { get; }Property value
See also
FgColor
HandWrittenReflection.cshttps://html.spec.whatwg.org/multipage/obsolete.html#dom-document-fgcolor
public string FgColor { get; set; }Property value
See also
FirstElementChild
Mixins.Members.csGets the first child that is an element, or null when there is none.
public Element? FirstElementChild { get; }Fonts
Document.Fonts.csThe font source of the document (https://drafts.csswg.org/css-font-loading/#font-source).
public FontFaceSet Fonts { get; }Property value
See also
Forms
Document.Legacy.csGets a live collection of the form elements of the document.
public HtmlCollection Forms { get; }Property value
See also
FragmentDirective
Document.TextDirectives.csGets the fragment directive of the document (https://wicg.github.io/scroll-to-text-fragment/#dom-document-fragmentdirective): an object without members, which tells the scripts that the text directives are supported. The fragment directive of the URL is not exposed.
public FragmentDirective FragmentDirective { get; }Fullscreen
Fullscreen.csGets whether the document has a fullscreen element (https://fullscreen.spec.whatwg.org/#dom-document-fullscreen, historical: use Document.FullscreenElement).
public bool Fullscreen { get; }FullscreenElement
Fullscreen.csGets the fullscreen element of the document (https://fullscreen.spec.whatwg.org/#dom-document-fullscreenelement): the host of the shadow tree of the element when it is in a shadow tree.
public Element? FullscreenElement { get; }FullscreenEnabled
Fullscreen.csGets whether the document is allowed to display elements fullscreen (https://fullscreen.spec.whatwg.org/#dom-document-fullscreenenabled): its permissions policy allows the fullscreen feature.
public bool FullscreenEnabled { get; }Head
Document.Html.cshttps://html.spec.whatwg.org/multipage/dom.html#dom-document-head
public HtmlElement? Head { get; }Hidden
Document.Legacy.cshttps://html.spec.whatwg.org/multipage/interaction.html#dom-document-hidden
public bool Hidden { get; }Property value
See also
Highlights
Document.Highlights.csThe custom highlights registered for the document (https://drafts.csswg.org/css-highlight-api-1/#highlight-registry), returned by CSS.highlights in the scripts of its window.
public HighlightRegistry Highlights { get; }Property value
Images
Document.Legacy.csGets a live collection of the img elements of the document.
public HtmlCollection Images { get; }Property value
See also
Implementation
Document.csGets the DOMImplementation object associated with the document.
public DomImplementation Implementation { get; }InputEncoding
Document.csGets the name of the character encoding of the document (alias of characterSet).
public string InputEncoding { get; }IsNetworkErrorDocument
Document.Navigation.csGets whether the document is the error document of a navigation whose response is a network error (e.g. the BrowsingContextOptions.DocumentLoader returned null, or the request was blocked by a policy): an empty document whose origin is opaque.
public bool IsNetworkErrorDocument { get; }Property value
LastElementChild
Mixins.Members.csGets the last child that is an element, or null when there is none.
public Element? LastElementChild { get; }LastModified
Document.Legacy.cshttps://html.spec.whatwg.org/multipage/dom.html#dom-document-lastmodified: the date and time of the Last-Modified header of the response of the document, in the local time zone, or the current date and time when it is unknown (measured with BrowsingContextOptions.TimeProvider).
public string LastModified { get; }Property value
See also
LayoutWorklet
Document.Worklets.csGets the layout worklet of the document (https://drafts.css-houdini.org/css-layout-api-1/#dom-css-layoutworklet, CSS.layoutWorklet): the scripts added to it register the classes that lay out the display: layout() boxes of the document. The scripts need a script engine that supports the module scripts.
public Worklet LayoutWorklet { get; }Property value
LinkColor
HandWrittenReflection.cshttps://html.spec.whatwg.org/multipage/obsolete.html#dom-document-linkcolor
public string LinkColor { get; set; }Property value
See also
Links
Document.Legacy.csGets a live collection of the a and area elements of the document that have an href attribute.
public HtmlCollection Links { get; }Property value
See also
Location
Document.Html.csThe location of the window, when the document is fully active (https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-document-location).
public Location? Location { get; }NodeName
Document.csNodeType
Document.csOnAbort
Document.g.csGets or sets the event handler of the abort event (the onabort event handler attribute).
Property value
See also
OnAnimationCancel
Document.g.csGets or sets the event handler of the animationcancel event (the onanimationcancel event handler attribute).
OnAnimationEnd
Document.g.csGets or sets the event handler of the animationend event (the onanimationend event handler attribute).
OnAnimationIteration
Document.g.csGets or sets the event handler of the animationiteration event (the onanimationiteration event handler attribute).
OnAnimationStart
Document.g.csGets or sets the event handler of the animationstart event (the onanimationstart event handler attribute).
OnAuxClick
Document.g.csGets or sets the event handler of the auxclick event (the onauxclick event handler attribute).
Property value
See also
OnBeforeInput
Document.g.csGets or sets the event handler of the beforeinput event (the onbeforeinput event handler attribute).
OnBeforeMatch
Document.g.csGets or sets the event handler of the beforematch event (the onbeforematch event handler attribute).
OnBeforeToggle
Document.g.csGets or sets the event handler of the beforetoggle event (the onbeforetoggle event handler attribute).
OnBlur
Document.g.csGets or sets the event handler of the blur event (the onblur event handler attribute).
Property value
See also
OnCanPlay
Document.g.csGets or sets the event handler of the canplay event (the oncanplay event handler attribute).
Property value
See also
OnCanPlayThrough
Document.g.csGets or sets the event handler of the canplaythrough event (the oncanplaythrough event handler attribute).
OnCancel
Document.g.csGets or sets the event handler of the cancel event (the oncancel event handler attribute).
Property value
See also
OnChange
Document.g.csGets or sets the event handler of the change event (the onchange event handler attribute).
Property value
See also
OnClick
Document.g.csGets or sets the event handler of the click event (the onclick event handler attribute).
Property value
See also
OnClose
Document.g.csGets or sets the event handler of the close event (the onclose event handler attribute).
Property value
See also
OnCommand
Document.g.csGets or sets the event handler of the command event (the oncommand event handler attribute).
Property value
See also
OnContentVisibilityAutoStateChange
Document.g.cs- Experimental (WEBPLATEXP0010)
Gets or sets the event handler of the contentvisibilityautostatechange event (the oncontentvisibilityautostatechange event handler attribute).
[Experimental("WEBPLATEXP0010", UrlFormat = "https://github.com/meziantou/Meziantou.Framework/blob/main/src/Meziantou.Framework.WebPlatform/docs/experimental-apis.md#{0}")]
public Action<Event>? OnContentVisibilityAutoStateChange { get; set; }OnContextMenu
Document.g.csGets or sets the event handler of the contextmenu event (the oncontextmenu event handler attribute).
OnContextRestored
Document.g.csGets or sets the event handler of the contextrestored event (the oncontextrestored event handler attribute).
OnContextlost
Document.g.csGets or sets the event handler of the contextlost event (the oncontextlost event handler attribute).
OnCopy
Document.g.csGets or sets the event handler of the copy event (the oncopy event handler attribute).
Property value
See also
OnCueChange
Document.g.csGets or sets the event handler of the cuechange event (the oncuechange event handler attribute).
Property value
See also
OnCut
Document.g.csGets or sets the event handler of the cut event (the oncut event handler attribute).
Property value
See also
OnDblClick
Document.g.csGets or sets the event handler of the dblclick event (the ondblclick event handler attribute).
Property value
See also
OnDrag
Document.g.csGets or sets the event handler of the drag event (the ondrag event handler attribute).
Property value
See also
OnDragEnd
Document.g.csGets or sets the event handler of the dragend event (the ondragend event handler attribute).
Property value
See also
OnDragEnter
Document.g.csGets or sets the event handler of the dragenter event (the ondragenter event handler attribute).
Property value
See also
OnDragLeave
Document.g.csGets or sets the event handler of the dragleave event (the ondragleave event handler attribute).
Property value
See also
OnDragOver
Document.g.csGets or sets the event handler of the dragover event (the ondragover event handler attribute).
Property value
See also
OnDragStart
Document.g.csGets or sets the event handler of the dragstart event (the ondragstart event handler attribute).
Property value
See also
OnDrop
Document.g.csGets or sets the event handler of the drop event (the ondrop event handler attribute).
Property value
See also
OnDurationChange
Document.g.csGets or sets the event handler of the durationchange event (the ondurationchange event handler attribute).
OnEmptied
Document.g.csGets or sets the event handler of the emptied event (the onemptied event handler attribute).
Property value
See also
OnEnded
Document.g.csGets or sets the event handler of the ended event (the onended event handler attribute).
Property value
See also
OnError
Document.g.csGets or sets the event handler of the error event (the onerror event handler attribute).
Property value
See also
OnFocus
Document.g.csGets or sets the event handler of the focus event (the onfocus event handler attribute).
Property value
See also
OnFormData
Document.g.csGets or sets the event handler of the formdata event (the onformdata event handler attribute).
Property value
See also
OnFreeze
Document.PageLifecycle.csGets or sets the event handler of the freeze event, fired when the document is frozen.
OnFullscreenChange
Document.g.csGets or sets the event handler of the fullscreenchange event (the onfullscreenchange event handler attribute).
Property value
See also
OnFullscreenError
Document.g.csGets or sets the event handler of the fullscreenerror event (the onfullscreenerror event handler attribute).
Property value
See also
OnGotPointerCapture
Document.g.csGets or sets the event handler of the gotpointercapture event (the ongotpointercapture event handler attribute).
OnInput
Document.g.csGets or sets the event handler of the input event (the oninput event handler attribute).
Property value
See also
OnInvalid
Document.g.csGets or sets the event handler of the invalid event (the oninvalid event handler attribute).
Property value
See also
OnKeyDown
Document.g.csGets or sets the event handler of the keydown event (the onkeydown event handler attribute).
Property value
See also
OnKeyPress
Document.g.csGets or sets the event handler of the keypress event (the onkeypress event handler attribute).
Property value
See also
OnKeyUp
Document.g.csGets or sets the event handler of the keyup event (the onkeyup event handler attribute).
Property value
See also
OnLoad
Document.g.csGets or sets the event handler of the load event (the onload event handler attribute).
Property value
See also
OnLoadStart
Document.g.csGets or sets the event handler of the loadstart event (the onloadstart event handler attribute).
Property value
See also
OnLoadedData
Document.g.csGets or sets the event handler of the loadeddata event (the onloadeddata event handler attribute).
OnLoadedMetadata
Document.g.csGets or sets the event handler of the loadedmetadata event (the onloadedmetadata event handler attribute).
OnLostPointerCapture
Document.g.csGets or sets the event handler of the lostpointercapture event (the onlostpointercapture event handler attribute).
OnMouseDown
Document.g.csGets or sets the event handler of the mousedown event (the onmousedown event handler attribute).
Property value
See also
OnMouseEnter
Document.g.csGets or sets the event handler of the mouseenter event (the onmouseenter event handler attribute).
OnMouseLeave
Document.g.csGets or sets the event handler of the mouseleave event (the onmouseleave event handler attribute).
OnMouseMove
Document.g.csGets or sets the event handler of the mousemove event (the onmousemove event handler attribute).
Property value
See also
OnMouseOut
Document.g.csGets or sets the event handler of the mouseout event (the onmouseout event handler attribute).
Property value
See also
OnMouseOver
Document.g.csGets or sets the event handler of the mouseover event (the onmouseover event handler attribute).
Property value
See also
OnMouseUp
Document.g.csGets or sets the event handler of the mouseup event (the onmouseup event handler attribute).
Property value
See also
OnPaste
Document.g.csGets or sets the event handler of the paste event (the onpaste event handler attribute).
Property value
See also
OnPause
Document.g.csGets or sets the event handler of the pause event (the onpause event handler attribute).
Property value
See also
OnPlay
Document.g.csGets or sets the event handler of the play event (the onplay event handler attribute).
Property value
See also
OnPlaying
Document.g.csGets or sets the event handler of the playing event (the onplaying event handler attribute).
Property value
See also
OnPointerCancel
Document.g.csGets or sets the event handler of the pointercancel event (the onpointercancel event handler attribute).
OnPointerDown
Document.g.csGets or sets the event handler of the pointerdown event (the onpointerdown event handler attribute).
Property value
See also
OnPointerEnter
Document.g.csGets or sets the event handler of the pointerenter event (the onpointerenter event handler attribute).
OnPointerLeave
Document.g.csGets or sets the event handler of the pointerleave event (the onpointerleave event handler attribute).
OnPointerLockChange
Document.g.csGets or sets the event handler of the pointerlockchange event (the onpointerlockchange event handler attribute).
Property value
See also
OnPointerLockError
Document.g.csGets or sets the event handler of the pointerlockerror event (the onpointerlockerror event handler attribute).
Property value
See also
OnPointerMove
Document.g.csGets or sets the event handler of the pointermove event (the onpointermove event handler attribute).
Property value
See also
OnPointerOut
Document.g.csGets or sets the event handler of the pointerout event (the onpointerout event handler attribute).
Property value
See also
OnPointerOver
Document.g.csGets or sets the event handler of the pointerover event (the onpointerover event handler attribute).
Property value
See also
OnPointerRawUpdate
Document.g.csGets or sets the event handler of the pointerrawupdate event (the onpointerrawupdate event handler attribute).
OnPointerUp
Document.g.csGets or sets the event handler of the pointerup event (the onpointerup event handler attribute).
Property value
See also
OnPrerenderingChange
Document.SpeculativeLoading.csGets or sets the event handler of the prerenderingchange event (the onprerenderingchange event handler attribute).
OnProgress
Document.g.csGets or sets the event handler of the progress event (the onprogress event handler attribute).
Property value
See also
OnRateChange
Document.g.csGets or sets the event handler of the ratechange event (the onratechange event handler attribute).
OnReadyStateChange
Document.g.csGets or sets the event handler of the readystatechange event (the onreadystatechange event handler attribute).
OnReset
Document.g.csGets or sets the event handler of the reset event (the onreset event handler attribute).
Property value
See also
OnResize
Document.g.csGets or sets the event handler of the resize event (the onresize event handler attribute).
Property value
See also
OnResume
Document.PageLifecycle.csGets or sets the event handler of the resume event, fired when the document is resumed.
OnScroll
Document.g.csGets or sets the event handler of the scroll event (the onscroll event handler attribute).
Property value
See also
OnScrollEnd
Document.g.csGets or sets the event handler of the scrollend event (the onscrollend event handler attribute).
Property value
See also
OnScrollSnapChange
Document.g.csGets or sets the event handler of the scrollsnapchange event (the onscrollsnapchange event handler attribute).
OnScrollSnapChanging
Document.g.csGets or sets the event handler of the scrollsnapchanging event (the onscrollsnapchanging event handler attribute).
OnSecurityPolicyViolation
Document.g.csGets or sets the event handler of the securitypolicyviolation event (the onsecuritypolicyviolation event handler attribute).
OnSeeked
Document.g.csGets or sets the event handler of the seeked event (the onseeked event handler attribute).
Property value
See also
OnSeeking
Document.g.csGets or sets the event handler of the seeking event (the onseeking event handler attribute).
Property value
See also
OnSelect
Document.g.csGets or sets the event handler of the select event (the onselect event handler attribute).
Property value
See also
OnSelectStart
Document.g.csGets or sets the event handler of the selectstart event (the onselectstart event handler attribute).
Property value
See also
OnSelectionChange
Document.g.csGets or sets the event handler of the selectionchange event (the onselectionchange event handler attribute).
OnSlotChange
Document.g.csGets or sets the event handler of the slotchange event (the onslotchange event handler attribute).
OnStalled
Document.g.csGets or sets the event handler of the stalled event (the onstalled event handler attribute).
Property value
See also
OnSubmit
Document.g.csGets or sets the event handler of the submit event (the onsubmit event handler attribute).
Property value
See also
OnSuspend
Document.g.csGets or sets the event handler of the suspend event (the onsuspend event handler attribute).
Property value
See also
OnTimeUpdate
Document.g.csGets or sets the event handler of the timeupdate event (the ontimeupdate event handler attribute).
OnToggle
Document.g.csGets or sets the event handler of the toggle event (the ontoggle event handler attribute).
Property value
See also
OnTransitionCancel
Document.g.csGets or sets the event handler of the transitioncancel event (the ontransitioncancel event handler attribute).
OnTransitionEnd
Document.g.csGets or sets the event handler of the transitionend event (the ontransitionend event handler attribute).
OnTransitionRun
Document.g.csGets or sets the event handler of the transitionrun event (the ontransitionrun event handler attribute).
OnTransitionStart
Document.g.csGets or sets the event handler of the transitionstart event (the ontransitionstart event handler attribute).
OnVisibilityChange
Document.g.csGets or sets the event handler of the visibilitychange event (the onvisibilitychange event handler attribute).
OnVolumeChange
Document.g.csGets or sets the event handler of the volumechange event (the onvolumechange event handler attribute).
OnWaiting
Document.g.csGets or sets the event handler of the waiting event (the onwaiting event handler attribute).
Property value
See also
OnWebkitAnimationEnd
Document.g.csGets or sets the event handler of the webkitanimationend event (the onwebkitanimationend event handler attribute).
OnWebkitAnimationIteration
Document.g.csGets or sets the event handler of the webkitanimationiteration event (the onwebkitanimationiteration event handler attribute).
OnWebkitAnimationStart
Document.g.csGets or sets the event handler of the webkitanimationstart event (the onwebkitanimationstart event handler attribute).
OnWebkitTransitionEnd
Document.g.csGets or sets the event handler of the webkittransitionend event (the onwebkittransitionend event handler attribute).
OnWheel
Document.g.csGets or sets the event handler of the wheel event (the onwheel event handler attribute).
Property value
See also
PaintWorklet
Document.Worklets.csGets the paint worklet of the document (https://drafts.css-houdini.org/css-paint-api-1/#dom-css-paintworklet, CSS.paintWorklet): the scripts added to it register the classes that paint the paint() images of the document. The scripts need a script engine that supports the module scripts, and the images a rendering backend.
public Worklet PaintWorklet { get; }Property value
PermissionsPolicy
Document.Navigation.csGets the policy object of the document (https://w3c.github.io/webappsec-permissions-policy/#dom-document-permissionspolicy): the features that its permissions policy allows.
public PermissionsPolicy PermissionsPolicy { get; }Plugins
Document.Legacy.csGets a live collection of the embed elements of the document (alias of embeds).
public HtmlCollection Plugins { get; }Property value
See also
PointerLockElement
PointerLock.csGets the element the pointer is locked to when it is in the document (https://w3c.github.io/pointerlock/#dom-documentorshadowroot-pointerlockelement): the host of the shadow tree of the element when it is in a shadow tree. Null while a request is pending.
public Element? PointerLockElement { get; }Property value
See also
Prerendering
Document.SpeculativeLoading.csGets whether the document is prerendering: it is in a prerendering traversable, which is not shown, until a navigation activates it (https://wicg.github.io/nav-speculation/prerendering.html#dom-document-prerendering).
public bool Prerendering { get; }Property value
See also
ReadyState
Document.Html.csDocuments parsed by this library are fully loaded, so the readiness is "complete" unless the host changes it.
public DocumentReadyState ReadyState { get; }Referrer
Document.Legacy.cshttps://html.spec.whatwg.org/multipage/dom.html#dom-document-referrer: the URL of the document that created or navigated to this document.
public string Referrer { get; }RootElement
Document.Legacy.cshttps://svgwg.org/svg2-draft/struct.html#__svg__Document__rootElement
public SvgSvgElement? RootElement { get; }Scripts
Document.Legacy.csGets a live collection of the script elements of the document.
public HtmlCollection Scripts { get; }Property value
See also
ScrollingElement
CssomView.Scrolling.csGets the element that scrolls the viewport (https://drafts.csswg.org/cssom-view/#dom-document-scrollingelement): the root element, or in quirks mode the body element when it is not potentially scrollable.
public Element? ScrollingElement { get; }StyleSheets
LinkStyle.csGets the list of the style sheets of the document.
public StyleSheetList StyleSheets { get; }Property value
See also
TextContent
Document.csTimeline
Document.Animations.csGets the default document timeline (https://drafts.csswg.org/web-animations-1/#dom-document-timeline).
public DocumentTimeline Timeline { get; }Property value
See also
Title
Document.Html.cshttps://html.spec.whatwg.org/multipage/dom.html#document.title
public string Title { get; set; }TrustedTypes
TrustedTypesGlobals.csThe trusted type policy factory of the relevant global object of the document (https://w3c.github.io/trusted-types/dist/spec/#dom-windoworworkerglobalscope-trustedtypes): the one of its window (Window.TrustedTypes), or of the window of the document that created it. A document without a window is its own global object.
public TrustedTypePolicyFactory TrustedTypes { get; }Property value
TrustedTypesDirectives
TrustedTypesGlobals.csThe Trusted Types directives of the content security policies of the document (the CSP list of its policy container), which enforce Trusted Types for the objects whose relevant global object is the window of the document (or the document itself when it has no window). A document loaded in a Document.BrowsingContext gets the directives of the Content-Security-Policy and Content-Security-Policy-Report-Only headers of its response (DocumentResource.Headers) and of its <meta http-equiv="Content-Security-Policy"> elements. Otherwise, it is empty by default: Trusted Types are not enforced. See TrustedTypesDirectives.Parse to get the directives of a Content-Security-Policy header.
public IList<TrustedTypesDirectives> TrustedTypesDirectives { get; }Property value
Url
Document.csGets the serialized URL of the document.
public string Url { get; }VisibilityState
Document.Legacy.cshttps://html.spec.whatwg.org/multipage/interaction.html#dom-document-visibilitystate: visible for the active document of a browsing context whose top-level browsing context is visible (see BrowsingContext.IsVisible), else hidden.
public string VisibilityState { get; }VlinkColor
HandWrittenReflection.cshttps://html.spec.whatwg.org/multipage/obsolete.html#dom-document-vlinkcolor
public string VlinkColor { get; set; }Property value
See also
WasDiscarded
Document.PageLifecycle.csGets whether the document was loaded again after the user agent discarded its browsing context to save resources (https://wicg.github.io/page-lifecycle/#dom-document-wasdiscarded, see BrowsingContext.Discard).
public bool WasDiscarded { get; }Indexers
| Name | Description |
|---|---|
| this[string] | Returns the value of a named property of the document (https://html.spec.whatwg.org/multipage/dom.html#dom-document-nameditem): the embed, form, iframe, img and object elements of the document tree whose name attribute is name, the object elements whose id is name, and the img elements whose id is name and that have a non-empty name attribute. The value is the element when there is a single one (the Window of its content navigable for an iframe element), an HtmlCollection of the elements when there are several, and null when there is none. |
this[string]
Document.NamedItems.csReturns the value of a named property of the document (https://html.spec.whatwg.org/multipage/dom.html#dom-document-nameditem): the embed, form, iframe, img and object elements of the document tree whose name attribute is name, the object elements whose id is name, and the img elements whose id is name and that have a non-empty name attribute. The value is the element when there is a single one (the Window of its content navigable for an iframe element), an HtmlCollection of the elements when there are several, and null when there is none.
Methods
| Name | Description |
|---|---|
| AdoptNode(Node) | https://dom.spec.whatwg.org/#dom-document-adoptnode |
| Append(ReadOnlySpan<NodeOrString>) | Inserts the nodes after the last child, converting the strings into text nodes. |
| CaptureEvents() | Does nothing; this obsolete method is kept for compatibility. |
| CaretPositionFromPoint(double, double, CaretPositionFromPointOptions?) | Returns the caret position at a point of the viewport (https://drafts.csswg.org/cssom-view/#dom-document-caretpositionfrompoint): the position in the text under the point (the closest boundary of the grapheme clusters), else in the closest text of the line of the element under the point, else before or after the replaced element under the point, else at the start of the element under the point. The positions in the shadow trees that are not given in the options are the positions of their shadow hosts. Returns null when the point is outside of the viewport or the document has no browsing context. |
| Clear() | Does nothing; this obsolete method is kept for compatibility. |
| Close() | https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-document-close: closes the input stream opened by Document.Open. |
| ConvertPointFromNode(DomPointInit, GeometryNode, ConvertCoordinateOptions?) | Converts a point from the coordinates of a node to the coordinates of the viewport of the document (https://drafts.csswg.org/cssom-view/#dom-geometryutils-convertpointfromnode). |
| ConvertQuadFromNode(DomQuadInit, GeometryNode, ConvertCoordinateOptions?) | Converts a quad from the coordinates of a node to the coordinates of the viewport of the document (https://drafts.csswg.org/cssom-view/#dom-geometryutils-convertquadfromnode). |
| ConvertRectFromNode(DomRectReadOnly, GeometryNode, ConvertCoordinateOptions?) | Converts a rectangle from the coordinates of a node to the coordinates of the viewport of the document (https://drafts.csswg.org/cssom-view/#dom-geometryutils-convertrectfromnode). |
| CreateAttribute(string) | https://dom.spec.whatwg.org/#dom-document-createattribute |
| CreateAttributeNS(string?, string) | https://dom.spec.whatwg.org/#dom-document-createattributens |
| CreateCDataSection(string) | https://dom.spec.whatwg.org/#dom-document-createcdatasection |
| CreateComment(string) | Creates a comment node with the given data. |
| CreateDocumentFragment() | Creates an empty document fragment owned by the document. |
| CreateElement(string, ElementCreationOptions?) | https://dom.spec.whatwg.org/#dom-document-createelement |
| CreateElement<T>(ElementCreationOptions?) | Creates the HTML element whose element interface is T, such as a for HtmlAnchorElement. Use Document.CreateElement for the interfaces of several elements, such as HtmlHeadingElement. |
| CreateElement<T>(string, ElementCreationOptions?) | Creates an element, as Document.CreateElement does, and returns it as a T. |
| CreateElementNS(string?, string, ElementCreationOptions?) | https://dom.spec.whatwg.org/#dom-document-createelementns |
| CreateEvent(string) | https://dom.spec.whatwg.org/#dom-document-createevent |
| CreateExpression(string, IXPathNSResolver?) | Compiles the XPath expression, using the optional resolver for its namespace prefixes. |
| CreateNSResolver(Node) | Returns a namespace resolver for the given node, which is the node itself. |
| CreateNodeIterator(Node, uint, INodeFilter?) | https://dom.spec.whatwg.org/#dom-document-createnodeiterator |
| CreateProcessingInstruction(string, string) | Creates a processing instruction with the given target and data. |
| CreateRange() | https://dom.spec.whatwg.org/#dom-document-createrange |
| CreateTextNode(string) | Creates a text node with the given data. |
| CreateTreeWalker(Node, uint, INodeFilter?) | https://dom.spec.whatwg.org/#dom-document-createtreewalker |
| ElementFromPoint(double, double) | Returns the topmost element at a point of the viewport (https://drafts.csswg.org/cssom-view/#dom-document-elementfrompoint): the element of the topmost box at the point (see Document.ElementsFromPoint), else the document element. Returns null when the point is outside of the viewport or the document has no browsing context. |
| ElementsFromPoint(double, double) | Returns the elements at a point of the viewport, topmost first (https://drafts.csswg.org/cssom-view/#dom-document-elementsfrompoint): the elements of the boxes at the point in the reverse of the painting order (retargeted out of the shadow trees; the texts are not listed, as in the browsers), then the document element. A box is not hit when its visibility is not visible, its pointer-events is none or its element is inert, outside of the overflow clip edge of its ancestors, or outside of its border box (the hit testing, see HitTesting). The list is empty when the point is outside of the viewport or the document has no browsing context. |
| Evaluate(string, Node, IXPathNSResolver?, ushort, XPathResult?) | Evaluates the XPath expression against the context node and returns the result, of the requested type. |
| ExecCommand(string, bool, TrustedHtml) | https://w3c.github.io/editing/docs/execCommand/#execcommand(): runs an editing command whose value was created by a Trusted Types policy (the HTML of the insertHTML command). |
| ExecCommand(string, bool, string) | https://w3c.github.io/editing/docs/execCommand/#execcommand(): runs an editing command at the selection of the document, and returns false when the command is not supported or not enabled, or when its value is not valid. |
| ExitFullscreen() | Stops displaying the fullscreen element of the document fullscreen (https://fullscreen.spec.whatwg.org/#dom-document-exitfullscreen); fullscreenchange is fired by the next rendering update. The task fails with a TypeErrorException when the document has no fullscreen element. |
| ExitPointerLock() | Exits the pointer lock when the pointer is locked to an element of the document (https://w3c.github.io/pointerlock/#dom-document-exitpointerlock); pointerlockchange is fired by a task. |
| GetAnimations() | Returns the relevant animations of the elements of the document (not of its shadow trees), sorted by their composite order (https://drafts.csswg.org/web-animations-1/#dom-documentorshadowroot-getanimations). |
| GetBoxQuads(BoxQuadOptions?) | Returns the quad of the document (https://drafts.csswg.org/cssom-view/#dom-geometryutils-getboxquads): the layout viewport, in the coordinates of the viewport or of BoxQuadOptions.RelativeTo. |
| GetElementById(string) | Returns the first element of the document, in tree order, with the given ID, or null when there is none. |
| GetElementsByClassName(string) | Returns a live collection of the descendant elements that have all the given class names. |
| GetElementsByName(string) | https://html.spec.whatwg.org/multipage/dom.html#dom-document-getelementsbyname |
| GetElementsByTagName(string) | Returns a live collection of the descendant elements with the given qualified name. |
| GetElementsByTagNameNS(string?, string) | Returns a live collection of the descendant elements with the given namespace and local name. |
| GetHtml(GetHtmlOptions?) | Serializes the children of the document (the doctype, the comments, the processing instructions and the document element) with the HTML fragment serialization algorithm (https://html.spec.whatwg.org/multipage/parsing.html#serialising-html-fragments), as Element.GetHtml does for an element. The HTML serialization is used even for XML documents. As defined by the algorithm, the doctype is serialized as <!DOCTYPE name>: its public and system identifiers are not serialized. |
| GetSelection() | Returns the selection of the document, or null when the document has no browsing context. |
| HasFocus() | https://html.spec.whatwg.org/multipage/interaction.html#dom-document-hasfocus: whether the key events are routed through or to the document, and its top-level browsing context has the system focus (see BrowsingContext.HasSystemFocus). |
| ImportNode(Node, ImportNodeOptions) | https://dom.spec.whatwg.org/#dom-document-importnode |
| ImportNode(Node, bool) | https://dom.spec.whatwg.org/#dom-document-importnode |
| MoveBefore(Node, Node?) | Moves the node, preserving its state, before the given child (or to the end when the child is null). |
| Open(string?, string?) | https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-document-open: replaces the document in place (its nodes, event listeners and URL) with an empty document, whose content is given by Document.Write. It has no effect in a script run by the parser. |
| Open(string, string, string) | https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-document-open-window: runs the window open steps, as Window.Open. As in the browsers, the target (e.g. _self) is chosen from the navigable of this document, not from the one of the entry document. |
| ParseHtml(string, SetHtmlOptions?) | https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-parsehtml |
| ParseHtmlUnsafe(TrustedHtml, ParseHtmlUnsafeOptionsOrTrustedHtmlParserOptions?) | https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-parsehtmlunsafe |
| ParseHtmlUnsafe(string, ParseHtmlUnsafeOptionsOrTrustedHtmlParserOptions?) | https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-parsehtmlunsafe |
| Prepend(ReadOnlySpan<NodeOrString>) | Inserts the nodes before the first child, converting the strings into text nodes. |
| QueryCommandEnabled(string) | Returns a value indicating whether the editing command can currently be executed. |
| QueryCommandIndeterm(string) | https://w3c.github.io/editing/docs/execCommand/#querycommandindeterm(): whether the command is indeterminate (e.g. a part of the selection is bold). |
| QueryCommandState(string) | https://w3c.github.io/editing/docs/execCommand/#querycommandstate(): the state of the command (e.g. whether the selection is bold). |
| QueryCommandSupported(string) | Returns a value indicating whether the editing command is supported. |
| QueryCommandValue(string) | https://w3c.github.io/editing/docs/execCommand/#querycommandvalue(): the value of the command (e.g. the font name of the selection). |
| QuerySelector(SelectorList) | Returns the first descendant element, in tree order, that matches the parsed selector list, or null. |
| QuerySelector(string) | Returns the first descendant element, in tree order, that matches the selectors, or null. |
| QuerySelector<T>(SelectorList) | Returns the first descendant, in tree order, that is a T and matches the parsed selector. |
| QuerySelector<T>(string) | Returns the first descendant, in tree order, that is a T and matches the selector. |
| QuerySelectorAll(SelectorList) | Returns the descendant elements, in tree order, that match the parsed selector list. |
| QuerySelectorAll(string) | Returns the descendant elements, in tree order, that match the selectors. |
| QuerySelectorAll<T>(SelectorList) | Returns the descendants, in tree order, that are a T and match the parsed selector. |
| QuerySelectorAll<T>(string) | Returns the descendants, in tree order, that are a T and match the selector. |
| ReleaseEvents() | Does nothing; this obsolete method is kept for compatibility. |
| ReplaceChildren(ReadOnlySpan<NodeOrString>) | Replaces all the children with the given nodes, converting the strings into text nodes. |
| StartViewTransition(StartViewTransitionOptions?) | Starts a view transition with options (https://drafts.csswg.org/css-view-transitions-2/#dom-document-startviewtransition): the update callback and the types of the transition. |
| StartViewTransition(ViewTransitionUpdateCallback) | Starts a view transition (https://drafts.csswg.org/css-view-transitions-1/#dom-document-startviewtransition): the old state of the document is captured at the next rendering opportunity, then the callback updates the document, and the transition between the two states is animated. The active view transition of the document, if any, is skipped. |
| Write(ReadOnlySpan<TrustedHtmlOrString>) | https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-document-write: inserts markup in the input stream of the parser (after the script being executed by the parser), or replaces the document (as Document.Open) when the document is not being parsed. |
| WriteHtml(TextWriter, GetHtmlOptions?) | Same as Document.GetHtml, but writes the serialization to writer instead of building a string. |
| Writeln(ReadOnlySpan<TrustedHtmlOrString>) | https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-document-writeln: Document.Write followed by a line feed. |
AdoptNode(Node)
Document.cshttps://dom.spec.whatwg.org/#dom-document-adoptnode
Append(ReadOnlySpan<NodeOrString>)
Mixins.Members.csInserts the nodes after the last child, converting the strings into text nodes.
public void Append(params scoped ReadOnlySpan<NodeOrString> nodes)Parameters
See also
CaptureEvents()
Document.Legacy.csDoes nothing; this obsolete method is kept for compatibility.
public void CaptureEvents()CaretPositionFromPoint(double, double, CaretPositionFromPointOptions?)
CssomView.csReturns the caret position at a point of the viewport (https://drafts.csswg.org/cssom-view/#dom-document-caretpositionfrompoint): the position in the text under the point (the closest boundary of the grapheme clusters), else in the closest text of the line of the element under the point, else before or after the replaced element under the point, else at the start of the element under the point. The positions in the shadow trees that are not given in the options are the positions of their shadow hosts. Returns null when the point is outside of the viewport or the document has no browsing context.
public CaretPosition? CaretPositionFromPoint(double x, double y, CaretPositionFromPointOptions? options = null)Clear()
Document.Legacy.csDoes nothing; this obsolete method is kept for compatibility.
public void Clear()https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-document-close: closes the input stream opened by Document.Open.
public void Close()ConvertPointFromNode(DomPointInit, GeometryNode, ConvertCoordinateOptions?)
CssomView.GeometryUtils.csConverts a point from the coordinates of a node to the coordinates of the viewport of the document (https://drafts.csswg.org/cssom-view/#dom-geometryutils-convertpointfromnode).
public DomPoint ConvertPointFromNode(DomPointInit point, GeometryNode from, ConvertCoordinateOptions? options = null)ConvertQuadFromNode(DomQuadInit, GeometryNode, ConvertCoordinateOptions?)
CssomView.GeometryUtils.csConverts a quad from the coordinates of a node to the coordinates of the viewport of the document (https://drafts.csswg.org/cssom-view/#dom-geometryutils-convertquadfromnode).
public DomQuad ConvertQuadFromNode(DomQuadInit quad, GeometryNode from, ConvertCoordinateOptions? options = null)ConvertRectFromNode(DomRectReadOnly, GeometryNode, ConvertCoordinateOptions?)
CssomView.GeometryUtils.csConverts a rectangle from the coordinates of a node to the coordinates of the viewport of the document (https://drafts.csswg.org/cssom-view/#dom-geometryutils-convertrectfromnode).
public DomQuad ConvertRectFromNode(DomRectReadOnly rect, GeometryNode from, ConvertCoordinateOptions? options = null)CreateAttribute(string)
Document.cshttps://dom.spec.whatwg.org/#dom-document-createattribute
CreateAttributeNS(string?, string)
Document.csCreateCDataSection(string)
Document.cshttps://dom.spec.whatwg.org/#dom-document-createcdatasection
public CDataSection CreateCDataSection(string data)CreateComment(string)
Document.csCreates a comment node with the given data.
CreateDocumentFragment()
Document.csCreates an empty document fragment owned by the document.
public DocumentFragment CreateDocumentFragment()CreateElement overloads
CreateElement(string, ElementCreationOptions?)
Document.cshttps://dom.spec.whatwg.org/#dom-document-createelement
public Element CreateElement(string localName, ElementCreationOptions? options = null)CreateElement<T>(ElementCreationOptions?)
Document.csCreates the HTML element whose element interface is T, such as a for HtmlAnchorElement. Use Document.CreateElement for the interfaces of several elements, such as HtmlHeadingElement.
public T CreateElement<T>(ElementCreationOptions? options = null) where T : HtmlElementType parameters
T
Parameters
optionsElementCreationOptions?
Returns
T
Exceptions
InvalidOperationExceptionTis not the element interface of exactly one element.ArgumentException- The document does not create HTML elements (an XML document).
CreateElement<T>(string, ElementCreationOptions?)
Document.csCreates an element, as Document.CreateElement does, and returns it as a T.
public T CreateElement<T>(string localName, ElementCreationOptions? options = null) where T : ElementType parameters
T
Parameters
localNamestringoptionsElementCreationOptions?
Returns
T
Exceptions
ArgumentException- The created element is not a
T.
CreateElementNS(string?, string, ElementCreationOptions?)
Document.cshttps://dom.spec.whatwg.org/#dom-document-createelementns
public Element CreateElementNS(string? @namespace, string qualifiedName, ElementCreationOptions? options = null)CreateEvent(string)
Document.Factories.cshttps://dom.spec.whatwg.org/#dom-document-createevent
CreateExpression(string, IXPathNSResolver?)
XPathApi.csCompiles the XPath expression, using the optional resolver for its namespace prefixes.
public XPathExpression CreateExpression(string expression, IXPathNSResolver? resolver = null)CreateNSResolver(Node)
XPathApi.csReturns a namespace resolver for the given node, which is the node itself.
CreateNodeIterator(Node, uint, INodeFilter?)
Document.Factories.cshttps://dom.spec.whatwg.org/#dom-document-createnodeiterator
public NodeIterator CreateNodeIterator(Node root, uint whatToShow = 4294967295U, INodeFilter? filter = null)CreateProcessingInstruction(string, string)
Document.csCreates a processing instruction with the given target and data.
public ProcessingInstruction CreateProcessingInstruction(string target, string data)Parameters
Returns
See also
CreateRange()
Document.Factories.cshttps://dom.spec.whatwg.org/#dom-document-createrange
public Range CreateRange()CreateTextNode(string)
Document.csCreates a text node with the given data.
CreateTreeWalker(Node, uint, INodeFilter?)
Document.Factories.cshttps://dom.spec.whatwg.org/#dom-document-createtreewalker
public TreeWalker CreateTreeWalker(Node root, uint whatToShow = 4294967295U, INodeFilter? filter = null)ElementFromPoint(double, double)
CssomView.csReturns the topmost element at a point of the viewport (https://drafts.csswg.org/cssom-view/#dom-document-elementfrompoint): the element of the topmost box at the point (see Document.ElementsFromPoint), else the document element. Returns null when the point is outside of the viewport or the document has no browsing context.
Parameters
Returns
See also
ElementsFromPoint(double, double)
CssomView.csReturns the elements at a point of the viewport, topmost first (https://drafts.csswg.org/cssom-view/#dom-document-elementsfrompoint): the elements of the boxes at the point in the reverse of the painting order (retargeted out of the shadow trees; the texts are not listed, as in the browsers), then the document element. A box is not hit when its visibility is not visible, its pointer-events is none or its element is inert, outside of the overflow clip edge of its ancestors, or outside of its border box (the hit testing, see HitTesting). The list is empty when the point is outside of the viewport or the document has no browsing context.
public IReadOnlyList<Element> ElementsFromPoint(double x, double y)Parameters
Returns
See also
Evaluate(string, Node, IXPathNSResolver?, ushort, XPathResult?)
XPathApi.csEvaluates the XPath expression against the context node and returns the result, of the requested type.
public XPathResult Evaluate(string expression, Node contextNode, IXPathNSResolver? resolver = null, ushort type = 0, XPathResult? result = null)Parameters
expressionstringcontextNodeNoderesolverIXPathNSResolver?typeushortresultXPathResult?
Returns
See also
ExecCommand overloads
ExecCommand(string, bool, TrustedHtml)
Document.Legacy.cshttps://w3c.github.io/editing/docs/execCommand/#execcommand(): runs an editing command whose value was created by a Trusted Types policy (the HTML of the insertHTML command).
public bool ExecCommand(string commandId, bool showUI, TrustedHtml value)ExecCommand(string, bool, string)
Document.Legacy.cshttps://w3c.github.io/editing/docs/execCommand/#execcommand(): runs an editing command at the selection of the document, and returns false when the command is not supported or not enabled, or when its value is not valid.
Parameters
Returns
Exceptions
TypeErrorException- The command is
insertHTML, Trusted Types are required and the default policy did not convert the value.
See also
ExitFullscreen()
Fullscreen.csStops displaying the fullscreen element of the document fullscreen (https://fullscreen.spec.whatwg.org/#dom-document-exitfullscreen); fullscreenchange is fired by the next rendering update. The task fails with a TypeErrorException when the document has no fullscreen element.
public Task ExitFullscreen()ExitPointerLock()
PointerLock.csExits the pointer lock when the pointer is locked to an element of the document (https://w3c.github.io/pointerlock/#dom-document-exitpointerlock); pointerlockchange is fired by a task.
public void ExitPointerLock()GetAnimations()
Document.Animations.csReturns the relevant animations of the elements of the document (not of its shadow trees), sorted by their composite order (https://drafts.csswg.org/web-animations-1/#dom-documentorshadowroot-getanimations).
public IReadOnlyList<Animation> GetAnimations()GetBoxQuads(BoxQuadOptions?)
CssomView.GeometryUtils.csReturns the quad of the document (https://drafts.csswg.org/cssom-view/#dom-geometryutils-getboxquads): the layout viewport, in the coordinates of the viewport or of BoxQuadOptions.RelativeTo.
public IReadOnlyList<DomQuad> GetBoxQuads(BoxQuadOptions? options = null)GetElementById(string)
Document.csReturns the first element of the document, in tree order, with the given ID, or null when there is none.
GetElementsByClassName(string)
Document.Factories.csReturns a live collection of the descendant elements that have all the given class names.
public HtmlCollection GetElementsByClassName(string classNames)GetElementsByName(string)
Document.Html.cshttps://html.spec.whatwg.org/multipage/dom.html#dom-document-getelementsbyname
GetElementsByTagName(string)
Document.Factories.csReturns a live collection of the descendant elements with the given qualified name.
public HtmlCollection GetElementsByTagName(string qualifiedName)GetElementsByTagNameNS(string?, string)
Document.Factories.csReturns a live collection of the descendant elements with the given namespace and local name.
public HtmlCollection GetElementsByTagNameNS(string? @namespace, string localName)Parameters
Returns
See also
GetHtml(GetHtmlOptions?)
DynamicMarkup.csSerializes the children of the document (the doctype, the comments, the processing instructions and the document element) with the HTML fragment serialization algorithm (https://html.spec.whatwg.org/multipage/parsing.html#serialising-html-fragments), as Element.GetHtml does for an element. The HTML serialization is used even for XML documents. As defined by the algorithm, the doctype is serialized as <!DOCTYPE name>: its public and system identifiers are not serialized.
public string GetHtml(GetHtmlOptions? options = null)GetSelection()
Selection.csReturns the selection of the document, or null when the document has no browsing context.
public Selection? GetSelection()HasFocus()
Focus.cshttps://html.spec.whatwg.org/multipage/interaction.html#dom-document-hasfocus: whether the key events are routed through or to the document, and its top-level browsing context has the system focus (see BrowsingContext.HasSystemFocus).
public bool HasFocus()ImportNode overloads
ImportNode(Node, ImportNodeOptions)
Document.cshttps://dom.spec.whatwg.org/#dom-document-importnode
public Node ImportNode(Node node, ImportNodeOptions options)ImportNode(Node, bool)
Document.csMoveBefore(Node, Node?)
Mixins.Members.csOpen overloads
Open(string?, string?)
Document.DynamicMarkupInsertion.cshttps://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-document-open: replaces the document in place (its nodes, event listeners and URL) with an empty document, whose content is given by Document.Write. It has no effect in a script run by the parser.
Parameters
Returns
See also
Open(string, string, string)
Document.DynamicMarkupInsertion.cshttps://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-document-open-window: runs the window open steps, as Window.Open. As in the browsers, the target (e.g. _self) is chosen from the navigable of this document, not from the one of the entry document.
Parameters
Returns
See also
ParseHtml(string, SetHtmlOptions?)
DynamicMarkup.cshttps://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-parsehtml
public static Document ParseHtml(string html, SetHtmlOptions? options = null)ParseHtmlUnsafe overloads
ParseHtmlUnsafe(TrustedHtml, ParseHtmlUnsafeOptionsOrTrustedHtmlParserOptions?)
DynamicMarkup.cshttps://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-parsehtmlunsafe
public static Document ParseHtmlUnsafe(TrustedHtml html, ParseHtmlUnsafeOptionsOrTrustedHtmlParserOptions? options = null)Parameters
Returns
Exceptions
TypeErrorException- Trusted Types are enforced and the options are not trusted.
See also
ParseHtmlUnsafe(string, ParseHtmlUnsafeOptionsOrTrustedHtmlParserOptions?)
DynamicMarkup.cshttps://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-parsehtmlunsafe
public static Document ParseHtmlUnsafe(string html, ParseHtmlUnsafeOptionsOrTrustedHtmlParserOptions? options = null)Parameters
Returns
Exceptions
TypeErrorException- Trusted Types are enforced and the options or the value are not trusted.
See also
Prepend(ReadOnlySpan<NodeOrString>)
Mixins.Members.csInserts the nodes before the first child, converting the strings into text nodes.
public void Prepend(params scoped ReadOnlySpan<NodeOrString> nodes)Parameters
See also
QueryCommandEnabled(string)
Document.Legacy.csReturns a value indicating whether the editing command can currently be executed.
QueryCommandIndeterm(string)
Document.Legacy.cshttps://w3c.github.io/editing/docs/execCommand/#querycommandindeterm(): whether the command is indeterminate (e.g. a part of the selection is bold).
QueryCommandState(string)
Document.Legacy.cshttps://w3c.github.io/editing/docs/execCommand/#querycommandstate(): the state of the command (e.g. whether the selection is bold).
QueryCommandSupported(string)
Document.Legacy.csReturns a value indicating whether the editing command is supported.
QueryCommandValue(string)
Document.Legacy.cshttps://w3c.github.io/editing/docs/execCommand/#querycommandvalue(): the value of the command (e.g. the font name of the selection).
QuerySelector overloads
QuerySelector(SelectorList)
Mixins.Members.csReturns the first descendant element, in tree order, that matches the parsed selector list, or null.
public Element? QuerySelector(SelectorList selectors)QuerySelector(string)
Mixins.Members.csReturns the first descendant element, in tree order, that matches the selectors, or null.
QuerySelector<T>(SelectorList)
Mixins.Members.csReturns the first descendant, in tree order, that is a T and matches the parsed selector.
public T? QuerySelector<T>(SelectorList selectors) where T : ElementQuerySelector<T>(string)
Mixins.Members.csQuerySelectorAll overloads
QuerySelectorAll(SelectorList)
Mixins.Members.csReturns the descendant elements, in tree order, that match the parsed selector list.
public NodeList QuerySelectorAll(SelectorList selectors)QuerySelectorAll(string)
Mixins.Members.csReturns the descendant elements, in tree order, that match the selectors.
QuerySelectorAll<T>(SelectorList)
Mixins.Members.csReturns the descendants, in tree order, that are a T and match the parsed selector.
public IReadOnlyList<T> QuerySelectorAll<T>(SelectorList selectors) where T : ElementQuerySelectorAll<T>(string)
Mixins.Members.csReturns the descendants, in tree order, that are a T and match the selector.
public IReadOnlyList<T> QuerySelectorAll<T>(string selectors) where T : ElementReleaseEvents()
Document.Legacy.csDoes nothing; this obsolete method is kept for compatibility.
public void ReleaseEvents()ReplaceChildren(ReadOnlySpan<NodeOrString>)
Mixins.Members.csReplaces all the children with the given nodes, converting the strings into text nodes.
public void ReplaceChildren(params scoped ReadOnlySpan<NodeOrString> nodes)Parameters
See also
StartViewTransition overloads
StartViewTransition(StartViewTransitionOptions?)
Document.ViewTransitions.csStarts a view transition with options (https://drafts.csswg.org/css-view-transitions-2/#dom-document-startviewtransition): the update callback and the types of the transition.
public ViewTransition StartViewTransition(StartViewTransitionOptions? options = null)StartViewTransition(ViewTransitionUpdateCallback)
Document.ViewTransitions.csStarts a view transition (https://drafts.csswg.org/css-view-transitions-1/#dom-document-startviewtransition): the old state of the document is captured at the next rendering opportunity, then the callback updates the document, and the transition between the two states is animated. The active view transition of the document, if any, is skipped.
public ViewTransition StartViewTransition(ViewTransitionUpdateCallback callback)Parameters
callbackViewTransitionUpdateCallback- The callback that updates the document. It is always called, even when the transition cannot happen.
Returns
See also
Write(ReadOnlySpan<TrustedHtmlOrString>)
Document.DynamicMarkupInsertion.cshttps://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-document-write: inserts markup in the input stream of the parser (after the script being executed by the parser), or replaces the document (as Document.Open) when the document is not being parsed.
public void Write(params scoped ReadOnlySpan<TrustedHtmlOrString> text)WriteHtml(TextWriter, GetHtmlOptions?)
DynamicMarkup.csSame as Document.GetHtml, but writes the serialization to writer instead of building a string.
public void WriteHtml(TextWriter writer, GetHtmlOptions? options = null)Parameters
writerTextWriteroptionsGetHtmlOptions?
Writeln(ReadOnlySpan<TrustedHtmlOrString>)
Document.DynamicMarkupInsertion.cshttps://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-document-writeln: Document.Write followed by a line feed.
public void Writeln(params scoped ReadOnlySpan<TrustedHtmlOrString> text)