public class HTMLElement extends Element implements ScriptableWithFallbackGetter
HtmlElement
.Modifier and Type | Class and Description |
---|---|
static class |
HTMLElement.ProxyDomNode
ProxyDomNode.
|
Modifier and Type | Field and Description |
---|---|
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.
|
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 |
---|
HTMLElement() |
Modifier and Type | Method and Description |
---|---|
void |
addComponentRequest(String id,
String idType,
String minVersion)
Adds the specified component to the queue of components to be installed.
|
void |
clearComponentRequest()
Clears the component install queue of all component requests.
|
int |
compareVersions(String v1,
String v2)
Compares the two specified version numbers.
|
protected void |
createEventHandler(String eventName,
String attrValue)
Create the event handler function from the attribute value.
|
boolean |
doComponentRequest()
Downloads all the components queued via
addComponentRequest(String, String, String) . |
protected String |
fixAttributeName(String attributeName)
For IE, foo.getAttribute(x) uses same names as foo.x.
|
Object |
get(String name,
net.sourceforge.htmlunit.corejs.javascript.Scriptable start)
Gets a named property from the object.
|
protected String |
getAlign(boolean returnInvalidValues)
Returns the value of the "align" property.
|
int |
getAvailHeight()
Returns the screen's available height.
|
int |
getAvailWidth()
Returns the screen's available width.
|
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.
|
protected String |
getChOff()
Returns the value of the "chOff" property.
|
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.
|
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.
|
int |
getHeight()
Returns the screen's height.
|
boolean |
getJavaEnabled()
Returns true if Java is enabled.
|
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 |
getSystemLanguage()
Returns the system language.
|
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.
|
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.
|
int |
jsxFunction_addBehavior(String behavior)
Adds the specified behavior to this HTML element.
|
void |
jsxFunction_blur()
Remove focus from this element.
|
void |
jsxFunction_clearAttributes()
An IE-only method which clears all custom attributes.
|
void |
jsxFunction_click()
Click this element.
|
boolean |
jsxFunction_contains(HTMLElement element)
Checks whether the given element is contained within this object.
|
Object |
jsxFunction_createTextRange()
Creates a new TextRange object for this element.
|
boolean |
jsxFunction_dispatchEvent(Event event)
Dispatches an event into the event system (standards-conformant browsers only).
|
void |
jsxFunction_doScroll(String scrollAction)
Simulates a click on a scrollbar component (IE only).
|
void |
jsxFunction_focus()
Sets the focus to this element.
|
Object |
jsxFunction_getAttributeNode(String attributeName)
Gets the attribute node for the specified attribute.
|
Object |
jsxFunction_getAttributeNodeNS(String namespaceURI,
String localName)
Returns the specified attribute.
|
String |
jsxFunction_getAttributeNS(String namespaceURI,
String localName)
Gets the specified attribute.
|
TextRectangle |
jsxFunction_getBoundingClientRect()
Retrieves an object that specifies the bounds of a collection of TextRectangle objects.
|
Object |
jsxFunction_getClientRects()
Retrieves a collection of rectangles that describes the layout of the contents of an object
or range within the client.
|
HTMLCollection |
jsxFunction_getElementsByClassName(String className)
Returns all the descendant elements with the specified class.
|
boolean |
jsxFunction_hasAttributeNS(String namespaceURI,
String localName)
Test for attribute.
|
Object |
jsxFunction_insertAdjacentElement(String where,
Object object)
Inserts the given element into the element at the location.
|
void |
jsxFunction_insertAdjacentHTML(String where,
String text)
Inserts the given HTML text into the element at the location.
|
void |
jsxFunction_mergeAttributes(HTMLElement source,
Object preserveIdentity)
An IE-only method which copies all custom attributes from the specified source element
to this element.
|
Node |
jsxFunction_querySelector(String selectors)
Returns the first element within the document that matches the specified group of selectors.
|
StaticNodeList |
jsxFunction_querySelectorAll(String selectors)
Retrieves all element nodes from descendants of the starting element node that match any selector
within the supplied selector strings.
|
void |
jsxFunction_removeAttributeNode(Attr attribute)
Removes the specified attribute.
|
void |
jsxFunction_removeAttributeNS(String namespaceURI,
String localName)
Removes the specified attribute.
|
void |
jsxFunction_removeBehavior(int id)
Removes the behavior corresponding to the specified identifier from this element.
|
boolean |
jsxFunction_removeExpression(String propertyName)
Removes the expression from the specified property.
|
HTMLElement |
jsxFunction_removeNode(boolean removeChildren)
Removes this object from the document hierarchy.
|
void |
jsxFunction_scrollIntoView()
Implement the scrollIntoView() JavaScript function but don't actually do
anything.
|
void |
jsxFunction_setActive()
Sets the object as active without setting focus to the object.
|
void |
jsxFunction_setAttribute(String name,
String value)
Sets an attribute.
|
Attr |
jsxFunction_setAttributeNode(Attr newAtt)
Sets the attribute node for the specified attribute.
|
void |
jsxFunction_setAttributeNS(String namespaceURI,
String qualifiedName,
String value)
Sets the specified attribute.
|
void |
jsxFunction_setExpression(String propertyName,
String expression,
String language)
Sets an expression for the specified HTMLElement.
|
String |
jsxGet_accessKey()
Returns the "accessKey" property.
|
HTMLCollection |
jsxGet_all()
Returns the value of the "all" property.
|
HTMLCollection |
jsxGet_children()
Gets the children of the current node.
|
Object |
jsxGet_className()
Returns the class defined for this element.
|
int |
jsxGet_clientHeight()
Returns "clientHeight" attribute.
|
int |
jsxGet_clientLeft()
Returns "clientLeft" attribute.
|
int |
jsxGet_clientTop()
Returns "clientTop" attribute.
|
int |
jsxGet_clientWidth()
Returns "clientWidth" attribute.
|
ComputedCSSStyleDeclaration |
jsxGet_currentStyle()
Returns the current (calculated) style object for this element.
|
String |
jsxGet_dir()
Returns the "dir" property.
|
boolean |
jsxGet_disabled()
Returns true if this element is disabled.
|
DocumentProxy |
jsxGet_document()
Returns the document.
|
Object |
jsxGet_filters()
Gets the filters.
|
String |
jsxGet_id()
Returns the element ID.
|
String |
jsxGet_innerHTML()
Gets the innerHTML attribute.
|
String |
jsxGet_innerText()
Gets the innerText attribute.
|
String |
jsxGet_lang()
Returns the "lang" property.
|
String |
jsxGet_language()
Returns the "language" property.
|
String |
jsxGet_localName()
Returns the local name of this element.
|
String |
jsxGet_namespaceURI()
Returns The URI that identifies an XML namespace.
|
String |
jsxGet_nodeName()
Gets the JavaScript property "nodeName" for the current node.
|
int |
jsxGet_offsetHeight()
Returns this element's offsetHeight, which is the element height plus the element's padding
plus the element's border.
|
int |
jsxGet_offsetLeft()
Returns this element's offsetLeft, which is the calculated left position of this
element relative to the offsetParent.
|
Object |
jsxGet_offsetParent()
Returns this element's offsetParent.
|
int |
jsxGet_offsetTop()
Returns this element's offsetTop, which is the calculated top position of this
element relative to the offsetParent.
|
int |
jsxGet_offsetWidth()
Returns this element's offsetWidth, which is the element width plus the element's padding
plus the element's border.
|
String |
jsxGet_outerHTML()
Gets the outerHTML of the node.
|
HTMLElement |
jsxGet_parentElement()
Gets the JavaScript property "parentElement".
|
String |
jsxGet_prefix()
Returns the namespace prefix.
|
CSSStyleDeclaration |
jsxGet_runtimeStyle()
Returns the runtime style object for this element.
|
String |
jsxGet_scopeName()
Gets the namespace defined for the element.
|
int |
jsxGet_scrollHeight()
Gets the scrollHeight for this element.
|
int |
jsxGet_scrollLeft()
Gets the scrollLeft value for this element.
|
int |
jsxGet_scrollTop()
Gets the scrollTop value for this element.
|
int |
jsxGet_scrollWidth()
Gets the scrollWidth for this element.
|
boolean |
jsxGet_spellcheck()
Returns the "spellcheck" property.
|
CSSStyleDeclaration |
jsxGet_style()
Returns the style object for this element.
|
int |
jsxGet_tabIndex()
Returns the value of the tabIndex attribute.
|
String |
jsxGet_tagUrn()
Gets the Uniform Resource Name (URN) specified in the namespace declaration.
|
String |
jsxGet_title()
Returns the element title.
|
String |
jsxGet_uniqueID()
Retrieves an auto-generated, unique identifier for the object.
|
void |
jsxSet_accessKey(String accessKey)
Sets the "accessKey" property.
|
void |
jsxSet_className(String className)
Sets the class attribute for this element.
|
void |
jsxSet_dir(String dir)
Sets the "dir" property.
|
void |
jsxSet_disabled(boolean disabled)
Sets whether or not to disable this element.
|
void |
jsxSet_id(String newId)
Sets the identifier this element.
|
void |
jsxSet_innerHTML(Object value)
Replace all children elements of this element with the supplied value.
|
void |
jsxSet_innerText(String value)
Replace all children elements of this element with the supplied value.
|
void |
jsxSet_lang(String lang)
Sets the "lang" property.
|
void |
jsxSet_language(String language)
Sets the "language" property.
|
void |
jsxSet_outerHTML(String value)
Replace all children elements of this element with the supplied value.
|
void |
jsxSet_scrollLeft(int scroll)
Sets the scrollLeft value for this element.
|
void |
jsxSet_scrollTop(int scroll)
Sets the scrollTop value for this element.
|
void |
jsxSet_spellcheck(boolean spellcheck)
Sets the "spellcheck" property.
|
void |
jsxSet_tabIndex(int tabIndex)
Sets the "tabIndex" property.
|
void |
jsxSet_tagUrn(String tagUrn)
Sets the Uniform Resource Name (URN) specified in the namespace declaration.
|
void |
jsxSet_textContent(Object value)
Replace all children elements of this element with the supplied value.
|
void |
jsxSet_title(String newTitle)
Sets the title of 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.
|
protected org.xml.sax.helpers.AttributesImpl |
readAttributes(HtmlElement element)
Gets the attributes of the element in the form of a
Attributes . |
protected void |
setAlign(String align,
boolean ignoreIfNoError)
Sets the value of the "align" property.
|
protected void |
setCh(String ch)
Sets the value of the "ch" property.
|
protected void |
setChOff(String chOff)
Sets the value of the "chOff" property.
|
protected void |
setColorAttribute(String name,
String value)
Sets the specified color attribute to the specified value.
|
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 |
setHomePage(String url)
Sets the web client's current homepage.
|
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() |
createAttributesObject, jsxFunction_getAttribute, jsxFunction_getElementsByTagName, jsxFunction_getElementsByTagNameNS, jsxFunction_hasAttribute, jsxFunction_removeAttribute, jsxFunction_selectNodes, jsxFunction_selectSingleNode, jsxGet_attributes, jsxGet_tagName, jsxGet_text
jsxFunction_fireEvent, jsxGet_onblur, jsxGet_onclick, jsxGet_oncontextmenu, jsxGet_ondblclick, jsxGet_onerror, jsxGet_onfocus, jsxGet_onfocusin, jsxGet_onfocusout, jsxGet_onkeydown, jsxGet_onkeypress, jsxGet_onkeyup, jsxGet_onmousedown, jsxGet_onmousemove, jsxGet_onmouseout, jsxGet_onmouseover, jsxGet_onmouseup, jsxGet_onpropertychange, jsxGet_onresize, jsxSet_onblur, jsxSet_onclick, jsxSet_oncontextmenu, jsxSet_ondblclick, jsxSet_onerror, jsxSet_onfocus, jsxSet_onfocusin, jsxSet_onfocusout, jsxSet_onkeydown, jsxSet_onkeypress, jsxSet_onkeyup, jsxSet_onmousedown, jsxSet_onmousemove, jsxSet_onmouseout, jsxSet_onmouseover, jsxSet_onmouseup, jsxSet_onpropertychange, jsxSet_onresize
executeEvent, fireEvent, getEventHandler, getEventHandlerProp, getJavaScriptNode, getParent, hasEventHandlers, jsxFunction_addEventListener, jsxFunction_appendChild, jsxFunction_attachEvent, jsxFunction_cloneNode, jsxFunction_compareDocumentPosition, jsxFunction_detachEvent, jsxFunction_hasChildNodes, jsxFunction_insertBefore, jsxFunction_insertBefore, jsxFunction_isSameNode, jsxFunction_normalize, jsxFunction_removeChild, jsxFunction_removeEventListener, jsxFunction_replaceChild, jsxGet_childNodes, jsxGet_firstChild, jsxGet_lastChild, jsxGet_nextSibling, jsxGet_nodeType, jsxGet_nodeValue, jsxGet_ownerDocument, jsxGet_parentNode, jsxGet_previousSibling, jsxGet_textContent, jsxGet_xml, jsxSet_nodeValue, setEventHandler, setEventHandlerProp
clone, defineFunctionProperties, defineProperty, equivalentValues, getBrowserVersion, getClassName, getDefaultValue, getPrototype, getScriptableFor, getStartingScope, getTransformerScriptableFor, getWindow, getWindow, getWithPreemption, hasInstance, initParentScope, makeScriptableFor, setCaseSensitive, setDomNode, setHtmlElement
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineOwnProperties, 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, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype, size
public static final int BEHAVIOR_ID_CLIENT_CAPS
public static final int BEHAVIOR_ID_HOMEPAGE
public static final int BEHAVIOR_ID_DOWNLOAD
public HTMLCollection jsxGet_all()
public CSSStyleDeclaration jsxGet_style()
public ComputedCSSStyleDeclaration jsxGet_currentStyle()
public void setDefaults(ComputedCSSStyleDeclaration style)
style
- the style to initializepublic CSSStyleDeclaration jsxGet_runtimeStyle()
public void setDomNode(DomNode domNode)
setDomNode
in class Node
domNode
- the DOM nodeprotected void createEventHandler(String eventName, String attrValue)
eventName
- the event name (ex: "onclick")attrValue
- the attribute valuepublic String jsxGet_id()
public void jsxSet_id(String newId)
newId
- the new identifier of this elementpublic String jsxGet_title()
public void jsxSet_title(String newTitle)
newTitle
- the new identifier of this elementpublic boolean jsxGet_disabled()
public DocumentProxy jsxGet_document()
public void jsxSet_disabled(boolean disabled)
disabled
- True if this is to be disabledpublic String jsxGet_namespaceURI()
jsxGet_namespaceURI
in class Node
public String jsxGet_localName()
jsxGet_localName
in class Node
public Object getWithFallback(String name)
Scriptable
object.getWithFallback
in interface ScriptableWithFallbackGetter
name
- the name of the requested propertyScriptable.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 Element
attributeName
- the namepublic void jsxFunction_clearAttributes()
public void jsxFunction_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 copiedpublic Object jsxFunction_getAttributeNodeNS(String namespaceURI, String localName)
namespaceURI
- the namespace URIlocalName
- the local name of the attribute to look fornull
if the attribute is not definedpublic String jsxFunction_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 jsxFunction_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 jsxFunction_setAttribute(String name, String value)
jsxFunction_setAttribute
in class Element
name
- Name of the attribute to setvalue
- Value to set the attribute topublic void jsxFunction_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 jsxFunction_removeAttributeNS(String namespaceURI, String localName)
namespaceURI
- the namespace URI of the attribute to removelocalName
- the local name of the attribute to removepublic void jsxFunction_removeAttributeNode(Attr attribute)
attribute
- the attribute to removepublic HTMLElement jsxFunction_removeNode(boolean removeChildren)
removeChildren
- whether to remove children or nopublic Object jsxFunction_getAttributeNode(String attributeName)
jsxFunction_getAttributeNode
in class Element
attributeName
- the name of the attribute to retrievepublic Attr jsxFunction_setAttributeNode(Attr newAtt)
newAtt
- the attribute to setpublic HTMLCollection jsxFunction_getElementsByClassName(String className)
className
- the name to search forpublic Object jsxGet_className()
public int jsxGet_clientHeight()
public int jsxGet_clientWidth()
public int jsxGet_clientLeft()
public int jsxGet_clientTop()
public void jsxSet_className(String className)
className
- the new class namepublic String jsxGet_innerHTML()
public String jsxGet_innerText()
jsxGet_innerText
in class Node
public String jsxGet_outerHTML()
public void jsxSet_innerHTML(Object value)
value
- the new value for the contents of this nodepublic void jsxSet_innerText(String value)
jsxSet_innerText
in class Node
value
- the new value for the contents of this nodepublic void jsxSet_textContent(Object value)
jsxSet_textContent
in class Node
value
- the new value for the contents of this nodepublic void jsxSet_outerHTML(String value)
value
- the new value for replacing this nodepublic 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 frompublic void jsxFunction_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 insertpublic Object jsxFunction_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 insertpublic int jsxFunction_addBehavior(String behavior)
behavior
- the URL of the behavior to add, or a default behavior namepublic void jsxFunction_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 comparepublic 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 specifiedpublic 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 forpublic 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 finishedMalformedURLException
- if the URL cannot be createdpublic boolean isHomePage(String url)
url
- the URL to checkpublic void setHomePage(String url)
url
- the new homepage URLpublic void navigateHomePage() throws IOException
IOException
- if loading home page failspublic HTMLCollection jsxGet_children()
public int jsxGet_offsetHeight()
public int jsxGet_offsetWidth()
protected boolean isAncestorOfEventTarget(MouseEvent event)
event
- the event whose target node is to be checkedpublic int getPosX()
public int getPosY()
public int jsxGet_offsetLeft()
public int jsxGet_offsetTop()
public Object jsxGet_offsetParent()
undefined
when this node is
not attached or null
for body
.public int jsxGet_scrollTop()
public void jsxSet_scrollTop(int scroll)
scroll
- the scrollTop value for this elementpublic int jsxGet_scrollLeft()
public void jsxSet_scrollLeft(int scroll)
scroll
- the scrollLeft value for this elementpublic int jsxGet_scrollHeight()
public int jsxGet_scrollWidth()
public String jsxGet_scopeName()
public String jsxGet_tagUrn()
public void jsxSet_tagUrn(String tagUrn)
tagUrn
- the Uniform Resource Name (URN) specified in the namespace declarationpublic HTMLElement jsxGet_parentElement()
Node.jsxGet_parentNode()
public HTMLElement getParentHTMLElement()
HTMLElement
. It is mostly identical
to Node.getParent()
except that it skips XML nodes.Node.getParent()
public void jsxFunction_scrollIntoView()
public TextRectangle jsxFunction_getBoundingClientRect()
public Object jsxFunction_getClientRects()
public void jsxFunction_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 jsxFunction_removeExpression(String propertyName)
propertyName
- Specifies the name of the property from which to remove an expressionpublic String jsxGet_uniqueID()
public boolean jsxFunction_dispatchEvent(Event event)
event
- the event to be dispatchedpublic final HtmlElement getDomNodeOrDie()
getDomNodeOrDie
in class Element
public HtmlElement getDomNodeOrNull()
getDomNodeOrNull
in class SimpleScriptable
public void jsxFunction_blur()
public Object jsxFunction_createTextRange()
public boolean jsxFunction_contains(HTMLElement element)
element
- element object that specifies the element to checkpublic void jsxFunction_focus()
public void jsxFunction_setActive()
public StaticNodeList jsxFunction_querySelectorAll(String selectors)
selectors
- the selectorspublic Node jsxFunction_querySelector(String selectors)
selectors
- the selectorspublic 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.Scriptable
get
in class SimpleScriptable
public String jsxGet_nodeName()
jsxGet_nodeName
in class Node
public String jsxGet_prefix()
jsxGet_prefix
in class Node
public Object jsxGet_filters()
public void jsxFunction_click() throws IOException
IOException
- if this click triggers a page load that encounters problemspublic boolean jsxGet_spellcheck()
public void jsxSet_spellcheck(boolean spellcheck)
spellcheck
- the "spellcheck" propertypublic String jsxGet_lang()
public void jsxSet_lang(String lang)
lang
- the "lang" propertypublic String jsxGet_language()
public void jsxSet_language(String language)
language
- the "language" propertypublic String jsxGet_dir()
public void jsxSet_dir(String dir)
dir
- the "dir" propertypublic int jsxGet_tabIndex()
public void jsxSet_tabIndex(int tabIndex)
tabIndex
- the "tabIndex" propertypublic void jsxFunction_doScroll(String scrollAction)
scrollAction
- the type of scroll action to simulatepublic String jsxGet_accessKey()
public void jsxSet_accessKey(String accessKey)
accessKey
- the "accessKey" propertyprotected 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 valuesprotected 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 0protected 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 valuesprotected 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 necessaryprotected 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" propertyCopyright © 2002–2014 Gargoyle Software Inc.. All rights reserved.