public class CSSStyleSheet extends StyleSheet
CSSStyleSheet
.org.htmlunit.corejs.javascript.ScriptableObject.KeyComparator
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
NOT_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, getOwnerNode
clone, equivalentValues, get, getBrowserVersion, getClassName, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getWindow, getWindow, getWindowFromTopCallScope, getWithPreemption, has, hasInstance, initParentScope, makeScriptableFor, put, setClassName, setDomNode, setDomNode, setParentScope, setupPromise, setupRejectedPromise
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, 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, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, putProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setPrototype, size
public 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 StyleSheet
public 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 StyleSheet
Copyright © 2002–2024 Gargoyle Software Inc.. All rights reserved.