|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.htmlunit.corejs.javascript.ScriptableObject
com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
com.gargoylesoftware.htmlunit.javascript.host.Node
com.gargoylesoftware.htmlunit.javascript.host.EventNode
com.gargoylesoftware.htmlunit.javascript.host.Element
com.gargoylesoftware.htmlunit.javascript.host.html.HTMLElement
public class HTMLElement
The JavaScript object "HTMLElement" which is the base class for all HTML
objects. This will typically wrap an instance of HtmlElement.
| Nested Class Summary | |
|---|---|
static class |
HTMLElement.ProxyDomNode
ProxyDomNode. |
| Field Summary | |
|---|---|
static int |
BEHAVIOR_ID_CLIENT_CAPS
BEHAVIOR_ID_CLIENT_CAPS. |
static int |
BEHAVIOR_ID_DOWNLOAD
BEHAVIOR_ID_DOWNLOAD. |
static int |
BEHAVIOR_ID_HOMEPAGE
BEHAVIOR_ID_HOMEPAGE. |
| Fields inherited from class com.gargoylesoftware.htmlunit.javascript.host.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 net.sourceforge.htmlunit.corejs.javascript.ScriptableObject |
|---|
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST |
| Fields inherited from interface net.sourceforge.htmlunit.corejs.javascript.Scriptable |
|---|
NOT_FOUND |
| Constructor Summary | |
|---|---|
HTMLElement()
|
|
| Method Summary | |
|---|---|
int |
addBehavior(String behavior)
Adds the specified behavior to this HTML element. |
void |
addComponentRequest(String id,
String idType,
String minVersion)
Adds the specified component to the queue of components to be installed. |
void |
blur()
Remove focus from this element. |
void |
clearAttributes()
An IE-only method which clears all custom attributes. |
void |
clearComponentRequest()
Clears the component install queue of all component requests. |
void |
click()
Click this element. |
int |
compareVersions(String v1,
String v2)
Compares the two specified version numbers. |
boolean |
contains(HTMLElement element)
Checks whether the given element is contained within this object. |
protected void |
createEventHandler(String eventName,
String attrValue)
Create the event handler function from the attribute value. |
Object |
createTextRange()
Creates a new TextRange object for this element. |
boolean |
dispatchEvent(Event event)
Dispatches an event into the event system (standards-conformant browsers only). |
boolean |
doComponentRequest()
Downloads all the components queued via addComponentRequest(String, String, String). |
void |
doScroll(String scrollAction)
Simulates a click on a scrollbar component (IE only). |
protected String |
fixAttributeName(String attributeName)
For IE, foo.getAttribute(x) uses same names as foo.x. |
void |
focus()
Sets the focus to this element. |
Object |
get(String name,
net.sourceforge.htmlunit.corejs.javascript.Scriptable start)
Gets a named property from the object. |
String |
getAccessKey()
Returns the "accessKey" property. |
protected String |
getAlign(boolean returnInvalidValues)
Returns the value of the "align" property. |
HTMLCollection |
getAll()
Returns the value of the "all" property. |
Object |
getAttribute(String attributeName,
Integer flags)
Returns the value of the specified attribute. |
Object |
getAttributeNode(String attributeName)
Gets the attribute node for the specified attribute. |
Object |
getAttributeNodeNS(String namespaceURI,
String localName)
Returns the specified attribute. |
int |
getAvailHeight()
Returns the screen's available height. |
int |
getAvailWidth()
Returns the screen's available width. |
ClientRect |
getBoundingClientRect()
Retrieves an object that specifies the bounds of a collection of TextRectangle objects. |
BoxObject |
getBoxObject()
Returns the BoxObject for this element. |
int |
getBufferDepth()
Returns the screen's buffer depth. |
protected String |
getCh()
Returns the value of the "ch" property. |
HTMLCollection |
getChildren()
Gets the children of the current node. |
protected String |
getChOff()
Returns the value of the "chOff" property. |
DOMTokenList |
getClassList()
Gets the token list of class attribute. |
Object |
getClassName_js()
Returns the class defined for this element. |
int |
getClientHeight()
Returns "clientHeight" attribute. |
int |
getClientLeft()
Returns "clientLeft" attribute. |
Object |
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 "clientWidth" attribute. |
int |
getColorDepth()
Returns the screen's color depth. |
String |
getComponentVersion(String id,
String idType)
Returns the version of the specified component. |
String |
getConnectionType()
Returns the connection type being used. |
boolean |
getCookieEnabled()
Returns true if cookies are enabled. |
String |
getCpuClass()
Returns the type of CPU used. |
ComputedCSSStyleDeclaration |
getCurrentStyle()
Returns the current (calculated) style object for this element. |
String |
getDir()
Returns the "dir" property. |
boolean |
getDisabled()
Returns true if this element is disabled. |
DocumentProxy |
getDocument()
Returns the document. |
HtmlElement |
getDomNodeOrDie()
Returns the DOM node that corresponds to this JavaScript object or throw an exception if one cannot be found. |
HtmlElement |
getDomNodeOrNull()
Returns the DOM node that corresponds to this JavaScript object or null if a node hasn't been set. |
HTMLCollection |
getElementsByClassName(String className)
Returns all the descendant elements with the specified class. |
Object |
getFilters()
Gets the filters. |
int |
getHeight()
Returns the screen's height. |
String |
getId()
Returns the element ID. |
String |
getInnerHTML()
Gets the innerHTML attribute. |
String |
getInnerText()
Gets the innerText attribute. |
boolean |
getJavaEnabled()
Returns true if Java is enabled. |
String |
getLang()
Returns the "lang" property. |
String |
getLanguage()
Returns the "language" property. |
String |
getLocalName()
Returns the local name of this element. |
String |
getNamespaceURI()
Returns The URI that identifies an XML namespace. |
String |
getNodeName()
Gets the JavaScript property "nodeName" for the current node. |
int |
getOffsetHeight()
Returns this element's offsetHeight, which is the element height plus the element's padding plus the element's border. |
int |
getOffsetLeft()
Returns this element's offsetLeft, which is the calculated left position of this element relative to the offsetParent. |
Object |
getOffsetParent_js()
Returns this element's offsetParent. |
int |
getOffsetTop()
Returns this element's offsetTop, which is the calculated top position of this element relative to the offsetParent. |
int |
getOffsetWidth()
Returns this element's offsetWidth, which is the element width plus the element's padding plus the element's border. |
String |
getOuterHTML()
Gets the outerHTML of the node. |
Element |
getParentElement()
Gets the first ancestor instance of Element. |
HTMLElement |
getParentHTMLElement()
Gets the first ancestor instance of HTMLElement. |
String |
getPlatform()
Returns the platform used. |
int |
getPosX()
Returns this element's X position. |
int |
getPosY()
Returns this element's Y position. |
String |
getPrefix()
Returns the namespace prefix. |
CSSStyleDeclaration |
getRuntimeStyle()
Returns the runtime style object for this element. |
String |
getScopeName()
Gets the namespace defined for the element. |
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. |
boolean |
getSpellcheck()
Returns the "spellcheck" property. |
CSSStyleDeclaration |
getStyle()
Returns the style object for this element. |
String |
getSystemLanguage()
Returns the system language. |
int |
getTabIndex()
Returns the value of the tabIndex attribute. |
String |
getTagName()
Returns the tag name of this element. |
String |
getTagUrn()
Gets the Uniform Resource Name (URN) specified in the namespace declaration. |
String |
getTitle()
Returns the element title. |
String |
getUniqueID()
Retrieves an auto-generated, unique identifier for the object. |
String |
getUserLanguage()
Returns the user language. |
protected String |
getVAlign(String[] valid,
String defaultValue)
Returns the value of the "vAlign" property. |
int |
getWidth()
Returns the screen's width. |
protected String |
getWidthOrHeight(String attributeName,
Boolean returnNegativeValues)
Returns the value of the specified attribute (width or height). |
Object |
getWithFallback(String name)
Looks at attributes with the given name. |
boolean |
hasAttribute(String name)
Returns true when an attribute with a given name is specified on this element or has a default value. |
Object |
insertAdjacentElement(String where,
Object object)
Inserts the given element into the element at the location. |
void |
insertAdjacentHTML(String where,
String text)
Inserts the given HTML text into the element at the location. |
protected boolean |
isAncestorOfEventTarget(MouseEvent event)
Returns true if this element's node is an ancestor of the specified event's target node. |
protected boolean |
isAttributeName(String name)
Indicates if this is the name of a well defined attribute that can be access as property. |
boolean |
isComponentInstalled(String id,
String idType,
String minVersion)
Returns true if the specified component is installed. |
boolean |
isHomePage(String url)
Returns true if the specified URL is the web client's current homepage and the document calling the method is on the same domain as the user's homepage. |
void |
mergeAttributes(HTMLElement source,
Object preserveIdentity)
An IE-only method which copies all custom attributes from the specified source element to this element. |
void |
navigateHomePage()
Causes the web client to navigate to the current home page. |
static void |
parseHtmlSnippet(DomNode target,
boolean append,
String source)
Parses the specified HTML source code, appending the resultant content at the specified target location. |
Node |
querySelector(String selectors)
Returns the first element within the document that matches the specified group of selectors. |
StaticNodeList |
querySelectorAll(String selectors)
Retrieves all element nodes from descendants of the starting element node that match any selector within the supplied selector strings. |
protected org.xml.sax.helpers.AttributesImpl |
readAttributes(HtmlElement element)
Gets the attributes of the element in the form of a Attributes. |
void |
removeAttributeNode(Attr attribute)
Removes the specified attribute. |
void |
removeBehavior(int id)
Removes the behavior corresponding to the specified identifier from this element. |
boolean |
removeExpression(String propertyName)
Removes the expression from the specified property. |
HTMLElement |
removeNode(boolean removeChildren)
Removes this object from the document hierarchy. |
void |
scrollIntoView()
Implement the scrollIntoView() JavaScript function but don't actually do anything. |
void |
setAccessKey(String accessKey)
Sets the "accessKey" property. |
void |
setActive()
Sets the object as active without setting focus to the object. |
protected void |
setAlign(String align,
boolean ignoreIfNoError)
Sets the value of the "align" property. |
void |
setAttribute(String name,
String value)
Sets an attribute. |
Attr |
setAttributeNode(Attr newAtt)
Sets the attribute node for the specified attribute. |
protected void |
setCh(String ch)
Sets the value of the "ch" property. |
protected void |
setChOff(String chOff)
Sets the value of the "chOff" property. |
void |
setClassName(String className)
Sets the class attribute for this element. |
protected void |
setColorAttribute(String name,
String value)
Sets the specified color attribute to the specified value. |
void |
setDir(String dir)
Sets the "dir" property. |
void |
setDisabled(boolean disabled)
Sets whether or not to disable this element. |
void |
setDomNode(DomNode domNode)
Sets the DOM node that corresponds to this JavaScript object. |
void |
setExpression(String propertyName,
String expression,
String language)
Sets an expression for the specified HTMLElement. |
void |
setHomePage(String url)
Sets the web client's current homepage. |
void |
setId(String newId)
Sets the identifier this element. |
void |
setInnerHTML(Object value)
Replace all children elements of this element with the supplied value. |
void |
setInnerText(String value)
Replace all children elements of this element with the supplied value. |
void |
setLang(String lang)
Sets the "lang" property. |
void |
setLanguage(String language)
Sets the "language" property. |
void |
setOuterHTML(String value)
Replace all children elements of this element 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. |
void |
setSpellcheck(boolean spellcheck)
Sets the "spellcheck" property. |
void |
setTabIndex(int tabIndex)
Sets the "tabIndex" property. |
void |
setTagUrn(String tagUrn)
Sets the Uniform Resource Name (URN) specified in the namespace declaration. |
void |
setTextContent(Object value)
Replace all children elements of this element with the supplied value. |
void |
setTitle(String newTitle)
Sets the title of this element. |
protected void |
setVAlign(Object vAlign,
String[] valid)
Sets the value of the "vAlign" property. |
protected void |
setWidthOrHeight(String attributeName,
String value,
Boolean allowNegativeValues)
Sets the value of the specified attribute (width or height). |
void |
startDownload(String uri,
net.sourceforge.htmlunit.corejs.javascript.Function callback)
Implementation of the IE behavior #default#download. |
String |
toString()
|
| Methods inherited from class com.gargoylesoftware.htmlunit.javascript.host.Element |
|---|
createAttributesObject, getAttributeNS, getAttributes, getBaseURI, getChildElementCount, getElementsByTagName, getElementsByTagNameNS, getFirstElementChild, getLastElementChild, getNextElementSibling, getPreviousElementSibling, getText, hasAttributeNS, removeAttribute, removeAttributeNS, selectNodes, selectSingleNode, setAttributeNS, setDefaults |
| Methods inherited from class com.gargoylesoftware.htmlunit.javascript.host.EventNode |
|---|
fireEvent, getOnblur, getOnclick, getOncontextmenu, getOndblclick, getOnerror, getOnfocus, getOnfocusin, getOnfocusout, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getOnpropertychange, getOnresize, setOnblur, setOnclick, setOncontextmenu, setOndblclick, setOnerror, setOnfocus, setOnfocusin, setOnfocusout, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setOnpropertychange, setOnresize |
| Methods inherited from class com.gargoylesoftware.htmlunit.javascript.host.Node |
|---|
addEventListener, appendChild, attachEvent, cloneNode, compareDocumentPosition, detachEvent, executeEvent, fireEvent, fireEvent, getChildNodes, getEventHandler, getEventHandlerProp, getFirstChild, getJavaScriptNode, getLastChild, getNextSibling, getNodeType, getNodeValue, getOwnerDocument, getParent, getParentNode, getPreviousSibling, getTextContent, getXml, hasChildNodes, hasEventHandlers, insertBefore, insertBeforeImpl, isSameNode, normalize, removeChild, removeEventListener, replaceChild, setEventHandler, setEventHandlerProp, setNodeValue |
| Methods inherited from class com.gargoylesoftware.htmlunit.javascript.SimpleScriptable |
|---|
clone, defineFunctionProperties, defineProperty, equivalentValues, getBrowserVersion, getClassName, getDefaultValue, getPrototype, getScriptableFor, getStartingScope, getTransformerScriptableFor, getWindow, getWindow, getWithPreemption, hasInstance, initParentScope, isReadOnlySettable, makeScriptableFor, setCaseSensitive, setDomNode, setHtmlElement |
| Methods inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject |
|---|
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, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype, size |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface net.sourceforge.htmlunit.corejs.javascript.Scriptable |
|---|
delete, delete, get, getClassName, getDefaultValue, getIds, getParentScope, getPrototype, has, has, hasInstance, put, put, setParentScope, setPrototype |
| Field Detail |
|---|
public static final int BEHAVIOR_ID_CLIENT_CAPS
public static final int BEHAVIOR_ID_HOMEPAGE
public static final int BEHAVIOR_ID_DOWNLOAD
| Constructor Detail |
|---|
public HTMLElement()
| Method Detail |
|---|
public HTMLCollection getAll()
public void setDomNode(DomNode domNode)
setDomNode in class NodedomNode - the DOM node
protected void createEventHandler(String eventName,
String attrValue)
eventName - the event name (ex: "onclick")attrValue - the attribute valuepublic String getId()
public void setId(String newId)
newId - the new identifier of this elementpublic String getTitle()
public void setTitle(String newTitle)
newTitle - the new identifier of this elementpublic boolean getDisabled()
public DocumentProxy getDocument()
public void setDisabled(boolean disabled)
disabled - True if this is to be disabledpublic String getNamespaceURI()
getNamespaceURI in class Nodepublic String getLocalName()
getLocalName in class Nodepublic Object getWithFallback(String name)
Scriptable object.
getWithFallback in interface ScriptableWithFallbackGettername - the name of the requested property
Scriptable.NOT_FOUND if nothing is foundprotected boolean isAttributeName(String name)
name - the name (case sensitive!)
false if no standard attribute exists with this nameprotected String fixAttributeName(String attributeName)
fixAttributeName in class ElementattributeName - the name
public void clearAttributes()
public void mergeAttributes(HTMLElement source,
Object preserveIdentity)
source - the source element from which to copy the custom attributespreserveIdentity - if false, the name and id attributes are not copied
public Object getAttributeNodeNS(String namespaceURI,
String localName)
namespaceURI - the namespace URIlocalName - the local name of the attribute to look for
null if the attribute is not defined
public void setAttribute(String name,
String value)
setAttribute in class Elementname - Name of the attribute to setvalue - Value to set the attribute topublic void removeAttributeNode(Attr attribute)
attribute - the attribute to removepublic HTMLElement removeNode(boolean removeChildren)
removeChildren - whether to remove children or no
public Object getAttributeNode(String attributeName)
getAttributeNode in class ElementattributeName - the name of the attribute to retrieve
public Attr setAttributeNode(Attr newAtt)
newAtt - the attribute to set
public HTMLCollection getElementsByClassName(String className)
className - the name to search for
public Object getClassName_js()
public int getClientHeight()
public int getClientWidth()
public void setClassName(String className)
className - the new class namepublic String getInnerHTML()
public String getInnerText()
public String getOuterHTML()
public void setInnerHTML(Object value)
value - the new value for the contents of this nodepublic void setInnerText(String value)
value - the new value for the contents of this nodepublic void setTextContent(Object value)
setTextContent in class Nodevalue - the new value for the contents of this nodepublic void setOuterHTML(String value)
value - the new value for replacing this node
public static void parseHtmlSnippet(DomNode target,
boolean append,
String source)
target - the node indicating the position at which the parsed content should be placedappend - if true, append the parsed content as a child of the specified target;
if false, append the parsed content as the previous sibling of the specified targetsource - the HTML code extract to parseprotected org.xml.sax.helpers.AttributesImpl readAttributes(HtmlElement element)
Attributes.
element - the element to read the attributes from
public void insertAdjacentHTML(String where,
String text)
where - specifies where to insert the HTML text, using one of the following value:
beforeBegin, afterBegin, beforeEnd, afterEndtext - the HTML text to insert
public Object insertAdjacentElement(String where,
Object object)
where - specifies where to insert the element, using one of the following value:
beforeBegin, afterBegin, beforeEnd, afterEndobject - the element to insert
public int addBehavior(String behavior)
behavior - the URL of the behavior to add, or a default behavior name
public void removeBehavior(int id)
id - the identifier for the behavior to removepublic int getAvailHeight()
public int getAvailWidth()
public int getBufferDepth()
public BoxObject getBoxObject()
public int getColorDepth()
public String getConnectionType()
public boolean getCookieEnabled()
public String getCpuClass()
public int getHeight()
public boolean getJavaEnabled()
public String getPlatform()
public String getSystemLanguage()
public String getUserLanguage()
public int getWidth()
public void addComponentRequest(String id,
String idType,
String minVersion)
id - the identifier for the component to installidType - the type of identifier specifiedminVersion - the minimum version of the component to installpublic void clearComponentRequest()
public int compareVersions(String v1,
String v2)
v1 - the first of the two version numbers to comparev2 - the second of the two version numbers to compare
public boolean doComponentRequest()
addComponentRequest(String, String, String).
false
public String getComponentVersion(String id,
String idType)
id - the identifier for the component whose version is to be returnedidType - the type of identifier specified
public boolean isComponentInstalled(String id,
String idType,
String minVersion)
id - the identifier for the component to check foridType - the type of id specifiedminVersion - the minimum version to check for
public void startDownload(String uri,
net.sourceforge.htmlunit.corejs.javascript.Function callback)
throws MalformedURLException
uri - the URI of the download sourcecallback - the method which should be called when the download is finished
MalformedURLException - if the URL cannot be createdpublic boolean isHomePage(String url)
url - the URL to check
public void setHomePage(String url)
url - the new homepage URL
public void navigateHomePage()
throws IOException
IOException - if loading home page failspublic int getOffsetHeight()
public int getOffsetWidth()
protected boolean isAncestorOfEventTarget(MouseEvent event)
event - the event whose target node is to be checked
public String toString()
toString in class Objectpublic 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()
public String getScopeName()
public String getTagUrn()
public void setTagUrn(String tagUrn)
tagUrn - the Uniform Resource Name (URN) specified in the namespace declarationpublic HTMLElement getParentHTMLElement()
HTMLElement. It is mostly identical
to Node.getParent() except that it skips XML nodes.
Node.getParent()public void scrollIntoView()
public Object getClientRects()
public void setExpression(String propertyName,
String expression,
String language)
propertyName - Specifies the name of the property to which expression is addedexpression - specifies any valid script statement without quotations or semicolons
This string can include references to other properties on the current page.
Array references are not allowed on object properties included in this script.language - specified the language usedpublic boolean removeExpression(String propertyName)
propertyName - Specifies the name of the property from which to remove an expression
public String getUniqueID()
public boolean dispatchEvent(Event event)
event - the event to be dispatched
public final HtmlElement getDomNodeOrDie()
getDomNodeOrDie in class Elementpublic HtmlElement getDomNodeOrNull()
getDomNodeOrNull in class SimpleScriptablepublic void blur()
public Object createTextRange()
public boolean contains(HTMLElement element)
element - element object that specifies the element to check
public void focus()
public void setActive()
public StaticNodeList querySelectorAll(String selectors)
selectors - the selectors
public Node querySelector(String selectors)
selectors - the selectors
public Object get(String name,
net.sourceforge.htmlunit.corejs.javascript.Scriptable start)
SimpleScriptable.getWithPreemption(String).
For fallback case just implement ScriptableWithFallbackGetter.
get in interface net.sourceforge.htmlunit.corejs.javascript.Scriptableget in class SimpleScriptablepublic String getNodeName()
getNodeName in class Nodepublic String getPrefix()
getPrefix in class Nodepublic Object getFilters()
public void click()
throws IOException
IOException - if this click triggers a page load that encounters problemspublic boolean getSpellcheck()
public void setSpellcheck(boolean spellcheck)
spellcheck - the "spellcheck" propertypublic String getLang()
public void setLang(String lang)
lang - the "lang" propertypublic String getLanguage()
public void setLanguage(String language)
language - the "language" propertypublic String getDir()
public void setDir(String dir)
dir - the "dir" propertypublic int getTabIndex()
public void setTabIndex(int tabIndex)
tabIndex - the "tabIndex" propertypublic void doScroll(String scrollAction)
scrollAction - the type of scroll action to simulatepublic String getAccessKey()
public void setAccessKey(String accessKey)
accessKey - the "accessKey" property
protected String getWidthOrHeight(String attributeName,
Boolean returnNegativeValues)
attributeName - the name of the attribute to return ("width" or "height")returnNegativeValues - if true, negative values are returned;
if false, this method returns an empty string in lieu of negative values;
if null, this method returns 0 in lieu of negative values
protected void setWidthOrHeight(String attributeName,
String value,
Boolean allowNegativeValues)
attributeName - the name of the attribute to set ("width" or "height")value - the value of the specified attribute (width or height)allowNegativeValues - if true, negative values will be stored;
if false, negative values cause an exception to be thrown;
if null, negative values set the value to 0
protected void setColorAttribute(String name,
String value)
name - the color attribute's namevalue - the color attribute's valueprotected String getAlign(boolean returnInvalidValues)
returnInvalidValues - if true, this method will return any value, including technically
invalid values; if false, this method will return an empty string instead of invalid values
protected void setAlign(String align,
boolean ignoreIfNoError)
align - the value of the "align" propertyignoreIfNoError - if true, the invocation will be a no-op if it does not trigger an error
(i.e., it will not actually set the align attribute)
protected String getVAlign(String[] valid,
String defaultValue)
valid - the valid values; if null, any value is validdefaultValue - the default value to use, if necessary
protected void setVAlign(Object vAlign,
String[] valid)
vAlign - the value of the "vAlign" propertyvalid - the valid values; if null, any value is validprotected String getCh()
protected void setCh(String ch)
ch - the value of the "ch" propertyprotected String getChOff()
protected void setChOff(String chOff)
chOff - the value of the "chOff" propertypublic ComputedCSSStyleDeclaration getCurrentStyle()
public int getOffsetLeft()
public int getPosX()
public int getPosY()
public int getClientLeft()
public int getClientTop()
public int getOffsetTop()
public Object getOffsetParent_js()
undefined when this node is
not attached or null for body.public ClientRect getBoundingClientRect()
getBoundingClientRect in class Elementpublic CSSStyleDeclaration getStyle()
public CSSStyleDeclaration getRuntimeStyle()
public DOMTokenList getClassList()
getClassList in class Elementpublic boolean hasAttribute(String name)
hasAttribute in class Elementname - the name of the attribute to look for
public Object getAttribute(String attributeName,
Integer flags)
getAttribute in class ElementattributeName - attribute nameflags - IE-specific flags (see the MSDN documentation for more info)
null if the attribute is not definedpublic final String getTagName()
getTagName in class Elementpublic HTMLCollection getChildren()
getChildren in class Elementpublic Element getParentElement()
Element. It is mostly identical
to Node.getParent() except that it skips non Element nodes. Overridden to modify browser configurations.
getParentElement in class ElementNode.getParent()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||