public class CSSStyleSheet extends StyleSheet
CSSStyleSheet.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 |
|---|
CSSStyleSheet()
Creates a new empty stylesheet.
|
CSSStyleSheet(HTMLElement element,
org.htmlunit.cssparser.parser.InputSource source,
String uri)
Creates a new stylesheet representing the CSS stylesheet for the specified input source.
|
CSSStyleSheet(HTMLElement element,
org.htmlunit.corejs.javascript.Scriptable parentScope,
CssStyleSheet cssStyleSheet)
Creates a new stylesheet representing the specified CSS stylesheet.
|
CSSStyleSheet(HTMLElement element,
String styleSheet,
String uri)
Creates a new stylesheet representing the CSS stylesheet for the specified input source.
|
| Modifier and Type | Method and Description |
|---|---|
int |
addRule(String selector,
String rule)
Adds a new rule.
|
void |
deleteRule(int position)
Deletes an existing rule.
|
CSSRuleList |
getCssRules()
Returns the collection of rules defined in this style sheet.
|
CssStyleSheet |
getCssStyleSheet()
Returns the wrapped stylesheet.
|
CSSRuleList |
getRules()
Retrieves the collection of rules defined in this style sheet.
|
String |
getUri()
Returns this stylesheet's URI (used to resolved contained @import rules).
|
int |
insertRule(String rule,
int position)
Inserts a new rule.
|
void |
jsConstructor()
Creates a new empty stylesheet.
|
void |
removeRule(int position)
Deletes an existing rule.
|
getHref, getOwnerNodeclone, equivalentValues, get, getBrowserVersion, getClassName, getDefaultValue, 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, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, 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 CSSStyleSheet()
public CSSStyleSheet(HTMLElement element, org.htmlunit.cssparser.parser.InputSource source, String uri)
element - the owning nodesource - the input source which contains the CSS stylesheet which this stylesheet host object representsuri - this stylesheet's URI (used to resolved contained @import rules)public CSSStyleSheet(HTMLElement element, String styleSheet, String uri)
element - the owning nodestyleSheet - the source which contains the CSS stylesheet which this stylesheet host object representsuri - this stylesheet's URI (used to resolved contained @import rules)public CSSStyleSheet(HTMLElement element, org.htmlunit.corejs.javascript.Scriptable parentScope, CssStyleSheet cssStyleSheet)
element - the owning nodeparentScope - the parent scopecssStyleSheet - the CSS stylesheet which this stylesheet host object representspublic void jsConstructor()
jsConstructor in class StyleSheetpublic CssStyleSheet getCssStyleSheet()
public CSSRuleList getRules()
public CSSRuleList getCssRules()
public int insertRule(String rule, int position)
rule - the CSS ruleposition - the position at which to insert the rulepublic void deleteRule(int position)
position - the position of the rule to be deletedpublic int addRule(String selector, String rule)
selector - the selector namerule - the rulepublic void removeRule(int position)
position - the position of the rule to be deletedpublic String getUri()
getUri in class StyleSheetCopyright © 2002–2025 Gargoyle Software Inc.. All rights reserved.