Wren

Module dom

The document tree (DOM Standard: Document, Node, Element). In a worker there is no document: the functions taking a node see no live node, and those returning one return null.

Exposed to: Window, Worker. Source: api/dom.widl.

Odin: import "wren:dom".

Types

handle Node : EventTarget

A node of the document. A node created by the module and never inserted lives until Node_release.

Checked by the browser on every call (lookup_Node).

handle Element : Node

A node that is an element.

Checked by the browser on every call (lookup_Element).

struct DomRect

A rectangle (DOMRect).

fieldtype
xf64
yf64
widthf64
heightf64

struct SelectionState

The document's selection.

fieldtype
anchoru64
anchor_offsetu32
focusu64
focus_offsetu32
kindu320 none, 1 caret (collapsed), 2 range

Functions

Document_documentElement

Element Document_documentElement()

document.documentElement (null in a worker).

Host: Document_documentElement :: proc(c: ^Call) -> u64

Document_head

Element Document_head()

document.head (null in a worker).

Host: Document_head :: proc(c: ^Call) -> u64

Document_body

Element Document_body()

document.body (null in a worker).

Host: Document_body :: proc(c: ^Call) -> u64

Document_createElement

Element Document_createElement(string tag) raises

document.createElement(tag). Invalid_Argument for an empty tag, Invalid_Handle in a worker (no document).

Raises: returns an Error (see web).

Host: Document_createElement :: proc(c: ^Call, tag: string) -> (u64, Api_Error)

Document_createTextNode

Node Document_createTextNode(string text) raises

document.createTextNode(text). Invalid_Handle in a worker.

Raises: returns an Error (see web).

Host: Document_createTextNode :: proc(c: ^Call, text: string) -> (u64, Api_Error)

Document_getElementById

Element Document_getElementById(string id)

document.getElementById(id): null when there is none.

Host: Document_getElementById :: proc(c: ^Call, id: string) -> u64

Node_appendChild

void Node_appendChild(Node parent, Node child) raises

parent.appendChild(child).

Raises: returns an Error (see web).

Host: Node_appendChild :: proc(c: ^Call, parent: Api_Node, child: Api_Node) -> Api_Error

Node_insertBefore

void Node_insertBefore(Node parent, Node child, optional Node ref) raises

parent.insertBefore(child, ref): ref null appends. Not_Found when ref is not a child of parent.

Raises: returns an Error (see web).

Host: Node_insertBefore :: proc(c: ^Call, parent: Api_Node, child: Api_Node, ref: Api_Node) -> Api_Error

Node_removeChild

void Node_removeChild(Node parent, Node child) raises

parent.removeChild(child). Not_Found when child is not a child of parent.

Raises: returns an Error (see web).

Host: Node_removeChild :: proc(c: ^Call, parent: Api_Node, child: Api_Node) -> Api_Error

Node_release

void Node_release(Node node) raises

Frees a detached node (and its subtree) the module no longer needs. Attached when it is still in the tree.

Raises: returns an Error (see web).

Host: Node_release :: proc(c: ^Call, node: Api_Node) -> Api_Error

Node_parentNode

Node Node_parentNode(Node node)

node.parentNode (null when detached).

Host: Node_parentNode :: proc(c: ^Call, node: Api_Node) -> u64

Node_firstChild

Node Node_firstChild(Node node)

node.firstChild

Host: Node_firstChild :: proc(c: ^Call, node: Api_Node) -> u64

Node_lastChild

Node Node_lastChild(Node node)

node.lastChild

Host: Node_lastChild :: proc(c: ^Call, node: Api_Node) -> u64

Node_previousSibling

Node Node_previousSibling(Node node)

node.previousSibling

Host: Node_previousSibling :: proc(c: ^Call, node: Api_Node) -> u64

Node_nextSibling

Node Node_nextSibling(Node node)

node.nextSibling

Host: Node_nextSibling :: proc(c: ^Call, node: Api_Node) -> u64

Node_nodeType

i32 Node_nodeType(Node node)

node.nodeType: 1 element, 3 text, 8 comment, 9 document.

Host: Node_nodeType :: proc(c: ^Call, node: Api_Node) -> i32

Node_setTextContent

void Node_setTextContent(Node node, string text) raises

node.textContent = text

Raises: returns an Error (see web).

Host: Node_setTextContent :: proc(c: ^Call, node: Api_Node, text: string) -> Api_Error

Node_getTextContent

string Node_getTextContent(Node node)

node.textContent

Host: Node_getTextContent :: proc(c: ^Call, node: Api_Node) -> string

Element_tagName

string Element_tagName(Element element)

element.tagName (lower case for HTML elements).

Host: Element_tagName :: proc(c: ^Call, element: Api_Element) -> string

Element_setAttribute

void Element_setAttribute(Element element, string name, string value) raises

element.setAttribute(name, value)

Raises: returns an Error (see web).

Host: Element_setAttribute :: proc(c: ^Call, element: Api_Element, name: string, value: string) -> Api_Error

Element_getAttribute

string Element_getAttribute(Element element, string name) raises

element.getAttribute(name): Not_Found when the attribute is absent (null).

Raises: returns an Error (see web).

Host: Element_getAttribute :: proc(c: ^Call, element: Api_Element, name: string) -> (string, Api_Error)

Element_removeAttribute

void Element_removeAttribute(Element element, string name) raises

element.removeAttribute(name)

Raises: returns an Error (see web).

Host: Element_removeAttribute :: proc(c: ^Call, element: Api_Element, name: string) -> Api_Error

HTMLIFrameElement_srcdoc

string HTMLIFrameElement_srcdoc(Element element)

iframe.srcdoc

Host: HTMLIFrameElement_srcdoc :: proc(c: ^Call, element: Api_Element) -> string

HTMLIFrameElement_set_srcdoc

void HTMLIFrameElement_set_srcdoc(Element element, string value) raises

iframe.srcdoc = value

Raises: returns an Error (see web).

Host: HTMLIFrameElement_set_srcdoc :: proc(c: ^Call, element: Api_Element, value: string) -> Api_Error

LinkStyle_sheetOf

u64 LinkStyle_sheetOf(Node node)

element.sheet of a <style> or <link rel=stylesheet> (any other node: 0, null): its CSSStyleSheet, the same object for as long as the element keeps that sheet. A <style> gets its sheet brought up to date first (HTML "update a style block"); a <link>'s is there once loaded.

Host: LinkStyle_sheetOf :: proc(c: ^Call, node: Api_Node) -> u64

DocumentOrShadowRoot_sheetCount

u32 DocumentOrShadowRoot_sheetCount(Node root)

document.styleSheets / shadowRoot.styleSheets: how many sheets the tree of root has (its <style> and loaded <link> elements, in tree order) ...

Host: DocumentOrShadowRoot_sheetCount :: proc(c: ^Call, root: Api_Node) -> u32

DocumentOrShadowRoot_sheetAt

u64 DocumentOrShadowRoot_sheetAt(Node root, u32 index)

... and the one at index (0 past the end).

Host: DocumentOrShadowRoot_sheetAt :: proc(c: ^Call, root: Api_Node, index: u32) -> u64

CSSStyleSheet_isSheet

bool CSSStyleSheet_isSheet(u64 sheet)

Whether sheet is a CSSStyleSheet of this page, constructed or an element's.

Host: CSSStyleSheet_isSheet :: proc(c: ^Call, sheet: u64) -> bool

CSSStyleSheet_ownerNodeOf

u64 CSSStyleSheet_ownerNodeOf(u64 sheet)

sheet.ownerNode: the element of an element's sheet while it has it (0: null).

Host: CSSStyleSheet_ownerNodeOf :: proc(c: ^Call, sheet: u64) -> u64

CSSStyleSheet_hrefOf

string CSSStyleSheet_hrefOf(u64 sheet)

sheet.href: the URL of a <link>'s sheet ("" for null).

Host: CSSStyleSheet_hrefOf :: proc(c: ^Call, sheet: u64) -> string

CSSStyleSheet_titleOf

string CSSStyleSheet_titleOf(u64 sheet)

sheet.title: the title attribute of its element ("" for null).

Host: CSSStyleSheet_titleOf :: proc(c: ^Call, sheet: u64) -> string

CSSStyleSheet_rulesVersion

u32 CSSStyleSheet_rulesVersion(u64 sheet)

A number that changes with every change of the sheet's rules (the rule list's items are made again then).

Host: CSSStyleSheet_rulesVersion :: proc(c: ^Call, sheet: u64) -> u32

CSSStyleSheet_ruleId

u32 CSSStyleSheet_ruleId(u64 sheet, u32 index)

The identity of cssRules[index], a number never given to another rule of the page (0 past the end): the rule list gives a rule the same object across insertions and deletions around it.

Host: CSSStyleSheet_ruleId :: proc(c: ^Call, sheet: u64, index: u32) -> u32

CustomElements_define

void CustomElements_define(string name)

customElements.define(name, ...) succeeded: elements of that local name now queue reactions.

Host: CustomElements_define :: proc(c: ^Call, name: string)

CustomElements_pending

u32 CustomElements_pending()

The size CustomElements_take needs now (0: nothing queued): the engine sizes its buffer with it, as the take empties the queue (it must not be called twice to learn its size).

Host: CustomElements_pending :: proc(c: ^Call) -> u32

CustomElements_take

bytes CustomElements_take()

The queued reactions, taken: per reaction u8 kind (1 upgrade, 2 connected, 3 disconnected, 4 attribute changed) and u64 element; an attribute change adds its name, old value and new value (u32 length + UTF-8 each) and a u8 of flags (1: there was an old value, 2: there is a new one). Each element stays pinned until CustomElements_release.

Host: CustomElements_take :: proc(c: ^Call) -> []u8

CustomElements_release

void CustomElements_release(u64[] elements)

The engine wrapped the elements of the last take (its wrappers pin them now).

Host: CustomElements_release :: proc(c: ^Call, elements: []u64)

CustomElements_create

u64 CustomElements_create(string name) raises

A new element of a defined local name for new MyElement(): custom already, nothing queued.

Raises: returns an Error (see web).

Host: CustomElements_create :: proc(c: ^Call, name: string) -> (u64, Api_Error)

Element_setCustomState

void Element_setCustomState(Element element, u32 state)

The element's custom element state: 0 undefined, 1 custom, 2 failed.

Host: Element_setCustomState :: proc(c: ^Call, element: Api_Element, state: u32)

Document_readyState

string Document_readyState()

document.readyState: "loading", "interactive" or "complete".

Host: Document_readyState :: proc(c: ^Call) -> string

Document_currentScript

Element Document_currentScript()

document.currentScript: the classic script element running, null otherwise.

Host: Document_currentScript :: proc(c: ^Call) -> u64

Window_document

Node Window_document()

window.document: the document node (null in a worker).

Host: Window_document :: proc(c: ^Call) -> u64

Document_resolveURL

string Document_resolveURL(string url) raises

url parsed against the document's base URL, serialized: Syntax when it is not a valid URL (reflected URL attributes then give the attribute's value as is).

Raises: returns an Error (see web).

Host: Document_resolveURL :: proc(c: ^Call, url: string) -> (string, Api_Error)

Element_id

string Element_id(Element element)

element.id

Host: Element_id :: proc(c: ^Call, element: Api_Element) -> string

Element_set_id

void Element_set_id(Element element, string value) raises

element.id = value

Raises: returns an Error (see web).

Host: Element_set_id :: proc(c: ^Call, element: Api_Element, value: string) -> Api_Error

Element_className

string Element_className(Element element)

element.className

Host: Element_className :: proc(c: ^Call, element: Api_Element) -> string

Element_set_className

void Element_set_className(Element element, string value) raises

element.className = value

Raises: returns an Error (see web).

Host: Element_set_className :: proc(c: ^Call, element: Api_Element, value: string) -> Api_Error

Collection_create

Object Collection_create(Node root, i32 kind, string arg) raises

A live collection. Kinds: 0 child nodes, 1 child elements, 2 elements by qualified name (arg; "" all), 3 by class names (arg), 4 by name attribute (arg), 5 forms, 6 images, 7 links (a and area with href), 8 scripts, 9 embeds, 10 anchors (a with name), 11 elements by namespace and local name (arg: namespace, NUL, local name; "" any), 12 all elements, 13 the select's / datalist's options, 14 a table's rows, 15 a row's cells, 16 a table's tBodies, 17 a form's elements. Invalid_Argument for an unknown kind.

Raises: returns an Error (see web).

Host: Collection_create :: proc(c: ^Call, root: Api_Node, kind: i32, arg: string) -> (u64, Api_Error)

Collection_length

u32 Collection_length(u64 collection)

The number of nodes (0 for a dead collection).

Host: Collection_length :: proc(c: ^Call, collection: u64) -> u32

Collection_item

u64 Collection_item(u64 collection, u32 index)

The node at index, 0 past the end.

Host: Collection_item :: proc(c: ^Call, collection: u64, index: u32) -> u64

Collection_namedItem

u64 Collection_namedItem(u64 collection, string name)

HTMLCollection.namedItem(name): the first element whose id or name (for the elements that have one) is name.

Host: Collection_namedItem :: proc(c: ^Call, collection: u64, name: string) -> u64

Collection_names

string Collection_names(u64 collection)

The supported property names of an HTMLCollection, each followed by a NUL byte.

Host: Collection_names :: proc(c: ^Call, collection: u64) -> string

ParentNode_querySelectorAllPacked

bytes ParentNode_querySelectorAllPacked(Node node, string selectors) raises

node.querySelectorAll(selectors): the elements in tree order, 8 bytes (a handle, little endian) each. Syntax for an invalid selector list.

Raises: returns an Error (see web).

Host: ParentNode_querySelectorAllPacked :: proc(c: ^Call, node: Api_Node, selectors: string) -> ([]u8, Api_Error)

HTMLFormElement_namedControl

u64 HTMLFormElement_namedControl(Element form, string name)

form[name]: the first of the form's controls whose id or name is name (0 when none; the form's named properties shadow its prototype's, [LegacyOverrideBuiltIns], so this answers for every property read).

Host: HTMLFormElement_namedControl :: proc(c: ^Call, form: Api_Element, name: string) -> u64

ParentNode_querySelector

Element ParentNode_querySelector(Node node, string selectors) raises

node.querySelector(selectors)

Raises: returns an Error (see web).

Host: ParentNode_querySelector :: proc(c: ^Call, node: Api_Node, selectors: string) -> (u64, Api_Error)

TokenList_length

u32 TokenList_length(Element element, string attr)

DOMTokenList over the content attribute attr of an element: its tokens (ordered set, ASCII whitespace split).

Host: TokenList_length :: proc(c: ^Call, element: Api_Element, attr: string) -> u32

TokenList_item

string TokenList_item(Element element, string attr, u32 index) raises

The token at index (Not_Found: null).

Raises: returns an Error (see web).

Host: TokenList_item :: proc(c: ^Call, element: Api_Element, attr: string, index: u32) -> (string, Api_Error)

TokenList_contains

bool TokenList_contains(Element element, string attr, string token)

Host: TokenList_contains :: proc(c: ^Call, element: Api_Element, attr: string, token: string) -> bool

TokenList_add

void TokenList_add(Element element, string attr, string tokens) raises

add(tokens...): tokens each ended by NUL (or NUL-separated; "": none, the attribute serialized again). Syntax for an empty token, Invalid_Character for one with whitespace.

Raises: returns an Error (see web).

Host: TokenList_add :: proc(c: ^Call, element: Api_Element, attr: string, tokens: string) -> Api_Error

TokenList_remove

void TokenList_remove(Element element, string attr, string tokens) raises

remove(tokens...): as add.

Raises: returns an Error (see web).

Host: TokenList_remove :: proc(c: ^Call, element: Api_Element, attr: string, tokens: string) -> Api_Error

TokenList_toggle

bool TokenList_toggle(Element element, string attr, string token, i32 force) raises

toggle(token, force): force -1 absent, 0 false, 1 true. Returns whether the token is there afterwards.

Raises: returns an Error (see web).

Host: TokenList_toggle :: proc(c: ^Call, element: Api_Element, attr: string, token: string, force: i32) -> (bool, Api_Error)

TokenList_replace

bool TokenList_replace(Element element, string attr, string token, string new_token) raises

replace(token, newToken): whether it was there.

Raises: returns an Error (see web).

Host: TokenList_replace :: proc(c: ^Call, element: Api_Element, attr: string, token: string, new_token: string) -> (bool, Api_Error)

TokenList_supports

bool TokenList_supports(Element element, string attr, string token) raises

supports(token): for rel lists, whether the browser knows the link type. Type for lists without supported tokens.

Raises: returns an Error (see web).

Host: TokenList_supports :: proc(c: ^Call, element: Api_Element, attr: string, token: string) -> (bool, Api_Error)

Dataset_get

string Dataset_get(Element element, string name) raises

dataset[name]: the data-* attribute of a camel-cased name (Not_Found: absent).

Raises: returns an Error (see web).

Host: Dataset_get :: proc(c: ^Call, element: Api_Element, name: string) -> (string, Api_Error)

Dataset_set

void Dataset_set(Element element, string name, string value) raises

dataset[name] = value: Syntax for a name with "-" followed by a lower-case letter, Invalid_Character for a name that does not make a valid attribute name.

Raises: returns an Error (see web).

Host: Dataset_set :: proc(c: ^Call, element: Api_Element, name: string, value: string) -> Api_Error

Dataset_delete

bool Dataset_delete(Element element, string name)

delete dataset[name]: whether there was one.

Host: Dataset_delete :: proc(c: ^Call, element: Api_Element, name: string) -> bool

Dataset_names

string Dataset_names(Element element)

The camel-cased names of the data-* attributes, each followed by a NUL byte.

Host: Dataset_names :: proc(c: ^Call, element: Api_Element) -> string

Element_namespaceURI

string Element_namespaceURI(Element element) raises

element.namespaceURI (Not_Found: null).

Raises: returns an Error (see web).

Host: Element_namespaceURI :: proc(c: ^Call, element: Api_Element) -> (string, Api_Error)

Element_prefix

string Element_prefix(Element element) raises

element.prefix (Not_Found: null).

Raises: returns an Error (see web).

Host: Element_prefix :: proc(c: ^Call, element: Api_Element) -> (string, Api_Error)

Element_localName

string Element_localName(Element element)

element.localName (SVG names with their case).

Host: Element_localName :: proc(c: ^Call, element: Api_Element) -> string

Element_qualifiedTagName

string Element_qualifiedTagName(Element element)

element.tagName: the qualified name, upper case for HTML elements.

Host: Element_qualifiedTagName :: proc(c: ^Call, element: Api_Element) -> string

Element_slot

string Element_slot(Element element)

element.slot

Host: Element_slot :: proc(c: ^Call, element: Api_Element) -> string

Element_set_slot

void Element_set_slot(Element element, string value) raises

element.slot = value

Raises: returns an Error (see web).

Host: Element_set_slot :: proc(c: ^Call, element: Api_Element, value: string) -> Api_Error

Element_hasAttributes

bool Element_hasAttributes(Element element)

element.hasAttributes()

Host: Element_hasAttributes :: proc(c: ^Call, element: Api_Element) -> bool

Element_attributeNames

string Element_attributeNames(Element element)

The attributes' names in order, each followed by a NUL byte.

Host: Element_attributeNames :: proc(c: ^Call, element: Api_Element) -> string

Element_attributeCount

u32 Element_attributeCount(Element element)

The number of attributes.

Host: Element_attributeCount :: proc(c: ^Call, element: Api_Element) -> u32

Element_attributeNameAt

string Element_attributeNameAt(Element element, u32 index) raises

The name of the attribute at index (Not_Found past the end).

Raises: returns an Error (see web).

Host: Element_attributeNameAt :: proc(c: ^Call, element: Api_Element, index: u32) -> (string, Api_Error)

Element_attributeNamespaceAt

string Element_attributeNamespaceAt(Element element, u32 index) raises

The namespace URI of the attribute at index (Not_Found: null, or past the end).

Raises: returns an Error (see web).

Host: Element_attributeNamespaceAt :: proc(c: ^Call, element: Api_Element, index: u32) -> (string, Api_Error)

Element_attributeIndex

i32 Element_attributeIndex(Element element, string name)

The index of the attribute element.getAttribute(name) reads, -1 when none.

Host: Element_attributeIndex :: proc(c: ^Call, element: Api_Element, name: string) -> i32

Element_attributeIndexNS

i32 Element_attributeIndexNS(Element element, optional string namespace, string local_name)

The index of the attribute element.getAttributeNS(namespace, localName) reads, -1 when none.

Host: Element_attributeIndexNS :: proc(c: ^Call, element: Api_Element, namespace: Maybe(string), local_name: string) -> i32

Element_setAttributeOfAttr

void Element_setAttributeOfAttr(Element element, optional string namespace, string qualified_name, string value) raises

The value of an Attr object's attribute (setAttributeNode, attr.value): its namespace and qualified name as the Attr has them, not validated again.

Raises: returns an Error (see web).

Host: Element_setAttributeOfAttr :: proc(c: ^Call, element: Api_Element, namespace: Maybe(string), qualified_name: string, value: string) -> Api_Error

Element_getAttributeNS

string Element_getAttributeNS(Element element, optional string namespace, string local_name) raises

element.getAttributeNS(namespace, localName) (Not_Found: null).

Raises: returns an Error (see web).

Host: Element_getAttributeNS :: proc(c: ^Call, element: Api_Element, namespace: Maybe(string), local_name: string) -> (string, Api_Error)

Element_setAttributeChecked

void Element_setAttributeChecked(Element element, string name, string value) raises

element.setAttribute(name, value): Invalid_Character for a name that is not a valid attribute name.

Raises: returns an Error (see web).

Host: Element_setAttributeChecked :: proc(c: ^Call, element: Api_Element, name: string, value: string) -> Api_Error

Element_setAttributeNS

void Element_setAttributeNS(Element element, optional string namespace, string qualified_name, string value) raises

element.setAttributeNS(namespace, qualifiedName, value): Invalid_Character, Namespace.

Raises: returns an Error (see web).

Host: Element_setAttributeNS :: proc(c: ^Call, element: Api_Element, namespace: Maybe(string), qualified_name: string, value: string) -> Api_Error

Element_removeAttributeNS

void Element_removeAttributeNS(Element element, optional string namespace, string local_name)

element.removeAttributeNS(namespace, localName)

Host: Element_removeAttributeNS :: proc(c: ^Call, element: Api_Element, namespace: Maybe(string), local_name: string)

Element_toggleAttributeChecked

bool Element_toggleAttributeChecked(Element element, string name, i32 force) raises

element.toggleAttribute(name, force): force -1 absent, 0 false, 1 true. Invalid_Character.

Raises: returns an Error (see web).

Host: Element_toggleAttributeChecked :: proc(c: ^Call, element: Api_Element, name: string, force: i32) -> (bool, Api_Error)

Element_hasAttribute

bool Element_hasAttribute(Element element, string name)

element.hasAttribute(name)

Host: Element_hasAttribute :: proc(c: ^Call, element: Api_Element, name: string) -> bool

Element_hasAttributeNS

bool Element_hasAttributeNS(Element element, optional string namespace, string local_name)

element.hasAttributeNS(namespace, localName)

Host: Element_hasAttributeNS :: proc(c: ^Call, element: Api_Element, namespace: Maybe(string), local_name: string) -> bool

Element_closest

Element Element_closest(Element element, string selectors) raises

element.closest(selectors): Syntax for an invalid selector list.

Raises: returns an Error (see web).

Host: Element_closest :: proc(c: ^Call, element: Api_Element, selectors: string) -> (u64, Api_Error)

Element_matches

bool Element_matches(Element element, string selectors) raises

element.matches(selectors): Syntax for an invalid selector list.

Raises: returns an Error (see web).

Host: Element_matches :: proc(c: ^Call, element: Api_Element, selectors: string) -> (bool, Api_Error)

Element_webkitMatchesSelector

bool Element_webkitMatchesSelector(Element element, string selectors) raises

element.webkitMatchesSelector(selectors)

Raises: returns an Error (see web).

Host: Element_webkitMatchesSelector :: proc(c: ^Call, element: Api_Element, selectors: string) -> (bool, Api_Error)

Element_insertAdjacentElement

Element Element_insertAdjacentElement(Element element, string position, Element other) raises

element.insertAdjacentElement(where, element): Syntax for a bad position, the tree errors of insertBefore.

Raises: returns an Error (see web).

Host: Element_insertAdjacentElement :: proc(c: ^Call, element: Api_Element, position: string, other: Api_Element) -> (u64, Api_Error)

Element_insertAdjacentText

void Element_insertAdjacentText(Element element, string position, string data) raises

element.insertAdjacentText(where, data)

Raises: returns an Error (see web).

Host: Element_insertAdjacentText :: proc(c: ^Call, element: Api_Element, position: string, data: string) -> Api_Error

Element_insertAdjacentHTML

void Element_insertAdjacentHTML(Element element, string position, string text) raises

element.insertAdjacentHTML(position, text): No_Modification_Allowed beside the document element.

Raises: returns an Error (see web).

Host: Element_insertAdjacentHTML :: proc(c: ^Call, element: Api_Element, position: string, text: string) -> Api_Error

Element_innerHTML

string Element_innerHTML(Element element)

element.innerHTML: the HTML fragment serialization of its children (a template's: its contents').

Host: Element_innerHTML :: proc(c: ^Call, element: Api_Element) -> string

Element_set_innerHTML

void Element_set_innerHTML(Element element, string value) raises

element.innerHTML = markup: parsed as a fragment in the element's context, one mutation replacing the children.

Raises: returns an Error (see web).

Host: Element_set_innerHTML :: proc(c: ^Call, element: Api_Element, value: string) -> Api_Error

Element_outerHTML

string Element_outerHTML(Element element)

element.outerHTML

Host: Element_outerHTML :: proc(c: ^Call, element: Api_Element) -> string

Element_set_outerHTML

void Element_set_outerHTML(Element element, string value) raises

element.outerHTML = markup: No_Modification_Allowed when the parent is the document.

Raises: returns an Error (see web).

Host: Element_set_outerHTML :: proc(c: ^Call, element: Api_Element, value: string) -> Api_Error

Element_shadowRoot

Node Element_shadowRoot(Element element)

element.shadowRoot: null (no shadow trees).

Host: Element_shadowRoot :: proc(c: ^Call, element: Api_Element) -> u64

HTMLElement_hiddenState

i32 HTMLElement_hiddenState(Element element)

The hidden content attribute as HTMLElement.hidden reads it: 0 absent, 1 present, 2 "until-found".

Host: HTMLElement_hiddenState :: proc(c: ^Call, element: Api_Element) -> i32

HTMLElement_dir

string HTMLElement_dir(Element element)

htmlElement.dir: "ltr", "rtl", "auto" or "".

Host: HTMLElement_dir :: proc(c: ^Call, element: Api_Element) -> string

HTMLElement_set_dir

void HTMLElement_set_dir(Element element, string value) raises

htmlElement.dir = value

Raises: returns an Error (see web).

Host: HTMLElement_set_dir :: proc(c: ^Call, element: Api_Element, value: string) -> Api_Error

HTMLElement_translate

bool HTMLElement_translate(Element element)

htmlElement.translate

Host: HTMLElement_translate :: proc(c: ^Call, element: Api_Element) -> bool

HTMLElement_set_translate

void HTMLElement_set_translate(Element element, bool value) raises

htmlElement.translate = value

Raises: returns an Error (see web).

Host: HTMLElement_set_translate :: proc(c: ^Call, element: Api_Element, value: bool) -> Api_Error

HTMLElement_draggable

bool HTMLElement_draggable(Element element)

htmlElement.draggable

Host: HTMLElement_draggable :: proc(c: ^Call, element: Api_Element) -> bool

HTMLElement_set_draggable

void HTMLElement_set_draggable(Element element, bool value) raises

htmlElement.draggable = value

Raises: returns an Error (see web).

Host: HTMLElement_set_draggable :: proc(c: ^Call, element: Api_Element, value: bool) -> Api_Error

HTMLElement_spellcheck

bool HTMLElement_spellcheck(Element element)

htmlElement.spellcheck

Host: HTMLElement_spellcheck :: proc(c: ^Call, element: Api_Element) -> bool

HTMLElement_set_spellcheck

void HTMLElement_set_spellcheck(Element element, bool value) raises

htmlElement.spellcheck = value

Raises: returns an Error (see web).

Host: HTMLElement_set_spellcheck :: proc(c: ^Call, element: Api_Element, value: bool) -> Api_Error

HTMLElement_innerText

string HTMLElement_innerText(Element element)

htmlElement.innerText: the rendered text (from the layout's text when the element is rendered, else textContent).

Host: HTMLElement_innerText :: proc(c: ^Call, element: Api_Element) -> string

HTMLElement_set_innerText

void HTMLElement_set_innerText(Element element, string value) raises

htmlElement.innerText = value: text nodes and <br> for line feeds.

Raises: returns an Error (see web).

Host: HTMLElement_set_innerText :: proc(c: ^Call, element: Api_Element, value: string) -> Api_Error

HTMLElement_outerText

string HTMLElement_outerText(Element element)

htmlElement.outerText

Host: HTMLElement_outerText :: proc(c: ^Call, element: Api_Element) -> string

HTMLElement_set_outerText

void HTMLElement_set_outerText(Element element, string value) raises

htmlElement.outerText = value: No_Modification_Allowed without a parent.

Raises: returns an Error (see web).

Host: HTMLElement_set_outerText :: proc(c: ^Call, element: Api_Element, value: string) -> Api_Error

HTMLElement_accessKeyLabel

string HTMLElement_accessKeyLabel(Element element)

htmlElement.accessKeyLabel ("": no access keys)

Host: HTMLElement_accessKeyLabel :: proc(c: ^Call, element: Api_Element) -> string

HTMLOrSVGOrMathMLElement_tabIndex

i32 HTMLOrSVGOrMathMLElement_tabIndex(Element element)

element.tabIndex: the attribute, else 0 for focusable elements and -1 for the others.

Host: HTMLOrSVGOrMathMLElement_tabIndex :: proc(c: ^Call, element: Api_Element) -> i32

HTMLOrSVGOrMathMLElement_set_tabIndex

void HTMLOrSVGOrMathMLElement_set_tabIndex(Element element, i32 value) raises

element.tabIndex = value

Raises: returns an Error (see web).

Host: HTMLOrSVGOrMathMLElement_set_tabIndex :: proc(c: ^Call, element: Api_Element, value: i32) -> Api_Error

HTMLOrSVGOrMathMLElement_nonce

string HTMLOrSVGOrMathMLElement_nonce(Element element)

element.nonce

Host: HTMLOrSVGOrMathMLElement_nonce :: proc(c: ^Call, element: Api_Element) -> string

HTMLOrSVGOrMathMLElement_set_nonce

void HTMLOrSVGOrMathMLElement_set_nonce(Element element, string value) raises

element.nonce = value

Raises: returns an Error (see web).

Host: HTMLOrSVGOrMathMLElement_set_nonce :: proc(c: ^Call, element: Api_Element, value: string) -> Api_Error

ElementContentEditable_contentEditable

string ElementContentEditable_contentEditable(Element element)

element.contentEditable: "true", "false", "plaintext-only" or "inherit".

Host: ElementContentEditable_contentEditable :: proc(c: ^Call, element: Api_Element) -> string

ElementContentEditable_set_contentEditable

void ElementContentEditable_set_contentEditable(Element element, string value) raises

element.contentEditable = value: Syntax for anything else.

Raises: returns an Error (see web).

Host: ElementContentEditable_set_contentEditable :: proc(c: ^Call, element: Api_Element, value: string) -> Api_Error

ElementContentEditable_isContentEditable

bool ElementContentEditable_isContentEditable(Element element)

element.isContentEditable

Host: ElementContentEditable_isContentEditable :: proc(c: ^Call, element: Api_Element) -> bool

HTMLHyperlinkElementUtils_href

string HTMLHyperlinkElementUtils_href(Element element)

a.href / area.href: the URL resolved, or the attribute as is when it does not parse.

Host: HTMLHyperlinkElementUtils_href :: proc(c: ^Call, element: Api_Element) -> string

HTMLHyperlinkElementUtils_set_href

void HTMLHyperlinkElementUtils_set_href(Element element, string value) raises

a.href = value

Raises: returns an Error (see web).

Host: HTMLHyperlinkElementUtils_set_href :: proc(c: ^Call, element: Api_Element, value: string) -> Api_Error

HyperlinkElementUtils_origin

string HyperlinkElementUtils_origin(Element element)

a.origin

Host: HyperlinkElementUtils_origin :: proc(c: ^Call, element: Api_Element) -> string

HyperlinkElementUtils_protocol

string HyperlinkElementUtils_protocol(Element element)

a.protocol and the other components (URL Standard setters; nothing for a URL that does not parse)

Host: HyperlinkElementUtils_protocol :: proc(c: ^Call, element: Api_Element) -> string

HyperlinkElementUtils_set_protocol

void HyperlinkElementUtils_set_protocol(Element element, string value) raises

Raises: returns an Error (see web).

Host: HyperlinkElementUtils_set_protocol :: proc(c: ^Call, element: Api_Element, value: string) -> Api_Error

HyperlinkElementUtils_username

string HyperlinkElementUtils_username(Element element)

Host: HyperlinkElementUtils_username :: proc(c: ^Call, element: Api_Element) -> string

HyperlinkElementUtils_set_username

void HyperlinkElementUtils_set_username(Element element, string value) raises

Raises: returns an Error (see web).

Host: HyperlinkElementUtils_set_username :: proc(c: ^Call, element: Api_Element, value: string) -> Api_Error

HyperlinkElementUtils_password

string HyperlinkElementUtils_password(Element element)

Host: HyperlinkElementUtils_password :: proc(c: ^Call, element: Api_Element) -> string

HyperlinkElementUtils_set_password

void HyperlinkElementUtils_set_password(Element element, string value) raises

Raises: returns an Error (see web).

Host: HyperlinkElementUtils_set_password :: proc(c: ^Call, element: Api_Element, value: string) -> Api_Error

HyperlinkElementUtils_host

string HyperlinkElementUtils_host(Element element)

Host: HyperlinkElementUtils_host :: proc(c: ^Call, element: Api_Element) -> string

HyperlinkElementUtils_set_host

void HyperlinkElementUtils_set_host(Element element, string value) raises

Raises: returns an Error (see web).

Host: HyperlinkElementUtils_set_host :: proc(c: ^Call, element: Api_Element, value: string) -> Api_Error

HyperlinkElementUtils_hostname

string HyperlinkElementUtils_hostname(Element element)

Host: HyperlinkElementUtils_hostname :: proc(c: ^Call, element: Api_Element) -> string

HyperlinkElementUtils_set_hostname

void HyperlinkElementUtils_set_hostname(Element element, string value) raises

Raises: returns an Error (see web).

Host: HyperlinkElementUtils_set_hostname :: proc(c: ^Call, element: Api_Element, value: string) -> Api_Error

HyperlinkElementUtils_port

string HyperlinkElementUtils_port(Element element)

Host: HyperlinkElementUtils_port :: proc(c: ^Call, element: Api_Element) -> string

HyperlinkElementUtils_set_port

void HyperlinkElementUtils_set_port(Element element, string value) raises

Raises: returns an Error (see web).

Host: HyperlinkElementUtils_set_port :: proc(c: ^Call, element: Api_Element, value: string) -> Api_Error

HyperlinkElementUtils_pathname

string HyperlinkElementUtils_pathname(Element element)

Host: HyperlinkElementUtils_pathname :: proc(c: ^Call, element: Api_Element) -> string

HyperlinkElementUtils_set_pathname

void HyperlinkElementUtils_set_pathname(Element element, string value) raises

Raises: returns an Error (see web).

Host: HyperlinkElementUtils_set_pathname :: proc(c: ^Call, element: Api_Element, value: string) -> Api_Error

string HyperlinkElementUtils_search(Element element)

Host: HyperlinkElementUtils_search :: proc(c: ^Call, element: Api_Element) -> string

void HyperlinkElementUtils_set_search(Element element, string value) raises

Raises: returns an Error (see web).

Host: HyperlinkElementUtils_set_search :: proc(c: ^Call, element: Api_Element, value: string) -> Api_Error

HyperlinkElementUtils_hash

string HyperlinkElementUtils_hash(Element element)

Host: HyperlinkElementUtils_hash :: proc(c: ^Call, element: Api_Element) -> string

HyperlinkElementUtils_set_hash

void HyperlinkElementUtils_set_hash(Element element, string value) raises

Raises: returns an Error (see web).

Host: HyperlinkElementUtils_set_hash :: proc(c: ^Call, element: Api_Element, value: string) -> Api_Error

HTMLAnchorElement_text

string HTMLAnchorElement_text(Element element)

a.text: its textContent.

Host: HTMLAnchorElement_text :: proc(c: ^Call, element: Api_Element) -> string

HTMLAnchorElement_set_text

void HTMLAnchorElement_set_text(Element element, string value) raises

a.text = value

Raises: returns an Error (see web).

Host: HTMLAnchorElement_set_text :: proc(c: ^Call, element: Api_Element, value: string) -> Api_Error

HTMLTemplateElement_content

Node HTMLTemplateElement_content(Element element)

template.content

Host: HTMLTemplateElement_content :: proc(c: ^Call, element: Api_Element) -> u64

HTMLInputElement_set_type

void HTMLInputElement_set_type(Element element, string value) raises

input.type = value

Raises: returns an Error (see web).

Host: HTMLInputElement_set_type :: proc(c: ^Call, element: Api_Element, value: string) -> Api_Error

HTMLInputElement_set_maxLength

void HTMLInputElement_set_maxLength(Element element, i32 value) raises

input.maxLength = value: Index_Size for a negative value.

Raises: returns an Error (see web).

Host: HTMLInputElement_set_maxLength :: proc(c: ^Call, element: Api_Element, value: i32) -> Api_Error

HTMLInputElement_set_minLength

void HTMLInputElement_set_minLength(Element element, i32 value) raises

input.minLength = value: Index_Size for a negative value.

Raises: returns an Error (see web).

Host: HTMLInputElement_set_minLength :: proc(c: ^Call, element: Api_Element, value: i32) -> Api_Error

HTMLTextAreaElement_set_maxLength

void HTMLTextAreaElement_set_maxLength(Element element, i32 value) raises

textarea.maxLength = value: Index_Size for a negative value.

Raises: returns an Error (see web).

Host: HTMLTextAreaElement_set_maxLength :: proc(c: ^Call, element: Api_Element, value: i32) -> Api_Error

HTMLTextAreaElement_set_minLength

void HTMLTextAreaElement_set_minLength(Element element, i32 value) raises

textarea.minLength = value: Index_Size for a negative value.

Raises: returns an Error (see web).

Host: HTMLTextAreaElement_set_minLength :: proc(c: ^Call, element: Api_Element, value: i32) -> Api_Error

HTMLOptionElement_set_text

void HTMLOptionElement_set_text(Element element, string value) raises

option.text = value: its children replaced by one Text node.

Raises: returns an Error (see web).

Host: HTMLOptionElement_set_text :: proc(c: ^Call, element: Api_Element, value: string) -> Api_Error

HTMLTableElement_caption

Element HTMLTableElement_caption(Element table)

table.caption: its first caption child.

Host: HTMLTableElement_caption :: proc(c: ^Call, table: Api_Element) -> u64

HTMLTableElement_set_caption

void HTMLTableElement_set_caption(Element table, optional Element value) raises

table.caption = value: the first caption child removed, the value (if any) inserted first. Type for another element.

Raises: returns an Error (see web).

Host: HTMLTableElement_set_caption :: proc(c: ^Call, table: Api_Element, value: Api_Element) -> Api_Error

HTMLTableElement_createCaption

Element HTMLTableElement_createCaption(Element table)

table.createCaption(): the first caption child, or a new one inserted first.

Host: HTMLTableElement_createCaption :: proc(c: ^Call, table: Api_Element) -> u64

HTMLTableElement_deleteCaption

void HTMLTableElement_deleteCaption(Element table)

table.deleteCaption()

Host: HTMLTableElement_deleteCaption :: proc(c: ^Call, table: Api_Element)

HTMLTableElement_tHead

Element HTMLTableElement_tHead(Element table)

table.tHead: its first thead child.

Host: HTMLTableElement_tHead :: proc(c: ^Call, table: Api_Element) -> u64

HTMLTableElement_set_tHead

void HTMLTableElement_set_tHead(Element table, optional Element value) raises

table.tHead = value: Hierarchy for an element that is not a thead.

Raises: returns an Error (see web).

Host: HTMLTableElement_set_tHead :: proc(c: ^Call, table: Api_Element, value: Api_Element) -> Api_Error

HTMLTableElement_createTHead

Element HTMLTableElement_createTHead(Element table)

table.createTHead(): inserted before the first child that is neither a caption nor a colgroup.

Host: HTMLTableElement_createTHead :: proc(c: ^Call, table: Api_Element) -> u64

HTMLTableElement_deleteTHead

void HTMLTableElement_deleteTHead(Element table)

table.deleteTHead()

Host: HTMLTableElement_deleteTHead :: proc(c: ^Call, table: Api_Element)

HTMLTableElement_tFoot

Element HTMLTableElement_tFoot(Element table)

table.tFoot: its first tfoot child.

Host: HTMLTableElement_tFoot :: proc(c: ^Call, table: Api_Element) -> u64

HTMLTableElement_set_tFoot

void HTMLTableElement_set_tFoot(Element table, optional Element value) raises

table.tFoot = value: Hierarchy for an element that is not a tfoot.

Raises: returns an Error (see web).

Host: HTMLTableElement_set_tFoot :: proc(c: ^Call, table: Api_Element, value: Api_Element) -> Api_Error

HTMLTableElement_createTFoot

Element HTMLTableElement_createTFoot(Element table)

table.createTFoot(): appended.

Host: HTMLTableElement_createTFoot :: proc(c: ^Call, table: Api_Element) -> u64

HTMLTableElement_deleteTFoot

void HTMLTableElement_deleteTFoot(Element table)

table.deleteTFoot()

Host: HTMLTableElement_deleteTFoot :: proc(c: ^Call, table: Api_Element)

HTMLTableElement_createTBody

Element HTMLTableElement_createTBody(Element table)

table.createTBody(): after the last tbody child.

Host: HTMLTableElement_createTBody :: proc(c: ^Call, table: Api_Element) -> u64

HTMLTableElement_insertRow

Element HTMLTableElement_insertRow(Element table, i32 index) raises

table.insertRow(index): Index_Size outside -1 ..= rows.length.

Raises: returns an Error (see web).

Host: HTMLTableElement_insertRow :: proc(c: ^Call, table: Api_Element, index: i32) -> (u64, Api_Error)

HTMLTableElement_deleteRow

void HTMLTableElement_deleteRow(Element table, i32 index) raises

table.deleteRow(index): Index_Size outside -1 ..< rows.length.

Raises: returns an Error (see web).

Host: HTMLTableElement_deleteRow :: proc(c: ^Call, table: Api_Element, index: i32) -> Api_Error

HTMLTableSectionElement_insertRow

Element HTMLTableSectionElement_insertRow(Element section, i32 index) raises

section.insertRow(index)

Raises: returns an Error (see web).

Host: HTMLTableSectionElement_insertRow :: proc(c: ^Call, section: Api_Element, index: i32) -> (u64, Api_Error)

HTMLTableSectionElement_deleteRow

void HTMLTableSectionElement_deleteRow(Element section, i32 index) raises

section.deleteRow(index)

Raises: returns an Error (see web).

Host: HTMLTableSectionElement_deleteRow :: proc(c: ^Call, section: Api_Element, index: i32) -> Api_Error

HTMLTableRowElement_insertCell

Element HTMLTableRowElement_insertCell(Element row, i32 index) raises

row.insertCell(index): a new td.

Raises: returns an Error (see web).

Host: HTMLTableRowElement_insertCell :: proc(c: ^Call, row: Api_Element, index: i32) -> (u64, Api_Error)

HTMLTableRowElement_deleteCell

void HTMLTableRowElement_deleteCell(Element row, i32 index) raises

row.deleteCell(index)

Raises: returns an Error (see web).

Host: HTMLTableRowElement_deleteCell :: proc(c: ^Call, row: Api_Element, index: i32) -> Api_Error

HTMLTableRowElement_rowIndex

i32 HTMLTableRowElement_rowIndex(Element row)

row.rowIndex (-1 outside a table)

Host: HTMLTableRowElement_rowIndex :: proc(c: ^Call, row: Api_Element) -> i32

HTMLTableRowElement_sectionRowIndex

i32 HTMLTableRowElement_sectionRowIndex(Element row)

row.sectionRowIndex

Host: HTMLTableRowElement_sectionRowIndex :: proc(c: ^Call, row: Api_Element) -> i32

HTMLTableCellElement_cellIndex

i32 HTMLTableCellElement_cellIndex(Element cell)

cell.cellIndex

Host: HTMLTableCellElement_cellIndex :: proc(c: ^Call, cell: Api_Element) -> i32

HTMLTitleElement_text

string HTMLTitleElement_text(Element element)

title.text: its child text content.

Host: HTMLTitleElement_text :: proc(c: ^Call, element: Api_Element) -> string

HTMLTitleElement_set_text

void HTMLTitleElement_set_text(Element element, string value) raises

title.text = value

Raises: returns an Error (see web).

Host: HTMLTitleElement_set_text :: proc(c: ^Call, element: Api_Element, value: string) -> Api_Error

HTMLScriptElement_text

string HTMLScriptElement_text(Element element)

script.text: its child text content.

Host: HTMLScriptElement_text :: proc(c: ^Call, element: Api_Element) -> string

HTMLScriptElement_set_text

void HTMLScriptElement_set_text(Element element, string value) raises

script.text = value

Raises: returns an Error (see web).

Host: HTMLScriptElement_set_text :: proc(c: ^Call, element: Api_Element, value: string) -> Api_Error

HTMLInputElement_list

Element HTMLInputElement_list(Element input)

input.list: the datalist of the id its list attribute gives.

Host: HTMLInputElement_list :: proc(c: ^Call, input: Api_Element) -> u64

HTMLDialogElement_closedBy

string HTMLDialogElement_closedBy(Element dialog)

dialog.closedBy: the closedby attribute's state ("any", "closerequest", "none"); without a valid one, "closerequest" for a modal dialog, else "none".

Host: HTMLDialogElement_closedBy :: proc(c: ^Call, dialog: Api_Element) -> string

HTMLDialogElement_set_closedBy

void HTMLDialogElement_set_closedBy(Element dialog, string value)

dialog.closedBy = value: sets the closedby attribute.

Host: HTMLDialogElement_set_closedBy :: proc(c: ^Call, dialog: Api_Element, value: string)

HTMLDialogElement_show

void HTMLDialogElement_show(Element dialog) raises

dialog.show(): Invalid_State when it is open as a modal dialog.

Raises: returns an Error (see web).

Host: HTMLDialogElement_show :: proc(c: ^Call, dialog: Api_Element) -> Api_Error

HTMLDialogElement_showModal

void HTMLDialogElement_showModal(Element dialog) raises

dialog.showModal(): Invalid_State when it is open without being modal, not connected, or a showing popover.

Raises: returns an Error (see web).

Host: HTMLDialogElement_showModal :: proc(c: ^Call, dialog: Api_Element) -> Api_Error

HTMLDialogElement_close

void HTMLDialogElement_close(Element dialog, optional string result)

dialog.close(result)

Host: HTMLDialogElement_close :: proc(c: ^Call, dialog: Api_Element, result: Maybe(string))

HTMLDialogElement_requestClose

void HTMLDialogElement_requestClose(Element dialog, optional string result)

dialog.requestClose(result): "cancel" fired first.

Host: HTMLDialogElement_requestClose :: proc(c: ^Call, dialog: Api_Element, result: Maybe(string))

Element_boundingRect

DomRect Element_boundingRect(Element element)

element.getBoundingClientRect(): the border box as drawn (transforms applied), in viewport coordinates.

Host: Element_boundingRect :: proc(c: ^Call, element: Api_Element) -> Api_DomRect

Element_clientRectsPacked

bytes Element_clientRectsPacked(Element element)

element.getClientRects(): per box fragment, 32 bytes each (x, y, width, height as f64).

Host: Element_clientRectsPacked :: proc(c: ^Call, element: Api_Element) -> []u8

Element_clientTop

i32 Element_clientTop(Element element)

element.clientTop, clientLeft, clientWidth, clientHeight (the viewport's size for the root element).

Host: Element_clientTop :: proc(c: ^Call, element: Api_Element) -> i32

Element_clientLeft

i32 Element_clientLeft(Element element)

Host: Element_clientLeft :: proc(c: ^Call, element: Api_Element) -> i32

Element_clientWidth

i32 Element_clientWidth(Element element)

Host: Element_clientWidth :: proc(c: ^Call, element: Api_Element) -> i32

Element_clientHeight

i32 Element_clientHeight(Element element)

Host: Element_clientHeight :: proc(c: ^Call, element: Api_Element) -> i32

Element_scrollTop

f64 Element_scrollTop(Element element)

element.scrollTop / scrollLeft (the document's scroll offsets for the scrolling element).

Host: Element_scrollTop :: proc(c: ^Call, element: Api_Element) -> f64

Element_set_scrollTop

void Element_set_scrollTop(Element element, f64 value)

Host: Element_set_scrollTop :: proc(c: ^Call, element: Api_Element, value: f64)

Element_scrollLeft

f64 Element_scrollLeft(Element element)

Host: Element_scrollLeft :: proc(c: ^Call, element: Api_Element) -> f64

Element_set_scrollLeft

void Element_set_scrollLeft(Element element, f64 value)

Host: Element_set_scrollLeft :: proc(c: ^Call, element: Api_Element, value: f64)

Element_scrollWidth

i32 Element_scrollWidth(Element element)

element.scrollWidth / scrollHeight

Host: Element_scrollWidth :: proc(c: ^Call, element: Api_Element) -> i32

Element_scrollHeight

i32 Element_scrollHeight(Element element)

Host: Element_scrollHeight :: proc(c: ^Call, element: Api_Element) -> i32

Element_scrollToXY

void Element_scrollToXY(Element element, f64 x, f64 y, bool relative)

element.scrollTo(x, y) / scrollBy (relative): NaN keeps that axis.

Host: Element_scrollToXY :: proc(c: ^Call, element: Api_Element, x: f64, y: f64, relative: bool)

Element_scrollIntoViewAt

void Element_scrollIntoViewAt(Element element, i32 block, i32 inline_pos)

element.scrollIntoView(options): block and inline 0 start, 1 center, 2 end, 3 nearest.

Host: Element_scrollIntoViewAt :: proc(c: ^Call, element: Api_Element, block: i32, inline_pos: i32)

HTMLElement_offsetParent

Element HTMLElement_offsetParent(Element element)

htmlElement.offsetParent, offsetTop, offsetLeft, offsetWidth, offsetHeight

Host: HTMLElement_offsetParent :: proc(c: ^Call, element: Api_Element) -> u64

HTMLElement_offsetTop

i32 HTMLElement_offsetTop(Element element)

Host: HTMLElement_offsetTop :: proc(c: ^Call, element: Api_Element) -> i32

HTMLElement_offsetLeft

i32 HTMLElement_offsetLeft(Element element)

Host: HTMLElement_offsetLeft :: proc(c: ^Call, element: Api_Element) -> i32

HTMLElement_offsetWidth

i32 HTMLElement_offsetWidth(Element element)

Host: HTMLElement_offsetWidth :: proc(c: ^Call, element: Api_Element) -> i32

HTMLElement_offsetHeight

i32 HTMLElement_offsetHeight(Element element)

Host: HTMLElement_offsetHeight :: proc(c: ^Call, element: Api_Element) -> i32

Document_elementFromPoint

Element Document_elementFromPoint(f64 x, f64 y)

document.elementFromPoint(x, y) (viewport coordinates)

Host: Document_elementFromPoint :: proc(c: ^Call, x: f64, y: f64) -> u64

Window_innerWidth

i32 Window_innerWidth()

window.innerWidth / innerHeight

Host: Window_innerWidth :: proc(c: ^Call) -> i32

Window_innerHeight

i32 Window_innerHeight()

Host: Window_innerHeight :: proc(c: ^Call) -> i32

Window_outerWidth

i32 Window_outerWidth()

window.outerWidth / outerHeight (the viewport's: the shell's window is not the page's business)

Host: Window_outerWidth :: proc(c: ^Call) -> i32

Window_outerHeight

i32 Window_outerHeight()

Host: Window_outerHeight :: proc(c: ^Call) -> i32

Window_scrollX

f64 Window_scrollX()

window.scrollX / scrollY and their aliases

Host: Window_scrollX :: proc(c: ^Call) -> f64

Window_scrollY

f64 Window_scrollY()

Host: Window_scrollY :: proc(c: ^Call) -> f64

Window_pageXOffset

f64 Window_pageXOffset()

Host: Window_pageXOffset :: proc(c: ^Call) -> f64

Window_pageYOffset

f64 Window_pageYOffset()

Host: Window_pageYOffset :: proc(c: ^Call) -> f64

Window_devicePixelRatio

f64 Window_devicePixelRatio()

window.devicePixelRatio

Host: Window_devicePixelRatio :: proc(c: ^Call) -> f64

Window_screenX

i32 Window_screenX()

window.screenX / screenY / screenLeft / screenTop (0: the page does not learn where the window is)

Host: Window_screenX :: proc(c: ^Call) -> i32

Window_screenY

i32 Window_screenY()

Host: Window_screenY :: proc(c: ^Call) -> i32

Window_screenLeft

i32 Window_screenLeft()

Host: Window_screenLeft :: proc(c: ^Call) -> i32

Window_screenTop

i32 Window_screenTop()

Host: Window_screenTop :: proc(c: ^Call) -> i32

Window_scrollToXY

void Window_scrollToXY(f64 x, f64 y, bool relative, bool smooth)

window.scrollTo(x, y) / scrollBy (relative): NaN keeps that axis; smooth asks for a smooth scroll.

Host: Window_scrollToXY :: proc(c: ^Call, x: f64, y: f64, relative: bool, smooth: bool)

Range_boundingRect

DomRect Range_boundingRect(Node start, u32 start_offset, Node end, u32 end_offset)

The bounding box of a range's contents (Range.getBoundingClientRect), as Element_boundingRect.

Host: Range_boundingRect :: proc(c: ^Call, start: Api_Node, start_offset: u32, end: Api_Node, end_offset: u32) -> Api_DomRect

Range_clientRectsPacked

bytes Range_clientRectsPacked(Node start, u32 start_offset, Node end, u32 end_offset)

Range.getClientRects(), packed as Element_clientRectsPacked.

Host: Range_clientRectsPacked :: proc(c: ^Call, start: Api_Node, start_offset: u32, end: Api_Node, end_offset: u32) -> []u8

MutationObserver_create

Object MutationObserver_create(MicrotaskCallback notify, i32 user)

new MutationObserver: notify(user) runs as a microtask when records are queued.

Host: MutationObserver_create :: proc(c: ^Call, notify: u32, user: i32) -> u64

MutationObserver_observe

void MutationObserver_observe(u64 observer, Node target, u32 options, string filter) raises

observer.observe(target, options): bits 1 childList, 2 attributes, 4 characterData, 8 subtree, 16 attributeOldValue, 32 characterDataOldValue, 64 an attributeFilter (filter, names NUL-separated). Type when no kind of mutation is asked for (as DOM says, after the implied ones).

Raises: returns an Error (see web).

Host: MutationObserver_observe :: proc(c: ^Call, observer: u64, target: Api_Node, options: u32, filter: string) -> Api_Error

MutationObserver_disconnect

void MutationObserver_disconnect(u64 observer)

observer.disconnect(): no more registrations, the queue emptied.

Host: MutationObserver_disconnect :: proc(c: ^Call, observer: u64)

MutationObserver_takeRecords

bytes MutationObserver_takeRecords(u64 observer)

observer.takeRecords(): the records waiting, packed (src/page/js_dom_observe.odin, records_pack). Nothing changes until MutationObserver_release, so a call that did not fit can be made again.

Host: MutationObserver_takeRecords :: proc(c: ^Call, observer: u64) -> []u8

MutationObserver_release

void MutationObserver_release(u64 observer)

The engine wrapped the nodes of the records it took: they leave the queue (and their pins go), the transient registrations end (DOM "notify mutation observers").

Host: MutationObserver_release :: proc(c: ^Call, observer: u64)

MutationObserver_live

bool MutationObserver_live(u64 observer)

Whether some node the observer is registered on is still alive (the engine lets an observer go otherwise).

Host: MutationObserver_live :: proc(c: ^Call, observer: u64) -> bool

Range_comparePoints

i32 Range_comparePoints(Node first, u32 first_offset, Node second, u32 second_offset)

A boundary point compared with another: -1 before, 0 equal, 1 after (DOM "position of a boundary point").

Host: Range_comparePoints :: proc(c: ^Call, first: Api_Node, first_offset: u32, second: Api_Node, second_offset: u32) -> i32

Range_text

string Range_text(Node start, u32 start_offset, Node end, u32 end_offset)

range.toString(): the text of the Text nodes in the range.

Host: Range_text :: proc(c: ^Call, start: Api_Node, start_offset: u32, end: Api_Node, end_offset: u32) -> string

Range_contents

Node Range_contents(Node start, u32 start_offset, Node end, u32 end_offset, i32 mode) raises

The contents of a range: mode 0 cloneContents (a new fragment), 1 extractContents (a fragment, the contents removed), 2 deleteContents (returns 0). Hierarchy when a doctype is in the range.

Raises: returns an Error (see web).

Host: Range_contents :: proc(c: ^Call, start: Api_Node, start_offset: u32, end: Api_Node, end_offset: u32, mode: i32) -> (u64, Api_Error)

Range_createContextualFragment

Node Range_createContextualFragment(Node start, string markup) raises

range.createContextualFragment(markup): parsed with the range's start node (its parent element for a Text or a Comment) as the context element, a <body> without one or for <html>; the scripts of the fragment are not marked "already started" (they run once inserted), except one the markup left open (HTML: end of input in a script).

Raises: returns an Error (see web).

Host: Range_createContextualFragment :: proc(c: ^Call, start: Api_Node, markup: string) -> (u64, Api_Error)

Selection_state

SelectionState Selection_state()

The selection (offsets in UTF-16 code units for Text nodes).

Host: Selection_state :: proc(c: ^Call) -> Api_SelectionState

Selection_setRange

void Selection_setRange(Node anchor, u32 anchor_offset, Node focus, u32 focus_offset) raises

setBaseAndExtent: Index_Size for an offset past a node's length, Invalid_Handle for a node outside the document.

Raises: returns an Error (see web).

Host: Selection_setRange :: proc(c: ^Call, anchor: Api_Node, anchor_offset: u32, focus: Api_Node, focus_offset: u32) -> Api_Error

Selection_clear

void Selection_clear()

removeAllRanges()

Host: Selection_clear :: proc(c: ^Call)

Selection_text

string Selection_text()

selection.toString()

Host: Selection_text :: proc(c: ^Call) -> string

InlineStyle_getProperty

string InlineStyle_getProperty(Element element, string name)

style.getPropertyValue(name): a longhand, a shorthand rebuilt from its longhands, or a custom property.

Host: InlineStyle_getProperty :: proc(c: ^Call, element: Api_Element, name: string) -> string

InlineStyle_priority

string InlineStyle_priority(Element element, string name)

style.getPropertyPriority(name): "important" or "".

Host: InlineStyle_priority :: proc(c: ^Call, element: Api_Element, name: string) -> string

InlineStyle_setProperty

void InlineStyle_setProperty(Element element, string name, string value, string priority) raises

style.setProperty(name, value, priority): an empty value removes it; an unknown property or an invalid value changes nothing (as CSSOM says).

Raises: returns an Error (see web).

Host: InlineStyle_setProperty :: proc(c: ^Call, element: Api_Element, name: string, value: string, priority: string) -> Api_Error

InlineStyle_removeProperty

string InlineStyle_removeProperty(Element element, string name) raises

style.removeProperty(name): the value it had.

Raises: returns an Error (see web).

Has effects: call it once per result (no length query).

Host: InlineStyle_removeProperty :: proc(c: ^Call, element: Api_Element, name: string) -> (string, Api_Error)

InlineStyle_cssText

string InlineStyle_cssText(Element element)

style.cssText

Host: InlineStyle_cssText :: proc(c: ^Call, element: Api_Element) -> string

InlineStyle_setCssText

void InlineStyle_setCssText(Element element, string text) raises

style.cssText = text

Raises: returns an Error (see web).

Host: InlineStyle_setCssText :: proc(c: ^Call, element: Api_Element, text: string) -> Api_Error

InlineStyle_length

u32 InlineStyle_length(Element element)

style.length: the longhands declared (shorthands count as theirs).

Host: InlineStyle_length :: proc(c: ^Call, element: Api_Element) -> u32

InlineStyle_item

string InlineStyle_item(Element element, u32 index)

style.item(index) ("" past the end).

Host: InlineStyle_item :: proc(c: ^Call, element: Api_Element, index: u32) -> string

ComputedStyle_get

string ComputedStyle_get(Element element, string pseudo, string name)

getComputedStyle(element, pseudo).getPropertyValue(name): "" for a property the browser does not compute. pseudo: "", "::before", "::after" (":before" too).

Host: ComputedStyle_get :: proc(c: ^Call, element: Api_Element, pseudo: string, name: string) -> string

ComputedStyle_count

u32 ComputedStyle_count()

The number of properties getComputedStyle lists.

Host: ComputedStyle_count :: proc(c: ^Call) -> u32

ComputedStyle_name

string ComputedStyle_name(u32 index)

The name of the listed property at index ("" past the end).

Host: ComputedStyle_name :: proc(c: ^Call, index: u32) -> string

CSS_supportsDeclaration

bool CSS_supportsDeclaration(string property, string value)

CSS.supports(property, value) (CSS Conditional 3 §8.1): a property the style engine knows whose value it parses.

Host: CSS_supportsDeclaration :: proc(c: ^Call, property: string, value: string) -> bool

CSS_supportsCondition

bool CSS_supportsCondition(string condition)

CSS.supports(conditionText): a <supports-condition>, or a declaration without its parentheses.

Host: CSS_supportsCondition :: proc(c: ^Call, condition: string) -> bool

Node_nodeName

string Node_nodeName(Node node)

node.nodeName ("#text", "DIV", "#document"...).

Host: Node_nodeName :: proc(c: ^Call, node: Api_Node) -> string

Node_baseURI

string Node_baseURI(Node node)

node.baseURI: the document's base URL.

Host: Node_baseURI :: proc(c: ^Call, node: Api_Node) -> string

Node_isConnected

bool Node_isConnected(Node node)

node.isConnected

Host: Node_isConnected :: proc(c: ^Call, node: Api_Node) -> bool

Node_ownerDocument

Node Node_ownerDocument(Node node)

node.ownerDocument (null for the document itself).

Host: Node_ownerDocument :: proc(c: ^Call, node: Api_Node) -> u64

Node_parentElement

Element Node_parentElement(Node node)

node.parentElement

Host: Node_parentElement :: proc(c: ^Call, node: Api_Node) -> u64

Node_hasChildNodes

bool Node_hasChildNodes(Node node)

node.hasChildNodes()

Host: Node_hasChildNodes :: proc(c: ^Call, node: Api_Node) -> bool

Node_nodeValue

string Node_nodeValue(Node node) raises

node.nodeValue: the data of a Text or Comment node, Not_Found (null) for the others.

Raises: returns an Error (see web).

Host: Node_nodeValue :: proc(c: ^Call, node: Api_Node) -> (string, Api_Error)

Node_set_nodeValue

void Node_set_nodeValue(Node node, string value) raises

node.nodeValue = value (nothing for nodes without data).

Raises: returns an Error (see web).

Host: Node_set_nodeValue :: proc(c: ^Call, node: Api_Node, value: string) -> Api_Error

Node_textContent

string Node_textContent(Node node) raises

node.textContent (Not_Found: null, for the document and a doctype).

Raises: returns an Error (see web).

Host: Node_textContent :: proc(c: ^Call, node: Api_Node) -> (string, Api_Error)

Node_set_textContent

void Node_set_textContent(Node node, string value) raises

node.textContent = value: one mutation replacing every child by a Text node (none for "").

Raises: returns an Error (see web).

Host: Node_set_textContent :: proc(c: ^Call, node: Api_Node, value: string) -> Api_Error

Node_normalize

void Node_normalize(Node node)

node.normalize()

Host: Node_normalize :: proc(c: ^Call, node: Api_Node)

Node_cloneNode

Node Node_cloneNode(Node node, bool deep = false) raises

node.cloneNode(deep). Not_Supported for the document (one document per page). The elements of the clone whose name has a custom element definition are upgraded before it returns, unless node is in a template's contents (an inert document: no definition applies there).

Raises: returns an Error (see web).

Host: Node_cloneNode :: proc(c: ^Call, node: Api_Node, deep: bool) -> (u64, Api_Error)

Document_importNodeCopy

Node Document_importNodeCopy(Node node, bool deep = false) raises

document.importNode(node, deep): the clone belongs to this document, whatever document node is in (a template's contents included), so its elements of a defined name are upgraded before it returns.

Raises: returns an Error (see web).

Host: Document_importNodeCopy :: proc(c: ^Call, node: Api_Node, deep: bool) -> (u64, Api_Error)

Node_isEqualNode

bool Node_isEqualNode(Node node, optional Node other)

node.isEqualNode(other)

Host: Node_isEqualNode :: proc(c: ^Call, node: Api_Node, other: Api_Node) -> bool

Node_isSameNode

bool Node_isSameNode(Node node, optional Node other)

node.isSameNode(other)

Host: Node_isSameNode :: proc(c: ^Call, node: Api_Node, other: Api_Node) -> bool

Node_compareDocumentPosition

u32 Node_compareDocumentPosition(Node node, Node other)

node.compareDocumentPosition(other): DOCUMENT_POSITION_* bits.

Host: Node_compareDocumentPosition :: proc(c: ^Call, node: Api_Node, other: Api_Node) -> u32

Node_contains

bool Node_contains(Node node, optional Node other)

node.contains(other)

Host: Node_contains :: proc(c: ^Call, node: Api_Node, other: Api_Node) -> bool

Node_lookupPrefix

string Node_lookupPrefix(Node node, optional string namespace) raises

node.lookupPrefix(namespace) (Not_Found: null).

Raises: returns an Error (see web).

Host: Node_lookupPrefix :: proc(c: ^Call, node: Api_Node, namespace: Maybe(string)) -> (string, Api_Error)

Node_lookupNamespaceURI

string Node_lookupNamespaceURI(Node node, optional string prefix) raises

node.lookupNamespaceURI(prefix) (Not_Found: null).

Raises: returns an Error (see web).

Host: Node_lookupNamespaceURI :: proc(c: ^Call, node: Api_Node, prefix: Maybe(string)) -> (string, Api_Error)

Node_isDefaultNamespace

bool Node_isDefaultNamespace(Node node, optional string namespace)

node.isDefaultNamespace(namespace)

Host: Node_isDefaultNamespace :: proc(c: ^Call, node: Api_Node, namespace: Maybe(string)) -> bool

Node_rootNode

Node Node_rootNode(Node node)

node.getRootNode() (no shadow trees: the root of its tree).

Host: Node_rootNode :: proc(c: ^Call, node: Api_Node) -> u64

Node_length

u32 Node_length(Node node)

The length of a node (DOM "length"): UTF-16 code units of a Text or Comment node, else its number of children.

Host: Node_length :: proc(c: ^Call, node: Api_Node) -> u32

Node_preInsert

void Node_preInsert(Node parent, Node node, optional Node child) raises

parent.insertBefore(node, child) / appendChild (child absent): DOM "pre-insert", every check (Hierarchy, Not_Found), a DocumentFragment's children inserted as one mutation.

Raises: returns an Error (see web).

Host: Node_preInsert :: proc(c: ^Call, parent: Api_Node, node: Api_Node, child: Api_Node) -> Api_Error

Node_moveBefore

void Node_moveBefore(Node parent, Node node, optional Node child) raises

parent.moveBefore(node, child): Node_preInsert's insertion without the insertion steps of script elements (HTML: a script moved, or text moved into one, does not run).

Raises: returns an Error (see web).

Host: Node_moveBefore :: proc(c: ^Call, parent: Api_Node, node: Api_Node, child: Api_Node) -> Api_Error

Node_replaceChildChecked

void Node_replaceChildChecked(Node parent, Node node, Node child) raises

parent.replaceChild(node, child): DOM "replace a child".

Raises: returns an Error (see web).

Host: Node_replaceChildChecked :: proc(c: ^Call, parent: Api_Node, node: Api_Node, child: Api_Node) -> Api_Error

Node_preRemove

void Node_preRemove(Node parent, Node child) raises

parent.removeChild(child): Not_Found when child is not a child of parent.

Raises: returns an Error (see web).

Host: Node_preRemove :: proc(c: ^Call, parent: Api_Node, child: Api_Node) -> Api_Error

Node_insertItems

void Node_insertItems(Node node, i32 mode, bytes items) raises

prepend / append / replaceChildren (mode 0, 1, 2) of ParentNode, before / after / replaceWith (3, 4, 5) of ChildNode, with their (Node or DOMString) arguments packed in items: per item one byte 0 then a node handle (8 bytes, little endian), or one byte 1 then a length (4 bytes) and UTF-8 text.

Raises: returns an Error (see web).

Host: Node_insertItems :: proc(c: ^Call, node: Api_Node, mode: i32, items: []u8) -> Api_Error

Node_pinAll

void Node_pinAll(u64[] nodes)

The node handles of nodes stay alive while pinned (a static NodeList, a mutation record).

Host: Node_pinAll :: proc(c: ^Call, nodes: []u64)

Node_unpinAll

void Node_unpinAll(u64[] nodes)

Drops the pins of Node_pinAll (dead handles are ignored).

Host: Node_unpinAll :: proc(c: ^Call, nodes: []u64)

ParentNode_firstElementChild

Element ParentNode_firstElementChild(Node node)

node.firstElementChild

Host: ParentNode_firstElementChild :: proc(c: ^Call, node: Api_Node) -> u64

ParentNode_lastElementChild

Element ParentNode_lastElementChild(Node node)

node.lastElementChild

Host: ParentNode_lastElementChild :: proc(c: ^Call, node: Api_Node) -> u64

ParentNode_childElementCount

u32 ParentNode_childElementCount(Node node)

node.childElementCount

Host: ParentNode_childElementCount :: proc(c: ^Call, node: Api_Node) -> u32

ChildNode_remove

void ChildNode_remove(Node node)

node.remove()

Host: ChildNode_remove :: proc(c: ^Call, node: Api_Node)

NonDocumentTypeChildNode_previousElementSibling

Element NonDocumentTypeChildNode_previousElementSibling(Node node)

node.previousElementSibling

Host: NonDocumentTypeChildNode_previousElementSibling :: proc(c: ^Call, node: Api_Node) -> u64

NonDocumentTypeChildNode_nextElementSibling

Element NonDocumentTypeChildNode_nextElementSibling(Node node)

node.nextElementSibling

Host: NonDocumentTypeChildNode_nextElementSibling :: proc(c: ^Call, node: Api_Node) -> u64

NonElementParentNode_getElementById

Element NonElementParentNode_getElementById(Node node, string id)

fragment.getElementById(id) (the document has its own)

Host: NonElementParentNode_getElementById :: proc(c: ^Call, node: Api_Node, id: string) -> u64

CharacterData_data

string CharacterData_data(Node node)

characterData.data

Host: CharacterData_data :: proc(c: ^Call, node: Api_Node) -> string

CharacterData_set_data

void CharacterData_set_data(Node node, string value)

characterData.data = value

Host: CharacterData_set_data :: proc(c: ^Call, node: Api_Node, value: string)

CharacterData_length

u32 CharacterData_length(Node node)

characterData.length (UTF-16 code units)

Host: CharacterData_length :: proc(c: ^Call, node: Api_Node) -> u32

CharacterData_substringData

string CharacterData_substringData(Node node, u32 offset, u32 count) raises

substringData(offset, count): Index_Size past the end.

Raises: returns an Error (see web).

Host: CharacterData_substringData :: proc(c: ^Call, node: Api_Node, offset: u32, count: u32) -> (string, Api_Error)

CharacterData_appendData

void CharacterData_appendData(Node node, string data)

appendData(data)

Host: CharacterData_appendData :: proc(c: ^Call, node: Api_Node, data: string)

CharacterData_insertData

void CharacterData_insertData(Node node, u32 offset, string data) raises

insertData(offset, data): Index_Size past the end.

Raises: returns an Error (see web).

Host: CharacterData_insertData :: proc(c: ^Call, node: Api_Node, offset: u32, data: string) -> Api_Error

CharacterData_deleteData

void CharacterData_deleteData(Node node, u32 offset, u32 count) raises

deleteData(offset, count): Index_Size past the end.

Raises: returns an Error (see web).

Host: CharacterData_deleteData :: proc(c: ^Call, node: Api_Node, offset: u32, count: u32) -> Api_Error

CharacterData_replaceData

void CharacterData_replaceData(Node node, u32 offset, u32 count, string data) raises

replaceData(offset, count, data): Index_Size past the end.

Raises: returns an Error (see web).

Host: CharacterData_replaceData :: proc(c: ^Call, node: Api_Node, offset: u32, count: u32, data: string) -> Api_Error

Text_splitText

Node Text_splitText(Node node, u32 offset) raises

text.splitText(offset): the new Text node (inserted after it when it has a parent). Index_Size past the end.

Raises: returns an Error (see web).

Host: Text_splitText :: proc(c: ^Call, node: Api_Node, offset: u32) -> (u64, Api_Error)

Text_wholeText

string Text_wholeText(Node node)

text.wholeText

Host: Text_wholeText :: proc(c: ^Call, node: Api_Node) -> string

DocumentType_name

string DocumentType_name(Node node)

doctype.name

Host: DocumentType_name :: proc(c: ^Call, node: Api_Node) -> string

DocumentType_publicId

string DocumentType_publicId(Node node)

doctype.publicId

Host: DocumentType_publicId :: proc(c: ^Call, node: Api_Node) -> string

DocumentType_systemId

string DocumentType_systemId(Node node)

doctype.systemId

Host: DocumentType_systemId :: proc(c: ^Call, node: Api_Node) -> string

Document_createElementChecked

Element Document_createElementChecked(string local_name) raises

document.createElement(localName): Invalid_Character for a name that is not a valid element name.

Raises: returns an Error (see web).

Host: Document_createElementChecked :: proc(c: ^Call, local_name: string) -> (u64, Api_Error)

Document_createElementInert

Element Document_createElementInert(string local_name) raises

createElement(localName) of a document other than the page's (createHTMLDocument, DOMParser, the one a template's contents belong to): no custom element registry, so the element is made as is and never constructed or upgraded.

Raises: returns an Error (see web).

Host: Document_createElementInert :: proc(c: ^Call, local_name: string) -> (u64, Api_Error)

Document_createElementNSChecked

Element Document_createElementNSChecked(optional string namespace, string qualified_name) raises

document.createElementNS(namespace, qualifiedName): Invalid_Character, Namespace as DOM "validate and extract".

Raises: returns an Error (see web).

Host: Document_createElementNSChecked :: proc(c: ^Call, namespace: Maybe(string), qualified_name: string) -> (u64, Api_Error)

Document_validateAttributeNS

void Document_validateAttributeNS(optional string namespace, string qualified_name) raises

document.createAttributeNS(namespace, qualifiedName)'s checks: Invalid_Character, Namespace as DOM "validate and extract" (the engine makes the Attr).

Raises: returns an Error (see web).

Host: Document_validateAttributeNS :: proc(c: ^Call, namespace: Maybe(string), qualified_name: string) -> Api_Error

Document_createDocumentFragment

Node Document_createDocumentFragment() raises

document.createDocumentFragment()

Raises: returns an Error (see web).

Host: Document_createDocumentFragment :: proc(c: ^Call) -> (u64, Api_Error)

Document_createComment

Node Document_createComment(string data) raises

document.createComment(data)

Raises: returns an Error (see web).

Host: Document_createComment :: proc(c: ^Call, data: string) -> (u64, Api_Error)

Document_createCDATASection

Node Document_createCDATASection(Node document, string data) raises

document.createCDATASection(data) of document (the page's, or a document of its own, whose node it is): Not_Supported for an HTML document, Invalid_Character when data contains "]]>".

Raises: returns an Error (see web).

Host: Document_createCDATASection :: proc(c: ^Call, document: Api_Node, data: string) -> (u64, Api_Error)

Document_createProcessingInstruction

Node Document_createProcessingInstruction(string target, string data) raises

document.createProcessingInstruction(target, data): Invalid_Character when target is not an XML Name or data contains "?>".

Raises: returns an Error (see web).

Host: Document_createProcessingInstruction :: proc(c: ^Call, target: string, data: string) -> (u64, Api_Error)

Document_adoptNode

Node Document_adoptNode(Node document, Node node) raises

document.adoptNode(node) (DOM "adopt"): removed from its parent, it and its shadow-including descendants get document (the page's, or a document of its own) as node document. Not_Supported for a document, Hierarchy for a shadow root. What the glue does too to what a document of its own makes (createElement, importNode).

Raises: returns an Error (see web).

Host: Document_adoptNode :: proc(c: ^Call, document: Api_Node, node: Api_Node) -> (u64, Api_Error)

Document_documentURI

string Document_documentURI(Node document)

document.documentURI (and document.URL) of document: about:blank for a document of its own createHTMLDocument, createDocument or parseHTMLUnsafe made, else the page's URL (DOMParser's documents have their creator's).

Host: Document_documentURI :: proc(c: ^Call, document: Api_Node) -> string

Document_compatMode

string Document_compatMode()

document.compatMode: "CSS1Compat" or "BackCompat".

Host: Document_compatMode :: proc(c: ^Call) -> string

Document_characterSet

string Document_characterSet()

document.characterSet

Host: Document_characterSet :: proc(c: ^Call) -> string

Document_charset

string Document_charset()

document.charset

Host: Document_charset :: proc(c: ^Call) -> string

Document_inputEncoding

string Document_inputEncoding()

document.inputEncoding

Host: Document_inputEncoding :: proc(c: ^Call) -> string

Document_contentType

string Document_contentType()

document.contentType

Host: Document_contentType :: proc(c: ^Call) -> string

Document_doctype

Node Document_doctype()

document.doctype

Host: Document_doctype :: proc(c: ^Call) -> u64

Document_title

string Document_title()

document.title: the <title> text, whitespace collapsed (the <svg> root's title in an SVG document).

Host: Document_title :: proc(c: ^Call) -> string

Document_set_title

void Document_set_title(string value)

document.title = value: the first <title> (made in <head> when missing).

Host: Document_set_title :: proc(c: ^Call, value: string)

Document_dir

string Document_dir()

document.dir

Host: Document_dir :: proc(c: ^Call) -> string

Document_set_dir

void Document_set_dir(string value)

document.dir = value

Host: Document_set_dir :: proc(c: ^Call, value: string)

Document_hasFocus

bool Document_hasFocus()

document.hasFocus()

Host: Document_hasFocus :: proc(c: ^Call) -> bool

Document_referrer

string Document_referrer()

document.referrer

Host: Document_referrer :: proc(c: ^Call) -> string

Document_lastModified

string Document_lastModified()

document.lastModified ("MM/DD/YYYY hh:mm:ss")

Host: Document_lastModified :: proc(c: ^Call) -> string

Document_domain

string Document_domain()

document.domain: the effective domain of the document's origin (its domain once set, else its host; "" for an opaque origin)

Host: Document_domain :: proc(c: ^Call) -> string

Document_set_domain

void Document_set_domain(string value) raises

document.domain = value: the origin's domain becomes value, a registrable domain suffix of the effective domain or that domain itself (HTML); Security when sandboxed, opaque or not such a suffix; nothing in an origin-keyed agent cluster.

Raises: returns an Error (see web).

Host: Document_set_domain :: proc(c: ^Call, value: string) -> Api_Error

Document_scrollingElement

Element Document_scrollingElement()

document.scrollingElement

Host: Document_scrollingElement :: proc(c: ^Call) -> u64

Document_set_body

void Document_set_body(optional Element body) raises

document.body = element: Hierarchy when not a <body> or <frameset>, or without a document element.

Raises: returns an Error (see web).

Host: Document_set_body :: proc(c: ^Call, body: Api_Element) -> Api_Error

DOMImplementation_createHTMLDocument

Node DOMImplementation_createHTMLDocument(optional string title) raises

document.implementation.createHTMLDocument(title): an inert document of its own (nothing loads or runs in it), made of the page's nodes: a doctype, <html>, <head> (with <title> when given) and <body>.

Raises: returns an Error (see web).

Host: DOMImplementation_createHTMLDocument :: proc(c: ^Call, title: Maybe(string)) -> (u64, Api_Error)

DOMParser_parseHTMLNode

Node DOMParser_parseHTMLNode(string html) raises

new DOMParser().parseFromString(html, "text/html"): a new inert document (as createHTMLDocument makes) holding the whole document parsed from html (no declarative shadow roots, nothing loads or runs in it).

Raises: returns an Error (see web).

Host: DOMParser_parseHTMLNode :: proc(c: ^Call, html: string) -> (u64, Api_Error)

DOMParser_parseXMLNode

Node DOMParser_parseXMLNode(string text, string type) raises

parseFromString(text, type) for the XML types (text/xml, application/xml, application/xhtml+xml, image/svg+xml): a new inert XML document; one whose element is <parsererror> when the text is not well-formed. Type for another type, Quota past dom.max_fragment_nodes.

Raises: returns an Error (see web).

Host: DOMParser_parseXMLNode :: proc(c: ^Call, text: string, type: string) -> (u64, Api_Error)

ProcessingInstruction_target

string ProcessingInstruction_target(Node node)

processingInstruction.target

Host: ProcessingInstruction_target :: proc(c: ^Call, node: Api_Node) -> string

Document_xmlContentType

string Document_xmlContentType(Node document) raises

document.contentType of an XML document (DOMParser's type); Not_Found for an HTML one.

Raises: returns an Error (see web).

Host: Document_xmlContentType :: proc(c: ^Call, document: Api_Node) -> (string, Api_Error)

Document_createXMLElement

Element Document_createXMLElement(Node document, optional string namespace, string qualified_name, bool with_namespace) raises

createElement(localName) (with_namespace false) or createElementNS(namespace, qualifiedName) of an XML document (DOMParser's XML types, createDocument): an element of that document, whose names keep their case (tagName as written, attribute names as given); createElement gives it the HTML namespace only in an application/xhtml+xml document. Invalid_Character, Namespace as the others; Not_Found when document is not an XML document.

Raises: returns an Error (see web).

Host: Document_createXMLElement :: proc(c: ^Call, document: Api_Node, namespace: Maybe(string), qualified_name: string, with_namespace: bool) -> (u64, Api_Error)

DOMImplementation_createDocument

Node DOMImplementation_createDocument(optional string namespace, string qualified_name, optional Node doctype) raises

document.implementation.createDocument(namespace, qualifiedName, doctype): a new inert XMLDocument, with the doctype (a node made by createDocumentType, not in a tree) and its element when the name is not empty; its contentType follows the namespace (application/xhtml+xml, image/svg+xml, else application/xml).

Raises: returns an Error (see web).

Host: DOMImplementation_createDocument :: proc(c: ^Call, namespace: Maybe(string), qualified_name: string, doctype: Api_Node) -> (u64, Api_Error)

DOMImplementation_createDocumentType

Node DOMImplementation_createDocumentType(string name, string public_id, string system_id) raises

document.implementation.createDocumentType(name, publicId, systemId): Invalid_Character for a bad name.

Raises: returns an Error (see web).

Host: DOMImplementation_createDocumentType :: proc(c: ^Call, name: string, public_id: string, system_id: string) -> (u64, Api_Error)

Document_partOf

Node Document_partOf(Node document, i32 which)

A part of a document node (the page's or one createHTMLDocument made): 0 documentElement, 1 head, 2 body, 3 doctype. 0 when there is none.

Host: Document_partOf :: proc(c: ^Call, document: Api_Node, which: i32) -> u64

ResizeObserver_create

Object ResizeObserver_create(MicrotaskCallback notify, i32 user)

new ResizeObserver: notify(user) runs, inside a rendering update, when some target's observed box changed; it takes the entries with ResizeObserver_takeEntries.

Host: ResizeObserver_create :: proc(c: ^Call, notify: u32, user: i32) -> u64

ResizeObserver_observe

void ResizeObserver_observe(u64 observer, Element target, i32 box) raises

observer.observe(target, { box }): box 0 content-box, 1 border-box, 2 device-pixel-content-box. Observing a target again with the same box does nothing; with another, the observation starts over.

Raises: returns an Error (see web).

Host: ResizeObserver_observe :: proc(c: ^Call, observer: u64, target: Api_Element, box: i32) -> Api_Error

ResizeObserver_unobserve

void ResizeObserver_unobserve(u64 observer, Element target)

Host: ResizeObserver_unobserve :: proc(c: ^Call, observer: u64, target: Api_Element)

ResizeObserver_disconnect

void ResizeObserver_disconnect(u64 observer)

Host: ResizeObserver_disconnect :: proc(c: ^Call, observer: u64)

ResizeObserver_observed

u32 ResizeObserver_observed(u64 observer)

How many targets the observer observes (the engine keeps the observer alive while it is not 0).

Host: ResizeObserver_observed :: proc(c: ^Call, observer: u64) -> u32

ResizeObserver_takeEntries

bytes ResizeObserver_takeEntries(u64 observer)

The entries being delivered, 72 bytes each, little endian: target u64, then eight f64: borderBoxSize (inline, block), contentBoxSize, devicePixelContentBoxSize, and the content rect's left and top.

Host: ResizeObserver_takeEntries :: proc(c: ^Call, observer: u64) -> []u8

IntersectionObserver_create

Object IntersectionObserver_create(MicrotaskCallback notify, i32 user, u64 root, string root_margin, string scroll_margin, bytes thresholds) raises

new IntersectionObserver: root is the root element or document (0: the viewport), thresholds the f64 values ascending (already checked to be in [0, 1]); notify(user) runs, from a task of the page, when entries were queued, and takes them with IntersectionObserver_takeRecords. Syntax when a margin is not one to four lengths in px or %.

Raises: returns an Error (see web).

Host: IntersectionObserver_create :: proc(c: ^Call, notify: u32, user: i32, root: u64, root_margin: string, scroll_margin: string, thresholds: []u8) -> (u64, Api_Error)

IntersectionObserver_rootMargin

string IntersectionObserver_rootMargin(u64 observer)

observer.rootMargin / scrollMargin: the four sides, each a number and its unit ("10px 0px 10px 0px").

Host: IntersectionObserver_rootMargin :: proc(c: ^Call, observer: u64) -> string

IntersectionObserver_scrollMargin

string IntersectionObserver_scrollMargin(u64 observer)

Host: IntersectionObserver_scrollMargin :: proc(c: ^Call, observer: u64) -> string

IntersectionObserver_observe

void IntersectionObserver_observe(u64 observer, Element target) raises

Raises: returns an Error (see web).

Host: IntersectionObserver_observe :: proc(c: ^Call, observer: u64, target: Api_Element) -> Api_Error

IntersectionObserver_unobserve

void IntersectionObserver_unobserve(u64 observer, Element target)

Host: IntersectionObserver_unobserve :: proc(c: ^Call, observer: u64, target: Api_Element)

IntersectionObserver_disconnect

void IntersectionObserver_disconnect(u64 observer)

observer.disconnect(): no more targets; the entries already queued stay for takeRecords.

Host: IntersectionObserver_disconnect :: proc(c: ^Call, observer: u64)

IntersectionObserver_observed

u32 IntersectionObserver_observed(u64 observer)

How many targets the observer observes (the engine keeps the observer alive while it is not 0).

Host: IntersectionObserver_observed :: proc(c: ^Call, observer: u64) -> u32

IntersectionObserver_takeRecords

bytes IntersectionObserver_takeRecords(u64 observer)

The entries waiting, 128 bytes each, little endian: target u64, time f64, intersectionRatio f64, flags u32 (bit 0 isIntersecting, bit 1 isVisible, bit 2 rootBounds is not null), 4 bytes of 0, then twelve f64: rootBounds, boundingClientRect and intersectionRect as x, y, width, height. Nothing changes until IntersectionObserver_release, so a call that did not fit can be made again.

Host: IntersectionObserver_takeRecords :: proc(c: ^Call, observer: u64) -> []u8

IntersectionObserver_release

void IntersectionObserver_release(u64 observer)

The engine made the entries it took: they leave the queue (and the pins of their targets go).

Host: IntersectionObserver_release :: proc(c: ^Call, observer: u64)

Window_print

void Window_print()

window.print().

Host: Window_print :: proc(c: ^Call)

Element_attachShadowInit

Node Element_attachShadowInit(Element element, u32 mode, bool delegates_focus, u32 slot_assignment, bool clonable, bool serializable) raises

element.attachShadow(init): Not_Supported for an element that cannot host one, a host already (unless its root was declared by the parser with the same mode: emptied and returned), or a custom element whose definition disables shadow roots.

Raises: returns an Error (see web).

Host: Element_attachShadowInit :: proc(c: ^Call, element: Api_Element, mode: u32, delegates_focus: bool, slot_assignment: u32, clonable: bool, serializable: bool) -> (u64, Api_Error)

CustomElements_disable

void CustomElements_disable(string name, bool shadow, bool internals)

The definition of custom element name disables shadow roots or element internals (its disabledFeatures): attachShadow / attachInternals refuse.

Host: CustomElements_disable :: proc(c: ^Call, name: string, shadow: bool, internals: bool)

ShadowRoot_mode

string ShadowRoot_mode(Node root)

shadowRoot.mode: "open" or "closed".

Host: ShadowRoot_mode :: proc(c: ^Call, root: Api_Node) -> string

ShadowRoot_delegatesFocus

bool ShadowRoot_delegatesFocus(Node root)

shadowRoot.delegatesFocus

Host: ShadowRoot_delegatesFocus :: proc(c: ^Call, root: Api_Node) -> bool

ShadowRoot_clonable

bool ShadowRoot_clonable(Node root)

shadowRoot.clonable

Host: ShadowRoot_clonable :: proc(c: ^Call, root: Api_Node) -> bool

ShadowRoot_serializable

bool ShadowRoot_serializable(Node root)

shadowRoot.serializable

Host: ShadowRoot_serializable :: proc(c: ^Call, root: Api_Node) -> bool

ShadowRoot_slotAssignment

string ShadowRoot_slotAssignment(Node root)

shadowRoot.slotAssignment: "named" or "manual".

Host: ShadowRoot_slotAssignment :: proc(c: ^Call, root: Api_Node) -> string

ShadowRoot_host

Element ShadowRoot_host(Node root)

shadowRoot.host

Host: ShadowRoot_host :: proc(c: ^Call, root: Api_Node) -> u64

ShadowRoot_innerHTML

string ShadowRoot_innerHTML(Node root)

shadowRoot.innerHTML

Host: ShadowRoot_innerHTML :: proc(c: ^Call, root: Api_Node) -> string

ShadowRoot_set_innerHTML

void ShadowRoot_set_innerHTML(Node root, string value) raises

shadowRoot.innerHTML = markup: parsed in the host's context (no declarative shadow roots), one mutation.

Raises: returns an Error (see web).

Host: ShadowRoot_set_innerHTML :: proc(c: ^Call, root: Api_Node, value: string) -> Api_Error

ShadowRoot_activeElement

Element ShadowRoot_activeElement(Node root)

shadowRoot.activeElement: the focused element retargeted against the root (null when it is not in its tree).

Host: ShadowRoot_activeElement :: proc(c: ^Call, root: Api_Node) -> u64

Node_getHTML

string Node_getHTML(Node node, bool serializable_roots, u64[] roots)

element.getHTML(options) / shadowRoot.getHTML(options): the children's serialization, with the shadow roots of hosts that are serializable (when serializable_roots) or listed in roots, as declarative shadow roots.

Host: Node_getHTML :: proc(c: ^Call, node: Api_Node, serializable_roots: bool, roots: []u64) -> string

Node_setHTMLUnsafe

void Node_setHTMLUnsafe(Node node, string html) raises

element.setHTMLUnsafe(html) / shadowRoot.setHTMLUnsafe(html): parsed with declarative shadow roots, one mutation.

Raises: returns an Error (see web).

Host: Node_setHTMLUnsafe :: proc(c: ^Call, node: Api_Node, html: string) -> Api_Error

Document_parseHTMLUnsafeNode

Node Document_parseHTMLUnsafeNode(string html) raises

Document.parseHTMLUnsafe(html): a new inert document (as createHTMLDocument makes) with declarative shadow roots.

Raises: returns an Error (see web).

Host: Document_parseHTMLUnsafeNode :: proc(c: ^Call, html: string) -> (u64, Api_Error)

Node_rootNodeComposed

Node Node_rootNodeComposed(Node node, bool composed)

node.getRootNode({composed})

Host: Node_rootNodeComposed :: proc(c: ^Call, node: Api_Node, composed: bool) -> u64

Slottable_assignedSlot

Element Slottable_assignedSlot(Node node)

node.assignedSlot: the slot it is assigned to, null when none or in a closed shadow root.

Host: Slottable_assignedSlot :: proc(c: ^Call, node: Api_Node) -> u64

HTMLSlotElement_assignedPacked

bytes HTMLSlotElement_assignedPacked(Element slot, bool flatten, bool elements)

slot.assignedNodes({flatten}) / assignedElements({flatten}) (elements): node handles, 8 bytes each.

Host: HTMLSlotElement_assignedPacked :: proc(c: ^Call, slot: Api_Element, flatten: bool, elements: bool) -> []u8

HTMLSlotElement_assignNodes

void HTMLSlotElement_assignNodes(Element slot, u64[] nodes) raises

slot.assign(...nodes): the slot's manually assigned nodes.

Raises: returns an Error (see web).

Host: HTMLSlotElement_assignNodes :: proc(c: ^Call, slot: Api_Element, nodes: []u64) -> Api_Error

Document_shadowIncludingByName

bytes Document_shadowIncludingByName(string name)

The handles of every element named name in shadow-including tree order (custom element upgrades at define).

Host: Document_shadowIncludingByName :: proc(c: ^Call, name: string) -> []u8

DocumentOrShadowRoot_elementsFromPointPacked

bytes DocumentOrShadowRoot_elementsFromPointPacked(Node root, f64 x, f64 y)

elementsFromPoint(x, y) of the document or of a shadow root: the elements hit, retargeted against root, innermost first. Handles, 8 bytes each.

Host: DocumentOrShadowRoot_elementsFromPointPacked :: proc(c: ^Call, root: Api_Node, x: f64, y: f64) -> []u8

Shadow_fireSlotChanges

void Shadow_fireSlotChanges()

Fires slotchange at the slots signalled since the last time (the engine's job, wj_slot_queue).

Host: Shadow_fireSlotChanges :: proc(c: ^Call)

Node_isLive

bool Node_isLive(u64 node)

Whether node is a live node of the page (not destroyed).

Host: Node_isLive :: proc(c: ^Call, node: u64) -> bool

Node_shadowIncludingElements

bytes Node_shadowIncludingElements(Node root)

The shadow-including descendants of root that are elements, in tree order (customElements.upgrade).

Host: Node_shadowIncludingElements :: proc(c: ^Call, root: Api_Node) -> []u8

Element_attachInternals

u64 Element_attachInternals(Element element) raises

element.attachInternals(): Not_Supported unless a custom element (or attached already). An ElementInternals.

Raises: returns an Error (see web).

Host: Element_attachInternals :: proc(c: ^Call, element: Api_Element) -> (u64, Api_Error)

ElementInternals_shadowRootOf

Node ElementInternals_shadowRootOf(u64 internals)

internals.shadowRoot: the host's shadow root when it is available to element internals (else null).

Host: ElementInternals_shadowRootOf :: proc(c: ^Call, internals: u64) -> u64

ElementInternals_element

Element ElementInternals_element(u64 internals)

The element of an ElementInternals.

Host: ElementInternals_element :: proc(c: ^Call, internals: u64) -> u64

CustomStates_add

void CustomStates_add(u64 internals, string state)

CustomStateSet: add / delete (true when it was there) / has / clear / the states (each followed by a NUL byte).

Host: CustomStates_add :: proc(c: ^Call, internals: u64, state: string)

CustomStates_delete

bool CustomStates_delete(u64 internals, string state)

Host: CustomStates_delete :: proc(c: ^Call, internals: u64, state: string) -> bool

CustomStates_has

bool CustomStates_has(u64 internals, string state)

Host: CustomStates_has :: proc(c: ^Call, internals: u64, state: string) -> bool

CustomStates_clear

void CustomStates_clear(u64 internals)

Host: CustomStates_clear :: proc(c: ^Call, internals: u64)

CustomStates_list

string CustomStates_list(u64 internals)

Host: CustomStates_list :: proc(c: ^Call, internals: u64) -> string

CSSStyleSheet_create

u64 CSSStyleSheet_create(string media, bool disabled, string base_url)

new CSSStyleSheet(options): a constructed stylesheet (an object of the page).

Host: CSSStyleSheet_create :: proc(c: ^Call, media: string, disabled: bool, base_url: string) -> u64

CSSStyleSheet_replaceText

void CSSStyleSheet_replaceText(u64 sheet, string text) raises

replaceSync(text) / replace(text): the rules of text, @import rules dropped.

Raises: returns an Error (see web).

Host: CSSStyleSheet_replaceText :: proc(c: ^Call, sheet: u64, text: string) -> Api_Error

CSSStyleSheet_ruleCount

u32 CSSStyleSheet_ruleCount(u64 sheet)

The number of top-level rules, and the cssText of one, CSSOM's serialization of the rule as parsed (Index_Size past the end).

Host: CSSStyleSheet_ruleCount :: proc(c: ^Call, sheet: u64) -> u32

CSSStyleSheet_ruleText

string CSSStyleSheet_ruleText(u64 sheet, u32 index) raises

Raises: returns an Error (see web).

Host: CSSStyleSheet_ruleText :: proc(c: ^Call, sheet: u64, index: u32) -> (string, Api_Error)

CSSStyleSheet_setRuleSelector

string CSSStyleSheet_setRuleSelector(u64 sheet, u32 rule_id, string selector)

CSSStyleRule.selectorText = selector, on the rule numbered rule_id (CSSStyleSheet_ruleId, CSSStyleSheet_childId): the rule's new cssText, "" when nothing changed (the rule is gone, not a style rule, or the selector is invalid).

Host: CSSStyleSheet_setRuleSelector :: proc(c: ^Call, sheet: u64, rule_id: u32, selector: string) -> string

CSSStyleSheet_ruleTextOf

string CSSStyleSheet_ruleTextOf(u64 sheet, u32 rule_id)

The cssText of the rule numbered rule_id as it is now ("" when it is gone).

Host: CSSStyleSheet_ruleTextOf :: proc(c: ^Call, sheet: u64, rule_id: u32) -> string

CSSStyleSheet_setRuleStyle

void CSSStyleSheet_setRuleStyle(u64 sheet, u32 rule_id, string text)

CSSStyleRule.style written: the style rule numbered rule_id takes the declarations of text (nothing changes for a rule that is gone or is no style rule).

Host: CSSStyleSheet_setRuleStyle :: proc(c: ^Call, sheet: u64, rule_id: u32, text: string)

CSSStyleSheet_childCount

u32 CSSStyleSheet_childCount(u64 sheet, u32 rule_id)

CSSGroupingRule.cssRules of the rule numbered rule_id (a group, or a style rule's nested rules): their number, and the number of one (0 past the end), which names it as CSSStyleSheet_ruleId names a top-level rule.

Host: CSSStyleSheet_childCount :: proc(c: ^Call, sheet: u64, rule_id: u32) -> u32

CSSStyleSheet_childId

u32 CSSStyleSheet_childId(u64 sheet, u32 rule_id, u32 index)

Host: CSSStyleSheet_childId :: proc(c: ^Call, sheet: u64, rule_id: u32, index: u32) -> u32

CSSStyleSheet_insertChildAt

u32 CSSStyleSheet_insertChildAt(u64 sheet, u32 rule_id, string rule, u32 index) raises

CSSGroupingRule.insertRule(rule, index) on the rule numbered rule_id: Index_Size past the end, Syntax when rule is not one rule (inside a style rule: nor declarations), Hierarchy when it cannot be there; the index.

Raises: returns an Error (see web).

Host: CSSStyleSheet_insertChildAt :: proc(c: ^Call, sheet: u64, rule_id: u32, rule: string, index: u32) -> (u32, Api_Error)

CSSStyleSheet_deleteChildAt

void CSSStyleSheet_deleteChildAt(u64 sheet, u32 rule_id, u32 index) raises

CSSGroupingRule.deleteRule(index) on the rule numbered rule_id: Index_Size past the end.

Raises: returns an Error (see web).

Host: CSSStyleSheet_deleteChildAt :: proc(c: ^Call, sheet: u64, rule_id: u32, index: u32) -> Api_Error

CSSStyleSheet_insertRuleAt

u32 CSSStyleSheet_insertRuleAt(u64 sheet, string rule, u32 index) raises

insertRule(rule, index): Index_Size past the end, Syntax when rule is not one rule; the index.

Raises: returns an Error (see web).

Host: CSSStyleSheet_insertRuleAt :: proc(c: ^Call, sheet: u64, rule: string, index: u32) -> (u32, Api_Error)

CSSStyleSheet_deleteRuleAt

void CSSStyleSheet_deleteRuleAt(u64 sheet, u32 index) raises

deleteRule(index): Index_Size past the end.

Raises: returns an Error (see web).

Host: CSSStyleSheet_deleteRuleAt :: proc(c: ^Call, sheet: u64, index: u32) -> Api_Error

CSSStyleSheet_isDisabled

bool CSSStyleSheet_isDisabled(u64 sheet)

sheet.disabled

Host: CSSStyleSheet_isDisabled :: proc(c: ^Call, sheet: u64) -> bool

CSSStyleSheet_setDisabled

void CSSStyleSheet_setDisabled(u64 sheet, bool disabled)

Host: CSSStyleSheet_setDisabled :: proc(c: ^Call, sheet: u64, disabled: bool)

CSSStyleSheet_mediaText

string CSSStyleSheet_mediaText(u64 sheet)

sheet.media.mediaText

Host: CSSStyleSheet_mediaText :: proc(c: ^Call, sheet: u64) -> string

CSSStyleSheet_setMediaText

void CSSStyleSheet_setMediaText(u64 sheet, string media)

Host: CSSStyleSheet_setMediaText :: proc(c: ^Call, sheet: u64, media: string)

CSSStyleSheet_isConstructed

bool CSSStyleSheet_isConstructed(u64 sheet)

Whether sheet is a constructed stylesheet of this page.

Host: CSSStyleSheet_isConstructed :: proc(c: ^Call, sheet: u64) -> bool

DocumentOrShadowRoot_adopt

void DocumentOrShadowRoot_adopt(Node root, u64[] sheets) raises

document.adoptedStyleSheets / shadowRoot.adoptedStyleSheets = sheets (constructed sheets, in order): Not_Allowed for a sheet that was not constructed.

Raises: returns an Error (see web).

Host: DocumentOrShadowRoot_adopt :: proc(c: ^Call, root: Api_Node, sheets: []u64) -> Api_Error

XMLSerializer_serialize

string XMLSerializer_serialize(Node node) raises

new XMLSerializer().serializeToString(node): the node and its subtree as XML (DOM Parsing §3.2, not well-formed-checked). Range past page.max_fetch_bytes.

Raises: returns an Error (see web).

Host: XMLSerializer_serialize :: proc(c: ^Call, node: Api_Node) -> (string, Api_Error)

Edit this page on GitHub