Class CSSRule

    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.htmlunit.corejs.javascript.ScriptableObject

        org.htmlunit.corejs.javascript.ScriptableObject.KeyComparator
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int CHARSET_RULE
      The rule is a CSSCharsetRule.
      static int COUNTER_STYLE_RULE
      The rule is a CSSCounterStyleRule.
      static int FONT_FACE_RULE
      The rule is a CSSFontFaceRule.
      static int FONT_FEATURE_VALUES_RULE
      The rule is a CSSCounterStyleRule.
      static int IMPORT_RULE
      The rule is a CSSImportRule.
      static int KEYFRAME_RULE
      The rule is a CSSKeyframeRule.
      static int KEYFRAMES_RULE
      The rule is a CSSKeyframesRule.
      private static org.apache.commons.logging.Log LOG  
      static int MEDIA_RULE
      The rule is a CSSMediaRule.
      static int NAMESPACE_RULE
      The rule is a CSSNamespaceRule.
      static int PAGE_RULE
      The rule is a CSSPageRule.
      private org.htmlunit.cssparser.dom.AbstractCSSRuleImpl rule_  
      static int STYLE_RULE
      The rule is a CSSStyleRule.
      private CSSStyleSheet stylesheet_  
      static int SUPPORTS_RULE
      The rule is a CSSSupportsRule.
      static int UNKNOWN_RULE
      The rule is a CSSUnknownRule.
      static int VIEWPORT_RULE
      The rule is a CSSViewportRule.
      • Fields inherited from class org.htmlunit.corejs.javascript.ScriptableObject

        CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
      • Fields inherited from interface org.htmlunit.corejs.javascript.Scriptable

        NOT_FOUND
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
        CSSRule()
      Creates a new instance.
      protected CSSRule​(CSSStyleSheet stylesheet, org.htmlunit.cssparser.dom.AbstractCSSRuleImpl rule)
      Creates a new instance.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static CSSRule create​(CSSStyleSheet stylesheet, org.htmlunit.cssparser.dom.AbstractCSSRuleImpl rule)
      Creates a CSSRule according to the specified rule type.
      java.lang.String getCssText()
      Returns the parsable textual representation of the rule.
      CSSRule getParentRule()
      If this rule is contained inside another rule (e.g.
      CSSStyleSheet getParentStyleSheet()
      Returns the style sheet that contains this rule.
      protected org.htmlunit.cssparser.dom.AbstractCSSRuleImpl getRule()
      Returns the wrapped rule.
      int getType()
      Returns the type of the rule.
      void jsConstructor()
      Creates an instance.
      void setCssText​(java.lang.String cssText)
      • Methods 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
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • LOG

        private static final org.apache.commons.logging.Log LOG
      • UNKNOWN_RULE

        public static final int UNKNOWN_RULE
        The rule is a CSSUnknownRule.
        See Also:
        Constant Field Values
      • STYLE_RULE

        public static final int STYLE_RULE
        The rule is a CSSStyleRule.
        See Also:
        Constant Field Values
      • CHARSET_RULE

        public static final int CHARSET_RULE
        The rule is a CSSCharsetRule.
        See Also:
        Constant Field Values
      • IMPORT_RULE

        public static final int IMPORT_RULE
        The rule is a CSSImportRule.
        See Also:
        Constant Field Values
      • MEDIA_RULE

        public static final int MEDIA_RULE
        The rule is a CSSMediaRule.
        See Also:
        Constant Field Values
      • FONT_FACE_RULE

        public static final int FONT_FACE_RULE
        The rule is a CSSFontFaceRule.
        See Also:
        Constant Field Values
      • PAGE_RULE

        public static final int PAGE_RULE
        The rule is a CSSPageRule.
        See Also:
        Constant Field Values
      • KEYFRAMES_RULE

        public static final int KEYFRAMES_RULE
        The rule is a CSSKeyframesRule.
        See Also:
        Constant Field Values
      • KEYFRAME_RULE

        public static final int KEYFRAME_RULE
        The rule is a CSSKeyframeRule.
        See Also:
        Constant Field Values
      • NAMESPACE_RULE

        public static final int NAMESPACE_RULE
        The rule is a CSSNamespaceRule.
        See Also:
        Constant Field Values
      • COUNTER_STYLE_RULE

        public static final int COUNTER_STYLE_RULE
        The rule is a CSSCounterStyleRule.
        See Also:
        Constant Field Values
      • SUPPORTS_RULE

        public static final int SUPPORTS_RULE
        The rule is a CSSSupportsRule.
        See Also:
        Constant Field Values
      • FONT_FEATURE_VALUES_RULE

        public static final int FONT_FEATURE_VALUES_RULE
        The rule is a CSSCounterStyleRule.
        See Also:
        Constant Field Values
      • VIEWPORT_RULE

        public static final int VIEWPORT_RULE
        The rule is a CSSViewportRule.
        See Also:
        Constant Field Values
      • rule_

        private final org.htmlunit.cssparser.dom.AbstractCSSRuleImpl rule_
    • Constructor Detail

      • CSSRule

        public CSSRule()
        Creates a new instance.
      • CSSRule

        protected CSSRule​(CSSStyleSheet stylesheet,
                          org.htmlunit.cssparser.dom.AbstractCSSRuleImpl rule)
        Creates a new instance.
        Parameters:
        stylesheet - the Stylesheet of this rule.
        rule - the wrapped rule
    • Method Detail

      • 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 rule
        rule - 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

        public java.lang.String 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.
      • getParentStyleSheet

        public CSSStyleSheet getParentStyleSheet()
        Returns the style sheet that contains this rule.
        Returns:
        the style sheet that contains this rule.
      • getParentRule

        public CSSRule 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 returns null.
        Returns:
        the parent rule
      • getRule

        protected org.htmlunit.cssparser.dom.AbstractCSSRuleImpl getRule()
        Returns the wrapped rule.
        Returns:
        the wrapped rule.