public class DOMTokenList extends HtmlUnitScriptable
DOMTokenList.org.htmlunit.corejs.javascript.ScriptableObject.DescriptorInfo, org.htmlunit.corejs.javascript.ScriptableObject.KeyComparator, org.htmlunit.corejs.javascript.ScriptableObject.LambdaGetterFunction, org.htmlunit.corejs.javascript.ScriptableObject.LambdaSetterFunctionCONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONSTNOT_FOUND| Constructor and Description |
|---|
DOMTokenList()
Creates an instance.
|
DOMTokenList(Node node,
String attributeName)
Creates an instance.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
add(org.htmlunit.corejs.javascript.Context context,
org.htmlunit.corejs.javascript.Scriptable scope,
org.htmlunit.corejs.javascript.Scriptable thisObj,
Object[] args,
org.htmlunit.corejs.javascript.Function function)
Adds the given tokens to the list, omitting any that are already present.
|
boolean |
contains(String token)
Checks if the specified token is contained in the underlying string.
|
org.htmlunit.corejs.javascript.Scriptable |
entries()
Returns an Iterator allowing to go through all key/value pairs contained in this object.
|
void |
forEach(Object callback)
Calls the
callback given in parameter once for each value in the list. |
Object |
get(int index,
org.htmlunit.corejs.javascript.Scriptable start) |
String |
getDefaultValue(Class<?> hint)
Returns the JavaScript default value of this object.
|
Object[] |
getIds()
.
|
int |
getLength()
Returns the length property.
|
String |
getValue() |
String |
item(int index)
Returns the item at the specified index.
|
void |
jsConstructor()
JavaScript constructor.
|
org.htmlunit.corejs.javascript.Scriptable |
keys()
Returns an Iterator allowing to go through all keys contained in this object.
|
static void |
remove(org.htmlunit.corejs.javascript.Context context,
org.htmlunit.corejs.javascript.Scriptable scope,
org.htmlunit.corejs.javascript.Scriptable thisObj,
Object[] args,
org.htmlunit.corejs.javascript.Function function)
Removes the specified tokens from the underlying string.
|
boolean |
replace(String oldToken,
String newToken)
Replaces an existing token with a new token.
|
void |
setValue(String value) |
boolean |
toggle(String token)
Toggle the token, by adding or removing.
|
org.htmlunit.corejs.javascript.Scriptable |
values()
Returns an Iterator allowing to go through all keys contained in this object.
|
clone, equivalentValues, get, getBrowserVersion, getClassName, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getWindow, getWindow, getWindowFromTopCallScope, getWithPreemption, has, hasInstance, initParentScope, makeScriptableFor, put, setClassName, setDomNode, setDomNode, setParentScope, setupPromise, setupRejectedPromiseapplyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkNotSealed, checkPropertyChangeForSlot, checkPropertyChangeForSlot, checkPropertyDefinition, checkSlotRemoval, defineBuiltInProperty, defineBuiltInProperty, defineBuiltInProperty, defineBuiltInProperty, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureScriptableObjectButNotSymbol, ensureSymbolScriptable, ensureType, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getSuperProperty, getSuperProperty, getSuperProperty, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putOwnProperty, putOwnProperty, putOwnProperty, putProperty, putProperty, putProperty, putSuperProperty, putSuperProperty, putSuperProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setPrototype, sizecreateSlotMappublic void jsConstructor()
public String getValue()
public void setValue(String value)
value - the new valuepublic int getLength()
public String getDefaultValue(Class<?> hint)
getDefaultValue in interface org.htmlunit.corejs.javascript.ScriptablegetDefaultValue in class HtmlUnitScriptablehint - a hint as to the format of the default value (ignored in this case)public static void add(org.htmlunit.corejs.javascript.Context context, org.htmlunit.corejs.javascript.Scriptable scope, org.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, org.htmlunit.corejs.javascript.Function function)
context - the JavaScript contextscope - the scopethisObj - the scriptableargs - the arguments passed into the methodfunction - the functionpublic static void remove(org.htmlunit.corejs.javascript.Context context, org.htmlunit.corejs.javascript.Scriptable scope, org.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, org.htmlunit.corejs.javascript.Function function)
context - the JavaScript contextscope - the scopethisObj - the scriptableargs - the arguments passed into the methodfunction - the functionpublic boolean replace(String oldToken, String newToken)
oldToken - a string representing the token you want to replacenewToken - a string representing the token you want to replace oldToken withpublic boolean toggle(String token)
token - the token to add or removepublic boolean contains(String token)
token - the token to addpublic String item(int index)
index - the index of the itempublic org.htmlunit.corejs.javascript.Scriptable keys()
public Object[] getIds()
getIds in interface org.htmlunit.corejs.javascript.ScriptablegetIds in class org.htmlunit.corejs.javascript.ScriptableObjectpublic org.htmlunit.corejs.javascript.Scriptable values()
public org.htmlunit.corejs.javascript.Scriptable entries()
public void forEach(Object callback)
callback given in parameter once for each value in the list.callback - function to execute for each elementpublic Object get(int index, org.htmlunit.corejs.javascript.Scriptable start)
get in interface org.htmlunit.corejs.javascript.Scriptableget in class org.htmlunit.corejs.javascript.ScriptableObjectCopyright © 2002–2025 Gargoyle Software Inc.. All rights reserved.