Package org.htmlunit.javascript.host.dom
Class Document
java.lang.Object
org.htmlunit.corejs.javascript.ScriptableObject
org.htmlunit.javascript.HtmlUnitScriptable
org.htmlunit.javascript.host.event.EventTarget
org.htmlunit.javascript.host.dom.Node
org.htmlunit.javascript.host.dom.Document
- All Implemented Interfaces:
Serializable
,Cloneable
,org.htmlunit.corejs.javascript.ConstProperties
,org.htmlunit.corejs.javascript.debug.DebuggableObject
,org.htmlunit.corejs.javascript.Scriptable
,org.htmlunit.corejs.javascript.SymbolScriptable
- Direct Known Subclasses:
HTMLDocument
,XMLDocument
A JavaScript object for
Document
.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.htmlunit.corejs.javascript.ScriptableObject
org.htmlunit.corejs.javascript.ScriptableObject.KeyComparator
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
private org.htmlunit.corejs.javascript.ScriptableObject
private String
private int
private String
https://developer.mozilla.org/en/Rich-Text_Editing_in_Mozilla#Executing_Commandsprivate FontFaceSet
private DOMImplementation
private static final String
The format to use for thelastModified
attribute.private String
private static final org.apache.commons.logging.Log
private StyleSheetList
Contains all supported DOM level 2 events.Contains all supported DOM level 3 events.Contains all supported vendor specific events.private static final Pattern
private Window
Fields inherited from class org.htmlunit.javascript.host.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
Fields inherited from class org.htmlunit.corejs.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
Fields inherited from interface org.htmlunit.corejs.javascript.Scriptable
NOT_FOUND
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdopts a node from an external document.void
captureEvents
(String type) Does nothing special anymore.void
clear()
Does...void
close()
JavaScript functionclose
.boolean
Checks whether the given element is contained within this object.createAttribute
(String attributeName) Creates a new HTML attribute with the specified name.createCDATASection
(String data) Creates a new createCDATASection.createComment
(String comment) Creates a new Comment.Creates a new document fragment.createElement
(String tagName) Creates a new element with the given tag name.createElementNS
(String namespaceURI, String qualifiedName) Creates a new HTML element with the given tag name, and name.createEvent
(String eventType) Implementation of theDocumentEvent
interface'sDocumentEvent.createEvent(String)
method.private static org.w3c.dom.traversal.NodeFilter
createFilterWrapper
(org.htmlunit.corejs.javascript.Scriptable filter, boolean filterFunctionOnly) createNodeIterator
(Node root, int whatToShow, org.htmlunit.corejs.javascript.Scriptable filter) Returns a new NodeIterator object.createNSResolver
(Node nodeResolver) Adapts any DOM node to resolve namespaces so that an XPath expression can be easily evaluated relative to the context of the node where it appeared within the document.createProcessingInstruction
(String target, String data) Creates a new ProcessingInstruction.Creates and returns a new range.createTextNode
(String newData) Create a new DOM text node with the given data.createTreeWalker
(Node root, double whatToShow, org.htmlunit.corejs.javascript.Scriptable filter, boolean expandEntityReferences) Creates and returns a new TreeWalker.elementFromPoint
(int x, int y) Returns the element for the specified x coordinate and the specified y coordinate.Evaluates an XPath expression string and returns a result of the specified type if possible.boolean
execCommand
(String cmd, boolean userInterface, Object value) Executes a command.void
forceDocumentMode
(int documentMode) INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Called from the HTMLParser if a 'X-UA-Compatible' meta tag found.generateBlobUrl
(Blob blob) Generate and return the URL for the given blob.Returns the value of theactiveElement
property.Returns the value of thealinkColor
property.getAll()
Returns the value of theall
property.Returns the value of the JavaScript propertyanchors
.Returns the value of the JavaScript propertyapplets
.Returns the value of thebgColor
property.getBody()
Returns this document'sbody
element.Returns the character encoding of the current document.Retrieves the character set used to encode the document.int
Returns the current number of child elements.Gets the children of the current node.Returns thecompatMode
property.Returns thecontentType
property.Returns thecookie
property.org.htmlunit.corejs.javascript.ScriptableObject
Gets the window in which this document is contained.Returns a value which indicates whether or not the document can be edited.Gets the JavaScript propertydoctype
for the document.Gets the JavaScript propertydocumentElement
for the document.int
Returns thedocumentMode
property.Returns the value of thedocumentURI
property.Returns the domain name of the server that served the document, ornull
if the server cannot be identified by a domain name.getElementById
(String id) Returns the element with the specified ID, as long as it is an HTML element;null
otherwise.getElementsByClassName
(String className) Returns all the descendant elements with the specified class name.getElementsByName
(String elementName) Returns all HTML elements that have aname
attribute with the specified value.getElementsByTagName
(String tagName) Returns all the descendant elements with the specified tag name.getElementsByTagNameNS
(Object namespaceURI, String localName) Returns a list of elements with the given tag name belonging to the given namespace.Returns the value of theembeds
property.Returns the value of thefgColor
property.Returns the first element child.org.htmlunit.corejs.javascript.ScriptableObject
getFonts()
getForms()
Returns the value of theforms
property.getHead()
Returns this document'shead
element.boolean
Returns thehidden
property.Returns the value of theembeds
property.Returns the implementation object of the current document.Returns a string representing the encoding under which the document was parsed.Returns the last element child.Returns the last modification date of the document.Returns the value of thelinkColor
property.getLinks()
Returns the value of the JavaScript propertylinks
.Returns the value of thelocation
property.org.htmlunit.corejs.javascript.Function
Returns theonabort
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonafterscriptexecute
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonauxclick
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonbeforecopy
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonbeforecut
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonbeforepaste
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonbeforescriptexecute
event handler for this element.Returns theonblur
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theoncancel
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theoncanplay
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theoncanplaythrough
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonchange
event handler for this element.Returns theonclick
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonclose
event handler for this element.Returns theoncontextmenu
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theoncopy
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theoncuechange
event handler for this element.org.htmlunit.corejs.javascript.Function
getOncut()
Returns theoncut
event handler for this element.Returns theondblclick
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theondrag
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theondragend
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theondragenter
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theondragleave
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theondragover
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theondragstart
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theondrop
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theondurationchange
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonemptied
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonended
event handler for this element.Returns theonerror
event handler for this element.Returns theonfocus
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theongotpointercapture
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theoninput
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theoninvalid
event handler for this element.Returns theonkeydown
event handler for this element.Returns theonkeypress
event handler for this element.Returns theonkeyup
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonload
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonloadeddata
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonloadedmetadata
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonloadstart
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonlostpointercapture
event handler for this element.Returns theonmousedown
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonmouseenter
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonmouseleave
event handler for this element.Returns theonmousemove
event handler for this element.Returns theonmouseout
event handler for this element.Returns theonmouseover
event handler for this element.Returns theonmouseup
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonmousewheel
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonmozfullscreenchange
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonmozfullscreenerror
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonpaste
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonpause
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonplay
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonplaying
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonpointercancel
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonpointerdown
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonpointerenter
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonpointerleave
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonpointerlockchange
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonpointerlockerror
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonpointermove
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonpointerout
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonpointerover
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonpointerup
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonprogress
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonratechange
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonreadystatechange
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonreset
event handler for this element.Returns theonresize
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonscroll
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonsearch
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonseeked
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonseeking
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonselect
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonselectionchange
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonselectstart
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonstalled
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonsubmit
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonsuspend
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theontimeupdate
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theontoggle
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonvolumechange
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonwaiting
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonwebkitfullscreenchange
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonwebkitfullscreenerror
event handler for this element.org.htmlunit.corejs.javascript.Function
Returns theonwheel
event handler for this element.getPage()
Returns the page that this document is modeling.Returns the value of theplugins
property.Returns the ready state of the document.Returns the value of thereferrer
property.Gets the JavaScript propertyrootElement
.Returns the value of thescripts
property.Returns the current selection.Retrieves a collection of stylesheet objects representing the style sheets that correspond to each instance of a Link orCSSStyleDeclaration
object in the document.getTitle()
Returns this document's title.Returns the value of theURL
property.Returns the value of thevlinkColor
property.Returns thexmlEncoding
property.Returns thexmlVersion
property.private boolean
hasCommand
(String cmd, boolean includeBold) boolean
hasFocus()
Returnsfalse
if the active element in the document has no focus;true
if the active element in the document has focus.importNode
(Node importedNode, boolean deep) Imports a node from another document to this document.private boolean
boolean
Returns thexmlStandalone
property.void
JavaScript constructor.private static Date
parseDateOrNow
(String stringDate) boolean
Indicates if the command can be successfully executed usingexecCommand
, given the current state of the document.boolean
Indicates if the command is supported.querySelector
(String selectors) Returns the first element within the document that matches the specified group of selectors.querySelectorAll
(String selectors) Retrieves all element nodes from descendants of the starting element node that match any selector within the supplied selector strings.void
Mock for the moment.void
releaseEvents
(String type) Does nothing special anymore.resolveBlobUrl
(String url) void
revokeBlobUrl
(String url) Revokes the URL for the given blob.void
setAlinkColor
(String color) Sets the value of thealinkColor
property.void
setBgColor
(String color) Sets the value of thebgColor
property.void
setBody
(HTMLElement htmlElement) Sets thebody
element of the document.void
setCurrentScript
(org.htmlunit.corejs.javascript.ScriptableObject script) void
setDesignMode
(String mode) Sets a value which indicates whether or not the document can be edited.void
Sets the domain of this document.void
setFgColor
(String color) Sets the value of thefgColor
property.void
setLinkColor
(String color) Sets the value of thelinkColor
property.void
setLocation
(String location) Sets the value of thelocation
property.void
setOnabort
(Object onabort) Sets theonabort
event handler for this element.void
setOnafterscriptexecute
(Object onafterscriptexecute) Sets theonafterscriptexecute
event handler for this element.void
setOnauxclick
(Object onauxclick) Sets theonauxclick
event handler for this element.void
setOnbeforecopy
(Object onbeforecopy) Sets theonbeforecopy
event handler for this element.void
setOnbeforecut
(Object onbeforecut) Sets theonbeforecut
event handler for this element.void
setOnbeforepaste
(Object onbeforepaste) Sets theonbeforepaste
event handler for this element.void
setOnbeforescriptexecute
(Object onbeforescriptexecute) Sets theonbeforescriptexecute
event handler for this element.void
Sets theonblur
event handler for this element.void
setOncancel
(Object oncancel) Sets theoncancel
event handler for this element.void
setOncanplay
(Object oncanplay) Sets theoncanplay
event handler for this element.void
setOncanplaythrough
(Object oncanplaythrough) Sets theoncanplaythrough
event handler for this element.void
setOnchange
(Object onchange) Sets theonchange
event handler for this element.void
setOnclick
(Object handler) Sets theonclick
event handler for this element.void
setOnclose
(Object onclose) Sets theonclose
event handler for this element.void
setOncontextmenu
(Object handler) Sets theoncontextmenu
event handler for this element.void
Sets theoncopy
event handler for this element.void
setOncuechange
(Object oncuechange) Sets theoncuechange
event handler for this element.void
Sets theoncut
event handler for this element.void
setOndblclick
(Object handler) Sets theondblclick
event handler for this element.void
Sets theondrag
event handler for this element.void
setOndragend
(Object ondragend) Sets theondragend
event handler for this element.void
setOndragenter
(Object ondragenter) Sets theondragenter
event handler for this element.void
setOndragleave
(Object ondragleave) Sets theondragleave
event handler for this element.void
setOndragover
(Object ondragover) Sets theondragover
event handler for this element.void
setOndragstart
(Object ondragstart) Sets theondragstart
event handler for this element.void
Sets theondrop
event handler for this element.void
setOndurationchange
(Object ondurationchange) Sets theondurationchange
event handler for this element.void
setOnemptied
(Object onemptied) Sets theonemptied
event handler for this element.void
setOnended
(Object onended) Sets theonended
event handler for this element.void
setOnerror
(Object handler) Sets theonerror
event handler for this element.void
setOnfocus
(Object handler) Sets theonfocus
event handler for this element.void
setOngotpointercapture
(Object ongotpointercapture) Sets theongotpointercapture
event handler for this element.void
setOninput
(Object oninput) Sets theoninput
event handler for this element.void
setOninvalid
(Object oninvalid) Sets theoninvalid
event handler for this element.void
setOnkeydown
(Object handler) Sets theonkeydown
event handler for this element.void
setOnkeypress
(Object handler) Sets theonkeypress
event handler for this element.void
setOnkeyup
(Object handler) Sets theonkeyup
event handler for this element.void
Sets theonload
event handler for this element.void
setOnloadeddata
(Object onloadeddata) Sets theonloadeddata
event handler for this element.void
setOnloadedmetadata
(Object onloadedmetadata) Sets theonloadedmetadata
event handler for this element.void
setOnloadstart
(Object onloadstart) Sets theonloadstart
event handler for this element.void
setOnlostpointercapture
(Object onlostpointercapture) Sets theonlostpointercapture
event handler for this element.void
setOnmousedown
(Object handler) Sets theonmousedown
event handler for this element.void
setOnmouseenter
(Object onmouseenter) Sets theonmouseenter
event handler for this element.void
setOnmouseleave
(Object onmouseleave) Sets theonmouseleave
event handler for this element.void
setOnmousemove
(Object handler) Sets theonmousemove
event handler for this element.void
setOnmouseout
(Object handler) Sets theonmouseout
event handler for this element.void
setOnmouseover
(Object handler) Sets theonmouseover
event handler for this element.void
setOnmouseup
(Object handler) Sets theonmouseup
event handler for this element.void
setOnmousewheel
(Object onmousewheel) Sets theonmousewheel
event handler for this element.void
setOnmozfullscreenchange
(Object onmozfullscreenchange) Sets theonmozfullscreenchange
event handler for this element.void
setOnmozfullscreenerror
(Object onmozfullscreenerror) Sets theonmozfullscreenerror
event handler for this element.void
setOnpaste
(Object onpaste) Sets theonpaste
event handler for this element.void
setOnpause
(Object onpause) Sets theonpause
event handler for this element.void
Sets theonplay
event handler for this element.void
setOnplaying
(Object onplaying) Sets theonplaying
event handler for this element.void
setOnpointercancel
(Object onpointercancel) Sets theonpointercancel
event handler for this element.void
setOnpointerdown
(Object onpointerdown) Sets theonpointerdown
event handler for this element.void
setOnpointerenter
(Object onpointerenter) Sets theonpointerenter
event handler for this element.void
setOnpointerleave
(Object onpointerleave) Sets theonpointerleave
event handler for this element.void
setOnpointerlockchange
(Object onpointerlockchange) Sets theonpointerlockchange
event handler for this element.void
setOnpointerlockerror
(Object onpointerlockerror) Sets theonpointerlockerror
event handler for this element.void
setOnpointermove
(Object onpointermove) Sets theonpointermove
event handler for this element.void
setOnpointerout
(Object onpointerout) Sets theonpointerout
event handler for this element.void
setOnpointerover
(Object onpointerover) Sets theonpointerover
event handler for this element.void
setOnpointerup
(Object onpointerup) Sets theonpointerup
event handler for this element.void
setOnprogress
(Object onprogress) Sets theonprogress
event handler for this element.void
setOnratechange
(Object onratechange) Sets theonratechange
event handler for this element.void
setOnreadystatechange
(Object onreadystatechange) Sets theonreadystatechange
event handler for this element.void
setOnreset
(Object onreset) Sets theonreset
event handler for this element.void
setOnresize
(Object handler) Sets theonresize
event handler for this element.void
setOnscroll
(Object onscroll) Sets theonscroll
event handler for this element.void
setOnsearch
(Object onsearch) Sets theonsearch
event handler for this element.void
setOnseeked
(Object onseeked) Sets theonseeked
event handler for this element.void
setOnseeking
(Object onseeking) Sets theonseeking
event handler for this element.void
setOnselect
(Object onselect) Sets theonselect
event handler for this element.void
setOnselectionchange
(Object onselectionchange) Sets theonselectionchange
event handler for this element.void
setOnselectstart
(Object onselectstart) Sets theonselectstart
event handler for this element.void
setOnstalled
(Object onstalled) Sets theonstalled
event handler for this element.void
setOnsubmit
(Object onsubmit) Sets theonsubmit
event handler for this element.void
setOnsuspend
(Object onsuspend) Sets theonsuspend
event handler for this element.void
setOntimeupdate
(Object ontimeupdate) Sets theontimeupdate
event handler for this element.void
setOntoggle
(Object ontoggle) Sets theontoggle
event handler for this element.void
setOnvolumechange
(Object onvolumechange) Sets theonvolumechange
event handler for this element.void
setOnwaiting
(Object onwaiting) Sets theonwaiting
event handler for this element.void
setOnwebkitfullscreenchange
(Object onwebkitfullscreenchange) Sets theonwebkitfullscreenchange
event handler for this element.void
setOnwebkitfullscreenerror
(Object onwebkitfullscreenerror) Sets theonwebkitfullscreenerror
event handler for this element.void
setOnwheel
(Object onwheel) Sets theonwheel
event handler for this element.void
Sets this document's title.void
setVlinkColor
(String color) Sets the value of thevlinkColor
property.void
Sets the Window JavaScript object that encloses this document.private static org.htmlunit.corejs.javascript.Scriptable
staticGetPrototype
(Window window, Class<? extends HtmlUnitScriptable> javaScriptClass) Methods inherited from class org.htmlunit.javascript.host.dom.Node
after, append, appendChild, before, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFirstChild, getJavaScriptNode, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParent, getParentElement, getParentNode, getPrefix, getPreviousSibling, getRootNode, getTextContent, hasAttributes, hasChildNodes, insertBefore, insertBeforeImpl, isEqualNode, isSameNode, normalize, prepend, remove, removeChild, replaceChild, replaceChildren, replaceWith, setNodeValue, setTextContent
Methods inherited from class org.htmlunit.javascript.host.event.EventTarget
addEventListener, clearEventListenersContainer, dispatchEvent, executeEventLocally, fireEvent, getEventHandler, getEventListenersContainer, hasEventHandlers, isEventHandlerOnWindow, removeEventListener, setEventHandler
Methods inherited from class org.htmlunit.javascript.HtmlUnitScriptable
clone, equivalentValues, get, getBrowserVersion, getClassName, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getStartingScope, getWindow, getWindow, getWithPreemption, has, hasInstance, initParentScope, makeScriptableFor, put, setClassName, setDomNode, setDomNode, setParentScope, setupPromise, setupRejectedPromise
Methods inherited from class org.htmlunit.corejs.javascript.ScriptableObject
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, get, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, putProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setPrototype, size
-
Field Details
-
LOG
private static final org.apache.commons.logging.Log LOG -
TAG_NAME_PATTERN
-
EXECUTE_CMDS_FF
https://developer.mozilla.org/en/Rich-Text_Editing_in_Mozilla#Executing_Commands -
EXECUTE_CMDS_CHROME
-
LAST_MODIFIED_DATE_FORMAT
The format to use for thelastModified
attribute.- See Also:
-
SUPPORTED_DOM2_EVENT_TYPE_MAP
Contains all supported DOM level 2 events. -
SUPPORTED_DOM3_EVENT_TYPE_MAP
Contains all supported DOM level 3 events. DOM level 2 events are not included. -
SUPPORTED_VENDOR_EVENT_TYPE_MAP
Contains all supported vendor specific events. -
window_
-
implementation_
-
designMode_
-
compatMode_
-
documentMode_
private int documentMode_ -
domain_
-
lastModified_
-
currentScript_
private org.htmlunit.corejs.javascript.ScriptableObject currentScript_ -
fonts_
-
styleSheetList_
-
blobUrl2Blobs_
-
-
Constructor Details
-
Document
public Document()Creates an instance.
-
-
Method Details
-
jsConstructor
public void jsConstructor()JavaScript constructor.- Overrides:
jsConstructor
in classNode
-
setWindow
Sets the Window JavaScript object that encloses this document.- Parameters:
window
- the Window JavaScript object that encloses this document
-
getLocation
Returns the value of thelocation
property.- Returns:
- the value of the
location
property
-
setLocation
Sets the value of thelocation
property. The location's default property is "href", so setting "document.location='http://www.sf.net'" is equivalent to setting "document.location.href='http://www.sf.net'".- Parameters:
location
- the location to navigate to- Throws:
IOException
- when location loading fails- See Also:
-
getReferrer
Returns the value of thereferrer
property.- Returns:
- the value of the
referrer
property
-
getDocumentElement
Gets the JavaScript propertydocumentElement
for the document.- Returns:
- the root node for the document
-
getRootElement
Gets the JavaScript propertyrootElement
.- Returns:
- the root node for the document
-
getDoctype
Gets the JavaScript propertydoctype
for the document.- Returns:
- the DocumentType of the document
-
getDesignMode
Returns a value which indicates whether or not the document can be edited.- Returns:
- a value which indicates whether or not the document can be edited
-
setDesignMode
Sets a value which indicates whether or not the document can be edited.- Parameters:
mode
- a value which indicates whether or not the document can be edited
-
getPage
Returns the page that this document is modeling.- Returns:
- the page that this document is modeling
-
getDefaultView
Gets the window in which this document is contained.- Returns:
- the window
-
createDocumentFragment
Creates a new document fragment.- Returns:
- a newly created document fragment
-
createAttribute
Creates a new HTML attribute with the specified name.- Parameters:
attributeName
- the name of the attribute to create- Returns:
- an attribute with the specified name
-
importNode
Imports a node from another document to this document. The source node is not altered or removed from the original document; this method creates a new copy of the source node.- Parameters:
importedNode
- the node to importdeep
- Whether to recursively import the subtree under the specified node; or not- Returns:
- the imported node that belongs to this Document
-
adoptNode
Adopts a node from an external document. The node and its subtree is removed from the document it's in (if any), and its ownerDocument is changed to the current document. The node can then be inserted into the current document.- Parameters:
externalNode
- the node from another document to be adopted- Returns:
- the adopted node that can be used in the current document
-
getImplementation
Returns the implementation object of the current document.- Returns:
- implementation-specific object
-
createNSResolver
Adapts any DOM node to resolve namespaces so that an XPath expression can be easily evaluated relative to the context of the node where it appeared within the document.- Parameters:
nodeResolver
- the node to be used as a context for namespace resolution- Returns:
- an XPathNSResolver which resolves namespaces with respect to the definitions in scope for a specified node
-
createTextNode
Create a new DOM text node with the given data.- Parameters:
newData
- the string value for the text node- Returns:
- the new text node or NOT_FOUND if there is an error
-
createComment
Creates a new Comment.- Parameters:
comment
- the comment text- Returns:
- the new Comment
-
evaluate
public XPathResult evaluate(String expression, Node contextNode, Object resolver, int type, Object result) Evaluates an XPath expression string and returns a result of the specified type if possible.- Parameters:
expression
- the XPath expression string to be parsed and evaluatedcontextNode
- the context node for the evaluation of this XPath expressionresolver
- the resolver permits translation of all prefixes, including the XML namespace prefix, within the XPath expression into appropriate namespace URIs.type
- If a specific type is specified, then the result will be returned as the corresponding typeresult
- the result object which may be reused and returned by this method- Returns:
- the result of the evaluation of the XPath expression
-
createElement
Creates a new element with the given tag name.- Parameters:
tagName
- the tag name- Returns:
- the new HTML element, or NOT_FOUND if the tag is not supported
-
createElementNS
Creates a new HTML element with the given tag name, and name.- Parameters:
namespaceURI
- the URI that identifies an XML namespacequalifiedName
- the qualified name of the element type to instantiate- Returns:
- the new HTML element, or NOT_FOUND if the tag is not supported
-
getElementsByTagName
Returns all the descendant elements with the specified tag name.- Parameters:
tagName
- the name to search for- Returns:
- all the descendant elements with the specified tag name
-
getElementsByTagNameNS
Returns a list of elements with the given tag name belonging to the given namespace.- Parameters:
namespaceURI
- the namespace URI of elements to look forlocalName
- is either the local name of elements to look for or the special value "*", which matches all elements.- Returns:
- a live NodeList of found elements in the order they appear in the tree
-
getActiveElement
Returns the value of theactiveElement
property.- Returns:
- the value of the
activeElement
property - See Also:
-
getCharacterSet
Returns the character encoding of the current document.- Returns:
- the character encoding of the current document
-
getCharset
Retrieves the character set used to encode the document.- Returns:
- the character set used to encode the document
-
getAnchors
Returns the value of the JavaScript propertyanchors
.- Returns:
- the value of this property
- See Also:
-
getApplets
Returns the value of the JavaScript propertyapplets
.- Returns:
- the value of this property
- See Also:
-
getBody
Returns this document'sbody
element.- Returns:
- this document's
body
element
-
setBody
Sets thebody
element of the document.- Parameters:
htmlElement
- the new html element
-
close
JavaScript functionclose
.See http://www.whatwg.org/specs/web-apps/current-work/multipage/section-dynamic.html for a good description of the semantics of open(), write(), writeln() and close().
- Throws:
IOException
- if an IO problem occurs
-
getCompatMode
Returns thecompatMode
property.- Returns:
- the
compatMode
property
-
getDocumentMode
public int getDocumentMode()Returns thedocumentMode
property.- Returns:
- the
documentMode
property
-
isQuirksDocType
private boolean isQuirksDocType() -
forceDocumentMode
public void forceDocumentMode(int documentMode) INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Called from the HTMLParser if a 'X-UA-Compatible' meta tag found.- Parameters:
documentMode
- the mode forced by the meta tag
-
querySelector
Returns the first element within the document that matches the specified group of selectors.- Parameters:
selectors
- the selectors- Returns:
- null if no matches are found; otherwise, it returns the first matching element
-
querySelectorAll
Retrieves all element nodes from descendants of the starting element node that match any selector within the supplied selector strings. The NodeList object returned by the querySelectorAll() method must be static, not live.- Parameters:
selectors
- the selectors- Returns:
- the static node list
-
queryCommandSupported
Indicates if the command is supported.- Parameters:
cmd
- the command identifier- Returns:
true
if the command is supported- See Also:
-
hasCommand
-
queryCommandEnabled
Indicates if the command can be successfully executed usingexecCommand
, given the current state of the document.- Parameters:
cmd
- the command identifier- Returns:
true
if the command can be successfully executed
-
execCommand
Executes a command.- Parameters:
cmd
- the command identifieruserInterface
- display a user interface if the command supports onevalue
- the string, number, or other value to assign (possible values depend on the command)- Returns:
true
if the command was successful,false
otherwise- See Also:
-
getURL_js
Returns the value of theURL
property.- Returns:
- the value of the
URL
property
-
getDocumentURI
Returns the value of thedocumentURI
property.- Returns:
- the value of the
documentURI
property
-
getCookie
Returns thecookie
property.- Returns:
- the
cookie
property
-
createEvent
Implementation of theDocumentEvent
interface'sDocumentEvent.createEvent(String)
method. The method creates an uninitialized event of the specified type.- Parameters:
eventType
- the event type to create- Returns:
- an event object for the specified type
- Throws:
DOMException
- if the event type is not supported (will have a type of DOMException.NOT_SUPPORTED_ERR)- See Also:
-
createNodeIterator
public NodeIterator createNodeIterator(Node root, int whatToShow, org.htmlunit.corejs.javascript.Scriptable filter) Returns a new NodeIterator object.- Parameters:
root
- The root node at which to begin the NodeIterator's traversal.whatToShow
- an optional long representing a bitmask created by combining the constant properties ofNodeFilter
filter
- an object implementing theNodeFilter
interface- Returns:
- a new NodeIterator object
-
createFilterWrapper
private static org.w3c.dom.traversal.NodeFilter createFilterWrapper(org.htmlunit.corejs.javascript.Scriptable filter, boolean filterFunctionOnly) -
createTreeWalker
public Object createTreeWalker(Node root, double whatToShow, org.htmlunit.corejs.javascript.Scriptable filter, boolean expandEntityReferences) throws DOMException Creates and returns a new TreeWalker. The following JavaScript parameters are passed into this method:- JavaScript param 1: The root node of the TreeWalker. Must not be
null
. - JavaScript param 2: Flag specifying which types of nodes appear in the logical view of the TreeWalker.
See
NodeFilter
for the set of possible Show_ values. - JavaScript param 3: The
NodeFilter
to be used with this TreeWalker, ornull
to indicate no filter. - JavaScript param 4: If
false
, the contents of EntityReference nodes are not present in the logical view.
- Parameters:
root
- the node which will serve as the root for the TreeWalkerwhatToShow
- specifies which node types may appear in the logical view of the tree presentedfilter
- the NodeFilter to be used with this TreeWalker, or null to indicate no filterexpandEntityReferences
- If false, the contents of EntityReference nodes are not presented in the logical view- Returns:
- a new TreeWalker
- Throws:
DOMException
- on attempt to create a TreeWalker with a root that isnull
- See Also:
- JavaScript param 1: The root node of the TreeWalker. Must not be
-
staticGetPrototype
private static org.htmlunit.corejs.javascript.Scriptable staticGetPrototype(Window window, Class<? extends HtmlUnitScriptable> javaScriptClass) -
createRange
Creates and returns a new range.- Returns:
- a new range
- See Also:
-
getDomain
Returns the domain name of the server that served the document, ornull
if the server cannot be identified by a domain name.- Returns:
- the domain name of the server that served the document
- See Also:
-
setDomain
Sets the domain of this document.Domains can only be set to suffixes of the existing domain with the exception of setting the domain to itself.
The domain will be set according to the following rules:
- If the newDomain.equalsIgnoreCase(currentDomain) the method returns with no error.
- If the browser version is netscape, the newDomain is downshifted.
- The change will take place if and only if the suffixes of the
current domain and the new domain match AND there are at least
two domain qualifiers e.g. the following transformations are legal
d1.d2.d3.gargoylesoftware.com may be transformed to itself or:
d2.d3.gargoylesoftware.com
d3.gargoylesoftware.com
gargoylesoftware.com
transformation to: com will fail
TODO This code could be modified to understand country domain suffixes. The domain www.bbc.co.uk should be trimmable only down to bbc.co.uk trimming to co.uk should not be possible.
- Parameters:
newDomain
- the new domain to set
-
setOnclick
Sets theonclick
event handler for this element.- Parameters:
handler
- theonclick
event handler for this element
-
getOnclick
Returns theonclick
event handler for this element.- Returns:
- the
onclick
event handler for this element
-
setOndblclick
Sets theondblclick
event handler for this element.- Parameters:
handler
- theondblclick
event handler for this element
-
getOndblclick
Returns theondblclick
event handler for this element.- Returns:
- the
ondblclick
event handler for this element
-
setOnblur
Sets theonblur
event handler for this element.- Parameters:
handler
- theonblur
event handler for this element
-
getOnblur
Returns theonblur
event handler for this element.- Returns:
- the
onblur
event handler for this element
-
setOnfocus
Sets theonfocus
event handler for this element.- Parameters:
handler
- theonfocus
event handler for this element
-
getOnfocus
Returns theonfocus
event handler for this element.- Returns:
- the
onfocus
event handler for this element
-
setOnkeydown
Sets theonkeydown
event handler for this element.- Parameters:
handler
- theonkeydown
event handler for this element
-
getOnkeydown
Returns theonkeydown
event handler for this element.- Returns:
- the
onkeydown
event handler for this element
-
setOnkeypress
Sets theonkeypress
event handler for this element.- Parameters:
handler
- theonkeypress
event handler for this element
-
getOnkeypress
Returns theonkeypress
event handler for this element.- Returns:
- the
onkeypress
event handler for this element
-
setOnkeyup
Sets theonkeyup
event handler for this element.- Parameters:
handler
- theonkeyup
event handler for this element
-
getOnkeyup
Returns theonkeyup
event handler for this element.- Returns:
- the
onkeyup
event handler for this element
-
setOnmousedown
Sets theonmousedown
event handler for this element.- Parameters:
handler
- theonmousedown
event handler for this element
-
getOnmousedown
Returns theonmousedown
event handler for this element.- Returns:
- the
onmousedown
event handler for this element
-
setOnmousemove
Sets theonmousemove
event handler for this element.- Parameters:
handler
- theonmousemove
event handler for this element
-
getOnmousemove
Returns theonmousemove
event handler for this element.- Returns:
- the
onmousemove
event handler for this element
-
setOnmouseout
Sets theonmouseout
event handler for this element.- Parameters:
handler
- theonmouseout
event handler for this element
-
getOnmouseout
Returns theonmouseout
event handler for this element.- Returns:
- the
onmouseout
event handler for this element
-
setOnmouseover
Sets theonmouseover
event handler for this element.- Parameters:
handler
- theonmouseover
event handler for this element
-
getOnmouseover
Returns theonmouseover
event handler for this element.- Returns:
- the
onmouseover
event handler for this element
-
setOnmouseup
Sets theonmouseup
event handler for this element.- Parameters:
handler
- theonmouseup
event handler for this element
-
getOnmouseup
Returns theonmouseup
event handler for this element.- Returns:
- the
onmouseup
event handler for this element
-
setOnresize
Sets theonresize
event handler for this element.- Parameters:
handler
- theonresize
event handler for this element
-
getOnresize
Returns theonresize
event handler for this element.- Returns:
- the
onresize
event handler for this element
-
setOnerror
Sets theonerror
event handler for this element.- Parameters:
handler
- theonerror
event handler for this element
-
getOnerror
Returns theonerror
event handler for this element.- Returns:
- the
onerror
event handler for this element
-
getOninput
public org.htmlunit.corejs.javascript.Function getOninput()Returns theoninput
event handler for this element.- Returns:
- the
oninput
event handler for this element
-
setOninput
Sets theoninput
event handler for this element.- Parameters:
oninput
- theoninput
event handler for this element
-
getHidden
public boolean getHidden()Returns thehidden
property.- Returns:
- the
hidden
property
-
getChildElementCount
public int getChildElementCount()Returns the current number of child elements.- Overrides:
getChildElementCount
in classNode
- Returns:
- the child element count
-
elementFromPoint
Returns the element for the specified x coordinate and the specified y coordinate. The current implementation always returns the <body> element.- Parameters:
x
- the x offset, in pixelsy
- the y offset, in pixels- Returns:
- the element for the specified x coordinate and the specified y coordinate
-
getForms
Returns the value of theforms
property.- Returns:
- the value of the
forms
property
-
getEmbeds
Returns the value of theembeds
property.- Returns:
- the value of the
embeds
property
-
getImages
Returns the value of theembeds
property.- Returns:
- the value of the
embeds
property
-
getScripts
Returns the value of thescripts
property.- Returns:
- the value of the
scripts
property
-
getStyleSheets
Retrieves a collection of stylesheet objects representing the style sheets that correspond to each instance of a Link orCSSStyleDeclaration
object in the document.- Returns:
- styleSheet collection
-
getPlugins
Returns the value of theplugins
property.- Returns:
- the value of the
plugins
property
-
getLinks
Returns the value of the JavaScript propertylinks
. Refer also to the MSDN documentation.- Returns:
- the value of this property
-
getElementsByClassName
Returns all the descendant elements with the specified class name.- Parameters:
className
- the name to search for- Returns:
- all the descendant elements with the specified class name
- See Also:
-
getElementsByName
Returns all HTML elements that have aname
attribute with the specified value.Refer to The DOM spec for details.
- Parameters:
elementName
- - value of thename
attribute to look for- Returns:
- all HTML elements that have a
name
attribute with the specified value
-
hasFocus
public boolean hasFocus()Returnsfalse
if the active element in the document has no focus;true
if the active element in the document has focus.- Returns:
- whether the active element in the document has focus or not
-
getTitle
Returns this document's title.- Returns:
- this document's title
-
setTitle
Sets this document's title.- Parameters:
title
- the new title
-
getChildren
Gets the children of the current node.- Overrides:
getChildren
in classNode
- Returns:
- the child at the given position
- See Also:
-
getContentType
Returns thecontentType
property.- Returns:
- the
contentType
property
-
getSelection
Returns the current selection.- Returns:
- the current selection
-
getHead
Returns this document'shead
element.- Returns:
- this document's
head
element
-
getInputEncoding
Returns a string representing the encoding under which the document was parsed.- Returns:
- a string representing the encoding under which the document was parsed
-
getLastModified
Returns the last modification date of the document.- Returns:
- the date as string
- See Also:
-
parseDateOrNow
-
releaseCapture
public void releaseCapture()Mock for the moment. -
getReadyState
Returns the ready state of the document.- Returns:
- the ready state of the document
- See Also:
-
captureEvents
Does nothing special anymore.- Parameters:
type
- the type of events to capture- See Also:
-
releaseEvents
Does nothing special anymore.- Parameters:
type
- the type of events to capture- See Also:
-
getAlinkColor
Returns the value of thealinkColor
property.- Returns:
- the value of the
alinkColor
property
-
setAlinkColor
Sets the value of thealinkColor
property.- Parameters:
color
- the value of thealinkColor
property
-
getBgColor
Returns the value of thebgColor
property.- Returns:
- the value of the
bgColor
property - See Also:
-
setBgColor
Sets the value of thebgColor
property.- Parameters:
color
- the value of thebgColor
property- See Also:
-
getFgColor
Returns the value of thefgColor
property.- Returns:
- the value of the
fgColor
property
-
setFgColor
Sets the value of thefgColor
property.- Parameters:
color
- the value of thefgColor
property
-
getLinkColor
Returns the value of thelinkColor
property.- Returns:
- the value of the
linkColor
property
-
setLinkColor
Sets the value of thelinkColor
property.- Parameters:
color
- the value of thelinkColor
property
-
getVlinkColor
Returns the value of thevlinkColor
property.- Returns:
- the value of the
vlinkColor
property
-
setVlinkColor
Sets the value of thevlinkColor
property.- Parameters:
color
- the value of thevlinkColor
property
-
getLastElementChild
Returns the last element child.- Overrides:
getLastElementChild
in classNode
- Returns:
- the last element child
-
getFirstElementChild
Returns the first element child.- Overrides:
getFirstElementChild
in classNode
- Returns:
- the first element child
-
getXmlEncoding
Returns thexmlEncoding
property.- Returns:
- the
xmlEncoding
property
-
isXmlStandalone
public boolean isXmlStandalone()Returns thexmlStandalone
property.- Returns:
- the
xmlStandalone
property
-
getXmlVersion
Returns thexmlVersion
property.- Returns:
- the
xmlVersion
property
-
getOnabort
public org.htmlunit.corejs.javascript.Function getOnabort()Returns theonabort
event handler for this element.- Returns:
- the
onabort
event handler for this element
-
setOnabort
Sets theonabort
event handler for this element.- Parameters:
onabort
- theonabort
event handler for this element
-
getOnauxclick
public org.htmlunit.corejs.javascript.Function getOnauxclick()Returns theonauxclick
event handler for this element.- Returns:
- the
onauxclick
event handler for this element
-
setOnauxclick
Sets theonauxclick
event handler for this element.- Parameters:
onauxclick
- theonauxclick
event handler for this element
-
getOnbeforecopy
public org.htmlunit.corejs.javascript.Function getOnbeforecopy()Returns theonbeforecopy
event handler for this element.- Returns:
- the
onbeforecopy
event handler for this element
-
setOnbeforecopy
Sets theonbeforecopy
event handler for this element.- Parameters:
onbeforecopy
- theonbeforecopy
event handler for this element
-
getOnbeforecut
public org.htmlunit.corejs.javascript.Function getOnbeforecut()Returns theonbeforecut
event handler for this element.- Returns:
- the
onbeforecut
event handler for this element
-
setOnbeforecut
Sets theonbeforecut
event handler for this element.- Parameters:
onbeforecut
- theonbeforecut
event handler for this element
-
getOnbeforepaste
public org.htmlunit.corejs.javascript.Function getOnbeforepaste()Returns theonbeforepaste
event handler for this element.- Returns:
- the
onbeforepaste
event handler for this element
-
setOnbeforepaste
Sets theonbeforepaste
event handler for this element.- Parameters:
onbeforepaste
- theonbeforepaste
event handler for this element
-
getOncancel
public org.htmlunit.corejs.javascript.Function getOncancel()Returns theoncancel
event handler for this element.- Returns:
- the
oncancel
event handler for this element
-
setOncancel
Sets theoncancel
event handler for this element.- Parameters:
oncancel
- theoncancel
event handler for this element
-
getOncanplay
public org.htmlunit.corejs.javascript.Function getOncanplay()Returns theoncanplay
event handler for this element.- Returns:
- the
oncanplay
event handler for this element
-
setOncanplay
Sets theoncanplay
event handler for this element.- Parameters:
oncanplay
- theoncanplay
event handler for this element
-
getOncanplaythrough
public org.htmlunit.corejs.javascript.Function getOncanplaythrough()Returns theoncanplaythrough
event handler for this element.- Returns:
- the
oncanplaythrough
event handler for this element
-
setOncanplaythrough
Sets theoncanplaythrough
event handler for this element.- Parameters:
oncanplaythrough
- theoncanplaythrough
event handler for this element
-
getOnchange
public org.htmlunit.corejs.javascript.Function getOnchange()Returns theonchange
event handler for this element.- Returns:
- the
onchange
event handler for this element
-
setOnchange
Sets theonchange
event handler for this element.- Parameters:
onchange
- theonchange
event handler for this element
-
getOnclose
public org.htmlunit.corejs.javascript.Function getOnclose()Returns theonclose
event handler for this element.- Returns:
- the
onclose
event handler for this element
-
setOnclose
Sets theonclose
event handler for this element.- Parameters:
onclose
- theonclose
event handler for this element
-
getOncopy
public org.htmlunit.corejs.javascript.Function getOncopy()Returns theoncopy
event handler for this element.- Returns:
- the
oncopy
event handler for this element
-
setOncopy
Sets theoncopy
event handler for this element.- Parameters:
oncopy
- theoncopy
event handler for this element
-
getOncuechange
public org.htmlunit.corejs.javascript.Function getOncuechange()Returns theoncuechange
event handler for this element.- Returns:
- the
oncuechange
event handler for this element
-
setOncuechange
Sets theoncuechange
event handler for this element.- Parameters:
oncuechange
- theoncuechange
event handler for this element
-
getOncut
public org.htmlunit.corejs.javascript.Function getOncut()Returns theoncut
event handler for this element.- Returns:
- the
oncut
event handler for this element
-
setOncut
Sets theoncut
event handler for this element.- Parameters:
oncut
- theoncut
event handler for this element
-
getOndrag
public org.htmlunit.corejs.javascript.Function getOndrag()Returns theondrag
event handler for this element.- Returns:
- the
ondrag
event handler for this element
-
setOndrag
Sets theondrag
event handler for this element.- Parameters:
ondrag
- theondrag
event handler for this element
-
getOndragend
public org.htmlunit.corejs.javascript.Function getOndragend()Returns theondragend
event handler for this element.- Returns:
- the
ondragend
event handler for this element
-
setOndragend
Sets theondragend
event handler for this element.- Parameters:
ondragend
- theondragend
event handler for this element
-
getOndragenter
public org.htmlunit.corejs.javascript.Function getOndragenter()Returns theondragenter
event handler for this element.- Returns:
- the
ondragenter
event handler for this element
-
setOndragenter
Sets theondragenter
event handler for this element.- Parameters:
ondragenter
- theondragenter
event handler for this element
-
getOndragleave
public org.htmlunit.corejs.javascript.Function getOndragleave()Returns theondragleave
event handler for this element.- Returns:
- the
ondragleave
event handler for this element
-
setOndragleave
Sets theondragleave
event handler for this element.- Parameters:
ondragleave
- theondragleave
event handler for this element
-
getOndragover
public org.htmlunit.corejs.javascript.Function getOndragover()Returns theondragover
event handler for this element.- Returns:
- the
ondragover
event handler for this element
-
setOndragover
Sets theondragover
event handler for this element.- Parameters:
ondragover
- theondragover
event handler for this element
-
getOndragstart
public org.htmlunit.corejs.javascript.Function getOndragstart()Returns theondragstart
event handler for this element.- Returns:
- the
ondragstart
event handler for this element
-
setOndragstart
Sets theondragstart
event handler for this element.- Parameters:
ondragstart
- theondragstart
event handler for this element
-
getOndrop
public org.htmlunit.corejs.javascript.Function getOndrop()Returns theondrop
event handler for this element.- Returns:
- the
ondrop
event handler for this element
-
setOndrop
Sets theondrop
event handler for this element.- Parameters:
ondrop
- theondrop
event handler for this element
-
getOndurationchange
public org.htmlunit.corejs.javascript.Function getOndurationchange()Returns theondurationchange
event handler for this element.- Returns:
- the
ondurationchange
event handler for this element
-
setOndurationchange
Sets theondurationchange
event handler for this element.- Parameters:
ondurationchange
- theondurationchange
event handler for this element
-
getOnemptied
public org.htmlunit.corejs.javascript.Function getOnemptied()Returns theonemptied
event handler for this element.- Returns:
- the
onemptied
event handler for this element
-
setOnemptied
Sets theonemptied
event handler for this element.- Parameters:
onemptied
- theonemptied
event handler for this element
-
getOnended
public org.htmlunit.corejs.javascript.Function getOnended()Returns theonended
event handler for this element.- Returns:
- the
onended
event handler for this element
-
setOnended
Sets theonended
event handler for this element.- Parameters:
onended
- theonended
event handler for this element
-
getOngotpointercapture
public org.htmlunit.corejs.javascript.Function getOngotpointercapture()Returns theongotpointercapture
event handler for this element.- Returns:
- the
ongotpointercapture
event handler for this element
-
setOngotpointercapture
Sets theongotpointercapture
event handler for this element.- Parameters:
ongotpointercapture
- theongotpointercapture
event handler for this element
-
getOninvalid
public org.htmlunit.corejs.javascript.Function getOninvalid()Returns theoninvalid
event handler for this element.- Returns:
- the
oninvalid
event handler for this element
-
setOninvalid
Sets theoninvalid
event handler for this element.- Parameters:
oninvalid
- theoninvalid
event handler for this element
-
getOnload
public org.htmlunit.corejs.javascript.Function getOnload()Returns theonload
event handler for this element.- Returns:
- the
onload
event handler for this element
-
setOnload
Sets theonload
event handler for this element.- Parameters:
onload
- theonload
event handler for this element
-
getOnloadeddata
public org.htmlunit.corejs.javascript.Function getOnloadeddata()Returns theonloadeddata
event handler for this element.- Returns:
- the
onloadeddata
event handler for this element
-
setOnloadeddata
Sets theonloadeddata
event handler for this element.- Parameters:
onloadeddata
- theonloadeddata
event handler for this element
-
getOnloadedmetadata
public org.htmlunit.corejs.javascript.Function getOnloadedmetadata()Returns theonloadedmetadata
event handler for this element.- Returns:
- the
onloadedmetadata
event handler for this element
-
setOnloadedmetadata
Sets theonloadedmetadata
event handler for this element.- Parameters:
onloadedmetadata
- theonloadedmetadata
event handler for this element
-
getOnloadstart
public org.htmlunit.corejs.javascript.Function getOnloadstart()Returns theonloadstart
event handler for this element.- Returns:
- the
onloadstart
event handler for this element
-
setOnloadstart
Sets theonloadstart
event handler for this element.- Parameters:
onloadstart
- theonloadstart
event handler for this element
-
getOnlostpointercapture
public org.htmlunit.corejs.javascript.Function getOnlostpointercapture()Returns theonlostpointercapture
event handler for this element.- Returns:
- the
onlostpointercapture
event handler for this element
-
setOnlostpointercapture
Sets theonlostpointercapture
event handler for this element.- Parameters:
onlostpointercapture
- theonlostpointercapture
event handler for this element
-
getOnmouseenter
public org.htmlunit.corejs.javascript.Function getOnmouseenter()Returns theonmouseenter
event handler for this element.- Returns:
- the
onmouseenter
event handler for this element
-
setOnmouseenter
Sets theonmouseenter
event handler for this element.- Parameters:
onmouseenter
- theonmouseenter
event handler for this element
-
getOnmouseleave
public org.htmlunit.corejs.javascript.Function getOnmouseleave()Returns theonmouseleave
event handler for this element.- Returns:
- the
onmouseleave
event handler for this element
-
setOnmouseleave
Sets theonmouseleave
event handler for this element.- Parameters:
onmouseleave
- theonmouseleave
event handler for this element
-
getOnmousewheel
public org.htmlunit.corejs.javascript.Function getOnmousewheel()Returns theonmousewheel
event handler for this element.- Returns:
- the
onmousewheel
event handler for this element
-
setOnmousewheel
Sets theonmousewheel
event handler for this element.- Parameters:
onmousewheel
- theonmousewheel
event handler for this element
-
getOnpaste
public org.htmlunit.corejs.javascript.Function getOnpaste()Returns theonpaste
event handler for this element.- Returns:
- the
onpaste
event handler for this element
-
setOnpaste
Sets theonpaste
event handler for this element.- Parameters:
onpaste
- theonpaste
event handler for this element
-
getOnpause
public org.htmlunit.corejs.javascript.Function getOnpause()Returns theonpause
event handler for this element.- Returns:
- the
onpause
event handler for this element
-
setOnpause
Sets theonpause
event handler for this element.- Parameters:
onpause
- theonpause
event handler for this element
-
getOnplay
public org.htmlunit.corejs.javascript.Function getOnplay()Returns theonplay
event handler for this element.- Returns:
- the
onplay
event handler for this element
-
setOnplay
Sets theonplay
event handler for this element.- Parameters:
onplay
- theonplay
event handler for this element
-
getOnplaying
public org.htmlunit.corejs.javascript.Function getOnplaying()Returns theonplaying
event handler for this element.- Returns:
- the
onplaying
event handler for this element
-
setOnplaying
Sets theonplaying
event handler for this element.- Parameters:
onplaying
- theonplaying
event handler for this element
-
getOnpointercancel
public org.htmlunit.corejs.javascript.Function getOnpointercancel()Returns theonpointercancel
event handler for this element.- Returns:
- the
onpointercancel
event handler for this element
-
setOnpointercancel
Sets theonpointercancel
event handler for this element.- Parameters:
onpointercancel
- theonpointercancel
event handler for this element
-
getOnpointerdown
public org.htmlunit.corejs.javascript.Function getOnpointerdown()Returns theonpointerdown
event handler for this element.- Returns:
- the
onpointerdown
event handler for this element
-
setOnpointerdown
Sets theonpointerdown
event handler for this element.- Parameters:
onpointerdown
- theonpointerdown
event handler for this element
-
getOnpointerenter
public org.htmlunit.corejs.javascript.Function getOnpointerenter()Returns theonpointerenter
event handler for this element.- Returns:
- the
onpointerenter
event handler for this element
-
setOnpointerenter
Sets theonpointerenter
event handler for this element.- Parameters:
onpointerenter
- theonpointerenter
event handler for this element
-
getOnpointerleave
public org.htmlunit.corejs.javascript.Function getOnpointerleave()Returns theonpointerleave
event handler for this element.- Returns:
- the
onpointerleave
event handler for this element
-
setOnpointerleave
Sets theonpointerleave
event handler for this element.- Parameters:
onpointerleave
- theonpointerleave
event handler for this element
-
getOnpointerlockchange
public org.htmlunit.corejs.javascript.Function getOnpointerlockchange()Returns theonpointerlockchange
event handler for this element.- Returns:
- the
onpointerlockchange
event handler for this element
-
setOnpointerlockchange
Sets theonpointerlockchange
event handler for this element.- Parameters:
onpointerlockchange
- theonpointerlockchange
event handler for this element
-
getOnpointerlockerror
public org.htmlunit.corejs.javascript.Function getOnpointerlockerror()Returns theonpointerlockerror
event handler for this element.- Returns:
- the
onpointerlockerror
event handler for this element
-
setOnpointerlockerror
Sets theonpointerlockerror
event handler for this element.- Parameters:
onpointerlockerror
- theonpointerlockerror
event handler for this element
-
getOnpointermove
public org.htmlunit.corejs.javascript.Function getOnpointermove()Returns theonpointermove
event handler for this element.- Returns:
- the
onpointermove
event handler for this element
-
setOnpointermove
Sets theonpointermove
event handler for this element.- Parameters:
onpointermove
- theonpointermove
event handler for this element
-
getOnpointerout
public org.htmlunit.corejs.javascript.Function getOnpointerout()Returns theonpointerout
event handler for this element.- Returns:
- the
onpointerout
event handler for this element
-
setOnpointerout
Sets theonpointerout
event handler for this element.- Parameters:
onpointerout
- theonpointerout
event handler for this element
-
getOnpointerover
public org.htmlunit.corejs.javascript.Function getOnpointerover()Returns theonpointerover
event handler for this element.- Returns:
- the
onpointerover
event handler for this element
-
setOnpointerover
Sets theonpointerover
event handler for this element.- Parameters:
onpointerover
- theonpointerover
event handler for this element
-
getOnpointerup
public org.htmlunit.corejs.javascript.Function getOnpointerup()Returns theonpointerup
event handler for this element.- Returns:
- the
onpointerup
event handler for this element
-
setOnpointerup
Sets theonpointerup
event handler for this element.- Parameters:
onpointerup
- theonpointerup
event handler for this element
-
getOnprogress
public org.htmlunit.corejs.javascript.Function getOnprogress()Returns theonprogress
event handler for this element.- Returns:
- the
onprogress
event handler for this element
-
setOnprogress
Sets theonprogress
event handler for this element.- Parameters:
onprogress
- theonprogress
event handler for this element
-
getOnratechange
public org.htmlunit.corejs.javascript.Function getOnratechange()Returns theonratechange
event handler for this element.- Returns:
- the
onratechange
event handler for this element
-
setOnratechange
Sets theonratechange
event handler for this element.- Parameters:
onratechange
- theonratechange
event handler for this element
-
getOnreadystatechange
public org.htmlunit.corejs.javascript.Function getOnreadystatechange()Returns theonreadystatechange
event handler for this element.- Returns:
- the
onreadystatechange
event handler for this element
-
setOnreadystatechange
Sets theonreadystatechange
event handler for this element.- Parameters:
onreadystatechange
- theonreadystatechange
event handler for this element
-
getOnreset
public org.htmlunit.corejs.javascript.Function getOnreset()Returns theonreset
event handler for this element.- Returns:
- the
onreset
event handler for this element
-
setOnreset
Sets theonreset
event handler for this element.- Parameters:
onreset
- theonreset
event handler for this element
-
getOnscroll
public org.htmlunit.corejs.javascript.Function getOnscroll()Returns theonscroll
event handler for this element.- Returns:
- the
onscroll
event handler for this element
-
setOnscroll
Sets theonscroll
event handler for this element.- Parameters:
onscroll
- theonscroll
event handler for this element
-
getOnsearch
public org.htmlunit.corejs.javascript.Function getOnsearch()Returns theonsearch
event handler for this element.- Returns:
- the
onsearch
event handler for this element
-
setOnsearch
Sets theonsearch
event handler for this element.- Parameters:
onsearch
- theonsearch
event handler for this element
-
getOnseeked
public org.htmlunit.corejs.javascript.Function getOnseeked()Returns theonseeked
event handler for this element.- Returns:
- the
onseeked
event handler for this element
-
setOnseeked
Sets theonseeked
event handler for this element.- Parameters:
onseeked
- theonseeked
event handler for this element
-
getOnseeking
public org.htmlunit.corejs.javascript.Function getOnseeking()Returns theonseeking
event handler for this element.- Returns:
- the
onseeking
event handler for this element
-
setOnseeking
Sets theonseeking
event handler for this element.- Parameters:
onseeking
- theonseeking
event handler for this element
-
getOnselect
public org.htmlunit.corejs.javascript.Function getOnselect()Returns theonselect
event handler for this element.- Returns:
- the
onselect
event handler for this element
-
setOnselect
Sets theonselect
event handler for this element.- Parameters:
onselect
- theonselect
event handler for this element
-
getOnselectionchange
public org.htmlunit.corejs.javascript.Function getOnselectionchange()Returns theonselectionchange
event handler for this element.- Returns:
- the
onselectionchange
event handler for this element
-
setOnselectionchange
Sets theonselectionchange
event handler for this element.- Parameters:
onselectionchange
- theonselectionchange
event handler for this element
-
getOnselectstart
public org.htmlunit.corejs.javascript.Function getOnselectstart()Returns theonselectstart
event handler for this element.- Returns:
- the
onselectstart
event handler for this element
-
setOnselectstart
Sets theonselectstart
event handler for this element.- Parameters:
onselectstart
- theonselectstart
event handler for this element
-
getOnstalled
public org.htmlunit.corejs.javascript.Function getOnstalled()Returns theonstalled
event handler for this element.- Returns:
- the
onstalled
event handler for this element
-
setOnstalled
Sets theonstalled
event handler for this element.- Parameters:
onstalled
- theonstalled
event handler for this element
-
getOnsubmit
public org.htmlunit.corejs.javascript.Function getOnsubmit()Returns theonsubmit
event handler for this element.- Returns:
- the
onsubmit
event handler for this element
-
setOnsubmit
Sets theonsubmit
event handler for this element.- Parameters:
onsubmit
- theonsubmit
event handler for this element
-
getOnsuspend
public org.htmlunit.corejs.javascript.Function getOnsuspend()Returns theonsuspend
event handler for this element.- Returns:
- the
onsuspend
event handler for this element
-
setOnsuspend
Sets theonsuspend
event handler for this element.- Parameters:
onsuspend
- theonsuspend
event handler for this element
-
getOntimeupdate
public org.htmlunit.corejs.javascript.Function getOntimeupdate()Returns theontimeupdate
event handler for this element.- Returns:
- the
ontimeupdate
event handler for this element
-
setOntimeupdate
Sets theontimeupdate
event handler for this element.- Parameters:
ontimeupdate
- theontimeupdate
event handler for this element
-
getOntoggle
public org.htmlunit.corejs.javascript.Function getOntoggle()Returns theontoggle
event handler for this element.- Returns:
- the
ontoggle
event handler for this element
-
setOntoggle
Sets theontoggle
event handler for this element.- Parameters:
ontoggle
- theontoggle
event handler for this element
-
getOnvolumechange
public org.htmlunit.corejs.javascript.Function getOnvolumechange()Returns theonvolumechange
event handler for this element.- Returns:
- the
onvolumechange
event handler for this element
-
setOnvolumechange
Sets theonvolumechange
event handler for this element.- Parameters:
onvolumechange
- theonvolumechange
event handler for this element
-
getOnwaiting
public org.htmlunit.corejs.javascript.Function getOnwaiting()Returns theonwaiting
event handler for this element.- Returns:
- the
onwaiting
event handler for this element
-
setOnwaiting
Sets theonwaiting
event handler for this element.- Parameters:
onwaiting
- theonwaiting
event handler for this element
-
getOnwebkitfullscreenchange
public org.htmlunit.corejs.javascript.Function getOnwebkitfullscreenchange()Returns theonwebkitfullscreenchange
event handler for this element.- Returns:
- the
onwebkitfullscreenchange
event handler for this element
-
setOnwebkitfullscreenchange
Sets theonwebkitfullscreenchange
event handler for this element.- Parameters:
onwebkitfullscreenchange
- theonwebkitfullscreenchange
event handler for this element
-
getOnwebkitfullscreenerror
public org.htmlunit.corejs.javascript.Function getOnwebkitfullscreenerror()Returns theonwebkitfullscreenerror
event handler for this element.- Returns:
- the
onwebkitfullscreenerror
event handler for this element
-
setOnwebkitfullscreenerror
Sets theonwebkitfullscreenerror
event handler for this element.- Parameters:
onwebkitfullscreenerror
- theonwebkitfullscreenerror
event handler for this element
-
getOnwheel
public org.htmlunit.corejs.javascript.Function getOnwheel()Returns theonwheel
event handler for this element.- Returns:
- the
onwheel
event handler for this element
-
setOnwheel
Sets theonwheel
event handler for this element.- Parameters:
onwheel
- theonwheel
event handler for this element
-
getOnafterscriptexecute
public org.htmlunit.corejs.javascript.Function getOnafterscriptexecute()Returns theonafterscriptexecute
event handler for this element.- Returns:
- the
onafterscriptexecute
event handler for this element
-
setOnafterscriptexecute
Sets theonafterscriptexecute
event handler for this element.- Parameters:
onafterscriptexecute
- theonafterscriptexecute
event handler for this element
-
getOnbeforescriptexecute
public org.htmlunit.corejs.javascript.Function getOnbeforescriptexecute()Returns theonbeforescriptexecute
event handler for this element.- Returns:
- the
onbeforescriptexecute
event handler for this element
-
setOnbeforescriptexecute
Sets theonbeforescriptexecute
event handler for this element.- Parameters:
onbeforescriptexecute
- theonbeforescriptexecute
event handler for this element
-
getOnmozfullscreenchange
public org.htmlunit.corejs.javascript.Function getOnmozfullscreenchange()Returns theonmozfullscreenchange
event handler for this element.- Returns:
- the
onmozfullscreenchange
event handler for this element
-
setOnmozfullscreenchange
Sets theonmozfullscreenchange
event handler for this element.- Parameters:
onmozfullscreenchange
- theonmozfullscreenchange
event handler for this element
-
getOnmozfullscreenerror
public org.htmlunit.corejs.javascript.Function getOnmozfullscreenerror()Returns theonmozfullscreenerror
event handler for this element.- Returns:
- the
onmozfullscreenerror
event handler for this element
-
setOnmozfullscreenerror
Sets theonmozfullscreenerror
event handler for this element.- Parameters:
onmozfullscreenerror
- theonmozfullscreenerror
event handler for this element
-
getCurrentScript
public org.htmlunit.corejs.javascript.ScriptableObject getCurrentScript()- Returns:
- the
currentScript
-
setCurrentScript
public void setCurrentScript(org.htmlunit.corejs.javascript.ScriptableObject script) - Parameters:
script
- thecurrentScript
-
getFonts
public org.htmlunit.corejs.javascript.ScriptableObject getFonts()- Returns:
- the
FontFaceSet
-
getAll
Returns the value of theall
property.- Returns:
- the value of the
all
property
-
getElementById
Returns the element with the specified ID, as long as it is an HTML element;null
otherwise.- Parameters:
id
- the ID to search for- Returns:
- the element with the specified ID, as long as it is an HTML element;
null
otherwise
-
createProcessingInstruction
Creates a new ProcessingInstruction.- Parameters:
target
- the targetdata
- the data- Returns:
- the new ProcessingInstruction
-
createCDATASection
Creates a new createCDATASection.- Parameters:
data
- the data- Returns:
- the new CDATASection
-
clear
public void clear()Does... nothing.- See Also:
-
contains
Checks whether the given element is contained within this object. -
generateBlobUrl
Generate and return the URL for the given blob.- Parameters:
blob
- the Blob containing the data- Returns:
- the URL
URL.createObjectURL(Object)
-
resolveBlobUrl
- Parameters:
url
- the url to resolve- Returns:
- the Blob for the given URL or
null
if not found.
-
revokeBlobUrl
Revokes the URL for the given blob.- Parameters:
url
- the url to revokeURL.revokeObjectURL(Scriptable)
-