Document
The Document interface represents any web page loaded in the browser and serves as an entry point into the web page's content, which is the DOM tree.HTMLElement
Documentation Document by Mozilla Contributors, licensed under CC-BY-SA 2.5.
Instance Members
implementation: DOMImplementationReturns the DOM implementation associated with the current document.
URL: StringReturns the document location as a string.
documentURI: StringReturns the document location as a string.
compatMode: StringIndicates whether the document is rendered in quirks or strict mode.
characterSet: StringReturns the character set being used by the document.
charset: StringAlias of Document.characterSet. Use this property instead.
inputEncoding: StringAlias of Document.characterSet. Use this property instead.
contentType: StringReturns the Content-Type from the MIME Header of the current document.
doctype: DocumentTypeReturns the Document Type Definition (DTD) of the current document.
documentElement: ElementReturns the Element that is a direct child of the document. For HTML documents, this is normally the HTMLElement element.
location: LocationReturns the URI of the current document.
referrer: StringReturns the URI of the page that linked to this page.
lastModified: StringReturns the date on which the document was last modified.
readyState: StringReturns loading status of the document.
title: StringSets or gets the title of the current document.
dir: StringGets/sets directionality (rtl/ltr) of the document.
body: ElementReturns the body or frameset node of the current document.
head: HeadElementReturns the head element of the current document.
images: HTMLCollectionReturns a list of the images in the current document.
embeds: HTMLCollectionReturns a list of the embedded embed elements within the current document.
plugins: HTMLCollectionReturns a list of the available plugins.
links: HTMLCollectionReturns a list of all the hyperlinks in the document.
forms: HTMLCollectionReturns a list of the form elements within the current document.
scripts: HTMLCollectionReturns all the script elements on the document.
defaultView: WindowReturns a reference to the window object.
onreadystatechange: haxe.FunctionRepresents the event handling code for the readystatechange event.
onbeforescriptexecute: haxe.FunctionRepresents the event handling code for the beforescriptexecute event.
onafterscriptexecute: haxe.FunctionRepresents the event handling code for the afterscriptexecute event.
onselectionchange: haxe.FunctionIs an EventHandler representing the code to be called when the selectionchange event is raised.
currentScript: Elementanchors: HTMLCollectionReturns a list of all of the anchors in the document.
applets: HTMLCollectionReturns an ordered list of the applets within a document.
fullscreen: Booltrue when the document is in Using_full-screen_mode.
fullscreenEnabled: Boolonfullscreenchange: haxe.FunctionIs an EventHandler representing the code to be called when the fullscreenchange event is raised.
onfullscreenerror: haxe.FunctionIs an EventHandler representing the code to be called when the fullscreenerror event is raised.
onpointerlockchange: haxe.FunctionRepresents the event handling code for the pointerlockchange event.
onpointerlockerror: haxe.FunctionRepresents the event handling code for the pointerlockerror event.
…
visibilityState: VisibilityStateReturns a string denoting the visibility state of the document. Possible values are visible, hidden, prerender, and unloaded.
onvisibilitychange: haxe.FunctionIs an EventHandler representing the code to be called when the visibilitychange event is raised.
selectedStyleSheetSet: StringReturns which style sheet set is currently in use.
lastStyleSheetSet: StringReturns the name of the style sheet set that was last enabled. Has the value null until the style sheet is changed by setting the value of document.selectedStyleSheetSet.
preferredStyleSheetSet: StringReturns the preferred style sheet set as specified by the page author.
styleSheetSets: DOMStringListReturns a list of the style sheet sets available on the document.
scrollingElement: ElementReturns a reference to the Element that scrolls the document.
timeline: DocumentTimeline…
rootElement: js.html.svg.SVGElementoncopy: haxe.FunctionRepresents the event handling code for the copy event.
oncut: haxe.FunctionRepresents the event handling code for the cut event.
onpaste: haxe.FunctionRepresents the event handling code for the paste event.
activeElement: ElementstyleSheets: StyleSheetListpointerLockElement: ElementfullscreenElement: ElementThe element that's currently in full screen mode for this document.
fonts: FontFaceSetonabort: haxe.Functiononblur: haxe.Functiononfocus: haxe.Functiononauxclick: haxe.Functiononcanplay: haxe.Functiononcanplaythrough: haxe.Functiononchange: haxe.Functiononclick: haxe.Functiononclose: haxe.Functionondblclick: haxe.Functionondrag: haxe.Functionondragend: haxe.Functionondragenter: haxe.Functionondragexit: haxe.Functionondragleave: haxe.Functionondragover: haxe.Functionondragstart: haxe.Functionondrop: haxe.Functionondurationchange: haxe.Functiononemptied: haxe.Functiononended: haxe.Functiononinput: haxe.Functiononinvalid: haxe.Functiononkeydown: haxe.Functiononkeypress: haxe.Functiononkeyup: haxe.Functiononload: haxe.Functiononloadeddata: haxe.Functiononloadedmetadata: haxe.Functiononloadend: haxe.Functiononloadstart: haxe.Functiononmousedown: haxe.Functiononmouseenter: haxe.Functiononmouseleave: haxe.Functiononmousemove: haxe.Functiononmouseout: haxe.Functiononmouseover: haxe.Functiononmouseup: haxe.Functiononwheel: haxe.FunctionRepresents the event handling code for the wheel event.
onpause: haxe.Functiononplay: haxe.Functiononplaying: haxe.Functiononprogress: haxe.Functiononratechange: haxe.Functiononreset: haxe.Functiononresize: haxe.Functiononscroll: haxe.Functiononseeked: haxe.Functiononseeking: haxe.Functiononselect: haxe.Functiononshow: haxe.Functiononstalled: haxe.Functiononsubmit: haxe.Functiononsuspend: haxe.Functionontimeupdate: haxe.Functiononvolumechange: haxe.Functiononwaiting: haxe.Functiononselectstart: haxe.Functionontoggle: haxe.Functiononpointercancel: haxe.Functiononpointerdown: haxe.Functiononpointerup: haxe.Functiononpointermove: haxe.Functiononpointerout: haxe.Functiononpointerover: haxe.Functiononpointerenter: haxe.Functiononpointerleave: haxe.Functionongotpointercapture: haxe.Functiononlostpointercapture: haxe.Functiononanimationcancel: haxe.Functiononanimationend: haxe.Functiononanimationiteration: haxe.Functiononanimationstart: haxe.Functionontransitioncancel: haxe.Functionontransitionend: haxe.Functionontransitionrun: haxe.Functionontransitionstart: haxe.Functiononwebkitanimationend: haxe.Functiononwebkitanimationiteration: haxe.Functiononwebkitanimationstart: haxe.Functiononwebkittransitionend: haxe.Functiononerror: haxe.Functionchildren: HTMLCollectionfirstElementChild: ElementlastElementChild: ElementchildElementCount: Intontouchstart: haxe.Functionontouchend: haxe.Functionontouchmove: haxe.Functionontouchcancel: haxe.FunctiongetElementsByTagName(localName: String): HTMLCollectionReturns a list of elements with the given tag name.
| Name | Type |
|---|---|
localName |
String |
| Returns |
|---|
| HTMLCollection |
getElementsByTagNameNS(namespace: String, localName: String): HTMLCollectionReturns a list of elements with the given tag name and namespace.
| Name | Type |
|---|---|
namespace |
String |
localName |
String |
| Returns |
|---|
| HTMLCollection |
getElementsByClassName(classNames: String): HTMLCollectionReturns a list of elements with the given class name.
| Name | Type |
|---|---|
classNames |
String |
| Returns |
|---|
| HTMLCollection |
| Name | Type |
|---|---|
elementId |
String |
| Returns |
|---|
| Element |
createElement(localName: String, ?options: Null<ElementCreationOptions>): ElementCreates a new element with the given tag name.
| Name | Type | Default |
|---|---|---|
localName |
String | |
options |
Null<ElementCreationOptions> | (optional) |
| Returns |
|---|
| Element |
createElementNS(namespace: String, qualifiedName: String, ?options: Null<ElementCreationOptions>): ElementCreates a new element with the given tag name and namespace URI.
| Name | Type | Default |
|---|---|---|
namespace |
String | |
qualifiedName |
String | |
options |
Null<ElementCreationOptions> | (optional) |
| Returns |
|---|
| Element |
createDocumentFragment(): DocumentFragmentCreates a new document fragment.
| Returns |
|---|
| DocumentFragment |
Creates a text node.
| Name | Type |
|---|---|
data |
String |
| Returns |
|---|
| Text |
Creates a new comment node and returns it.
| Name | Type |
|---|---|
data |
String |
| Returns |
|---|
| Comment |
createProcessingInstruction(target: String, data: String): ProcessingInstructionCreates a new ProcessingInstruction object.
| Name | Type |
|---|---|
target |
String |
data |
String |
| Returns |
|---|
| ProcessingInstruction |
Returns a clone of a node from an external document.
| Name | Type | Default |
|---|---|---|
node |
Node | |
deep |
Bool | false |
| Returns |
|---|
| Node |
Adopt node from an external document.
| Name | Type |
|---|---|
node |
Node |
| Returns |
|---|
| Node |
Creates an event object.
| Name | Type |
|---|---|
interface_ |
String |
| Returns |
|---|
| Event |
createRange(): RangeCreates a Range object.
| Returns |
|---|
| Range |
createNodeIterator(root: Node, ?whatToShow: Int = cast 4294967295, ?filter: Function): NodeIteratorCreates a NodeIterator object.
| Name | Type | Default |
|---|---|---|
root |
Node | |
whatToShow |
Int | cast 4294967295 |
filter |
Function | (optional) |
| Returns |
|---|
| NodeIterator |
createTreeWalker(root: Node, ?whatToShow: Int = cast 4294967295, ?filter: Function): TreeWalkerCreates a TreeWalker object.
| Name | Type | Default |
|---|---|---|
root |
Node | |
whatToShow |
Int | cast 4294967295 |
filter |
Function | (optional) |
| Returns |
|---|
| TreeWalker |
createCDATASection(data: String): CDATASectionCreates a new CDATA node and returns it.
| Name | Type |
|---|---|
data |
String |
| Returns |
|---|
| CDATASection |
Creates a new Attr object and returns it.
| Name | Type |
|---|---|
name |
String |
| Returns |
|---|
| Attr |
Creates a new attribute node in a given namespace and returns it.
| Name | Type |
|---|---|
namespace |
String |
name |
String |
| Returns |
|---|
| Attr |
| Name | Type |
|---|---|
elementName |
String |
| Returns |
|---|
| NodeList |
hasFocus(): BoolReturns true if the focus is currently located anywhere inside the specified document.
| Returns |
|---|
| Bool |
releaseCapture(): VoidReleases the current mouse capture if it's on an element in this document.
exitFullscreen(): js.lib.Promise<Void>Requests that the element on this document which is currently being presented in fullscreen mode be taken out of fullscreen mode, restoring the previous state of the screen.
| Returns |
|---|
| js.lib.Promise<Void> |
exitPointerLock(): VoidRelease the pointer lock.
Enables the style sheets for the specified style sheet set.
| Name | Type |
|---|---|
name |
String |
caretPositionFromPoint(x: Float, y: Float): CaretPosition| Name | Type |
|---|---|
x |
Float |
y |
Float |
| Returns |
|---|
| CaretPosition |
| Name | Type |
|---|---|
selectors |
String |
| Returns |
|---|
| Element |
| Name | Type |
|---|---|
selectors |
String |
| Returns |
|---|
| NodeList |
Returns an array of all Animation objects currently in effect, whose target elements are descendants of the document.
| Returns |
|---|
| Array<Animation> |
createTouch(?view: Window, ?target: EventTarget, ?identifier: Int = 0, ?pageX: Int = 0, ?pageY: Int = 0, ?screenX: Int = 0, ?screenY: Int = 0, ?clientX: Int = 0, ?clientY: Int = 0, ?radiusX: Int = 0, ?radiusY: Int = 0, ?rotationAngle: Float = 0.0, ?force: Float = 0.0): TouchCreates a Touch object.
| Name | Type | Default |
|---|---|---|
view |
Window | (optional) |
target |
EventTarget | (optional) |
identifier |
Int | 0 |
pageX |
Int | 0 |
pageY |
Int | 0 |
screenX |
Int | 0 |
screenY |
Int | 0 |
clientX |
Int | 0 |
clientY |
Int | 0 |
radiusX |
Int | 0 |
radiusY |
Int | 0 |
rotationAngle |
Float | 0.0 |
force |
Float | 0.0 |
| Returns |
|---|
| Touch |
Creates a TouchList object.
| Name | Type |
|---|---|
touches |
Array<Touch> |
| Returns |
|---|
| TouchList |
getSelection(): Selection| Returns |
|---|
| Selection |
| Name | Type |
|---|---|
x |
Float |
y |
Float |
| Returns |
|---|
| Element |
| Name | Type |
|---|---|
x |
Float |
y |
Float |
| Returns |
|---|
| Array<Element> |
convertQuadFromNode(quad: DOMQuad, from: Text, ?options: Null<ConvertCoordinateOptions>): DOMQuad| Name | Type | Default |
|---|---|---|
quad |
DOMQuad | |
from |
Text | |
options |
Null<ConvertCoordinateOptions> | (optional) |
| Returns |
|---|
| DOMQuad |
convertRectFromNode(rect: DOMRectReadOnly, from: Text, ?options: Null<ConvertCoordinateOptions>): DOMQuad| Name | Type | Default |
|---|---|---|
rect |
DOMRectReadOnly | |
from |
Text | |
options |
Null<ConvertCoordinateOptions> | (optional) |
| Returns |
|---|
| DOMQuad |
convertPointFromNode(point: DOMPointInit, from: Text, ?options: Null<ConvertCoordinateOptions>): DOMPoint| Name | Type | Default |
|---|---|---|
point |
DOMPointInit | |
from |
Text | |
options |
Null<ConvertCoordinateOptions> | (optional) |
| Returns |
|---|
| DOMPoint |
prepend(nodes: haxe.extern.Rest): Void| Name | Type |
|---|---|
nodes |
haxe.extern.Rest |
append(nodes: haxe.extern.Rest): Void| Name | Type |
|---|---|
nodes |
haxe.extern.Rest |
createExpression(expression: String, ?resolver: Function): XPathExpression| Name | Type | Default |
|---|---|---|
expression |
String | |
resolver |
Function | (optional) |
| Returns |
|---|
| XPathExpression |
| Name | Type |
|---|---|
nodeResolver |
Node |
| Returns |
|---|
| Node |
evaluate(expression: String, contextNode: Node, ?resolver: Function, ?type: Int = 0, ?result: Dynamic): XPathResult| Name | Type | Default |
|---|---|---|
expression |
String | |
contextNode |
Node | |
resolver |
Function | (optional) |
type |
Int | 0 |
result |
Dynamic | (optional) |
| Returns |
|---|
| XPathResult |
new(): Void