Document Class

https://dom.spec.whatwg.org/#interface-document

public class Document : Node, INonElementParentNode, IParentNode
Inheritance
Node Document
Implements

Constructors

NameDescription
Document()https://dom.spec.whatwg.org/#dom-document-document

Document()

Document.cs

https://dom.spec.whatwg.org/#dom-document-document

public Document()

Properties

NameDescription
ActiveElementhttps://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.
ActiveViewTransitionGets the active view transition of the document, or null (https://drafts.csswg.org/css-view-transitions-2/#dom-document-activeviewtransition).
AdoptedStyleSheetsGets the list of the constructed style sheets adopted by the document.
AlinkColorhttps://html.spec.whatwg.org/multipage/obsolete.html#dom-document-alinkcolor
Allhttps://html.spec.whatwg.org/multipage/obsolete.html#dom-document-all
AnchorsGets a live collection of the a elements of the document that have a name attribute.
AnimationWorkletGets 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.
AppletsGets an always empty collection, as applets are no longer supported.
BgColorhttps://html.spec.whatwg.org/multipage/obsolete.html#dom-document-bgcolor
Bodyhttps://html.spec.whatwg.org/multipage/dom.html#dom-document-body
CharacterSetGets the name of the character encoding of the document.
CharsetGets the name of the character encoding of the document (alias of characterSet).
ChildElementCountGets the number of child elements.
ChildrenGets the live collection of the child elements.
CompatModeGets BackCompat when the document is in quirks mode, otherwise CSS1Compat.
ContentTypeGets the content type (MIME type) of the document.
Cookiehttps://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.
CurrentScriptAlways null, as scripts are not executed, unless the host executes scripts.
CustomElementRegistryhttps://dom.spec.whatwg.org/#dom-documentorshadowroot-customelementregistry
DefaultViewThe 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.
DesignModehttps://html.spec.whatwg.org/multipage/interaction.html#designMode
Dirhttps://html.spec.whatwg.org/multipage/dom.html#dom-document-dir
DoctypeGets the document type node that is a child of the document, or null when there is none.
DocumentElementGets the root element of the document, or null when there is none.
DocumentUriGets the serialized URL of the document (alias of URL).
Domainhttps://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).
EmbedsGets a live collection of the embed elements of the document.
FgColorhttps://html.spec.whatwg.org/multipage/obsolete.html#dom-document-fgcolor
FirstElementChildGets the first child that is an element, or null when there is none.
FontsThe font source of the document (https://drafts.csswg.org/css-font-loading/#font-source).
FormsGets a live collection of the form elements of the document.
FragmentDirectiveGets 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.
FullscreenGets whether the document has a fullscreen element (https://fullscreen.spec.whatwg.org/#dom-document-fullscreen, historical: use Document.FullscreenElement).
FullscreenElementGets 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.
FullscreenEnabledGets whether the document is allowed to display elements fullscreen (https://fullscreen.spec.whatwg.org/#dom-document-fullscreenenabled): its permissions policy allows the fullscreen feature.
Headhttps://html.spec.whatwg.org/multipage/dom.html#dom-document-head
Hiddenhttps://html.spec.whatwg.org/multipage/interaction.html#dom-document-hidden
HighlightsThe 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.
ImagesGets a live collection of the img elements of the document.
ImplementationGets the DOMImplementation object associated with the document.
InputEncodingGets the name of the character encoding of the document (alias of characterSet).
IsNetworkErrorDocumentGets 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.
LastElementChildGets the last child that is an element, or null when there is none.
LastModifiedhttps://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).
LayoutWorkletGets 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.
LinkColorhttps://html.spec.whatwg.org/multipage/obsolete.html#dom-document-linkcolor
LinksGets a live collection of the a and area elements of the document that have an href attribute.
LocationThe location of the window, when the document is fully active (https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-document-location).
NodeNameGets the node name of a document, which is #document.
NodeTypeGets the node type of a document, which is 9 (DOCUMENT_NODE).
OnAbortGets or sets the event handler of the abort event (the onabort event handler attribute).
OnAnimationCancelGets or sets the event handler of the animationcancel event (the onanimationcancel event handler attribute).
OnAnimationEndGets or sets the event handler of the animationend event (the onanimationend event handler attribute).
OnAnimationIterationGets or sets the event handler of the animationiteration event (the onanimationiteration event handler attribute).
OnAnimationStartGets or sets the event handler of the animationstart event (the onanimationstart event handler attribute).
OnAuxClickGets or sets the event handler of the auxclick event (the onauxclick event handler attribute).
OnBeforeInputGets or sets the event handler of the beforeinput event (the onbeforeinput event handler attribute).
OnBeforeMatchGets or sets the event handler of the beforematch event (the onbeforematch event handler attribute).
OnBeforeToggleGets or sets the event handler of the beforetoggle event (the onbeforetoggle event handler attribute).
OnBlurGets or sets the event handler of the blur event (the onblur event handler attribute).
OnCanPlayGets or sets the event handler of the canplay event (the oncanplay event handler attribute).
OnCanPlayThroughGets or sets the event handler of the canplaythrough event (the oncanplaythrough event handler attribute).
OnCancelGets or sets the event handler of the cancel event (the oncancel event handler attribute).
OnChangeGets or sets the event handler of the change event (the onchange event handler attribute).
OnClickGets or sets the event handler of the click event (the onclick event handler attribute).
OnCloseGets or sets the event handler of the close event (the onclose event handler attribute).
OnCommandGets or sets the event handler of the command event (the oncommand event handler attribute).
OnContentVisibilityAutoStateChangeGets or sets the event handler of the contentvisibilityautostatechange event (the oncontentvisibilityautostatechange event handler attribute).
OnContextMenuGets or sets the event handler of the contextmenu event (the oncontextmenu event handler attribute).
OnContextRestoredGets or sets the event handler of the contextrestored event (the oncontextrestored event handler attribute).
OnContextlostGets or sets the event handler of the contextlost event (the oncontextlost event handler attribute).
OnCopyGets or sets the event handler of the copy event (the oncopy event handler attribute).
OnCueChangeGets or sets the event handler of the cuechange event (the oncuechange event handler attribute).
OnCutGets or sets the event handler of the cut event (the oncut event handler attribute).
OnDblClickGets or sets the event handler of the dblclick event (the ondblclick event handler attribute).
OnDragGets or sets the event handler of the drag event (the ondrag event handler attribute).
OnDragEndGets or sets the event handler of the dragend event (the ondragend event handler attribute).
OnDragEnterGets or sets the event handler of the dragenter event (the ondragenter event handler attribute).
OnDragLeaveGets or sets the event handler of the dragleave event (the ondragleave event handler attribute).
OnDragOverGets or sets the event handler of the dragover event (the ondragover event handler attribute).
OnDragStartGets or sets the event handler of the dragstart event (the ondragstart event handler attribute).
OnDropGets or sets the event handler of the drop event (the ondrop event handler attribute).
OnDurationChangeGets or sets the event handler of the durationchange event (the ondurationchange event handler attribute).
OnEmptiedGets or sets the event handler of the emptied event (the onemptied event handler attribute).
OnEndedGets or sets the event handler of the ended event (the onended event handler attribute).
OnErrorGets or sets the event handler of the error event (the onerror event handler attribute).
OnFocusGets or sets the event handler of the focus event (the onfocus event handler attribute).
OnFormDataGets or sets the event handler of the formdata event (the onformdata event handler attribute).
OnFreezeGets or sets the event handler of the freeze event, fired when the document is frozen.
OnFullscreenChangeGets or sets the event handler of the fullscreenchange event (the onfullscreenchange event handler attribute).
OnFullscreenErrorGets or sets the event handler of the fullscreenerror event (the onfullscreenerror event handler attribute).
OnGotPointerCaptureGets or sets the event handler of the gotpointercapture event (the ongotpointercapture event handler attribute).
OnInputGets or sets the event handler of the input event (the oninput event handler attribute).
OnInvalidGets or sets the event handler of the invalid event (the oninvalid event handler attribute).
OnKeyDownGets or sets the event handler of the keydown event (the onkeydown event handler attribute).
OnKeyPressGets or sets the event handler of the keypress event (the onkeypress event handler attribute).
OnKeyUpGets or sets the event handler of the keyup event (the onkeyup event handler attribute).
OnLoadGets or sets the event handler of the load event (the onload event handler attribute).
OnLoadStartGets or sets the event handler of the loadstart event (the onloadstart event handler attribute).
OnLoadedDataGets or sets the event handler of the loadeddata event (the onloadeddata event handler attribute).
OnLoadedMetadataGets or sets the event handler of the loadedmetadata event (the onloadedmetadata event handler attribute).
OnLostPointerCaptureGets or sets the event handler of the lostpointercapture event (the onlostpointercapture event handler attribute).
OnMouseDownGets or sets the event handler of the mousedown event (the onmousedown event handler attribute).
OnMouseEnterGets or sets the event handler of the mouseenter event (the onmouseenter event handler attribute).
OnMouseLeaveGets or sets the event handler of the mouseleave event (the onmouseleave event handler attribute).
OnMouseMoveGets or sets the event handler of the mousemove event (the onmousemove event handler attribute).
OnMouseOutGets or sets the event handler of the mouseout event (the onmouseout event handler attribute).
OnMouseOverGets or sets the event handler of the mouseover event (the onmouseover event handler attribute).
OnMouseUpGets or sets the event handler of the mouseup event (the onmouseup event handler attribute).
OnPasteGets or sets the event handler of the paste event (the onpaste event handler attribute).
OnPauseGets or sets the event handler of the pause event (the onpause event handler attribute).
OnPlayGets or sets the event handler of the play event (the onplay event handler attribute).
OnPlayingGets or sets the event handler of the playing event (the onplaying event handler attribute).
OnPointerCancelGets or sets the event handler of the pointercancel event (the onpointercancel event handler attribute).
OnPointerDownGets or sets the event handler of the pointerdown event (the onpointerdown event handler attribute).
OnPointerEnterGets or sets the event handler of the pointerenter event (the onpointerenter event handler attribute).
OnPointerLeaveGets or sets the event handler of the pointerleave event (the onpointerleave event handler attribute).
OnPointerLockChangeGets or sets the event handler of the pointerlockchange event (the onpointerlockchange event handler attribute).
OnPointerLockErrorGets or sets the event handler of the pointerlockerror event (the onpointerlockerror event handler attribute).
OnPointerMoveGets or sets the event handler of the pointermove event (the onpointermove event handler attribute).
OnPointerOutGets or sets the event handler of the pointerout event (the onpointerout event handler attribute).
OnPointerOverGets or sets the event handler of the pointerover event (the onpointerover event handler attribute).
OnPointerRawUpdateGets or sets the event handler of the pointerrawupdate event (the onpointerrawupdate event handler attribute).
OnPointerUpGets or sets the event handler of the pointerup event (the onpointerup event handler attribute).
OnPrerenderingChangeGets or sets the event handler of the prerenderingchange event (the onprerenderingchange event handler attribute).
OnProgressGets or sets the event handler of the progress event (the onprogress event handler attribute).
OnRateChangeGets or sets the event handler of the ratechange event (the onratechange event handler attribute).
OnReadyStateChangeGets or sets the event handler of the readystatechange event (the onreadystatechange event handler attribute).
OnResetGets or sets the event handler of the reset event (the onreset event handler attribute).
OnResizeGets or sets the event handler of the resize event (the onresize event handler attribute).
OnResumeGets or sets the event handler of the resume event, fired when the document is resumed.
OnScrollGets or sets the event handler of the scroll event (the onscroll event handler attribute).
OnScrollEndGets or sets the event handler of the scrollend event (the onscrollend event handler attribute).
OnScrollSnapChangeGets or sets the event handler of the scrollsnapchange event (the onscrollsnapchange event handler attribute).
OnScrollSnapChangingGets or sets the event handler of the scrollsnapchanging event (the onscrollsnapchanging event handler attribute).
OnSecurityPolicyViolationGets or sets the event handler of the securitypolicyviolation event (the onsecuritypolicyviolation event handler attribute).
OnSeekedGets or sets the event handler of the seeked event (the onseeked event handler attribute).
OnSeekingGets or sets the event handler of the seeking event (the onseeking event handler attribute).
OnSelectGets or sets the event handler of the select event (the onselect event handler attribute).
OnSelectStartGets or sets the event handler of the selectstart event (the onselectstart event handler attribute).
OnSelectionChangeGets or sets the event handler of the selectionchange event (the onselectionchange event handler attribute).
OnSlotChangeGets or sets the event handler of the slotchange event (the onslotchange event handler attribute).
OnStalledGets or sets the event handler of the stalled event (the onstalled event handler attribute).
OnSubmitGets or sets the event handler of the submit event (the onsubmit event handler attribute).
OnSuspendGets or sets the event handler of the suspend event (the onsuspend event handler attribute).
OnTimeUpdateGets or sets the event handler of the timeupdate event (the ontimeupdate event handler attribute).
OnToggleGets or sets the event handler of the toggle event (the ontoggle event handler attribute).
OnTransitionCancelGets or sets the event handler of the transitioncancel event (the ontransitioncancel event handler attribute).
OnTransitionEndGets or sets the event handler of the transitionend event (the ontransitionend event handler attribute).
OnTransitionRunGets or sets the event handler of the transitionrun event (the ontransitionrun event handler attribute).
OnTransitionStartGets or sets the event handler of the transitionstart event (the ontransitionstart event handler attribute).
OnVisibilityChangeGets or sets the event handler of the visibilitychange event (the onvisibilitychange event handler attribute).
OnVolumeChangeGets or sets the event handler of the volumechange event (the onvolumechange event handler attribute).
OnWaitingGets or sets the event handler of the waiting event (the onwaiting event handler attribute).
OnWebkitAnimationEndGets or sets the event handler of the webkitanimationend event (the onwebkitanimationend event handler attribute).
OnWebkitAnimationIterationGets or sets the event handler of the webkitanimationiteration event (the onwebkitanimationiteration event handler attribute).
OnWebkitAnimationStartGets or sets the event handler of the webkitanimationstart event (the onwebkitanimationstart event handler attribute).
OnWebkitTransitionEndGets or sets the event handler of the webkittransitionend event (the onwebkittransitionend event handler attribute).
OnWheelGets or sets the event handler of the wheel event (the onwheel event handler attribute).
PaintWorkletGets 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.
PermissionsPolicyGets the policy object of the document (https://w3c.github.io/webappsec-permissions-policy/#dom-document-permissionspolicy): the features that its permissions policy allows.
PluginsGets a live collection of the embed elements of the document (alias of embeds).
PointerLockElementGets 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.
PrerenderingGets 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).
ReadyStateDocuments parsed by this library are fully loaded, so the readiness is "complete" unless the host changes it.
Referrerhttps://html.spec.whatwg.org/multipage/dom.html#dom-document-referrer: the URL of the document that created or navigated to this document.
RootElementhttps://svgwg.org/svg2-draft/struct.html#__svg__Document__rootElement
ScriptsGets a live collection of the script elements of the document.
ScrollingElementGets 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.
StyleSheetsGets the list of the style sheets of the document.
TextContentGets or sets the text content of the document; the value is always null and setting it has no effect.
TimelineGets the default document timeline (https://drafts.csswg.org/web-animations-1/#dom-document-timeline).
Titlehttps://html.spec.whatwg.org/multipage/dom.html#document.title
TrustedTypesThe 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.
TrustedTypesDirectivesThe 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.
UrlGets the serialized URL of the document.
VisibilityStatehttps://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.
VlinkColorhttps://html.spec.whatwg.org/multipage/obsolete.html#dom-document-vlinkcolor
WasDiscardedGets 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.cs

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.

public Element? ActiveElement { get; }

ActiveViewTransition

Document.ViewTransitions.cs

Gets 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.cs

Gets the list of the constructed style sheets adopted by the document.

public IList<CssStyleSheet> AdoptedStyleSheets { get; set; }

https://html.spec.whatwg.org/multipage/obsolete.html#dom-document-alinkcolor

public string AlinkColor { get; set; }

https://html.spec.whatwg.org/multipage/obsolete.html#dom-document-all

public HtmlAllCollection All { get; }

Gets a live collection of the a elements of the document that have a name attribute.

public HtmlCollection Anchors { get; }

AnimationWorklet

Document.Worklets.cs

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.

public Worklet AnimationWorklet { get; }

Property value

Worklet

Gets an always empty collection, as applets are no longer supported.

public HtmlCollection Applets { get; }

https://html.spec.whatwg.org/multipage/obsolete.html#dom-document-bgcolor

public string BgColor { get; set; }

https://html.spec.whatwg.org/multipage/dom.html#dom-document-body

public HtmlElement? Body { get; set; }

CharacterSet

Document.cs

Gets the name of the character encoding of the document.

public string CharacterSet { get; }

Gets the name of the character encoding of the document (alias of characterSet).

public string Charset { get; }

ChildElementCount

Mixins.Members.cs

Gets the number of child elements.

public uint ChildElementCount { get; }

Gets the live collection of the child elements.

public HtmlCollection Children { get; }

CompatMode

Document.cs

Gets BackCompat when the document is in quirks mode, otherwise CSS1Compat.

public string CompatMode { get; }

ContentType

Document.cs

Gets the content type (MIME type) of the document.

public string ContentType { get; }

CurrentScript

Document.Html.cs

Always null, as scripts are not executed, unless the host executes scripts.

public Element? CurrentScript { get; }

CustomElementRegistry

Document.cs

https://dom.spec.whatwg.org/#dom-documentorshadowroot-customelementregistry

public CustomElementRegistry? CustomElementRegistry { get; }

DefaultView

Document.Html.cs

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.

public Window? DefaultView { get; }

https://html.spec.whatwg.org/multipage/interaction.html#designMode

public string DesignMode { get; set; }

https://html.spec.whatwg.org/multipage/dom.html#dom-document-dir

public string Dir { get; set; }

Gets the document type node that is a child of the document, or null when there is none.

public DocumentType? Doctype { get; }

DocumentElement

Document.cs

Gets the root element of the document, or null when there is none.

public Element? DocumentElement { get; }

DocumentUri

Document.cs

Gets the serialized URL of the document (alias of URL).

public string DocumentUri { get; }

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).

public string Domain { get; set; }

Gets a live collection of the embed elements of the document.

public HtmlCollection Embeds { get; }

https://html.spec.whatwg.org/multipage/obsolete.html#dom-document-fgcolor

public string FgColor { get; set; }

FirstElementChild

Mixins.Members.cs

Gets the first child that is an element, or null when there is none.

public Element? FirstElementChild { get; }

The font source of the document (https://drafts.csswg.org/css-font-loading/#font-source).

public FontFaceSet Fonts { get; }

Gets a live collection of the form elements of the document.

public HtmlCollection Forms { get; }

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.

public FragmentDirective FragmentDirective { get; }

Fullscreen

Fullscreen.cs

Gets 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.cs

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.

public Element? FullscreenElement { get; }

FullscreenEnabled

Fullscreen.cs

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.

public bool FullscreenEnabled { get; }

https://html.spec.whatwg.org/multipage/interaction.html#dom-document-hidden

public bool Hidden { get; }

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.

public HighlightRegistry Highlights { get; }

Property value

HighlightRegistry

Gets a live collection of the img elements of the document.

public HtmlCollection Images { get; }

Implementation

Document.cs

Gets the DOMImplementation object associated with the document.

public DomImplementation Implementation { get; }

InputEncoding

Document.cs

Gets the name of the character encoding of the document (alias of characterSet).

public string InputEncoding { get; }

IsNetworkErrorDocument

Document.Navigation.cs

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.

public bool IsNetworkErrorDocument { get; }

Property value

bool

LastElementChild

Mixins.Members.cs

Gets the last child that is an element, or null when there is none.

public Element? LastElementChild { get; }

LastModified

Document.Legacy.cs

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).

public string LastModified { get; }

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.

public Worklet LayoutWorklet { get; }

Property value

Worklet

https://html.spec.whatwg.org/multipage/obsolete.html#dom-document-linkcolor

public string LinkColor { get; set; }

The 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.cs

Gets the node name of a document, which is #document.

public override string NodeName { get; }

Property value

string

NodeType

Document.cs

Gets the node type of a document, which is 9 (DOCUMENT_NODE).

public override ushort NodeType { get; }

Property value

ushort

Gets or sets the event handler of the abort event (the onabort event handler attribute).

public Action<Event>? OnAbort { get; set; }

OnAnimationCancel

Document.g.cs

Gets or sets the event handler of the animationcancel event (the onanimationcancel event handler attribute).

public Action<Event>? OnAnimationCancel { get; set; }

OnAnimationEnd

Document.g.cs

Gets or sets the event handler of the animationend event (the onanimationend event handler attribute).

public Action<Event>? OnAnimationEnd { get; set; }

OnAnimationIteration

Document.g.cs

Gets or sets the event handler of the animationiteration event (the onanimationiteration event handler attribute).

public Action<Event>? OnAnimationIteration { get; set; }

OnAnimationStart

Document.g.cs

Gets or sets the event handler of the animationstart event (the onanimationstart event handler attribute).

public Action<Event>? OnAnimationStart { get; set; }

OnAuxClick

Document.g.cs

Gets or sets the event handler of the auxclick event (the onauxclick event handler attribute).

public Action<Event>? OnAuxClick { get; set; }

OnBeforeInput

Document.g.cs

Gets or sets the event handler of the beforeinput event (the onbeforeinput event handler attribute).

public Action<Event>? OnBeforeInput { get; set; }

OnBeforeMatch

Document.g.cs

Gets or sets the event handler of the beforematch event (the onbeforematch event handler attribute).

public Action<Event>? OnBeforeMatch { get; set; }

OnBeforeToggle

Document.g.cs

Gets or sets the event handler of the beforetoggle event (the onbeforetoggle event handler attribute).

public Action<Event>? OnBeforeToggle { get; set; }

Gets or sets the event handler of the blur event (the onblur event handler attribute).

public Action<Event>? OnBlur { get; set; }

OnCanPlay

Document.g.cs

Gets or sets the event handler of the canplay event (the oncanplay event handler attribute).

public Action<Event>? OnCanPlay { get; set; }

OnCanPlayThrough

Document.g.cs

Gets or sets the event handler of the canplaythrough event (the oncanplaythrough event handler attribute).

public Action<Event>? OnCanPlayThrough { get; set; }

Gets or sets the event handler of the cancel event (the oncancel event handler attribute).

public Action<Event>? OnCancel { get; set; }

Gets or sets the event handler of the change event (the onchange event handler attribute).

public Action<Event>? OnChange { get; set; }

Gets or sets the event handler of the click event (the onclick event handler attribute).

public Action<Event>? OnClick { get; set; }

Gets or sets the event handler of the close event (the onclose event handler attribute).

public Action<Event>? OnClose { get; set; }

OnCommand

Document.g.cs

Gets or sets the event handler of the command event (the oncommand event handler attribute).

public Action<Event>? OnCommand { get; set; }

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.cs

Gets or sets the event handler of the contextmenu event (the oncontextmenu event handler attribute).

public Action<Event>? OnContextMenu { get; set; }

OnContextRestored

Document.g.cs

Gets or sets the event handler of the contextrestored event (the oncontextrestored event handler attribute).

public Action<Event>? OnContextRestored { get; set; }

OnContextlost

Document.g.cs

Gets or sets the event handler of the contextlost event (the oncontextlost event handler attribute).

public Action<Event>? OnContextlost { get; set; }

Gets or sets the event handler of the copy event (the oncopy event handler attribute).

public Action<Event>? OnCopy { get; set; }

OnCueChange

Document.g.cs

Gets or sets the event handler of the cuechange event (the oncuechange event handler attribute).

public Action<Event>? OnCueChange { get; set; }

Gets or sets the event handler of the cut event (the oncut event handler attribute).

public Action<Event>? OnCut { get; set; }

OnDblClick

Document.g.cs

Gets or sets the event handler of the dblclick event (the ondblclick event handler attribute).

public Action<Event>? OnDblClick { get; set; }

Gets or sets the event handler of the drag event (the ondrag event handler attribute).

public Action<Event>? OnDrag { get; set; }

OnDragEnd

Document.g.cs

Gets or sets the event handler of the dragend event (the ondragend event handler attribute).

public Action<Event>? OnDragEnd { get; set; }

OnDragEnter

Document.g.cs

Gets or sets the event handler of the dragenter event (the ondragenter event handler attribute).

public Action<Event>? OnDragEnter { get; set; }

OnDragLeave

Document.g.cs

Gets or sets the event handler of the dragleave event (the ondragleave event handler attribute).

public Action<Event>? OnDragLeave { get; set; }

OnDragOver

Document.g.cs

Gets or sets the event handler of the dragover event (the ondragover event handler attribute).

public Action<Event>? OnDragOver { get; set; }

OnDragStart

Document.g.cs

Gets or sets the event handler of the dragstart event (the ondragstart event handler attribute).

public Action<Event>? OnDragStart { get; set; }

Gets or sets the event handler of the drop event (the ondrop event handler attribute).

public Action<Event>? OnDrop { get; set; }

OnDurationChange

Document.g.cs

Gets or sets the event handler of the durationchange event (the ondurationchange event handler attribute).

public Action<Event>? OnDurationChange { get; set; }

OnEmptied

Document.g.cs

Gets or sets the event handler of the emptied event (the onemptied event handler attribute).

public Action<Event>? OnEmptied { get; set; }

Gets or sets the event handler of the ended event (the onended event handler attribute).

public Action<Event>? OnEnded { get; set; }

Gets or sets the event handler of the error event (the onerror event handler attribute).

public Action<Event>? OnError { get; set; }

Gets or sets the event handler of the focus event (the onfocus event handler attribute).

public Action<Event>? OnFocus { get; set; }

OnFormData

Document.g.cs

Gets or sets the event handler of the formdata event (the onformdata event handler attribute).

public Action<Event>? OnFormData { get; set; }

Gets or sets the event handler of the freeze event, fired when the document is frozen.

public Action<Event>? OnFreeze { get; set; }

OnFullscreenChange

Document.g.cs

Gets or sets the event handler of the fullscreenchange event (the onfullscreenchange event handler attribute).

public Action<Event>? OnFullscreenChange { get; set; }

OnFullscreenError

Document.g.cs

Gets or sets the event handler of the fullscreenerror event (the onfullscreenerror event handler attribute).

public Action<Event>? OnFullscreenError { get; set; }

OnGotPointerCapture

Document.g.cs

Gets or sets the event handler of the gotpointercapture event (the ongotpointercapture event handler attribute).

public Action<Event>? OnGotPointerCapture { get; set; }

Gets or sets the event handler of the input event (the oninput event handler attribute).

public Action<Event>? OnInput { get; set; }

OnInvalid

Document.g.cs

Gets or sets the event handler of the invalid event (the oninvalid event handler attribute).

public Action<Event>? OnInvalid { get; set; }

OnKeyDown

Document.g.cs

Gets or sets the event handler of the keydown event (the onkeydown event handler attribute).

public Action<Event>? OnKeyDown { get; set; }

OnKeyPress

Document.g.cs

Gets or sets the event handler of the keypress event (the onkeypress event handler attribute).

public Action<Event>? OnKeyPress { get; set; }

Gets or sets the event handler of the keyup event (the onkeyup event handler attribute).

public Action<Event>? OnKeyUp { get; set; }

Gets or sets the event handler of the load event (the onload event handler attribute).

public Action<Event>? OnLoad { get; set; }

OnLoadStart

Document.g.cs

Gets or sets the event handler of the loadstart event (the onloadstart event handler attribute).

public Action<Event>? OnLoadStart { get; set; }

OnLoadedData

Document.g.cs

Gets or sets the event handler of the loadeddata event (the onloadeddata event handler attribute).

public Action<Event>? OnLoadedData { get; set; }

OnLoadedMetadata

Document.g.cs

Gets or sets the event handler of the loadedmetadata event (the onloadedmetadata event handler attribute).

public Action<Event>? OnLoadedMetadata { get; set; }

OnLostPointerCapture

Document.g.cs

Gets or sets the event handler of the lostpointercapture event (the onlostpointercapture event handler attribute).

public Action<Event>? OnLostPointerCapture { get; set; }

OnMouseDown

Document.g.cs

Gets or sets the event handler of the mousedown event (the onmousedown event handler attribute).

public Action<Event>? OnMouseDown { get; set; }

OnMouseEnter

Document.g.cs

Gets or sets the event handler of the mouseenter event (the onmouseenter event handler attribute).

public Action<Event>? OnMouseEnter { get; set; }

OnMouseLeave

Document.g.cs

Gets or sets the event handler of the mouseleave event (the onmouseleave event handler attribute).

public Action<Event>? OnMouseLeave { get; set; }

OnMouseMove

Document.g.cs

Gets or sets the event handler of the mousemove event (the onmousemove event handler attribute).

public Action<Event>? OnMouseMove { get; set; }

OnMouseOut

Document.g.cs

Gets or sets the event handler of the mouseout event (the onmouseout event handler attribute).

public Action<Event>? OnMouseOut { get; set; }

OnMouseOver

Document.g.cs

Gets or sets the event handler of the mouseover event (the onmouseover event handler attribute).

public Action<Event>? OnMouseOver { get; set; }

OnMouseUp

Document.g.cs

Gets or sets the event handler of the mouseup event (the onmouseup event handler attribute).

public Action<Event>? OnMouseUp { get; set; }

Gets or sets the event handler of the paste event (the onpaste event handler attribute).

public Action<Event>? OnPaste { get; set; }

Gets or sets the event handler of the pause event (the onpause event handler attribute).

public Action<Event>? OnPause { get; set; }

Gets or sets the event handler of the play event (the onplay event handler attribute).

public Action<Event>? OnPlay { get; set; }

OnPlaying

Document.g.cs

Gets or sets the event handler of the playing event (the onplaying event handler attribute).

public Action<Event>? OnPlaying { get; set; }

OnPointerCancel

Document.g.cs

Gets or sets the event handler of the pointercancel event (the onpointercancel event handler attribute).

public Action<Event>? OnPointerCancel { get; set; }

OnPointerDown

Document.g.cs

Gets or sets the event handler of the pointerdown event (the onpointerdown event handler attribute).

public Action<Event>? OnPointerDown { get; set; }

OnPointerEnter

Document.g.cs

Gets or sets the event handler of the pointerenter event (the onpointerenter event handler attribute).

public Action<Event>? OnPointerEnter { get; set; }

OnPointerLeave

Document.g.cs

Gets or sets the event handler of the pointerleave event (the onpointerleave event handler attribute).

public Action<Event>? OnPointerLeave { get; set; }

OnPointerLockChange

Document.g.cs

Gets or sets the event handler of the pointerlockchange event (the onpointerlockchange event handler attribute).

public Action<Event>? OnPointerLockChange { get; set; }

OnPointerLockError

Document.g.cs

Gets or sets the event handler of the pointerlockerror event (the onpointerlockerror event handler attribute).

public Action<Event>? OnPointerLockError { get; set; }

OnPointerMove

Document.g.cs

Gets or sets the event handler of the pointermove event (the onpointermove event handler attribute).

public Action<Event>? OnPointerMove { get; set; }

OnPointerOut

Document.g.cs

Gets or sets the event handler of the pointerout event (the onpointerout event handler attribute).

public Action<Event>? OnPointerOut { get; set; }

OnPointerOver

Document.g.cs

Gets or sets the event handler of the pointerover event (the onpointerover event handler attribute).

public Action<Event>? OnPointerOver { get; set; }

OnPointerRawUpdate

Document.g.cs

Gets or sets the event handler of the pointerrawupdate event (the onpointerrawupdate event handler attribute).

public Action<Event>? OnPointerRawUpdate { get; set; }

OnPointerUp

Document.g.cs

Gets or sets the event handler of the pointerup event (the onpointerup event handler attribute).

public Action<Event>? OnPointerUp { get; set; }

OnPrerenderingChange

Document.SpeculativeLoading.cs

Gets or sets the event handler of the prerenderingchange event (the onprerenderingchange event handler attribute).

public Action<Event>? OnPrerenderingChange { get; set; }

OnProgress

Document.g.cs

Gets or sets the event handler of the progress event (the onprogress event handler attribute).

public Action<Event>? OnProgress { get; set; }

OnRateChange

Document.g.cs

Gets or sets the event handler of the ratechange event (the onratechange event handler attribute).

public Action<Event>? OnRateChange { get; set; }

OnReadyStateChange

Document.g.cs

Gets or sets the event handler of the readystatechange event (the onreadystatechange event handler attribute).

public Action<Event>? OnReadyStateChange { get; set; }

Gets or sets the event handler of the reset event (the onreset event handler attribute).

public Action<Event>? OnReset { get; set; }

Gets or sets the event handler of the resize event (the onresize event handler attribute).

public Action<Event>? OnResize { get; set; }

Gets or sets the event handler of the resume event, fired when the document is resumed.

public Action<Event>? OnResume { get; set; }

Gets or sets the event handler of the scroll event (the onscroll event handler attribute).

public Action<Event>? OnScroll { get; set; }

OnScrollEnd

Document.g.cs

Gets or sets the event handler of the scrollend event (the onscrollend event handler attribute).

public Action<Event>? OnScrollEnd { get; set; }

OnScrollSnapChange

Document.g.cs

Gets or sets the event handler of the scrollsnapchange event (the onscrollsnapchange event handler attribute).

public Action<Event>? OnScrollSnapChange { get; set; }

OnScrollSnapChanging

Document.g.cs

Gets or sets the event handler of the scrollsnapchanging event (the onscrollsnapchanging event handler attribute).

public Action<Event>? OnScrollSnapChanging { get; set; }

OnSecurityPolicyViolation

Document.g.cs

Gets or sets the event handler of the securitypolicyviolation event (the onsecuritypolicyviolation event handler attribute).

public Action<Event>? OnSecurityPolicyViolation { get; set; }

Gets or sets the event handler of the seeked event (the onseeked event handler attribute).

public Action<Event>? OnSeeked { get; set; }

OnSeeking

Document.g.cs

Gets or sets the event handler of the seeking event (the onseeking event handler attribute).

public Action<Event>? OnSeeking { get; set; }

Gets or sets the event handler of the select event (the onselect event handler attribute).

public Action<Event>? OnSelect { get; set; }

OnSelectStart

Document.g.cs

Gets or sets the event handler of the selectstart event (the onselectstart event handler attribute).

public Action<Event>? OnSelectStart { get; set; }

OnSelectionChange

Document.g.cs

Gets or sets the event handler of the selectionchange event (the onselectionchange event handler attribute).

public Action<Event>? OnSelectionChange { get; set; }

OnSlotChange

Document.g.cs

Gets or sets the event handler of the slotchange event (the onslotchange event handler attribute).

public Action<Event>? OnSlotChange { get; set; }

OnStalled

Document.g.cs

Gets or sets the event handler of the stalled event (the onstalled event handler attribute).

public Action<Event>? OnStalled { get; set; }

Gets or sets the event handler of the submit event (the onsubmit event handler attribute).

public Action<Event>? OnSubmit { get; set; }

OnSuspend

Document.g.cs

Gets or sets the event handler of the suspend event (the onsuspend event handler attribute).

public Action<Event>? OnSuspend { get; set; }

OnTimeUpdate

Document.g.cs

Gets or sets the event handler of the timeupdate event (the ontimeupdate event handler attribute).

public Action<Event>? OnTimeUpdate { get; set; }

Gets or sets the event handler of the toggle event (the ontoggle event handler attribute).

public Action<Event>? OnToggle { get; set; }

OnTransitionCancel

Document.g.cs

Gets or sets the event handler of the transitioncancel event (the ontransitioncancel event handler attribute).

public Action<Event>? OnTransitionCancel { get; set; }

OnTransitionEnd

Document.g.cs

Gets or sets the event handler of the transitionend event (the ontransitionend event handler attribute).

public Action<Event>? OnTransitionEnd { get; set; }

OnTransitionRun

Document.g.cs

Gets or sets the event handler of the transitionrun event (the ontransitionrun event handler attribute).

public Action<Event>? OnTransitionRun { get; set; }

OnTransitionStart

Document.g.cs

Gets or sets the event handler of the transitionstart event (the ontransitionstart event handler attribute).

public Action<Event>? OnTransitionStart { get; set; }

OnVisibilityChange

Document.g.cs

Gets or sets the event handler of the visibilitychange event (the onvisibilitychange event handler attribute).

public Action<Event>? OnVisibilityChange { get; set; }

OnVolumeChange

Document.g.cs

Gets or sets the event handler of the volumechange event (the onvolumechange event handler attribute).

public Action<Event>? OnVolumeChange { get; set; }

OnWaiting

Document.g.cs

Gets or sets the event handler of the waiting event (the onwaiting event handler attribute).

public Action<Event>? OnWaiting { get; set; }

OnWebkitAnimationEnd

Document.g.cs

Gets or sets the event handler of the webkitanimationend event (the onwebkitanimationend event handler attribute).

public Action<Event>? OnWebkitAnimationEnd { get; set; }

OnWebkitAnimationIteration

Document.g.cs

Gets or sets the event handler of the webkitanimationiteration event (the onwebkitanimationiteration event handler attribute).

public Action<Event>? OnWebkitAnimationIteration { get; set; }

OnWebkitAnimationStart

Document.g.cs

Gets or sets the event handler of the webkitanimationstart event (the onwebkitanimationstart event handler attribute).

public Action<Event>? OnWebkitAnimationStart { get; set; }

OnWebkitTransitionEnd

Document.g.cs

Gets or sets the event handler of the webkittransitionend event (the onwebkittransitionend event handler attribute).

public Action<Event>? OnWebkitTransitionEnd { get; set; }

Gets or sets the event handler of the wheel event (the onwheel event handler attribute).

public Action<Event>? OnWheel { get; set; }

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.

public Worklet PaintWorklet { get; }

Property value

Worklet

PermissionsPolicy

Document.Navigation.cs

Gets 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; }

Gets a live collection of the embed elements of the document (alias of embeds).

public HtmlCollection Plugins { get; }

PointerLockElement

PointerLock.cs

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.

public Element? PointerLockElement { get; }

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).

public bool Prerendering { get; }

Documents parsed by this library are fully loaded, so the readiness is "complete" unless the host changes it.

public DocumentReadyState ReadyState { get; }

https://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; }

https://svgwg.org/svg2-draft/struct.html#__svg__Document__rootElement

public SvgSvgElement? RootElement { get; }

Gets a live collection of the script elements of the document.

public HtmlCollection Scripts { get; }

ScrollingElement

CssomView.Scrolling.cs

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.

public Element? ScrollingElement { get; }

StyleSheets

LinkStyle.cs

Gets the list of the style sheets of the document.

public StyleSheetList StyleSheets { get; }

TextContent

Document.cs

Gets or sets the text content of the document; the value is always null and setting it has no effect.

public override string? TextContent { get; set; }

Property value

string?

Gets the default document timeline (https://drafts.csswg.org/web-animations-1/#dom-document-timeline).

public DocumentTimeline Timeline { get; }

https://html.spec.whatwg.org/multipage/dom.html#document.title

public string Title { get; set; }

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.

public TrustedTypePolicyFactory TrustedTypes { get; }

TrustedTypesDirectives

TrustedTypesGlobals.cs

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.

public IList<TrustedTypesDirectives> TrustedTypesDirectives { get; }

Gets the serialized URL of the document.

public string Url { get; }

VisibilityState

Document.Legacy.cs

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.

public string VisibilityState { get; }

https://html.spec.whatwg.org/multipage/obsolete.html#dom-document-vlinkcolor

public string VlinkColor { get; set; }

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).

public bool WasDiscarded { get; }

Indexers

NameDescription
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.

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.

public object? this[string name] { get; }

Methods

NameDescription
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.cs

https://dom.spec.whatwg.org/#dom-document-adoptnode

public Node AdoptNode(Node node)

Append(ReadOnlySpan<NodeOrString>)

Mixins.Members.cs

Inserts the nodes after the last child, converting the strings into text nodes.

public void Append(params scoped ReadOnlySpan<NodeOrString> nodes)

CaptureEvents()

Document.Legacy.cs

Does nothing; this obsolete method is kept for compatibility.

public void CaptureEvents()

CaretPositionFromPoint(double, double, CaretPositionFromPointOptions?)

CssomView.cs

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.

public CaretPosition? CaretPositionFromPoint(double x, double y, CaretPositionFromPointOptions? options = null)

Does 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.cs

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).

public DomPoint ConvertPointFromNode(DomPointInit point, GeometryNode from, ConvertCoordinateOptions? options = null)

ConvertQuadFromNode(DomQuadInit, GeometryNode, ConvertCoordinateOptions?)

CssomView.GeometryUtils.cs

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).

public DomQuad ConvertQuadFromNode(DomQuadInit quad, GeometryNode from, ConvertCoordinateOptions? options = null)

ConvertRectFromNode(DomRectReadOnly, GeometryNode, ConvertCoordinateOptions?)

CssomView.GeometryUtils.cs

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).

public DomQuad ConvertRectFromNode(DomRectReadOnly rect, GeometryNode from, ConvertCoordinateOptions? options = null)

CreateAttribute(string)

Document.cs

https://dom.spec.whatwg.org/#dom-document-createattribute

public Attr CreateAttribute(string localName)

CreateAttributeNS(string?, string)

Document.cs

https://dom.spec.whatwg.org/#dom-document-createattributens

public Attr CreateAttributeNS(string? @namespace, string qualifiedName)

CreateCDataSection(string)

Document.cs

https://dom.spec.whatwg.org/#dom-document-createcdatasection

public CDataSection CreateCDataSection(string data)

CreateComment(string)

Document.cs

Creates a comment node with the given data.

public Comment CreateComment(string data)

CreateDocumentFragment()

Document.cs

Creates an empty document fragment owned by the document.

public DocumentFragment CreateDocumentFragment()

CreateElement overloads

CreateElement(string, ElementCreationOptions?)

Document.cs

https://dom.spec.whatwg.org/#dom-document-createelement

public Element CreateElement(string localName, ElementCreationOptions? options = null)

CreateElement<T>(ElementCreationOptions?)

Document.cs

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.

public T CreateElement<T>(ElementCreationOptions? options = null) where T : HtmlElement
Type parameters
T
Parameters
options ElementCreationOptions?
Returns

T

Exceptions
InvalidOperationException
T is not the element interface of exactly one element.
ArgumentException
The document does not create HTML elements (an XML document).

CreateElement<T>(string, ElementCreationOptions?)

Document.cs

Creates an element, as Document.CreateElement does, and returns it as a T.

public T CreateElement<T>(string localName, ElementCreationOptions? options = null) where T : Element
Type parameters
T
Parameters
localName string
options ElementCreationOptions?
Returns

T

Exceptions
ArgumentException
The created element is not a T.

CreateElementNS(string?, string, ElementCreationOptions?)

Document.cs

https://dom.spec.whatwg.org/#dom-document-createelementns

public Element CreateElementNS(string? @namespace, string qualifiedName, ElementCreationOptions? options = null)

CreateEvent(string)

Document.Factories.cs

https://dom.spec.whatwg.org/#dom-document-createevent

public Event CreateEvent(string @interface)

CreateExpression(string, IXPathNSResolver?)

XPathApi.cs

Compiles the XPath expression, using the optional resolver for its namespace prefixes.

public XPathExpression CreateExpression(string expression, IXPathNSResolver? resolver = null)

CreateNSResolver(Node)

XPathApi.cs

Returns a namespace resolver for the given node, which is the node itself.

public Node CreateNSResolver(Node nodeResolver)

CreateNodeIterator(Node, uint, INodeFilter?)

Document.Factories.cs

https://dom.spec.whatwg.org/#dom-document-createnodeiterator

public NodeIterator CreateNodeIterator(Node root, uint whatToShow = 4294967295U, INodeFilter? filter = null)

CreateProcessingInstruction(string, string)

Document.cs

Creates a processing instruction with the given target and data.

public ProcessingInstruction CreateProcessingInstruction(string target, string data)

https://dom.spec.whatwg.org/#dom-document-createrange

public Range CreateRange()

CreateTextNode(string)

Document.cs

Creates a text node with the given data.

public Text CreateTextNode(string data)

CreateTreeWalker(Node, uint, INodeFilter?)

Document.Factories.cs

https://dom.spec.whatwg.org/#dom-document-createtreewalker

public TreeWalker CreateTreeWalker(Node root, uint whatToShow = 4294967295U, INodeFilter? filter = null)

ElementFromPoint(double, double)

CssomView.cs

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.

public Element? ElementFromPoint(double x, double y)

ElementsFromPoint(double, double)

CssomView.cs

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.

public IReadOnlyList<Element> ElementsFromPoint(double x, double y)

Evaluate(string, Node, IXPathNSResolver?, ushort, XPathResult?)

XPathApi.cs

Evaluates 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)

ExecCommand overloads

ExecCommand(string, bool, TrustedHtml)

Document.Legacy.cs

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).

public bool ExecCommand(string commandId, bool showUI, TrustedHtml value)

ExecCommand(string, bool, string)

Document.Legacy.cs

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.

public bool ExecCommand(string commandId, bool showUI = false, string value = "")
Parameters
commandId string
showUI bool
value string
Returns

bool

Exceptions
TypeErrorException
The command is insertHTML, Trusted Types are required and the default policy did not convert the value.
See also

ExitFullscreen()

Fullscreen.cs

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.

public Task ExitFullscreen()

ExitPointerLock()

PointerLock.cs

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.

public void ExitPointerLock()

GetAnimations()

Document.Animations.cs

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).

public IReadOnlyList<Animation> GetAnimations()

GetBoxQuads(BoxQuadOptions?)

CssomView.GeometryUtils.cs

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.

public IReadOnlyList<DomQuad> GetBoxQuads(BoxQuadOptions? options = null)

GetElementById(string)

Document.cs

Returns the first element of the document, in tree order, with the given ID, or null when there is none.

public Element? GetElementById(string elementId)

GetElementsByClassName(string)

Document.Factories.cs

Returns a live collection of the descendant elements that have all the given class names.

public HtmlCollection GetElementsByClassName(string classNames)

GetElementsByName(string)

Document.Html.cs

https://html.spec.whatwg.org/multipage/dom.html#dom-document-getelementsbyname

public NodeList GetElementsByName(string elementName)

GetElementsByTagName(string)

Document.Factories.cs

Returns a live collection of the descendant elements with the given qualified name.

public HtmlCollection GetElementsByTagName(string qualifiedName)

GetElementsByTagNameNS(string?, string)

Document.Factories.cs

Returns a live collection of the descendant elements with the given namespace and local name.

public HtmlCollection GetElementsByTagNameNS(string? @namespace, string localName)

GetHtml(GetHtmlOptions?)

DynamicMarkup.cs

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.

public string GetHtml(GetHtmlOptions? options = null)

Parameters

options GetHtmlOptions?

Returns

string

GetSelection()

Selection.cs

Returns the selection of the document, or null when the document has no browsing context.

public Selection? GetSelection()

HasFocus()

Focus.cs

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).

public bool HasFocus()

ImportNode overloads

ImportNode(Node, ImportNodeOptions)

Document.cs

https://dom.spec.whatwg.org/#dom-document-importnode

public Node ImportNode(Node node, ImportNodeOptions options)

ImportNode(Node, bool)

Document.cs

https://dom.spec.whatwg.org/#dom-document-importnode

public Node ImportNode(Node node, bool subtree = false)

MoveBefore(Node, Node?)

Mixins.Members.cs

Moves the node, preserving its state, before the given child (or to the end when the child is null).

public void MoveBefore(Node node, Node? child)

Open overloads

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.

public Document Open(string? unused1 = null, string? unused2 = null)

Open(string, string, string)

Document.DynamicMarkupInsertion.cs

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.

public Window? Open(string url, string name, string features)

ParseHtml(string, SetHtmlOptions?)

DynamicMarkup.cs

https://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.cs

https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-parsehtmlunsafe

public static Document ParseHtmlUnsafe(TrustedHtml html, ParseHtmlUnsafeOptionsOrTrustedHtmlParserOptions? options = null)

ParseHtmlUnsafe(string, ParseHtmlUnsafeOptionsOrTrustedHtmlParserOptions?)

DynamicMarkup.cs

https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-parsehtmlunsafe

public static Document ParseHtmlUnsafe(string html, ParseHtmlUnsafeOptionsOrTrustedHtmlParserOptions? options = null)
Parameters
html string
options ParseHtmlUnsafeOptionsOrTrustedHtmlParserOptions?
Returns

Document

Exceptions
TypeErrorException
Trusted Types are enforced and the options or the value are not trusted.
See also

Prepend(ReadOnlySpan<NodeOrString>)

Mixins.Members.cs

Inserts the nodes before the first child, converting the strings into text nodes.

public void Prepend(params scoped ReadOnlySpan<NodeOrString> nodes)

QueryCommandEnabled(string)

Document.Legacy.cs

Returns a value indicating whether the editing command can currently be executed.

public bool QueryCommandEnabled(string commandId)

QueryCommandIndeterm(string)

Document.Legacy.cs

https://w3c.github.io/editing/docs/execCommand/#querycommandindeterm(): whether the command is indeterminate (e.g. a part of the selection is bold).

public bool QueryCommandIndeterm(string commandId)

QueryCommandState(string)

Document.Legacy.cs

https://w3c.github.io/editing/docs/execCommand/#querycommandstate(): the state of the command (e.g. whether the selection is bold).

public bool QueryCommandState(string commandId)

QueryCommandSupported(string)

Document.Legacy.cs

Returns a value indicating whether the editing command is supported.

public bool QueryCommandSupported(string commandId)

QueryCommandValue(string)

Document.Legacy.cs

https://w3c.github.io/editing/docs/execCommand/#querycommandvalue(): the value of the command (e.g. the font name of the selection).

public string QueryCommandValue(string commandId)

QuerySelector overloads

QuerySelector(SelectorList)

Mixins.Members.cs

Returns the first descendant element, in tree order, that matches the parsed selector list, or null.

public Element? QuerySelector(SelectorList selectors)
Parameters
selectors SelectorList
Returns

Element?

QuerySelector(string)

Mixins.Members.cs

Returns the first descendant element, in tree order, that matches the selectors, or null.

public Element? QuerySelector(string selectors)

QuerySelector<T>(SelectorList)

Mixins.Members.cs

Returns the first descendant, in tree order, that is a T and matches the parsed selector.

public T? QuerySelector<T>(SelectorList selectors) where T : Element
Type parameters
T
Parameters
selectors SelectorList
Returns

T?

QuerySelector<T>(string)

Mixins.Members.cs

Returns the first descendant, in tree order, that is a T and matches the selector.

public T? QuerySelector<T>(string selectors) where T : Element
Type parameters
T
Parameters
selectors string
Returns

T?

QuerySelectorAll overloads

QuerySelectorAll(SelectorList)

Mixins.Members.cs

Returns the descendant elements, in tree order, that match the parsed selector list.

public NodeList QuerySelectorAll(SelectorList selectors)
Parameters
selectors SelectorList
Returns

NodeList

QuerySelectorAll(string)

Mixins.Members.cs

Returns the descendant elements, in tree order, that match the selectors.

public NodeList QuerySelectorAll(string selectors)

QuerySelectorAll<T>(SelectorList)

Mixins.Members.cs

Returns the descendants, in tree order, that are a T and match the parsed selector.

public IReadOnlyList<T> QuerySelectorAll<T>(SelectorList selectors) where T : Element
Type parameters
T
Parameters
selectors SelectorList
Returns

IReadOnlyList<T>

QuerySelectorAll<T>(string)

Mixins.Members.cs

Returns the descendants, in tree order, that are a T and match the selector.

public IReadOnlyList<T> QuerySelectorAll<T>(string selectors) where T : Element
Type parameters
T
Parameters
selectors string
Returns

IReadOnlyList<T>

ReleaseEvents()

Document.Legacy.cs

Does nothing; this obsolete method is kept for compatibility.

public void ReleaseEvents()

ReplaceChildren(ReadOnlySpan<NodeOrString>)

Mixins.Members.cs

Replaces all the children with the given nodes, converting the strings into text nodes.

public void ReplaceChildren(params scoped ReadOnlySpan<NodeOrString> nodes)

StartViewTransition overloads

StartViewTransition(StartViewTransitionOptions?)

Document.ViewTransitions.cs

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.

public ViewTransition StartViewTransition(StartViewTransitionOptions? options = null)

StartViewTransition(ViewTransitionUpdateCallback)

Document.ViewTransitions.cs

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.

public ViewTransition StartViewTransition(ViewTransitionUpdateCallback callback)
Parameters
callback ViewTransitionUpdateCallback
The callback that updates the document. It is always called, even when the transition cannot happen.
Returns

ViewTransition

See also

Write(ReadOnlySpan<TrustedHtmlOrString>)

Document.DynamicMarkupInsertion.cs

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.

public void Write(params scoped ReadOnlySpan<TrustedHtmlOrString> text)

WriteHtml(TextWriter, GetHtmlOptions?)

DynamicMarkup.cs

Same as Document.GetHtml, but writes the serialization to writer instead of building a string.

public void WriteHtml(TextWriter writer, GetHtmlOptions? options = null)

Parameters

writer TextWriter
options GetHtmlOptions?

Writeln(ReadOnlySpan<TrustedHtmlOrString>)

Document.DynamicMarkupInsertion.cs

https://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)