Document

open external class Document : 
    Node,
    GlobalEventHandlers,
    DocumentAndElementEventHandlers,
    NonElementParentNode,
    DocumentOrShadowRoot,
    ParentNode,
    GeometryUtils
(source)

Platform and version requirements: JS

Exposes the JavaScript Document to Kotlin

Constructors

<init>

Document()

Exposes the JavaScript Document to Kotlin

Properties

URL

open val URL: String

activeElement

open val activeElement: Element?

alinkColor

var alinkColor: String

all

open val all: HTMLAllCollection

anchors

open val anchors: HTMLCollection

applets

open val applets: HTMLCollection

bgColor

var bgColor: String

body

var body: HTMLElement?

characterSet

open val characterSet: String

charset

open val charset: String

childElementCount

open val childElementCount: Int

children

open val children: HTMLCollection

compatMode

open val compatMode: String

contentType

open val contentType: String

cookie

var cookie: String

currentScript

open val currentScript: HTMLOrSVGScriptElement?

defaultView

open val defaultView: Window?

designMode

var designMode: String

dir

var dir: String

doctype

open val doctype: DocumentType?

documentElement

open val documentElement: Element?

documentURI

open val documentURI: String

domain

var domain: String

embeds

open val embeds: HTMLCollection

fgColor

var fgColor: String

firstElementChild

open val firstElementChild: Element?

forms

open val forms: HTMLCollection

fullscreen

open val fullscreen: Boolean

fullscreenElement

open val fullscreenElement: Element?

fullscreenEnabled

open val fullscreenEnabled: Boolean

head

open val head: HTMLHeadElement?

images

open val images: HTMLCollection

implementation

open val implementation: DOMImplementation

inputEncoding

open val inputEncoding: String

lastElementChild

open val lastElementChild: Element?

lastModified

open val lastModified: String

linkColor

var linkColor: String

links

open val links: HTMLCollection

location

open val location: Location?

onabort

open var onabort: (Event) -> dynamic

onblur

open var onblur: (Event) -> dynamic

oncancel

open var oncancel: (Event) -> dynamic

oncanplay

open var oncanplay: (Event) -> dynamic

oncanplaythrough

open var oncanplaythrough: (Event) -> dynamic

onchange

open var onchange: (Event) -> dynamic

onclick

open var onclick: (Event) -> dynamic

onclose

open var onclose: (Event) -> dynamic

oncontextmenu

open var oncontextmenu: (Event) -> dynamic

oncopy

open var oncopy: (Event) -> dynamic

oncuechange

open var oncuechange: (Event) -> dynamic

oncut

open var oncut: (Event) -> dynamic

ondblclick

open var ondblclick: (Event) -> dynamic

ondrag

open var ondrag: (Event) -> dynamic

ondragend

open var ondragend: (Event) -> dynamic

ondragenter

open var ondragenter: (Event) -> dynamic

ondragexit

open var ondragexit: (Event) -> dynamic

ondragleave

open var ondragleave: (Event) -> dynamic

ondragover

open var ondragover: (Event) -> dynamic

ondragstart

open var ondragstart: (Event) -> dynamic

ondrop

open var ondrop: (Event) -> dynamic

ondurationchange

open var ondurationchange: (Event) -> dynamic

onemptied

open var onemptied: (Event) -> dynamic

onended

open var onended: (Event) -> dynamic

onerror

open var onerror: (dynamic, String, Int, Int, Any?) -> dynamic

onfocus

open var onfocus: (Event) -> dynamic

onfullscreenchange

var onfullscreenchange: (Event) -> dynamic

onfullscreenerror

var onfullscreenerror: (Event) -> dynamic

oninput

open var oninput: (Event) -> dynamic

oninvalid

open var oninvalid: (Event) -> dynamic

onkeydown

open var onkeydown: (Event) -> dynamic

onkeypress

open var onkeypress: (Event) -> dynamic

onkeyup

open var onkeyup: (Event) -> dynamic

onload

open var onload: (Event) -> dynamic

onloadeddata

open var onloadeddata: (Event) -> dynamic

onloadedmetadata

open var onloadedmetadata: (Event) -> dynamic

onloadend

open var onloadend: (Event) -> dynamic

onloadstart

open var onloadstart: (Event) -> dynamic

onmousedown

open var onmousedown: (Event) -> dynamic

onmouseenter

open var onmouseenter: (Event) -> dynamic

onmouseleave

open var onmouseleave: (Event) -> dynamic

onmousemove

open var onmousemove: (Event) -> dynamic

onmouseout

open var onmouseout: (Event) -> dynamic

onmouseover

open var onmouseover: (Event) -> dynamic

onmouseup

open var onmouseup: (Event) -> dynamic

onpaste

open var onpaste: (Event) -> dynamic

onpause

open var onpause: (Event) -> dynamic

onplay

open var onplay: (Event) -> dynamic

onplaying

open var onplaying: (Event) -> dynamic

onprogress

open var onprogress: (Event) -> dynamic

onratechange

open var onratechange: (Event) -> dynamic

onreadystatechange

var onreadystatechange: (Event) -> dynamic

onreset

open var onreset: (Event) -> dynamic

onresize

open var onresize: (Event) -> dynamic

onscroll

open var onscroll: (Event) -> dynamic

onseeked

open var onseeked: (Event) -> dynamic

onseeking

open var onseeking: (Event) -> dynamic

onselect

open var onselect: (Event) -> dynamic

onshow

open var onshow: (Event) -> dynamic

onstalled

open var onstalled: (Event) -> dynamic

onsubmit

open var onsubmit: (Event) -> dynamic

onsuspend

open var onsuspend: (Event) -> dynamic

ontimeupdate

open var ontimeupdate: (Event) -> dynamic

ontoggle

open var ontoggle: (Event) -> dynamic

onvolumechange

open var onvolumechange: (Event) -> dynamic

onwaiting

open var onwaiting: (Event) -> dynamic

onwheel

open var onwheel: (Event) -> dynamic

origin

open val origin: String

plugins

open val plugins: HTMLCollection

readyState

open val readyState: DocumentReadyState

referrer

open val referrer: String

rootElement

open val rootElement: SVGSVGElement?

scripts

open val scripts: HTMLCollection

scrollingElement

open val scrollingElement: Element?

styleSheets

open val styleSheets: StyleSheetList

title

var title: String

vlinkColor

var vlinkColor: String

Inherited Properties

baseURI

open val baseURI: String

childNodes

open val childNodes: NodeList

firstChild

open val firstChild: Node?

isConnected

open val isConnected: Boolean

lastChild

open val lastChild: Node?

nextSibling

open val nextSibling: Node?

nodeName

open val nodeName: String

nodeType

open val nodeType: Short

nodeValue

open var nodeValue: String?

ownerDocument

open val ownerDocument: Document?

parentElement

open val parentElement: Element?

parentNode

open val parentNode: Node?

previousSibling

open val previousSibling: Node?

textContent

open var textContent: String?

Functions

adoptNode

fun adoptNode(node: Node): Node

append

open fun append(vararg nodes: dynamic)

captureEvents

fun captureEvents()

caretPositionFromPoint

fun caretPositionFromPoint(
    x: Double,
    y: Double
): CaretPosition?

clear

fun clear()

close

fun close()

convertPointFromNode

open fun convertPointFromNode(
    point: DOMPointInit,
    from: dynamic,
    options: ConvertCoordinateOptions
): DOMPoint

convertQuadFromNode

open fun convertQuadFromNode(
    quad: dynamic,
    from: dynamic,
    options: ConvertCoordinateOptions
): DOMQuad

convertRectFromNode

open fun convertRectFromNode(
    rect: DOMRectReadOnly,
    from: dynamic,
    options: ConvertCoordinateOptions
): DOMQuad

createAttribute

fun createAttribute(localName: String): Attr

createAttributeNS

fun createAttributeNS(
    namespace: String?,
    qualifiedName: String
): Attr

createCDATASection

fun createCDATASection(data: String): CDATASection

createComment

fun createComment(data: String): Comment

createDocumentFragment

fun createDocumentFragment(): DocumentFragment

createElement

fun createElement(
    localName: String,
    options: ElementCreationOptions = definedExternally
): Element

createElementNS

fun createElementNS(
    namespace: String?,
    qualifiedName: String,
    options: ElementCreationOptions = definedExternally
): Element

createEvent

fun createEvent(interface_: String): Event

createNodeIterator

fun createNodeIterator(
    root: Node,
    whatToShow: Int = definedExternally,
    filter: NodeFilter? = definedExternally
): NodeIterator
fun createNodeIterator(
    root: Node,
    whatToShow: Int = definedExternally,
    filter: (Node) -> Short = definedExternally
): NodeIterator

createProcessingInstruction

fun createProcessingInstruction(
    target: String,
    data: String
): ProcessingInstruction

createRange

fun createRange(): Range

createTextNode

fun createTextNode(data: String): Text

createTreeWalker

fun createTreeWalker(
    root: Node,
    whatToShow: Int = definedExternally,
    filter: NodeFilter? = definedExternally
): TreeWalker
fun createTreeWalker(
    root: Node,
    whatToShow: Int = definedExternally,
    filter: (Node) -> Short = definedExternally
): TreeWalker

elementFromPoint

fun elementFromPoint(x: Double, y: Double): Element?

elementsFromPoint

fun elementsFromPoint(x: Double, y: Double): Array<Element>

execCommand

fun execCommand(
    commandId: String,
    showUI: Boolean = definedExternally,
    value: String = definedExternally
): Boolean

exitFullscreen

fun exitFullscreen(): Promise<Unit>

getBoxQuads

open fun getBoxQuads(options: BoxQuadOptions): Array<DOMQuad>

getElementById

open fun getElementById(elementId: String): Element?

getElementsByClassName

fun getElementsByClassName(
    classNames: String
): HTMLCollection

getElementsByName

fun getElementsByName(elementName: String): NodeList

getElementsByTagName

fun getElementsByTagName(
    qualifiedName: String
): HTMLCollection

getElementsByTagNameNS

fun getElementsByTagNameNS(
    namespace: String?,
    localName: String
): HTMLCollection

hasFocus

fun hasFocus(): Boolean

importNode

fun importNode(
    node: Node,
    deep: Boolean = definedExternally
): Node

open

fun open(
    type: String = definedExternally,
    replace: String = definedExternally
): Document
fun open(url: String, name: String, features: String): Window

prepend

open fun prepend(vararg nodes: dynamic)

queryCommandEnabled

fun queryCommandEnabled(commandId: String): Boolean

queryCommandIndeterm

fun queryCommandIndeterm(commandId: String): Boolean

queryCommandState

fun queryCommandState(commandId: String): Boolean

queryCommandSupported

fun queryCommandSupported(commandId: String): Boolean

queryCommandValue

fun queryCommandValue(commandId: String): String

querySelector

open fun querySelector(selectors: String): Element?

querySelectorAll

open fun querySelectorAll(selectors: String): NodeList

releaseEvents

fun releaseEvents()

write

fun write(vararg text: String)

writeln

fun writeln(vararg text: String)

Inherited Functions

appendChild

fun appendChild(node: Node): Node

cloneNode

fun cloneNode(deep: Boolean = definedExternally): Node

compareDocumentPosition

fun compareDocumentPosition(other: Node): Short

contains

fun contains(other: Node?): Boolean

getRootNode

fun getRootNode(
    options: GetRootNodeOptions = definedExternally
): Node

hasChildNodes

fun hasChildNodes(): Boolean

insertBefore

fun insertBefore(node: Node, child: Node?): Node

isDefaultNamespace

fun isDefaultNamespace(namespace: String?): Boolean

isEqualNode

fun isEqualNode(otherNode: Node?): Boolean

isSameNode

fun isSameNode(otherNode: Node?): Boolean

lookupNamespaceURI

fun lookupNamespaceURI(prefix: String?): String?

lookupPrefix

fun lookupPrefix(namespace: String?): String?

normalize

fun normalize()

removeChild

fun removeChild(child: Node): Node

replaceChild

fun replaceChild(node: Node, child: Node): Node

Extension Properties

isElement

val Node.isElement: Boolean

Gets a value indicating whether this node is an Element.

isText

val Node.isText: Boolean

Gets a value indicating whether this node is a TEXT_NODE or a CDATA_SECTION_NODE.

Extension Functions

clear

fun Node.clear()

Removes all the children from this node.

createElement

fun Document.createElement(
    name: String,
    init: Element.() -> Unit
): Element

Creates a new element with the specified name.

get

operator fun Document.get(name: String): dynamic

Inheritors

XMLDocument

open external class XMLDocument : Document

Exposes the JavaScript XMLDocument to Kotlin