JavaScript is disabled on your browser.
Skip navigation links
org.htmlunit.javascript.host.css

Class CSSStyleSheet

    • Constructor Detail

      • CSSStyleSheet

        public CSSStyleSheet()
        Creates a new empty stylesheet.
      • CSSStyleSheet

        public CSSStyleSheet(HTMLElement element,
         org.htmlunit.cssparser.parser.InputSource source,
         String uri)
        Creates a new stylesheet representing the CSS stylesheet for the specified input source.
        Parameters:
        element - the owning node
        source - the input source which contains the CSS stylesheet which this stylesheet host object represents
        uri - this stylesheet's URI (used to resolved contained @import rules)
      • CSSStyleSheet

        public CSSStyleSheet(HTMLElement element,
         String styleSheet,
         String uri)
        Creates a new stylesheet representing the CSS stylesheet for the specified input source.
        Parameters:
        element - the owning node
        styleSheet - the source which contains the CSS stylesheet which this stylesheet host object represents
        uri - this stylesheet's URI (used to resolved contained @import rules)
      • CSSStyleSheet

        public CSSStyleSheet(HTMLElement element,
         org.htmlunit.corejs.javascript.Scriptable parentScope,
         CssStyleSheet cssStyleSheet)
        Creates a new stylesheet representing the specified CSS stylesheet.
        Parameters:
        element - the owning node
        parentScope - the parent scope
        cssStyleSheet - the CSS stylesheet which this stylesheet host object represents
    • Method Detail

      • jsConstructor

        public void jsConstructor()
        Creates a new empty stylesheet.
        Overrides:
        jsConstructor in class StyleSheet
      • getCssStyleSheet

        public CssStyleSheet getCssStyleSheet()
        Returns the wrapped stylesheet.
        Returns:
        the wrapped stylesheet
      • getRules

        public CSSRuleList getRules()
        Retrieves the collection of rules defined in this style sheet.
        Returns:
        the collection of rules defined in this style sheet
      • getCssRules

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

        public int insertRule(String rule,
         int 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
        See Also:
        DOM level 2
      • deleteRule

        public void deleteRule(int position)
        Deletes an existing rule.
        Parameters:
        position - the position of the rule to be deleted
        See Also:
        DOM level 2
      • addRule

        public int addRule(String selector,
         String rule)
        Adds a new rule.
        Parameters:
        selector - the selector name
        rule - the rule
        Returns:
        always return -1 as of MSDN documentation
        See Also:
        MSDN
      • removeRule

        public void removeRule(int position)
        Deletes an existing rule.
        Parameters:
        position - the position of the rule to be deleted
        See Also:
        MSDN
      • getUri

        public String getUri()
        Returns this stylesheet's URI (used to resolved contained @import rules). For inline styles this is the page uri.
        Overrides:
        getUri in class StyleSheet
        Returns:
        this stylesheet's URI (used to resolved contained @import rules)
Skip navigation links

Copyright © 2002–2025 Gargoyle Software Inc.. All rights reserved.

AltStyle によって変換されたページ (->オリジナル) /