Class CSSGroupingRule

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.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:
    CSSConditionRule

    public class CSSGroupingRule
    extends CSSRule
    A JavaScript object for CSSGroupingRule.
    See Also:
    MDN doc, Serialized Form
    • Field Detail

      • cssRules_

        private CSSRuleList cssRules_
        The collection of rules defined in this rule.
      • cssRulesIndexFix_

        private java.util.List<java.lang.Integer> cssRulesIndexFix_
    • Constructor Detail

      • CSSGroupingRule

        public CSSGroupingRule()
        Creates a new instance.
      • CSSGroupingRule

        protected CSSGroupingRule​(CSSStyleSheet stylesheet,
                                  org.htmlunit.cssparser.dom.CSSMediaRuleImpl 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.
        Overrides:
        jsConstructor in class CSSRule
      • getCssRules

        public CSSRuleList getCssRules()
        Returns the collection of rules defined in this rule.
        Returns:
        the collection of rules defined in this rule
      • insertRule

        public int insertRule​(java.lang.String rule,
                              java.lang.Object position)
        Inserts a new rule.
        Parameters:
        rule - the CSS rule
        position - the position at which to insert the rule
        Returns:
        the position of the inserted rule
      • deleteRule

        public void deleteRule​(int position)
        Deletes an existing rule.
        Parameters:
        position - the position of the rule to be deleted
      • initCssRules

        private void initCssRules()
      • fixIndex

        private int fixIndex​(int index)
      • refreshCssRules

        private void refreshCssRules()
      • getGroupingRule

        private org.htmlunit.cssparser.dom.CSSMediaRuleImpl getGroupingRule()
        Returns the wrapped rule, as a media rule.
        Returns:
        the wrapped rule, as a media rule