Package org.htmlunit.javascript.host.css
Class CSSRule
java.lang.Object
org.htmlunit.corejs.javascript.ScriptableObject
org.htmlunit.javascript.HtmlUnitScriptable
org.htmlunit.javascript.host.css.CSSRule
- All Implemented Interfaces:
Serializable,Cloneable,org.htmlunit.corejs.javascript.ConstProperties,org.htmlunit.corejs.javascript.debug.DebuggableObject,org.htmlunit.corejs.javascript.Scriptable,org.htmlunit.corejs.javascript.SymbolScriptable
- Direct Known Subclasses:
CSSCounterStyleRule,CSSFontFaceRule,CSSGroupingRule,CSSImportRule,CSSKeyframeRule,CSSKeyframesRule,CSSNamespaceRule,CSSPageRule,CSSStyleRule
A JavaScript object for
CSSRule.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.htmlunit.corejs.javascript.ScriptableObject
org.htmlunit.corejs.javascript.ScriptableObject.KeyComparator -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe rule is aCSSCharsetRule.static final intThe rule is aCSSCounterStyleRule.static final intThe rule is aCSSFontFaceRule.static final intThe rule is aCSSCounterStyleRule.static final intThe rule is aCSSImportRule.static final intThe rule is aCSSKeyframeRule.static final intThe rule is aCSSKeyframesRule.private static final org.apache.commons.logging.Logstatic final intThe rule is aCSSMediaRule.static final intThe rule is aCSSNamespaceRule.static final intThe rule is aCSSPageRule.private final org.htmlunit.cssparser.dom.AbstractCSSRuleImplstatic final intThe rule is aCSSStyleRule.private final CSSStyleSheetstatic final intThe rule is aCSSSupportsRule.static final intThe rule is aCSSUnknownRule.static final intThe rule is aCSSViewportRule.Fields inherited from class org.htmlunit.corejs.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONSTFields inherited from interface org.htmlunit.corejs.javascript.Scriptable
NOT_FOUND -
Constructor Summary
ConstructorsModifierConstructorDescriptionCSSRule()Creates a new instance.protectedCSSRule(CSSStyleSheet stylesheet, org.htmlunit.cssparser.dom.AbstractCSSRuleImpl rule) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic CSSRulecreate(CSSStyleSheet stylesheet, org.htmlunit.cssparser.dom.AbstractCSSRuleImpl rule) Creates a CSSRule according to the specified rule type.Returns the parsable textual representation of the rule.If this rule is contained inside another rule (e.g.Returns the style sheet that contains this rule.protected org.htmlunit.cssparser.dom.AbstractCSSRuleImplgetRule()Returns the wrapped rule.intgetType()Returns the type of the rule.voidCreates an instance.voidsetCssText(String cssText) Methods inherited from class org.htmlunit.javascript.HtmlUnitScriptable
clone, equivalentValues, get, getBrowserVersion, getClassName, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getStartingScope, getWindow, getWindow, getWithPreemption, has, hasInstance, initParentScope, makeScriptableFor, put, setClassName, setDomNode, setDomNode, setParentScope, setupPromise, setupRejectedPromiseMethods inherited from class org.htmlunit.corejs.javascript.ScriptableObject
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, 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
-
Field Details
-
LOG
private static final org.apache.commons.logging.Log LOG -
UNKNOWN_RULE
public static final int UNKNOWN_RULEThe rule is aCSSUnknownRule.- See Also:
-
STYLE_RULE
public static final int STYLE_RULEThe rule is aCSSStyleRule.- See Also:
-
CHARSET_RULE
public static final int CHARSET_RULEThe rule is aCSSCharsetRule.- See Also:
-
IMPORT_RULE
public static final int IMPORT_RULEThe rule is aCSSImportRule.- See Also:
-
MEDIA_RULE
public static final int MEDIA_RULEThe rule is aCSSMediaRule.- See Also:
-
FONT_FACE_RULE
public static final int FONT_FACE_RULEThe rule is aCSSFontFaceRule.- See Also:
-
PAGE_RULE
public static final int PAGE_RULEThe rule is aCSSPageRule.- See Also:
-
KEYFRAMES_RULE
public static final int KEYFRAMES_RULEThe rule is aCSSKeyframesRule.- See Also:
-
KEYFRAME_RULE
public static final int KEYFRAME_RULEThe rule is aCSSKeyframeRule.- See Also:
-
NAMESPACE_RULE
public static final int NAMESPACE_RULEThe rule is aCSSNamespaceRule.- See Also:
-
COUNTER_STYLE_RULE
public static final int COUNTER_STYLE_RULEThe rule is aCSSCounterStyleRule.- See Also:
-
SUPPORTS_RULE
public static final int SUPPORTS_RULEThe rule is aCSSSupportsRule.- See Also:
-
FONT_FEATURE_VALUES_RULE
public static final int FONT_FEATURE_VALUES_RULEThe rule is aCSSCounterStyleRule.- See Also:
-
VIEWPORT_RULE
public static final int VIEWPORT_RULEThe rule is aCSSViewportRule.- See Also:
-
stylesheet_
-
rule_
private final org.htmlunit.cssparser.dom.AbstractCSSRuleImpl rule_
-
-
Constructor Details
-
CSSRule
public CSSRule()Creates a new instance. -
CSSRule
Creates a new instance.- Parameters:
stylesheet- the Stylesheet of this rule.rule- the wrapped rule
-
-
Method Details
-
jsConstructor
public void jsConstructor()Creates an instance. -
create
public static CSSRule create(CSSStyleSheet stylesheet, org.htmlunit.cssparser.dom.AbstractCSSRuleImpl rule) Creates a CSSRule according to the specified rule type.- Parameters:
stylesheet- the Stylesheet of this rulerule- the wrapped rule- Returns:
- a CSSRule subclass according to the rule type
-
getType
public int getType()Returns the type of the rule.- Returns:
- the type of the rule.
-
getCssText
Returns the parsable textual representation of the rule. This reflects the current state of the rule and not its initial value.- Returns:
- the parsable textual representation of the rule.
-
setCssText
- Parameters:
cssText- ignored
-
getParentStyleSheet
Returns the style sheet that contains this rule.- Returns:
- the style sheet that contains this rule.
-
getParentRule
If this rule is contained inside another rule (e.g. a style rule inside a @media block), this is the containing rule. If this rule is not nested inside any other rules, this returnsnull.- Returns:
- the parent rule
-
getRule
protected org.htmlunit.cssparser.dom.AbstractCSSRuleImpl getRule()Returns the wrapped rule.- Returns:
- the wrapped rule.
-