Skip to content

ElementInternals

Types

t

type t = WebAPI.DOMTree.elementInternals = {
shadowRoot: Null.t<WebAPI.DOMTree.shadowRoot>,
form: Null.t<WebAPI.DOMTree.htmlFormElement>,
willValidate: bool,
validity: WebAPI.DOM.validityState,
validationMessage: string,
labels: WebAPI.DOM.nodeList<unknown>,
states: WebAPI.DOMTree.customStateSet,
mutable ariaAtomic: Null.t<string>,
mutable ariaAutoComplete: Null.t<string>,
mutable ariaBrailleLabel: Null.t<string>,
mutable ariaBrailleRoleDescription: Null.t<string>,
mutable ariaBusy: Null.t<string>,
mutable ariaChecked: Null.t<string>,
mutable ariaColCount: Null.t<string>,
mutable ariaColIndex: Null.t<string>,
mutable ariaColIndexText: Null.t<string>,
mutable ariaColSpan: Null.t<string>,
mutable ariaCurrent: Null.t<string>,
mutable ariaDescription: Null.t<string>,
mutable ariaDisabled: Null.t<string>,
mutable ariaExpanded: Null.t<string>,
mutable ariaHasPopup: Null.t<string>,
mutable ariaHidden: Null.t<string>,
mutable ariaKeyShortcuts: Null.t<string>,
mutable ariaLabel: Null.t<string>,
mutable ariaLevel: Null.t<string>,
mutable ariaLive: Null.t<string>,
mutable ariaModal: Null.t<string>,
mutable ariaMultiLine: Null.t<string>,
mutable ariaMultiSelectable: Null.t<string>,
mutable ariaOrientation: Null.t<string>,
mutable ariaPlaceholder: Null.t<string>,
mutable ariaPosInSet: Null.t<string>,
mutable ariaPressed: Null.t<string>,
mutable ariaReadOnly: Null.t<string>,
mutable ariaRequired: Null.t<string>,
mutable ariaRoleDescription: Null.t<string>,
mutable ariaRowCount: Null.t<string>,
mutable ariaRowIndex: Null.t<string>,
mutable ariaRowIndexText: Null.t<string>,
mutable ariaRowSpan: Null.t<string>,
mutable ariaSelected: Null.t<string>,
mutable ariaSetSize: Null.t<string>,
mutable ariaSort: Null.t<string>,
mutable ariaValueMax: Null.t<string>,
mutable ariaValueMin: Null.t<string>,
mutable ariaValueNow: Null.t<string>,
mutable ariaValueText: Null.t<string>,
}

Record fields

shadowRoot
willValidate
bool
validationMessage
string
labels
ariaAtomic
Null.t<string>
ariaAutoComplete
Null.t<string>
ariaBrailleLabel
Null.t<string>
ariaBrailleRoleDescription
Null.t<string>
ariaBusy
Null.t<string>
ariaChecked
Null.t<string>
ariaColCount
Null.t<string>
ariaColIndex
Null.t<string>
ariaColIndexText
Null.t<string>
ariaColSpan
Null.t<string>
ariaCurrent
Null.t<string>
ariaDescription
Null.t<string>
ariaDisabled
Null.t<string>
ariaExpanded
Null.t<string>
ariaHasPopup
Null.t<string>
ariaHidden
Null.t<string>
ariaKeyShortcuts
Null.t<string>
ariaLabel
Null.t<string>
ariaLevel
Null.t<string>
ariaLive
Null.t<string>
ariaModal
Null.t<string>
ariaMultiLine
Null.t<string>
ariaMultiSelectable
Null.t<string>
ariaOrientation
Null.t<string>
ariaPlaceholder
Null.t<string>
ariaPosInSet
Null.t<string>
ariaPressed
Null.t<string>
ariaReadOnly
Null.t<string>
ariaRequired
Null.t<string>
ariaRoleDescription
Null.t<string>
ariaRowCount
Null.t<string>
ariaRowIndex
Null.t<string>
ariaRowIndexText
Null.t<string>
ariaRowSpan
Null.t<string>
ariaSelected
Null.t<string>
ariaSetSize
Null.t<string>
ariaSort
Null.t<string>
ariaValueMax
Null.t<string>
ariaValueMin
Null.t<string>
ariaValueNow
Null.t<string>
ariaValueText
Null.t<string>

Values

checkValidity

Returns true if internals's target element has no validity problems; false otherwise. Fires an invalid event at the element in the latter case. Read more on MDN

let checkValidity: WebAPI.DOMTree.elementInternals => bool

Parameters

WebAPI.DOMTree.elementInternals

Return type

bool

reportValidity

Returns true if internals's target element has no validity problems; otherwise, returns false, fires an invalid event at the element, and (if the event isn't canceled) reports the problem to the user. Read more on MDN

let reportValidity: WebAPI.DOMTree.elementInternals => bool

Parameters

WebAPI.DOMTree.elementInternals

Return type

bool

setFormValue

Sets both the state and submission value of internals's target element to value.

If value is null, the element won't participate in form submission. Read more on MDN

let setFormValue: (
WebAPI.DOMTree.elementInternals,
~value: unknown,
~state: unknown=?,
) => unit

Parameters

WebAPI.DOMTree.elementInternalsunknownoption<unknown>

Return type

unit

setValidity

Marks internals's target element as suffering from the constraints indicated by the flags argument, and sets the element's validation message to message. If anchor is specified, the user agent might use it to indicate problems with the constraints of internals's target element when the form owner is validated interactively or reportValidity() is called. Read more on MDN

let setValidity: (
WebAPI.DOMTree.elementInternals,
~flags: WebAPI.DOM.validityStateFlags=?,
~message: string=?,
~anchor: WebAPI.DOMTree.htmlElement=?,
) => unit