public class Element extends Node
Element
.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
Constructor and Description |
---|
Element()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
static void |
after(net.sourceforge.htmlunit.corejs.javascript.Context context,
net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj,
Object[] args,
net.sourceforge.htmlunit.corejs.javascript.Function function)
Inserts a set of Node or DOMString objects in the children list of this ChildNode's parent,
just after this ChildNode.
|
static void |
before(net.sourceforge.htmlunit.corejs.javascript.Context context,
net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj,
Object[] args,
net.sourceforge.htmlunit.corejs.javascript.Function function)
Inserts a set of Node or DOMString objects in the children list of this ChildNode's parent,
just before this ChildNode.
|
protected NamedNodeMap |
createAttributesObject()
Creates the JS object for the property attributes.
|
protected void |
createEventHandler(String eventName,
String attrValue)
Create the event handler function from the attribute value.
|
protected TextRange |
createTextRange()
Creates a new TextRange object for this element.
|
Object |
get(String name,
net.sourceforge.htmlunit.corejs.javascript.Scriptable start)
Gets a named property from the object.
|
String |
getAttribute(String attributeName,
Integer flags)
Returns the value of the specified attribute.
|
Object |
getAttributeNode(String name)
Retrieves an attribute node by name.
|
Object |
getAttributeNodeNS(String namespaceURI,
String localName)
Returns the specified attribute.
|
String |
getAttributeNS(String namespaceURI,
String localName)
Gets the specified attribute.
|
NamedNodeMap |
getAttributes()
Returns the attributes of this XML element.
|
ClientRect |
getBoundingClientRect()
Retrieves an object that specifies the bounds of a collection of TextRectangle objects.
|
int |
getChildElementCount()
Returns the current number of child elements.
|
HTMLCollection |
getChildren()
Gets the children of the current node.
|
DOMTokenList |
getClassList()
Gets the token list of class attribute.
|
Object |
getClassName_js()
Returns the class defined for this element.
|
int |
getClientHeight()
Returns the
clientHeight attribute. |
int |
getClientLeft()
Returns the
clientLeft attribute. |
ClientRectList |
getClientRects()
Retrieves a collection of rectangles that describes the layout of the contents of an object
or range within the client.
|
int |
getClientTop()
Returns
clientTop attribute. |
int |
getClientWidth()
Returns the
clientWidth attribute. |
DomElement |
getDomNodeOrDie()
Returns the DOM node that corresponds to this JavaScript object or throw
an exception if one cannot be found.
|
HTMLCollection |
getElementsByClassName(String className)
Returns all the descendant elements with the specified class.
|
HTMLCollection |
getElementsByTagName(String tagName)
Returns all the descendant elements with the specified tag name.
|
Object |
getElementsByTagNameNS(Object namespaceURI,
String localName)
Returns a list of elements with the given tag name belonging to the given namespace.
|
Element |
getFirstElementChild()
Returns the first element child.
|
String |
getId()
Returns the element ID.
|
String |
getInnerHTML()
Gets the
innerHTML attribute. |
protected String |
getInnerHTML(DomNode domNode)
Helper for getInnerHtml (to be reuses bei HTMLTemplate.
|
Element |
getLastElementChild()
Returns the last element child.
|
Object |
getLocalName()
Returns the local name of this attribute.
|
Object |
getNamespaceURI()
Returns the URI that identifies an XML namespace.
|
Element |
getNextElementSibling()
Returns the next element sibling.
|
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnbeforecopy()
Returns the
onbeforecopy event handler for this element. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnbeforecut()
Returns the
onbeforecut event handler for this element. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnbeforepaste()
Returns the
onbeforepaste event handler for this element. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOncopy()
Returns the
oncopy event handler for this element. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOncut()
Returns the
oncut event handler for this element. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOngotpointercapture()
Returns the
ongotpointercapture event handler for this element. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnlostpointercapture()
Returns the
onlostpointercapture event handler for this element. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnmsgesturechange()
Returns the
onmsgesturechange event handler for this element. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnmsgesturedoubletap()
Returns the
onmsgesturedoubletap event handler for this element. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnmsgestureend()
Returns the
onmsgestureend event handler for this element. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnmsgesturehold()
Returns the
onmsgesturehold event handler for this element. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnmsgesturestart()
Returns the
onmsgesturestart event handler for this element. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnmsgesturetap()
Returns the
onmsgesturetap event handler for this element. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnmsgotpointercapture()
Returns the
onmsgotpointercapture event handler for this element. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnmsinertiastart()
Returns the
onmsinertiastart event handler for this element. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnmslostpointercapture()
Returns the
onmslostpointercapture event handler for this element. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnmspointercancel()
Returns the
onmspointercancel event handler for this element. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnmspointerdown()
Returns the
onmspointerdown event handler for this element. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnmspointerenter()
Returns the
onmspointerenter event handler for this element. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnmspointerleave()
Returns the
onmspointerleave event handler for this element. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnmspointermove()
Returns the
onmspointermove event handler for this element. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnmspointerout()
Returns the
onmspointerout event handler for this element. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnmspointerover()
Returns the
onmspointerover event handler for this element. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnmspointerup()
Returns the
onmspointerup event handler for this element. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnpaste()
Returns the
onpaste event handler for this element. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnpointercancel()
Returns the
onpointercancel event handler for this element. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnpointerdown()
Returns the
onpointerdown event handler for this element. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnpointerenter()
Returns the
onpointerenter event handler for this element. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnpointerleave()
Returns the
onpointerleave event handler for this element. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnpointermove()
Returns the
onpointermove event handler for this element. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnpointerout()
Returns the
onpointerout event handler for this element. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnpointerover()
Returns the
onpointerover event handler for this element. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnpointerup()
Returns the
onpointerup event handler for this element. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnsearch()
Returns the
onsearch event handler for this element. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnselectstart()
Returns the
onselectstart event handler for this element. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnwebkitfullscreenchange()
Returns the
onwebkitfullscreenchange event handler for this element. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnwebkitfullscreenerror()
Returns the
onwebkitfullscreenerror event handler for this element. |
net.sourceforge.htmlunit.corejs.javascript.Function |
getOnwheel()
Returns the
onwheel event handler for this element. |
String |
getOuterHTML()
Gets the outerHTML of the node.
|
Element |
getParentElement()
Gets the first ancestor instance of
Element . |
Object |
getPrefix()
Returns the namespace prefix.
|
Element |
getPreviousElementSibling()
Returns the previous element sibling.
|
int |
getScrollHeight()
Gets the scrollHeight for this element.
|
int |
getScrollLeft()
Gets the scrollLeft value for this element.
|
int |
getScrollTop()
Gets the scrollTop value for this element.
|
int |
getScrollWidth()
Gets the scrollWidth for this element.
|
protected CSSStyleDeclaration |
getStyle()
Returns the style object for this element.
|
String |
getTagName()
Returns the tag name of this element.
|
boolean |
hasAttribute(String name)
Returns true when an attribute with a given name is specified on this element or has a default value.
|
boolean |
hasAttributeNS(String namespaceURI,
String localName)
Test for attribute.
|
boolean |
hasAttributes()
Returns true when the current element has any attributes or not.
|
Object |
insertAdjacentElement(String where,
Object insertedElement)
Inserts the given element into the element at the location.
|
void |
insertAdjacentHTML(String position,
String text)
Parses the given text as HTML or XML and inserts the resulting nodes into the tree in the position given by the
position argument.
|
void |
insertAdjacentText(String where,
String text)
Inserts the given text into the element at the specified location.
|
protected boolean |
isDisplayNone()
Returns whether the
display is none or not. |
protected boolean |
isEndTagForbidden()
Returns whether the end tag is forbidden or not.
|
static boolean |
matches(net.sourceforge.htmlunit.corejs.javascript.Context context,
net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj,
Object[] args,
net.sourceforge.htmlunit.corejs.javascript.Function function)
Returns true if the element would be selected by the specified selector string; otherwise, returns false.
|
static boolean |
mozMatchesSelector(net.sourceforge.htmlunit.corejs.javascript.Context context,
net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj,
Object[] args,
net.sourceforge.htmlunit.corejs.javascript.Function function)
Returns true if the element would be selected by the specified selector string; otherwise, returns false.
|
static boolean |
msMatchesSelector(net.sourceforge.htmlunit.corejs.javascript.Context context,
net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj,
Object[] args,
net.sourceforge.htmlunit.corejs.javascript.Function function)
Returns true if the element would be selected by the specified selector string; otherwise, returns false.
|
protected void |
printChildren(StringBuilder builder,
DomNode node,
boolean html)
Helper for getting code back from nodes.
|
Node |
querySelector(String selectors)
Returns the first element within the document that matches the specified group of selectors.
|
NodeList |
querySelectorAll(String selectors)
Retrieves all element nodes from descendants of the starting element node that match any selector
within the supplied selector strings.
|
void |
remove()
Removes the DOM node from its parent.
|
void |
removeAttribute(String name)
Removes the specified attribute.
|
void |
removeAttributeNode(Attr attribute)
Removes the specified attribute.
|
void |
removeAttributeNS(String namespaceURI,
String localName)
Removes the specified attribute.
|
static void |
replaceWith(net.sourceforge.htmlunit.corejs.javascript.Context context,
net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj,
Object[] args,
net.sourceforge.htmlunit.corejs.javascript.Function function)
Replaces the node wit a set of Node or DOMString objects.
|
void |
scrollIntoView()
Implement the
scrollIntoView() JavaScript function but don't actually do
anything. |
void |
scrollIntoViewIfNeeded()
Implement the
scrollIntoViewIfNeeded() JavaScript function but don't actually do
anything. |
void |
setAttribute(String name,
String value)
Sets an attribute.
|
Attr |
setAttributeNode(Attr newAtt)
Sets the attribute node for the specified attribute.
|
void |
setAttributeNS(String namespaceURI,
String qualifiedName,
String value)
Sets the specified attribute.
|
void |
setClassName_js(String className)
Sets the class attribute for this element.
|
void |
setDefaults(ComputedCSSStyleDeclaration style)
Callback method which allows different HTML element types to perform custom
initialization of computed styles.
|
void |
setDomNode(DomNode domNode)
Sets the DOM node that corresponds to this JavaScript object.
|
void |
setId(String newId) |
void |
setInnerHTML(Object value)
Replaces all child elements of this element with the supplied value.
|
void |
setOnbeforecopy(Object onbeforecopy)
Sets the
onbeforecopy event handler for this element. |
void |
setOnbeforecut(Object onbeforecut)
Sets the
onbeforecut event handler for this element. |
void |
setOnbeforepaste(Object onbeforepaste)
Sets the
onbeforepaste event handler for this element. |
void |
setOncopy(Object oncopy)
Sets the
oncopy event handler for this element. |
void |
setOncut(Object oncut)
Sets the
oncut event handler for this element. |
void |
setOngotpointercapture(Object ongotpointercapture)
Sets the
ongotpointercapture event handler for this element. |
void |
setOnlostpointercapture(Object onlostpointercapture)
Sets the
onlostpointercapture event handler for this element. |
void |
setOnmsgesturechange(Object onmsgesturechange)
Sets the
onmsgesturechange event handler for this element. |
void |
setOnmsgesturedoubletap(Object onmsgesturedoubletap)
Sets the
onmsgesturedoubletap event handler for this element. |
void |
setOnmsgestureend(Object onmsgestureend)
Sets the
onmsgestureend event handler for this element. |
void |
setOnmsgesturehold(Object onmsgesturehold)
Sets the
onmsgesturehold event handler for this element. |
void |
setOnmsgesturestart(Object onmsgesturestart)
Sets the
onmsgesturestart event handler for this element. |
void |
setOnmsgesturetap(Object onmsgesturetap)
Sets the
onmsgesturetap event handler for this element. |
void |
setOnmsgotpointercapture(Object onmsgotpointercapture)
Sets the
onmsgotpointercapture event handler for this element. |
void |
setOnmsinertiastart(Object onmsinertiastart)
Sets the
onmsinertiastart event handler for this element. |
void |
setOnmslostpointercapture(Object onmslostpointercapture)
Sets the
onmslostpointercapture event handler for this element. |
void |
setOnmspointercancel(Object onmspointercancel)
Sets the
onmspointercancel event handler for this element. |
void |
setOnmspointerdown(Object onmspointerdown)
Sets the
onmspointerdown event handler for this element. |
void |
setOnmspointerenter(Object onmspointerenter)
Sets the
onmspointerenter event handler for this element. |
void |
setOnmspointerleave(Object onmspointerleave)
Sets the
onmspointerleave event handler for this element. |
void |
setOnmspointermove(Object onmspointermove)
Sets the
onmspointermove event handler for this element. |
void |
setOnmspointerout(Object onmspointerout)
Sets the
onmspointerout event handler for this element. |
void |
setOnmspointerover(Object onmspointerover)
Sets the
onmspointerover event handler for this element. |
void |
setOnmspointerup(Object onmspointerup)
Sets the
onmspointerup event handler for this element. |
void |
setOnpaste(Object onpaste)
Sets the
onpaste event handler for this element. |
void |
setOnpointercancel(Object onpointercancel)
Sets the
onpointercancel event handler for this element. |
void |
setOnpointerdown(Object onpointerdown)
Sets the
onpointerdown event handler for this element. |
void |
setOnpointerenter(Object onpointerenter)
Sets the
onpointerenter event handler for this element. |
void |
setOnpointerleave(Object onpointerleave)
Sets the
onpointerleave event handler for this element. |
void |
setOnpointermove(Object onpointermove)
Sets the
onpointermove event handler for this element. |
void |
setOnpointerout(Object onpointerout)
Sets the
onpointerout event handler for this element. |
void |
setOnpointerover(Object onpointerover)
Sets the
onpointerover event handler for this element. |
void |
setOnpointerup(Object onpointerup)
Sets the
onpointerup event handler for this element. |
void |
setOnsearch(Object onsearch)
Sets the
onsearch event handler for this element. |
void |
setOnselectstart(Object onselectstart)
Sets the
onselectstart event handler for this element. |
void |
setOnwebkitfullscreenchange(Object onwebkitfullscreenchange)
Sets the
onwebkitfullscreenchange event handler for this element. |
void |
setOnwebkitfullscreenerror(Object onwebkitfullscreenerror)
Sets the
onwebkitfullscreenerror event handler for this element. |
void |
setOnwheel(Object onwheel)
Sets the
onwheel event handler for this element. |
void |
setOuterHTML(Object value)
Replaces this element (including all child elements) with the supplied value.
|
void |
setScrollLeft(int scroll)
Sets the scrollLeft value for this element.
|
void |
setScrollTop(int scroll)
Sets the scrollTop value for this element.
|
protected void |
setStyle(String style)
Sets the styles for this element.
|
static boolean |
webkitMatchesSelector(net.sourceforge.htmlunit.corejs.javascript.Context context,
net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj,
Object[] args,
net.sourceforge.htmlunit.corejs.javascript.Function function)
Returns true if the element would be selected by the specified selector string; otherwise, returns false.
|
appendChild, asJavaScriptException, cloneNode, compareDocumentPosition, contains, getBaseURI, getChildNodes, getFirstChild, getJavaScriptNode, getLastChild, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParent, getParentNode, getPreviousSibling, getTextContent, hasChildNodes, insertBefore, insertBeforeImpl, isSameNode, normalize, removeChild, replaceChild, setNodeValue, setTextContent
addEventListener, clearEventListenersContainer, dispatchEvent, executeEventLocally, fireEvent, getEventHandler, getEventListenersContainer, hasEventHandlers, isEventHandlerOnWindow, removeEventListener, setEventHandler
clone, equivalentValues, getBrowserVersion, getDefaultValue, getDomNodeOrNull, getPrototype, getScriptableFor, getStartingScope, getWindow, getWindow, getWithPreemption, has, hasInstance, initParentScope, isReadOnlySettable, makeScriptableFor, setCaseSensitive, setDomNode, setHtmlElement
defineFunctionProperties, defineProperty, getClassName, put, setClassName, setParentScope
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setExternalArrayData, setGetterOrSetter, setPrototype, size
public void setDomNode(DomNode domNode)
setDomNode
in class SimpleScriptable
domNode
- the DOM nodeprotected void createEventHandler(String eventName, String attrValue)
eventName
- the event name (ex: "onclick")attrValue
- the attribute valuepublic String getTagName()
public NamedNodeMap getAttributes()
getAttributes
in class Node
protected NamedNodeMap createAttributesObject()
public String getAttribute(String attributeName, Integer flags)
attributeName
- attribute nameflags
- IE-specific flags (see the MSDN documentation for more info)null
if the attribute is not definedpublic void setAttribute(String name, String value)
name
- Name of the attribute to setvalue
- Value to set the attribute topublic HTMLCollection getElementsByTagName(String tagName)
tagName
- the name to search forpublic Object getAttributeNode(String name)
name
- the name of the attribute to retrievenull
if there is no such attributepublic Object getElementsByTagNameNS(Object namespaceURI, String localName)
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.public boolean hasAttribute(String name)
name
- the name of the attribute to look forpublic boolean hasAttributes()
hasAttributes
in class Node
public DomElement getDomNodeOrDie()
getDomNodeOrDie
in class SimpleScriptable
public void removeAttribute(String name)
name
- the name of the attribute to removepublic ClientRect getBoundingClientRect()
public int getChildElementCount()
getChildElementCount
in class Node
public Element getFirstElementChild()
getFirstElementChild
in class Node
public Element getLastElementChild()
getLastElementChild
in class Node
public Element getNextElementSibling()
public Element getPreviousElementSibling()
public Element getParentElement()
Element
. It is mostly identical
to Node.getParent()
except that it skips non Element
nodes.getParentElement
in class Node
Node.getParent()
public void setDefaults(ComputedCSSStyleDeclaration style)
style
- the style to initializepublic HTMLCollection getChildren()
getChildren
in class Node
public DOMTokenList getClassList()
public String getAttributeNS(String namespaceURI, String localName)
namespaceURI
- the namespace URIlocalName
- the local name of the attribute to look fornull
if the attribute is not definedpublic boolean hasAttributeNS(String namespaceURI, String localName)
namespaceURI
- the namespace URIlocalName
- the local name of the attribute to look fortrue
if the node has this attributepublic void setAttributeNS(String namespaceURI, String qualifiedName, String value)
namespaceURI
- the namespace URIqualifiedName
- the qualified name of the attribute to look forvalue
- the new attribute valuepublic void removeAttributeNS(String namespaceURI, String localName)
namespaceURI
- the namespace URI of the attribute to removelocalName
- the local name of the attribute to removepublic Attr setAttributeNode(Attr newAtt)
newAtt
- the attribute to setpublic Object get(String name, net.sourceforge.htmlunit.corejs.javascript.Scriptable start)
SimpleScriptable.getWithPreemption(String)
.
get
in interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
get
in class SimpleScriptable
public NodeList querySelectorAll(String selectors)
selectors
- the selectorspublic Node querySelector(String selectors)
selectors
- the selectorspublic Object getClassName_js()
public void setClassName_js(String className)
className
- the new class namepublic int getClientHeight()
clientHeight
attribute.clientHeight
attributepublic int getClientWidth()
clientWidth
attribute.clientWidth
attributepublic int getClientLeft()
clientLeft
attribute.clientLeft
attributepublic int getClientTop()
clientTop
attribute.clientTop
attributepublic Object getAttributeNodeNS(String namespaceURI, String localName)
namespaceURI
- the namespace URIlocalName
- the local name of the attribute to look fornull
if the attribute is not definedpublic HTMLCollection getElementsByClassName(String className)
className
- the name to search forpublic ClientRectList getClientRects()
protected final boolean isDisplayNone()
display
is none
or not.display
is none
or notprotected TextRange createTextRange()
public Object insertAdjacentElement(String where, Object insertedElement)
where
- specifies where to insert the element, using one of the following values (case-insensitive):
beforebegin, afterbegin, beforeend, afterendinsertedElement
- the element to be insertedpublic void insertAdjacentText(String where, String text)
where
- specifies where to insert the text, using one of the following values (case-insensitive):
beforebegin, afterbegin, beforeend, afterendtext
- the text to insertpublic void insertAdjacentHTML(String position, String text)
position
- specifies where to insert the nodes, using one of the following values (case-insensitive):
beforebegin
, afterbegin
, beforeend
, afterend
text
- the text to parsepublic String getInnerHTML()
innerHTML
attribute.public void setInnerHTML(Object value)
value
- the new value for the contents of this elementprotected String getInnerHTML(DomNode domNode)
domNode
- the nodepublic String getOuterHTML()
public void setOuterHTML(Object value)
value
- the new value for replacing this elementprotected void printChildren(StringBuilder builder, DomNode node, boolean html)
builder
- the builder to write tonode
- the node to be serializedhtml
- flagprotected boolean isEndTagForbidden()
public String getId()
public void setId(String newId)
public void removeAttributeNode(Attr attribute)
attribute
- the attribute to removepublic int getScrollTop()
public void setScrollTop(int scroll)
scroll
- the scrollTop value for this elementpublic int getScrollLeft()
public void setScrollLeft(int scroll)
scroll
- the scrollLeft value for this elementpublic int getScrollHeight()
public int getScrollWidth()
protected CSSStyleDeclaration getStyle()
protected void setStyle(String style)
style
- the style of the elementpublic void scrollIntoView()
scrollIntoView()
JavaScript function but don't actually do
anything. The requirement
is just to prevent scripts that call that method from failingpublic void scrollIntoViewIfNeeded()
scrollIntoViewIfNeeded()
JavaScript function but don't actually do
anything.public Object getPrefix()
public Object getLocalName()
getLocalName
in class Node
public Object getNamespaceURI()
getNamespaceURI
in class Node
public net.sourceforge.htmlunit.corejs.javascript.Function getOnbeforecopy()
onbeforecopy
event handler for this element.onbeforecopy
event handler for this elementpublic void setOnbeforecopy(Object onbeforecopy)
onbeforecopy
event handler for this element.onbeforecopy
- the onbeforecopy
event handler for this elementpublic net.sourceforge.htmlunit.corejs.javascript.Function getOnbeforecut()
onbeforecut
event handler for this element.onbeforecut
event handler for this elementpublic void setOnbeforecut(Object onbeforecut)
onbeforecut
event handler for this element.onbeforecut
- the onbeforecut
event handler for this elementpublic net.sourceforge.htmlunit.corejs.javascript.Function getOnbeforepaste()
onbeforepaste
event handler for this element.onbeforepaste
event handler for this elementpublic void setOnbeforepaste(Object onbeforepaste)
onbeforepaste
event handler for this element.onbeforepaste
- the onbeforepaste
event handler for this elementpublic net.sourceforge.htmlunit.corejs.javascript.Function getOncopy()
oncopy
event handler for this element.oncopy
event handler for this elementpublic void setOncopy(Object oncopy)
oncopy
event handler for this element.oncopy
- the oncopy
event handler for this elementpublic net.sourceforge.htmlunit.corejs.javascript.Function getOncut()
oncut
event handler for this element.oncut
event handler for this elementpublic void setOncut(Object oncut)
oncut
event handler for this element.oncut
- the oncut
event handler for this elementpublic net.sourceforge.htmlunit.corejs.javascript.Function getOnpaste()
onpaste
event handler for this element.onpaste
event handler for this elementpublic void setOnpaste(Object onpaste)
onpaste
event handler for this element.onpaste
- the onpaste
event handler for this elementpublic net.sourceforge.htmlunit.corejs.javascript.Function getOnsearch()
onsearch
event handler for this element.onsearch
event handler for this elementpublic void setOnsearch(Object onsearch)
onsearch
event handler for this element.onsearch
- the onsearch
event handler for this elementpublic net.sourceforge.htmlunit.corejs.javascript.Function getOnselectstart()
onselectstart
event handler for this element.onselectstart
event handler for this elementpublic void setOnselectstart(Object onselectstart)
onselectstart
event handler for this element.onselectstart
- the onselectstart
event handler for this elementpublic net.sourceforge.htmlunit.corejs.javascript.Function getOnwebkitfullscreenchange()
onwebkitfullscreenchange
event handler for this element.onwebkitfullscreenchange
event handler for this elementpublic void setOnwebkitfullscreenchange(Object onwebkitfullscreenchange)
onwebkitfullscreenchange
event handler for this element.onwebkitfullscreenchange
- the onwebkitfullscreenchange
event handler for this elementpublic net.sourceforge.htmlunit.corejs.javascript.Function getOnwebkitfullscreenerror()
onwebkitfullscreenerror
event handler for this element.onwebkitfullscreenerror
event handler for this elementpublic void setOnwebkitfullscreenerror(Object onwebkitfullscreenerror)
onwebkitfullscreenerror
event handler for this element.onwebkitfullscreenerror
- the onwebkitfullscreenerror
event handler for this elementpublic net.sourceforge.htmlunit.corejs.javascript.Function getOnwheel()
onwheel
event handler for this element.onwheel
event handler for this elementpublic void setOnwheel(Object onwheel)
onwheel
event handler for this element.onwheel
- the onwheel
event handler for this elementpublic net.sourceforge.htmlunit.corejs.javascript.Function getOngotpointercapture()
ongotpointercapture
event handler for this element.ongotpointercapture
event handler for this elementpublic void setOngotpointercapture(Object ongotpointercapture)
ongotpointercapture
event handler for this element.ongotpointercapture
- the ongotpointercapture
event handler for this elementpublic net.sourceforge.htmlunit.corejs.javascript.Function getOnlostpointercapture()
onlostpointercapture
event handler for this element.onlostpointercapture
event handler for this elementpublic void setOnlostpointercapture(Object onlostpointercapture)
onlostpointercapture
event handler for this element.onlostpointercapture
- the onlostpointercapture
event handler for this elementpublic net.sourceforge.htmlunit.corejs.javascript.Function getOnmsgesturechange()
onmsgesturechange
event handler for this element.onmsgesturechange
event handler for this elementpublic void setOnmsgesturechange(Object onmsgesturechange)
onmsgesturechange
event handler for this element.onmsgesturechange
- the onmsgesturechange
event handler for this elementpublic net.sourceforge.htmlunit.corejs.javascript.Function getOnmsgesturedoubletap()
onmsgesturedoubletap
event handler for this element.onmsgesturedoubletap
event handler for this elementpublic void setOnmsgesturedoubletap(Object onmsgesturedoubletap)
onmsgesturedoubletap
event handler for this element.onmsgesturedoubletap
- the onmsgesturedoubletap
event handler for this elementpublic net.sourceforge.htmlunit.corejs.javascript.Function getOnmsgestureend()
onmsgestureend
event handler for this element.onmsgestureend
event handler for this elementpublic void setOnmsgestureend(Object onmsgestureend)
onmsgestureend
event handler for this element.onmsgestureend
- the onmsgestureend
event handler for this elementpublic net.sourceforge.htmlunit.corejs.javascript.Function getOnmsgesturehold()
onmsgesturehold
event handler for this element.onmsgesturehold
event handler for this elementpublic void setOnmsgesturehold(Object onmsgesturehold)
onmsgesturehold
event handler for this element.onmsgesturehold
- the onmsgesturehold
event handler for this elementpublic net.sourceforge.htmlunit.corejs.javascript.Function getOnmsgesturestart()
onmsgesturestart
event handler for this element.onmsgesturestart
event handler for this elementpublic void setOnmsgesturestart(Object onmsgesturestart)
onmsgesturestart
event handler for this element.onmsgesturestart
- the onmsgesturestart
event handler for this elementpublic net.sourceforge.htmlunit.corejs.javascript.Function getOnmsgesturetap()
onmsgesturetap
event handler for this element.onmsgesturetap
event handler for this elementpublic void setOnmsgesturetap(Object onmsgesturetap)
onmsgesturetap
event handler for this element.onmsgesturetap
- the onmsgesturetap
event handler for this elementpublic net.sourceforge.htmlunit.corejs.javascript.Function getOnmsgotpointercapture()
onmsgotpointercapture
event handler for this element.onmsgotpointercapture
event handler for this elementpublic void setOnmsgotpointercapture(Object onmsgotpointercapture)
onmsgotpointercapture
event handler for this element.onmsgotpointercapture
- the onmsgotpointercapture
event handler for this elementpublic net.sourceforge.htmlunit.corejs.javascript.Function getOnmsinertiastart()
onmsinertiastart
event handler for this element.onmsinertiastart
event handler for this elementpublic void setOnmsinertiastart(Object onmsinertiastart)
onmsinertiastart
event handler for this element.onmsinertiastart
- the onmsinertiastart
event handler for this elementpublic net.sourceforge.htmlunit.corejs.javascript.Function getOnmslostpointercapture()
onmslostpointercapture
event handler for this element.onmslostpointercapture
event handler for this elementpublic void setOnmslostpointercapture(Object onmslostpointercapture)
onmslostpointercapture
event handler for this element.onmslostpointercapture
- the onmslostpointercapture
event handler for this elementpublic net.sourceforge.htmlunit.corejs.javascript.Function getOnmspointercancel()
onmspointercancel
event handler for this element.onmspointercancel
event handler for this elementpublic void setOnmspointercancel(Object onmspointercancel)
onmspointercancel
event handler for this element.onmspointercancel
- the onmspointercancel
event handler for this elementpublic net.sourceforge.htmlunit.corejs.javascript.Function getOnmspointerdown()
onmspointerdown
event handler for this element.onmspointerdown
event handler for this elementpublic void setOnmspointerdown(Object onmspointerdown)
onmspointerdown
event handler for this element.onmspointerdown
- the onmspointerdown
event handler for this elementpublic net.sourceforge.htmlunit.corejs.javascript.Function getOnmspointerenter()
onmspointerenter
event handler for this element.onmspointerenter
event handler for this elementpublic void setOnmspointerenter(Object onmspointerenter)
onmspointerenter
event handler for this element.onmspointerenter
- the onmspointerenter
event handler for this elementpublic net.sourceforge.htmlunit.corejs.javascript.Function getOnmspointerleave()
onmspointerleave
event handler for this element.onmspointerleave
event handler for this elementpublic void setOnmspointerleave(Object onmspointerleave)
onmspointerleave
event handler for this element.onmspointerleave
- the onmspointerleave
event handler for this elementpublic net.sourceforge.htmlunit.corejs.javascript.Function getOnmspointermove()
onmspointermove
event handler for this element.onmspointermove
event handler for this elementpublic void setOnmspointermove(Object onmspointermove)
onmspointermove
event handler for this element.onmspointermove
- the onmspointermove
event handler for this elementpublic net.sourceforge.htmlunit.corejs.javascript.Function getOnmspointerout()
onmspointerout
event handler for this element.onmspointerout
event handler for this elementpublic void setOnmspointerout(Object onmspointerout)
onmspointerout
event handler for this element.onmspointerout
- the onmspointerout
event handler for this elementpublic net.sourceforge.htmlunit.corejs.javascript.Function getOnmspointerover()
onmspointerover
event handler for this element.onmspointerover
event handler for this elementpublic void setOnmspointerover(Object onmspointerover)
onmspointerover
event handler for this element.onmspointerover
- the onmspointerover
event handler for this elementpublic net.sourceforge.htmlunit.corejs.javascript.Function getOnmspointerup()
onmspointerup
event handler for this element.onmspointerup
event handler for this elementpublic void setOnmspointerup(Object onmspointerup)
onmspointerup
event handler for this element.onmspointerup
- the onmspointerup
event handler for this elementpublic net.sourceforge.htmlunit.corejs.javascript.Function getOnpointercancel()
onpointercancel
event handler for this element.onpointercancel
event handler for this elementpublic void setOnpointercancel(Object onpointercancel)
onpointercancel
event handler for this element.onpointercancel
- the onpointercancel
event handler for this elementpublic net.sourceforge.htmlunit.corejs.javascript.Function getOnpointerdown()
onpointerdown
event handler for this element.onpointerdown
event handler for this elementpublic void setOnpointerdown(Object onpointerdown)
onpointerdown
event handler for this element.onpointerdown
- the onpointerdown
event handler for this elementpublic net.sourceforge.htmlunit.corejs.javascript.Function getOnpointerenter()
onpointerenter
event handler for this element.onpointerenter
event handler for this elementpublic void setOnpointerenter(Object onpointerenter)
onpointerenter
event handler for this element.onpointerenter
- the onpointerenter
event handler for this elementpublic net.sourceforge.htmlunit.corejs.javascript.Function getOnpointerleave()
onpointerleave
event handler for this element.onpointerleave
event handler for this elementpublic void setOnpointerleave(Object onpointerleave)
onpointerleave
event handler for this element.onpointerleave
- the onpointerleave
event handler for this elementpublic net.sourceforge.htmlunit.corejs.javascript.Function getOnpointermove()
onpointermove
event handler for this element.onpointermove
event handler for this elementpublic void setOnpointermove(Object onpointermove)
onpointermove
event handler for this element.onpointermove
- the onpointermove
event handler for this elementpublic net.sourceforge.htmlunit.corejs.javascript.Function getOnpointerout()
onpointerout
event handler for this element.onpointerout
event handler for this elementpublic void setOnpointerout(Object onpointerout)
onpointerout
event handler for this element.onpointerout
- the onpointerout
event handler for this elementpublic net.sourceforge.htmlunit.corejs.javascript.Function getOnpointerover()
onpointerover
event handler for this element.onpointerover
event handler for this elementpublic void setOnpointerover(Object onpointerover)
onpointerover
event handler for this element.onpointerover
- the onpointerover
event handler for this elementpublic net.sourceforge.htmlunit.corejs.javascript.Function getOnpointerup()
onpointerup
event handler for this element.onpointerup
event handler for this elementpublic void setOnpointerup(Object onpointerup)
onpointerup
event handler for this element.onpointerup
- the onpointerup
event handler for this elementpublic void remove()
remove
in class Node
public static void before(net.sourceforge.htmlunit.corejs.javascript.Context context, net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, net.sourceforge.htmlunit.corejs.javascript.Function function)
context
- the contextthisObj
- this objectargs
- the argumentsfunction
- the functionpublic static void after(net.sourceforge.htmlunit.corejs.javascript.Context context, net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, net.sourceforge.htmlunit.corejs.javascript.Function function)
context
- the contextthisObj
- this objectargs
- the argumentsfunction
- the functionpublic static void replaceWith(net.sourceforge.htmlunit.corejs.javascript.Context context, net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, net.sourceforge.htmlunit.corejs.javascript.Function function)
context
- the contextthisObj
- this objectargs
- the argumentsfunction
- the functionpublic static boolean matches(net.sourceforge.htmlunit.corejs.javascript.Context context, net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, net.sourceforge.htmlunit.corejs.javascript.Function function)
context
- the JavaScript contextthisObj
- the scriptableargs
- the arguments passed into the methodfunction
- the functionpublic static boolean mozMatchesSelector(net.sourceforge.htmlunit.corejs.javascript.Context context, net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, net.sourceforge.htmlunit.corejs.javascript.Function function)
context
- the JavaScript contextthisObj
- the scriptableargs
- the arguments passed into the methodfunction
- the functionpublic static boolean webkitMatchesSelector(net.sourceforge.htmlunit.corejs.javascript.Context context, net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, net.sourceforge.htmlunit.corejs.javascript.Function function)
context
- the JavaScript contextthisObj
- the scriptableargs
- the arguments passed into the methodfunction
- the functionpublic static boolean msMatchesSelector(net.sourceforge.htmlunit.corejs.javascript.Context context, net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, net.sourceforge.htmlunit.corejs.javascript.Function function)
context
- the JavaScript contextthisObj
- the scriptableargs
- the arguments passed into the methodfunction
- the functionCopyright © 2002–2017 Gargoyle Software Inc.. All rights reserved.